@charset "UTF-8";
/* ════════════════════════════════════════════════════════════════════════
   games.css — the games hub, the level map, and the board a level is played
   on. Loaded after public.css, and every colour is one of its tokens.

   Prefixed .gm- so it cannot collide with .hp- (public) or the portal's own
   vocabulary, since the same markup is rendered inside both shells.
   ════════════════════════════════════════════════════════════════════════ */

:root {
  --gm-dark: var(--hna-color-text-primary);
  --gm-deep: var(--hna-color-primary-deep);
  --gm-mint: var(--hna-color-secondary-subtle);
}

/* ── hub ───────────────────────────────────────────────────────────────── */
/* Why min(Npx, 100%) and not a bare Npx floor: under min-content sizing an
   auto-fit track list keeps one track per item, each with that floor, so a
   two-card row reports a 496px minimum and refuses to shrink — the grid item
   above it then refuses too, and the page grows a horizontal scrollbar instead
   of stacking. Wrapping the floor in min(…, 100%) lets it collapse. Found on
   the live gate at 571px, where the two sign-in cards pushed the page 26px
   wide. */
.gm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
  gap: 1.15rem;
}

.gm-card {
  display: flex; flex-direction: column; gap: .5rem;
  padding: 1.25rem 1.2rem;
  border: 2px solid var(--hna-color-border);
  border-radius: var(--ha-radius-lg);
  background: var(--hna-color-surface-elevated);
  text-decoration: none;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.gm-card:hover { border-color: var(--hna-color-primary); transform: translateY(-2px); box-shadow: var(--ha-elevation-2); }
.gm-card:focus-visible { outline: 3px solid var(--hna-color-primary); outline-offset: 2px; }

.gm-card-skill {
  font-size: .6875rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--hna-color-primary);
}
.gm-card-ar { font-size: 1.1875rem; font-weight: 800; line-height: 1.3; color: var(--hna-color-text-primary); }
.gm-card-en { font-size: .8125rem; color: var(--hna-color-text-secondary); }
.gm-card-foot { margin-top: auto; padding-top: .75rem; display: flex; align-items: center; gap: .5rem; }

.gm-bar { flex: 1 1 auto; height: 6px; border-radius: 999px; background: var(--hna-color-surface-sunken); overflow: hidden; }
.gm-bar > span { display: block; height: 100%; background: var(--hna-color-primary); border-radius: 999px; }
.gm-bar-lbl { font-size: .75rem; font-weight: 700; color: var(--hna-color-text-secondary); white-space: nowrap; }

/* A game whose pictures or recordings are not in yet. Said plainly rather
   than hidden, so the catalogue does not look arbitrarily short. */
.gm-card.is-waiting { border-style: dashed; background: var(--hna-color-surface); }
.gm-card.is-waiting:hover { transform: none; box-shadow: none; border-color: var(--hna-color-border-strong); }
.gm-waiting-tag {
  align-self: flex-start;
  font-size: .6875rem; font-weight: 700;
  padding: .2rem .55rem; border-radius: 999px;
  background: var(--hna-color-warning-subtle); color: var(--hna-color-warning-strong);
}

