/* CardsClan – Say Hi: floating button + "hi from around the world" board. From AllFours.tt (index page),
   recoloured with the CardsClan accent. Uses the same SayHi Azure function, so the board is shared. */
.hi-fab {
  position: fixed; z-index: 15; top: 76px; right: clamp(1rem, 3vw, 2rem);
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem .9rem .5rem .6rem; border-radius: 18px 18px 18px 18px; cursor: pointer;
  font: inherit; font-family: var(--font); font-weight: 600; font-size: 1rem; letter-spacing: .01em; color: var(--text);
  background: var(--card);
  border: 1px solid var(--border-strong);
  box-shadow: 0 10px 26px -12px rgba(0, 0, 0, .55);
  transform-origin: calc(100% - 22px) -8px;
  animation: hi-pop .6s .5s backwards cubic-bezier(.34, 1.56, .64, 1), hi-bob 3.2s 1.2s ease-in-out infinite;
  transition: opacity .28s ease, scale .28s ease, visibility 0s linear 0s;
}
/* tucks away while you scroll down, comes back when you scroll up */
.hi-fab.is-away { opacity: 0; scale: .8; visibility: hidden; pointer-events: none; transition: opacity .22s ease, scale .22s ease, visibility 0s linear .22s; }
/* speech-bubble tail pointing up at the logo */
.hi-fab::before {
  content: ""; position: absolute; top: -9px; right: 18px; width: 14px; height: 14px;
  background: var(--card); border-left: 1px solid var(--border-strong); border-top: 1px solid var(--border-strong);
  border-radius: 3px 0 0 0; transform: rotate(45deg) skew(8deg, 8deg);
}
.hi-fab:hover { animation-play-state: paused; transform: scale(1.06) rotate(-2deg); transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.hi-fab:hover .hi-hand { animation: hi-wave .8s ease-in-out infinite; }
.hi-fab:active { transform: scale(.96); }
/* once you've said hi, it sits still */
.hi-fab.is-sent, .hi-fab.is-sent .hi-hand, .hi-fab.is-sent:hover .hi-hand { animation: none; }
.hi-fab.is-sent:hover { transform: none; }
.hi-fab:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.hi-hand {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface); font-size: 1.05rem; line-height: 1;
  transform-origin: 70% 75%; animation: hi-wave 1.6s 1.4s ease-in-out infinite;
}
.hi-txt { color: var(--text); }
.hi-fab .tt-flag { display: block; width: 24px; height: auto; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.3); transform: rotate(-6deg); }
@keyframes hi-pop { from { opacity: 0; transform: scale(.4) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes hi-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
@keyframes hi-wave {
  0%, 60%, 100% { transform: rotate(0); }
  10% { transform: rotate(18deg); } 20% { transform: rotate(-10deg); }
  30% { transform: rotate(16deg); } 40% { transform: rotate(-6deg); } 50% { transform: rotate(10deg); }
}
@media (max-width: 600px) { .hi-fab { top: 72px; font-size: .92rem; padding: .42rem .8rem .42rem .5rem; } .hi-hand { width: 24px; height: 24px; font-size: .95rem; } .hi-fab .tt-flag { display: none; } }
@media (prefers-reduced-motion: reduce) { .hi-fab, .hi-hand, .hi-fab:hover .hi-hand { animation: none !important; } }

.hi-dialog {
  width: min(92vw, 460px); max-height: min(84vh, 680px); margin: auto; padding: 0; border: 0; border-radius: 18px;
  background: var(--card); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); overflow: hidden;
}
.hi-dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); }
.hi-dialog[open] { display: flex; }
.hi-dlg { display: flex; flex-direction: column; width: 100%; max-height: inherit; }
.hi-dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.1rem .4rem 1.3rem; }
.hi-dlg-head h2 { font-size: 1.35rem; color: var(--text); }
.hi-close { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; cursor: pointer; font-size: 1.6rem; line-height: 1; color: var(--muted); }
.hi-close:hover { color: var(--text); background: var(--surface); }
.hi-pick, .hi-board { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.hi-pick[hidden], .hi-board[hidden] { display: none; }
.hi-lead { color: var(--muted); font-size: .93rem; padding: 0 1.3rem .8rem; }
.hi-search { margin: 0 1.1rem .7rem; padding: .7rem .9rem; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; }
.hi-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hi-countries { overflow-y: auto; padding: 0 .6rem .4rem; flex: 1; min-height: 0; }
.hi-group { font-size: .8rem; font-weight: 700; color: var(--muted); padding: .6rem .7rem .3rem; }
.hi-option { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .6rem .7rem; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.hi-option:hover, .hi-option:focus-visible { background: var(--surface); outline: none; }
.hi-option .hi-flag { width: 1.6rem; text-align: center; }
.hi-option span:last-child { flex: 1; }
.hi-link { align-self: flex-start; margin: .5rem 1.3rem 1.1rem; background: none; border: 0; padding: .2rem 0; font: inherit; font-weight: 700; color: var(--accent); cursor: pointer; }
.hi-link[hidden] { display: none; }
.hi-board { overflow-y: auto; padding: 0 1.1rem .4rem; }
.hi-board .hi-link { margin: .7rem .2rem .2rem; }
.hi-note { color: var(--muted); font-size: .92rem; margin: 0 .2rem .9rem; }
.hi-note:empty { display: none; }
.hi-note b { color: var(--text); }
.hi-board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 .2rem .7rem; }
.hi-board h3 { font-size: 1.05rem; color: var(--text); }
.hi-total { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.hi-list { list-style: none; display: grid; gap: .35rem; }
.hi-row { position: relative; display: grid; grid-template-columns: 1.6rem 1.8rem minmax(0, 1fr) auto; align-items: center; gap: .55rem; padding: .5rem .8rem; border-radius: 10px; background: var(--surface); overflow: hidden; }
.hi-row::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: linear-gradient(90deg, rgba(0, 128, 255, .32), rgba(0, 128, 255, .12)); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.hi-row > * { position: relative; }
.hi-row.is-mine { box-shadow: inset 0 0 0 2px var(--accent); }
.hi-rank { font-weight: 800; color: var(--muted); font-size: .85rem; text-align: center; }
.hi-flag { display: flex; align-items: center; justify-content: center; line-height: 1; }
.hi-flag-img { display: block; width: 1.45rem; height: 1.45rem; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .55), 0 1px 3px rgba(0, 0, 0, .3); }
.hi-note .hi-flag-img { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -.18em; margin-right: .1em; }
.hi-name { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hi-count { color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; }
.hi-empty { color: var(--muted); padding: 1rem .2rem; }
.hi-preview { margin: .6rem .2rem 1rem; font-size: .8rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .hi-row::before { transition: none; } }

