/* ---- Free play statistics: found / all words on this board, overall and by length ---- */
#fp-stats {
  display: none;
  width: 100%;
  flex-direction: column; gap: 8px;
  padding: 2px 16px 6px;
  color: var(--fg);
  flex-shrink: 0;
}
.fp-totals { display: flex; gap: 14px; }
.fp-total { flex: 1; min-width: 0; }
.fp-total-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 12px; margin-bottom: 5px; white-space: nowrap; }
.fp-bar-fill.score { background: linear-gradient(90deg, #ffd93d, #ff9f43); }
.fp-total-head b { font-size: 15px; }
.fp-label { font-size: 11px; font-weight: 800; letter-spacing: 1px; opacity: 0.7; }
.fp-bar { height: 8px; border-radius: 4px; background: rgba(var(--fg-rgb),0.12); overflow: hidden; }
.fp-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--good), var(--select));
  transition: width 0.5s cubic-bezier(.2,.8,.2,1);
}
.fp-lengths { display: flex; gap: 6px; }
.fp-len {
  flex: 1; min-width: 0;
  background: rgba(var(--fg-rgb),0.08);
  border-radius: 10px;
  padding: 5px 4px 6px;
  text-align: center;
  transition: background 0.3s, transform 0.3s;
}
.fp-len .fp-len-name { font-size: 10px; font-weight: 800; letter-spacing: 0.5px; opacity: 0.7; }
.fp-len .fp-len-count { font-size: 13px; font-weight: 800; margin: 1px 0 4px; font-variant-numeric: tabular-nums; }
.fp-len .fp-bar { height: 4px; }
.fp-len.done { background: rgba(78,203,113,0.28); }
.fp-len.done .fp-bar-fill { background: var(--good); }
.fp-len.bump { animation: fp-bump 0.4s ease-out; }
@keyframes fp-bump { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ---- Landscape phones: the board sits on the right, HUD / word / found words on the left ---- */
@media (orientation: landscape) and (max-height: 600px), (orientation: landscape) and (hover: hover) and (pointer: fine) and (min-width: 900px) {
  #app-root #app {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    align-items: start;
    padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
  }
  #app #topbar, #app #hud-level, #app #hud-multi { grid-column: 1; grid-row: 1; }
  #app #fp-stats, #app #fp-targets { grid-column: 1; grid-row: 2; }
  #app #current-word { height: 38px; font-size: 22px; }
  #app #found-words { grid-column: 1; grid-row: 4; align-self: stretch; overflow-y: auto; }
  #app.fp-mode #fp-targets { grid-row: 2 / -1; align-self: stretch; }
  #app.pic-mode #lvl-pic { grid-column: 1; grid-row: 2 / -1; align-self: stretch; align-items: flex-start; } /* top line set by alignPictureWithBoard */
  #app #board-wrap { grid-column: 2; grid-row: 1 / -1; align-self: center; width: auto; padding: 8px 12px 8px 4px; }
  #app #topbar { padding-top: 8px; }
  #app #hud-level { padding-top: 6px; }
  #app .lvl-hud-top { margin-bottom: 4px; }
  /* Menu: title on the left, buttons on the right */
  #app-root #screen-menu { padding-top: 56px; }
  #screen-menu #menu-center { display: grid; grid-template-columns: auto auto; column-gap: 44px; row-gap: 8px; justify-content: center; align-items: center; }
  #screen-menu #menu-title { grid-column: 1; grid-row: 1 / 3; align-self: end; }
  #screen-menu #menu-sub { grid-column: 1; grid-row: 3 / 5; align-self: start; margin: 6px 0 0; text-align: center; }
  #screen-menu #menu-center > .menu-btn, #screen-menu .menu-row { grid-column: 2; width: min(46vw, 320px); }
  #screen-menu .menu-btn.mode { height: 52px; font-size: 18px; }
  #screen-menu .menu-btn.mode .mode-ic { width: 38px; height: 38px; }
  #screen-menu .menu-row .menu-btn { height: 44px; }
  .tut-box .tut-stage { height: 200px; }
  .modal-box.tut-box p { min-height: 0; }
}