/* ── leaderboard ───────────────────────────────────────────────────────── */
.gm-board { background: var(--hna-color-surface-elevated); border-radius: var(--ha-radius-lg); box-shadow: var(--ha-elevation-1); overflow: hidden; }
.gm-board-row {
  display: grid; grid-template-columns: 2.5rem 1fr auto auto;
  gap: .75rem; align-items: center;
  padding: .7rem 1.1rem;
  border-bottom: 1px solid var(--hna-color-border-subtle);
  font-size: .9375rem;
}
.gm-board-row:last-child { border-bottom: 0; }
.gm-board-row.is-me { background: var(--gm-mint); font-weight: 700; }
.gm-board-rank { font-weight: 800; color: var(--hna-color-text-secondary); }
.gm-board-row.is-me .gm-board-rank { color: var(--hna-color-primary-hover); }
.gm-board-name { font-weight: 600; color: var(--hna-color-text-primary); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-board-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-inline-end: .45rem; background: var(--hna-color-surface, #f4f6f8); }
.gm-board-n { font-size: .8125rem; color: var(--hna-color-text-secondary); white-space: nowrap; }
.gm-board-you { font-size: .6875rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; background: var(--hna-color-primary); color: #fff; }
.gm-board-gap { padding: .5rem 1.1rem; text-align: center; color: var(--hna-color-text-disabled); }

/* ── level map ─────────────────────────────────────────────────────────── */
.gm-map { display: flex; flex-wrap: wrap; gap: .5rem; }
.gm-tile {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border: 2px solid var(--hna-color-border);
  border-radius: var(--ha-radius-md);
  background: var(--hna-color-surface-elevated);
  color: var(--hna-color-text-secondary);
  font-weight: 800; font-size: .9375rem;
  cursor: pointer;
}
.gm-tile:hover:not(:disabled) { border-color: var(--hna-color-primary); }
.gm-tile:focus-visible { outline: 3px solid var(--hna-color-primary); outline-offset: 2px; }
.gm-tile.is-open    { border-color: var(--hna-color-primary); color: var(--hna-color-primary); }
.gm-tile.is-current { background: var(--hna-color-primary); border-color: var(--hna-color-primary); color: #fff; }
.gm-tile.is-passed  { background: var(--hna-color-success-subtle); border-color: var(--hna-color-success-strong); color: var(--hna-color-success-strong); }
.gm-tile:disabled   { cursor: default; opacity: .55; }
.gm-tile-lock { font-size: .8125rem; }

/* ── the board a level plays on ────────────────────────────────────────── */
.gm-stage {
  display: grid; grid-template-columns: minmax(0, 1fr) 260px;
  gap: clamp(1rem, 2vw, 1.75rem);
  align-items: start;
}
.gm-play {
  background: var(--hna-color-surface-elevated);
  border-radius: var(--ha-radius-xl);
  box-shadow: var(--ha-elevation-1);
  padding: clamp(1.25rem, 3vw, 2.25rem);
  min-height: 24rem;
  display: flex; flex-direction: column;
}
.gm-side { display: grid; gap: 1rem; }
.gm-side-card { background: var(--hna-color-surface-elevated); border-radius: var(--ha-radius-lg); box-shadow: var(--ha-elevation-1); padding: 1.1rem 1.2rem; }
.gm-side-card h2 { font-size: .75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--hna-color-primary); margin: 0 0 .7rem; }

.gm-progress { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hna-color-text-secondary); margin-bottom: .6rem; }
.gm-instruction { font-size: 1.0625rem; line-height: 1.6; color: var(--hna-color-text-secondary); margin: 0 0 1.1rem; }
.gm-ask { font-size: clamp(1.15rem, 2.2vw, 1.4rem); font-weight: 800; line-height: 1.45; color: var(--hna-color-text-primary); margin: 0 0 1.1rem; }
.gm-ask-ar { font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.9; font-weight: 700; color: var(--hna-color-primary-hover); }

/* the vowelled word with one letter singled out */
.gm-word { font-size: clamp(2rem, 6vw, 3.25rem); line-height: 1.9; font-weight: 700; text-align: center; color: var(--hna-color-text-primary); margin: 0 0 1rem; }
.gm-word mark { background: var(--hna-color-tertiary); color: var(--hna-color-warning-ink); padding: 0 .12em; border-radius: 6px; }

.gm-media { display: grid; place-items: center; gap: .75rem; margin-bottom: 1.1rem; }
.gm-media img { max-width: min(100%, 320px); border-radius: var(--ha-radius-lg); }
.gm-audio-btn {
  display: inline-flex; align-items: center; gap: .6rem;
  min-height: 56px; padding: .8rem 1.5rem;
  border: 0; border-radius: var(--ha-radius-full);
  background: var(--hna-color-primary); color: #fff;
  font-size: 1rem; font-weight: 700; cursor: pointer;
}
.gm-audio-btn:hover { background: var(--hna-color-primary-hover); }
.gm-audio-btn i { font-size: 1.3rem; }

/* choices */
.gm-opts { display: grid; gap: .65rem; }
.gm-opts.is-wide { grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
.gm-opt {
  min-height: 60px; padding: .85rem 1.1rem;
  border: 2px solid var(--hna-color-border); border-radius: var(--ha-radius-md);
  background: var(--hna-color-surface); color: var(--hna-color-text-primary);
  font-size: 1rem; font-weight: 600; line-height: 1.5; text-align: start;
  cursor: pointer;
}
.gm-opt:hover:not(:disabled) { border-color: var(--hna-color-primary); }
.gm-opt:focus-visible { outline: 3px solid var(--hna-color-primary); outline-offset: 2px; }
.gm-opt.is-right { background: var(--hna-color-success-subtle); border-color: var(--hna-color-success-strong); color: var(--hna-color-success-strong); }
.gm-opt.is-wrong { background: var(--hna-color-error-subtle); border-color: var(--hna-color-error-strong); color: var(--hna-color-error-strong); }
.gm-opt:disabled { cursor: default; }

/* typed answer */
.gm-type { display: flex; flex-wrap: wrap; gap: .6rem; }
.gm-input {
  flex: 1 1 14rem; min-width: 0; min-height: 56px;
  padding: .7rem 1rem;
  border: 2px solid var(--hna-color-border); border-radius: var(--ha-radius-md);
  background: var(--hna-color-surface-elevated); color: var(--hna-color-text-primary);
  font-size: 1.125rem;
}
.gm-input:focus { outline: none; border-color: var(--hna-color-primary); box-shadow: 0 0 0 3px rgba(var(--hna-color-primary-rgb), .18); }

/* pairing */
.gm-pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.gm-col { display: grid; gap: .5rem; align-content: start; }
.gm-col-h { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hna-color-text-secondary); }
.gm-pair {
  min-height: 54px; padding: .6rem .9rem;
  border: 2px solid var(--hna-color-border); border-radius: var(--ha-radius-md);
  background: var(--hna-color-surface-elevated); color: var(--hna-color-text-primary);
  font-size: 1rem; font-weight: 600; cursor: pointer;
}
.gm-pair.is-picked { border-color: var(--hna-color-primary); background: var(--gm-mint); }
.gm-pair.is-linked { border-color: var(--hna-color-secondary); background: var(--gm-mint); }
.gm-pair.is-right  { border-color: var(--hna-color-success-strong); background: var(--hna-color-success-subtle); color: var(--hna-color-success-strong); }
.gm-pair.is-wrong  { border-color: var(--hna-color-error-strong); background: var(--hna-color-error-subtle); }
.gm-pair img { max-width: 100%; max-height: 90px; border-radius: var(--ha-radius-sm); display: block; margin-inline: auto; }
.gm-pair-tag { display: block; font-size: .6875rem; color: var(--hna-color-text-secondary); margin-top: .25rem; }

/* sequence */
.gm-slot, .gm-bank {
  display: flex; flex-wrap: wrap; gap: .45rem; align-items: center;
  min-height: 66px; padding: .75rem;
  border-radius: var(--ha-radius-md);
  background: var(--hna-color-surface);
}
.gm-slot { border: 2px dashed var(--hna-color-border-strong); margin-bottom: .9rem; }
.gm-bank { border: 2px solid var(--hna-color-border); }
.gm-bank:empty { display: none; }
.gm-slot:empty::before { content: attr(data-empty); color: var(--hna-color-text-secondary); font-size: .875rem; }
.gm-token {
  min-height: 46px; padding: .45rem 1rem;
  border: 2px solid var(--hna-color-border); border-radius: var(--ha-radius-sm);
  background: var(--hna-color-surface-elevated); color: var(--hna-color-text-primary);
  font-size: 1.125rem; font-weight: 600; cursor: pointer;
}
.gm-token:hover { border-color: var(--hna-color-primary); }
.gm-token.is-placed { background: var(--gm-mint); border-color: var(--hna-color-secondary); }

/* tap-all */
.gm-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(110px, 100%), 1fr)); gap: .55rem; }
.gm-word-tile {
  min-height: 58px; padding: .6rem .5rem;
  border: 2px solid var(--hna-color-border); border-radius: var(--ha-radius-md);
  background: var(--hna-color-surface-elevated); color: var(--hna-color-text-primary);
  font-size: 1.0625rem; font-weight: 600; cursor: pointer;
}
.gm-word-tile.is-on   { border-color: var(--hna-color-primary); background: var(--gm-mint); }
.gm-word-tile.is-right { border-color: var(--hna-color-success-strong); background: var(--hna-color-success-subtle); color: var(--hna-color-success-strong); }
.gm-word-tile.is-wrong { border-color: var(--hna-color-error-strong); background: var(--hna-color-error-subtle); color: var(--hna-color-error-strong); }
.gm-word-tile.is-missed { border-style: dashed; border-color: var(--hna-color-success-strong); }

/* grid search */
.gm-search { display: grid; gap: 3px; justify-content: center; margin-bottom: 1rem; direction: rtl; }
.gm-cell {
  width: 2.35rem; height: 2.35rem;
  display: grid; place-items: center;
  border: 1px solid var(--hna-color-border);
  border-radius: 6px;
  background: var(--hna-color-surface-elevated);
  font-size: 1.05rem; font-weight: 700; color: var(--hna-color-text-primary);
  cursor: pointer; user-select: none;
}
.gm-cell.is-on    { background: var(--hna-color-tertiary); color: var(--hna-color-warning-ink); border-color: var(--hna-color-tertiary); }
.gm-cell.is-found { background: var(--hna-color-success-subtle); border-color: var(--hna-color-success-strong); color: var(--hna-color-success-strong); }
.gm-hunt { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-bottom: 1rem; }
.gm-hunt span { font-size: .9375rem; font-weight: 700; padding: .25rem .7rem; border-radius: 999px; background: var(--hna-color-surface); color: var(--hna-color-text-primary); }
.gm-hunt span.is-found { background: var(--hna-color-success-subtle); color: var(--hna-color-success-strong); text-decoration: line-through; }

/* timer */
.gm-timer { font-size: .875rem; font-weight: 800; color: var(--hna-color-text-secondary); }
.gm-timer.is-low { color: var(--hna-color-error-strong); }