/* ---- Multiplayer HUD (instead of the top bar) ---- */
#hud-multi {
  display: none;
  width: 100%;
  flex-direction: column;
  color: var(--fg);
  padding: 12px 14px 4px 14px;
  flex-shrink: 0;
}
.mp-hud-top { display: flex; align-items: center; gap: 10px; }
.mp-hud-cell { flex: 1; text-align: center; }
.mp-hud-cell:last-child { text-align: right; }
.mp-hud-cell .label { font-size: 11px; opacity: 0.7; letter-spacing: 1px; }
.mp-hud-cell .value { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
#mp-time.low { color: var(--bad); animation: mp-tick 1s infinite; }
@keyframes mp-tick { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }
#mp-timebar { height: 6px; border-radius: 3px; background: rgba(var(--fg-rgb),0.12); margin-top: 8px; overflow: hidden; }
#mp-timebar-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--good), var(--select)); transition: width 0.25s linear; }
#mp-timebar-fill.low { background: var(--bad); }

/* Lobby countdown / results, laid over the game screen */
#mp-overlay {
  display: none;
  position: absolute; inset: 0; z-index: 50;
  background: rgba(10,4,28,0.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
  padding: 20px;
}
#mp-overlay.show { display: flex; }
.mp-panel {
  width: min(92vw, 400px); max-height: 100%; overflow-y: auto;
  background: linear-gradient(165deg, #2a1958, #1a0f38);
  border-radius: 22px; padding: 22px 20px; color: #fff; text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  animation: popin 0.3s ease-out;
}
.mp-panel h3 { margin: 0 0 6px 0; padding: 0 40px; font-size: 20px; letter-spacing: 1px; }
.mp-panel p { font-size: 13px; line-height: 1.5; opacity: 0.8; margin: 0 0 12px 0; }
/* Only as wide as the number: a full-width block scaled by the pop animation spilled out of the panel
   and flashed a scrollbar on every tick. */
.mp-count { width: fit-content; margin: 0 auto; font-size: 64px; font-weight: 900; line-height: 1.1; color: #ffd93d; text-shadow: 0 4px 20px rgba(255,217,61,0.4); }
.mp-count.pop { animation: popin 0.35s ease-out; }
.mp-sub { font-size: 13px; opacity: 0.75; margin-bottom: 10px; }
.mp-name-row { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.mp-name-row label { font-size: 12px; opacity: 0.7; white-space: nowrap; }
#mp-name, .mp-input {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: none;
  background: rgba(255,255,255,0.1); color: #fff; font-size: 15px; font-weight: 700;
  -webkit-user-select: text; user-select: text;
}
#mp-name::placeholder, .mp-input::placeholder { color: rgba(255,255,255,0.45); font-weight: 400; }
.mp-you { font-size: 15px; font-weight: 800; margin: 4px 0 12px; color: #ffd93d; }
.mp-rank { list-style: none; margin: 0 0 12px 0; padding: 0; text-align: left; }
.mp-rank li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 12px; margin-bottom: 6px;
  background: rgba(255,255,255,0.07);
  opacity: 0; animation: mp-row-in 0.4s ease-out forwards;
}
.mp-rank li.me { background: rgba(78,203,113,0.25); box-shadow: inset 0 0 0 2px var(--good); }
.mp-rank .pos { width: 30px; font-weight: 900; font-size: 16px; text-align: center; }
.mp-rank li:nth-child(1) .pos { color: #ffd93d; }
.mp-rank li:nth-child(2) .pos { color: #d7dbe8; }
.mp-rank li:nth-child(3) .pos { color: #e8a36a; }
.mp-rank .who { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-rank .meta { font-size: 11px; opacity: 0.65; white-space: nowrap; }
.mp-rank .pts { font-weight: 900; font-size: 17px; min-width: 40px; text-align: right; }
@keyframes mp-row-in { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.mp-best { font-size: 12px; opacity: 0.8; margin-bottom: 10px; line-height: 1.6; }
.mp-best b { color: #ffd93d; }
.mp-next { font-size: 14px; }
.mp-next b { font-size: 18px; color: #ffd93d; }
/* Live scores while watching a round: redrawn on every update, so no entry animation. */
.mp-rank.live li { opacity: 1; animation: none; }

/* Private rooms */
.mp-choose .mp-name-row { margin: 0 0 14px 0; }
.mp-choose .menu-btn { width: 100%; margin-top: 4px; }
.mp-choose small { display: block; font-size: 12px; opacity: 0.65; margin: 6px 0 14px; text-align: center; }
.mp-code-input { text-transform: uppercase; letter-spacing: 3px; text-align: center; }
.mp-join-row { display: flex; gap: 8px; }
.mp-join-row .menu-btn { width: auto; margin: 0; padding: 10px 18px; font-size: 15px; }
.mp-or { font-size: 12px; opacity: 0.55; margin: 2px 0 10px; text-align: center; }
.mp-share { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 4px 0 12px; }
.mp-code { font-size: 22px; font-weight: 900; letter-spacing: 4px; color: #ffd93d; }
.mp-share .menu-btn { width: auto; padding: 9px 16px; font-size: 14px; }
.mp-members { list-style: none; margin: 0 0 14px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.mp-members li { padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,0.07); font-size: 13px; font-weight: 700; opacity: 0.45; }
.mp-members li.on { opacity: 1; }
.mp-members li small { font-weight: 400; opacity: 0.7; }
.mp-panel .menu-btn.mp-start { width: 100%; margin: 4px 0 2px; }

/* ---- Seviye modu HUD'u (topbar yerine) ---- */
#hud-level {
  display: none;
  width: 100%;
  flex-direction: column;
  color: var(--fg);
  padding: 10px 14px 4px 14px;
  flex-shrink: 0;
}
.lvl-hud-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lvl-hud-right { display: flex; align-items: center; gap: 10px; }
/* Level picture shown while playing: covers everything above the board, never the board itself.
   A title row (level, hints, close), the picture as a card, and under it the keyword tray (letter tiles). */
#peek {
  display: none; position: absolute; left: 0; right: 0; top: 0; z-index: 40; box-sizing: border-box;
  flex-direction: column; padding: 6px 10px 4px; color: var(--fg);
  background: var(--bg1); box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}
#peek.show { display: flex; animation: peekin 0.25s ease-out; }
@keyframes peekin { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
/* The level's name (top-left) and the close button (top-right) sit on the picture's corners as see-through tabs,
   like the key; placeKeyButton() puts all three on the visible picture's corners. */
.peek-tag, .peek-x { position: absolute; z-index: 1; box-sizing: border-box; height: 36px;
  background: rgba(12,20,32,0.3); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.7); }
.peek-tag { left: 0; top: 0; max-width: 70%; padding: 0 12px; border-radius: 16px 0 14px 0; pointer-events: none;
  display: flex; align-items: center; font-family: var(--font-display); font-size: 16px; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peek-x { right: 0; top: 0; width: 40px; border: none; border-radius: 0 16px 0 14px; padding: 0; cursor: pointer;
  font-size: 17px; font-weight: 900; }
.peek-pic { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.peek-pic img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 16px; }
.peek-pic { position: relative; }
/* The key on the picture opens the keyword panel: "🔑 1/3", gold-framed while keywords are left; the first time the
   picture opens on a level it blinks twice, with a tip above it for 3 s. placeKeyButton() puts it on the picture's corner. */
/* A see-through tab sitting on the picture's bottom-left corner (flush with its edges), so the picture shows through */
.key-btn { position: absolute; left: 0; bottom: 0; z-index: 1; height: 40px; min-width: 40px; padding: 0 12px 0 10px; border: none;
  border-radius: 0 14px 0 16px; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  background: rgba(12,20,32,0.3); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  font-family: var(--font-ui); font-size: 15px; font-weight: 900; transform-origin: bottom left;
  box-shadow: inset 0 0 0 2px rgba(255,217,61,0.75); }
.key-btn .k { font-size: 19px; line-height: 1; }
.key-btn .x { display: none; font-size: 18px; line-height: 1; }
.key-btn.blink { animation: keyblink 0.6s ease-in-out 2; }
.key-btn.done { box-shadow: inset 0 0 0 2px rgba(120,220,150,0.9); }
/* While the keyword panel is open the key turns into a plain ✕ (still see-through) */
.key-btn.open { animation: none; padding: 0; width: 40px; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.7); }
.key-btn.open .k, .key-btn.open b { display: none; }
.key-btn.open .x { display: block; }
@keyframes keyblink {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); box-shadow: inset 0 0 0 3px rgba(255,217,61,1), 0 0 26px 8px rgba(255,200,40,0.95); }
}
.key-tip { position: absolute; z-index: 2; max-width: 230px; padding: 8px 11px; border-radius: 12px; pointer-events: none;
  background: #1f2b3a; color: #fff; font-size: 13px; font-weight: 800; line-height: 1.3; opacity: 0; transition: opacity 0.25s; }
.key-tip::after { content: ''; position: absolute; left: 20px; bottom: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: #1f2b3a; }
.key-tip.show { opacity: 1; }
/* Keyword panel over the board (the picture stays visible above); tapping outside the panel closes it */
#kw-layer { display: none; position: absolute; z-index: 45; box-sizing: border-box; padding: 8px; border-radius: 26px;
  align-items: flex-start; justify-content: center; background: rgba(20,25,35,0.45); }
#kw-layer.show { display: flex; animation: peekin 0.2s ease-out; }
.kw-panel { width: 100%; max-height: 100%; overflow-y: auto; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px; border-radius: 16px; background: var(--surface); color: var(--fg); box-shadow: 0 10px 30px rgba(0,0,0,0.35); }
.kw-panel-head { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 900; letter-spacing: 1px; }
.kw-panel-head > span:first-child { opacity: 0.65; }
.kw-panel-hints { font-size: 13px; letter-spacing: 0; }
.peek-note { font-size: 11.5px; font-weight: 800; opacity: 0.6; text-align: center; }
.peek-note:empty { display: none; }
#kw-layer .theme-keywords { align-items: stretch; margin: 0; }
#kw-layer .kw-add { margin-left: auto; }
#level-loading {
  position: fixed; inset: 0; z-index: 2500; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(0,0,0,0.35); color: #fff; font-weight: 800; letter-spacing: 1px;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
#level-loading.show { display: flex; animation: peekin 0.2s ease-out; }
#level-loading .spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.3); border-top-color: #fff; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* Pull to refresh (menu, level map, settings). The page itself never scrolls (touch-action: none keeps drags on
   the board from moving it), so the browser's own pull-to-refresh can't fire; this one stands in for it. */
#ptr { position: fixed; left: 50%; top: 0; z-index: 3000; width: 42px; height: 42px; margin-left: -21px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; pointer-events: none; opacity: 0;
  background: var(--surface, #fff); color: var(--primary, #1f2b3a); box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transform: translateY(-50px); }
#ptr svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
#ptr.back { transition: transform 0.2s ease-out, opacity 0.2s ease-out; }
#ptr.ready svg { color: var(--c-green, #2e9d5b); }
#ptr.loading svg { animation: spin 0.8s linear infinite; }
/* "7 harfli" bubble over a tapped blank keyword, gone after a second */
.kw-tip {
  position: fixed; z-index: 3000; transform: translate(-50%, -100%); pointer-events: none;
  background: rgba(0,0,0,0.85); color: #fff; font-size: 12px; font-weight: 700;
  padding: 5px 9px; border-radius: 8px; white-space: nowrap; opacity: 0; transition: opacity 0.15s;
}
.kw-tip.show { opacity: 1; }
/* Level HUD: title, score and the goal cards are styled in the NEW LOOK block below */
.found-chip.keyword { background: rgba(255,217,61,0.28); color: #ffe9a3; box-shadow: inset 0 0 0 1px #ffd93d; }

/* Level complete window */
.modal-box.complete-box { width: min(92vw, 400px); text-align: center; }
.complete-stars { display: flex; justify-content: center; gap: 10px; margin: 2px 0 10px; }
.complete-stars span { font-size: 44px; color: rgba(255,255,255,0.2); line-height: 1; }
.complete-stars span.filled { color: #ffd93d; text-shadow: 0 0 14px rgba(255,217,61,0.8); animation: popin 0.4s ease-out both; }
.complete-stars span.filled:nth-child(2) { animation-delay: 0.15s; }
.complete-stars span.filled:nth-child(3) { animation-delay: 0.3s; }
.fp-missed-title { font-size: 12px; font-weight: 800; letter-spacing: 1px; opacity: 0.75; margin: 4px 0 8px; }
.fp-missed { list-style: none; margin: 0 0 6px; padding: 0; text-align: left; }
.fp-missed li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; margin-bottom: 5px; border-radius: 11px;
  background: rgba(255,255,255,0.07);
  cursor: pointer;
  opacity: 0; animation: mp-row-in 0.35s ease-out forwards;
}
.fp-missed li:active { background: rgba(255,255,255,0.14); }
.fp-missed .w { flex: 1; font-weight: 800; letter-spacing: 1px; }
.fp-missed .len { font-size: 11px; opacity: 0.6; }
.fp-missed .p { font-weight: 900; color: #ffd93d; min-width: 34px; text-align: right; }
.fp-missed-hint { font-size: 11.5px !important; opacity: 0.55 !important; margin: 0 0 12px !important; }
.complete-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.complete-stats div { background: rgba(255,255,255,0.08); border-radius: 12px; padding: 8px 6px; }
.complete-stats b { display: block; font-size: 20px; }
.complete-stats small { font-size: 12px; opacity: 0.75; }
.complete-conds { list-style: none; padding: 0; margin: 0 0 6px; text-align: left; font-size: 14px; }
.complete-conds li { padding: 4px 2px; opacity: 0.55; }
.complete-conds li.met { opacity: 1; }
.complete-conds li::before { content: '○  '; }
.complete-conds li.met::before { content: '✓  '; color: #3fd57a; font-weight: 900; }
.modal-actions { display: flex; gap: 10px; margin-top: 4px; }
.modal-actions .menu-btn { flex: 1; width: auto; margin: 0; padding-left: 8px; padding-right: 8px; font-size: 15px; white-space: nowrap; }

/* Theme picture window */
/* The picture is the point of this window: use the whole width of the screen. */
#modal-theme { padding: 10px 0; }
.modal-box.theme-box { width: min(100vw, 640px); padding: 18px 12px 16px; text-align: center; max-height: 100%; overflow-y: auto; }
.theme-box img { width: calc(100% + 24px); margin: 4px -12px 12px; border-radius: 0; display: block; background: #fff; }
@media (min-width: 641px) { .theme-box img { width: 100%; margin: 4px 0 12px; border-radius: 14px; } }
.theme-actions { display: flex; gap: 8px; margin-top: 8px; }
.theme-actions .modal-close-btn { margin-top: 0; flex: 1; }
/* Keywords as letter tiles (theme window and the picture tray): found = green, opened by a hint = gold,
   not found = empty. fitKeywordTiles() sets the tile size (--kt) from the longest keyword; more than 4 → two columns. */
.theme-keywords { --kt: 34px; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 6px; }
.theme-keywords.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-items: start; column-gap: 10px; }
.theme-keywords.two .kw-row { gap: 2px; }
.theme-keywords.two .kw-ok { display: none; }
.kw-row { display: flex; align-items: center; gap: 3px; min-width: 0; }
.kw-row.blanks { cursor: pointer; }
.kt { width: var(--kt); height: calc(var(--kt) * 1.12); flex: none; box-sizing: border-box; border-radius: calc(var(--kt) * 0.26);
  display: flex; align-items: center; justify-content: center; padding-top: 0.08em;
  font-family: var(--font-display); font-weight: 800; font-size: calc(var(--kt) * 0.6); line-height: 1; }
.kt.f { background: var(--c-green); color: #fff; }
.kt.r { background: color-mix(in srgb, var(--star) 30%, var(--surface)); color: color-mix(in srgb, var(--star) 45%, var(--fg));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--star) 75%, transparent); }
.kt.e { background: var(--surface-2); box-shadow: inset 0 0 0 2px rgba(var(--fg-rgb),0.2); }
.kw-ok { margin-left: 5px; font-weight: 900; color: var(--c-green); }
.kw-add { margin-left: 6px; padding: 4px 9px; border-radius: 999px; white-space: nowrap; font-size: 12px; font-weight: 900;
  background: color-mix(in srgb, var(--star) 30%, var(--surface)); color: color-mix(in srgb, var(--star) 45%, var(--fg)); }
.theme-keywords.two .kw-add, #theme-keywords .kw-add { display: none; }
/* Only the tile a hint just opened pops: scaling the whole row (full panel width) spilled out of the
   scrolling keyword panel and flashed a scrollbar. */
.kt.hinted { animation: fp-hint 0.6s ease-out; }
@keyframes gatepulse {
  0%, 100% { box-shadow: 0 4px 0 rgba(0,0,0,0.25), 0 0 10px rgba(63,213,122,0.35); }
  50% { box-shadow: 0 4px 0 rgba(0,0,0,0.25), 0 0 22px rgba(63,213,122,0.85); }
}

/* The word being traced floats over the top of the found-words list (it takes no room of its own; the list
   uses the whole space). A soft halo in the page color keeps it readable over the chips below it.
   placeCurrentWord() centers it on the list's top edge (portrait and landscape). */
#current-word {
  position: absolute; z-index: 6; left: 50%; transform: translateX(-50%);
  box-sizing: border-box; height: 48px; line-height: 1; white-space: nowrap; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; letter-spacing: 4px;
  color: var(--fg);
  padding: 4px 20px;
  border-radius: 16px;
  background: var(--bg1);
  box-shadow: 0 0 14px 12px color-mix(in srgb, var(--bg1) 85%, transparent);
  transition: background 0.15s, color 0.15s;
}
#current-word:empty { visibility: hidden; }