/* feedback */
.gm-feedback {
  margin-top: auto; padding-top: 1.25rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
  font-size: .9375rem; line-height: 1.6; color: var(--hna-color-text-secondary);
}
.gm-feedback strong { font-weight: 800; }
.gm-feedback.is-right strong { color: var(--hna-color-success-strong); }
.gm-feedback.is-wrong strong { color: var(--hna-color-error-strong); }
.gm-feedback .hp-btn { margin-inline-start: .6rem; }

/* the gate */
.gm-gate { text-align: center; padding: clamp(1.5rem, 4vw, 3rem) 1rem; }
.gm-gate h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); font-weight: 800; color: var(--hna-color-text-primary); margin: 0 0 .6rem; }
.gm-gate p { font-size: 1rem; line-height: 1.65; color: var(--hna-color-text-secondary); max-width: 34rem; margin: 0 auto 1.5rem; }
.gm-gate-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 1rem; max-width: 40rem; margin-inline: auto; text-align: start; }
.gm-gate-card { background: var(--hna-color-surface); border-radius: var(--ha-radius-lg); padding: 1.2rem; }
.gm-gate-card.is-mint { background: var(--gm-mint); }
.gm-gate-card h3 { font-size: 1rem; font-weight: 800; margin: 0 0 .3rem; color: var(--hna-color-text-primary); }
.gm-gate-card p { font-size: .8125rem; margin: 0 0 .8rem; max-width: none; }
.gm-msg { font-size: .8125rem; line-height: 1.5; margin: .6rem 0 0; min-height: 1.2em; }
.gm-msg.is-ok  { color: var(--hna-color-success-strong); }
.gm-msg.is-err { color: var(--hna-color-error-strong); }

.gm-empty { text-align: center; padding: 3rem 1rem; color: var(--hna-color-text-secondary); }
.gm-empty i { font-size: 2.5rem; color: var(--hna-color-text-disabled); display: block; margin-bottom: .75rem; }

@media (max-width: 1023.98px) {
  /* minmax(0,…) not 1fr: a bare 1fr track takes its minimum from the
     item's min-content, which is how a wide child drags the whole page
     past the viewport instead of being made to fit. */
  .gm-stage { grid-template-columns: minmax(0, 1fr); }
  .gm-side { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
}
@media (max-width: 575.98px) {
  .gm-pairs { grid-template-columns: 1fr; }
  .gm-cell { width: 2rem; height: 2rem; font-size: .95rem; }
  .gm-tile { width: 42px; height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .gm-card { transition: none; }
  .gm-card:hover { transform: none; }
}

/* ── speaking levels ───────────────────────────────────────────────────────
   The record button is the only control on the level, so it is the largest
   thing on it. Red while live, because a microphone that is on and does not
   look on is how people record thirty seconds of their kitchen.            */
.gm-rec { display: grid; justify-items: center; gap: .85rem; padding: .5rem 0 0; }
.gm-rec-hint { font-size: .9375rem; line-height: 1.6; color: var(--hna-color-text-secondary); margin: 0; text-align: center; max-width: 26rem; }
.gm-rec-btn {
  display: inline-flex; align-items: center; gap: .6rem;
  min-height: 56px; padding: 0 1.9rem;
  border: 2px solid var(--hna-color-primary); border-radius: 999px;
  background: var(--hna-color-surface); color: var(--hna-color-primary);
  font: inherit; font-size: 1.0625rem; font-weight: 700; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.gm-rec-btn:hover:not(:disabled) { background: var(--gm-mint); }
.gm-rec-btn:disabled { opacity: .55; cursor: default; }
.gm-rec-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--hna-color-error-strong); flex: none; }
.gm-rec-btn.is-live { border-color: var(--hna-color-error-strong); color: var(--hna-color-error-strong); }
.gm-rec-btn.is-live .gm-rec-dot { animation: gm-rec-pulse 1.1s ease-in-out infinite; }
@keyframes gm-rec-pulse { 50% { opacity: .25; } }
.gm-rec-clock { font-size: .8125rem; font-variant-numeric: tabular-nums; color: var(--hna-color-text-secondary); min-height: 1.2em; }
.gm-rec-out { display: grid; justify-items: center; gap: .75rem; width: 100%; }
.gm-rec-audio { width: min(100%, 22rem); }
.gm-rec.is-sent .gm-rec-out { opacity: .6; pointer-events: none; }

/* what came back from Habiba */
.gm-voicelog { display: grid; gap: .55rem; }
.gm-voicelog-row { display: grid; grid-template-columns: auto 1fr; gap: .2rem .6rem; align-items: baseline; font-size: .8125rem; }
.gm-voicelog-lv { font-weight: 800; color: var(--hna-color-text-primary); }
.gm-voicelog-state { color: var(--hna-color-text-secondary); }
.gm-voicelog-row.is-reviewed .gm-voicelog-state { color: var(--hna-color-success-strong); font-weight: 700; }
.gm-voicelog-note { grid-column: 1 / -1; color: var(--hna-color-text-secondary); line-height: 1.55; margin: 0; }

/* Top three wear a badge in place of the number. Sized a little larger than
   the digits it replaces so the row height does not jump between a crown and
   a 4, and not coloured — the emoji carries its own. */
.gm-board-rank.is-medal { font-size: 1.05rem; line-height: 1; }

/* The "next one…" hint that appears while a correct answer carries you on.
   Quiet on purpose: it reports what is about to happen, it is not a control. */
.gm-advance {
  font-size: .75rem; font-weight: 700; letter-spacing: .04em;
  color: var(--hna-color-text-secondary); opacity: .85;
}
.gm-feedback .gm-advance { margin-inline-start: auto; }
