/* ---- Free play: target words ---- */
#title small { display: block; font-family: var(--font-ui); font-size: 12px; font-weight: 800; letter-spacing: 0; opacity: 0.7; margin-top: 1px; }
#title small:empty { display: none; }
/* With target words the title gives way to a second counter beside the score: "KELİME 3/10" */
#topbar:has(#title.stat) #score-box { flex: 0 0 auto; }
#topbar:has(#title.stat) #refresh-area { flex: 0 0 auto; }
#title.stat { flex: 1; text-align: left; padding-left: 18px; white-space: nowrap; text-shadow: none; }
/* Free play: two counters side by side (HEDEF, TAHTA), each a label over a value */
#title.stat:has(.tstat) { display: flex; gap: 14px; padding-left: 14px; }
@media (max-width: 380px) {
  #title.stat:has(.tstat) { gap: 10px; padding-left: 10px; }
  #title.stat .tstat .value { font-size: 22px; }
  #title.stat .tstat .value small { font-size: 14px; }
}
#title.stat .label { font-family: var(--font-ui); font-size: 12px; font-weight: 800; letter-spacing: 1px; opacity: 0.7; }
#title.stat .value { font-family: var(--font-display); font-size: 26px; font-weight: 800; line-height: 1.05; }
#title.stat .value small { display: inline; margin: 0; font-family: inherit; font-size: 17px; font-weight: 800; letter-spacing: 0; opacity: 0.5; }
#refresh-area { gap: 8px; align-items: center; }
#hint-btn, #lvl-hint-btn {
  height: 42px; padding: 0 12px 0 10px; border-radius: 999px; border: none; flex-shrink: 0;
  background: color-mix(in srgb, var(--star) 30%, var(--surface)); color: var(--fg);
  display: flex; align-items: center; gap: 5px; font-size: 15px; font-weight: 900;
}
#hint-btn svg, #lvl-hint-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
#hint-btn.empty, #lvl-hint-btn.empty { background: var(--surface-2); opacity: 0.6; }
#lvl-hint-btn { height: 40px; padding: 0 10px 0 8px; }
#hint-btn:active, #lvl-hint-btn:active { transform: scale(0.95); }
#fp-targets { display: none; width: 100%; flex-direction: column; gap: 7px; padding: 2px 16px 4px; color: var(--fg); flex-shrink: 0; }
.fp-tbar { height: 6px; border-radius: 3px; background: rgba(var(--fg-rgb),0.12); overflow: hidden; }
.fp-tbar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--c-green); transition: width 0.5s cubic-bezier(.2,.8,.2,1); }
/* Target tiles scale with --fpc (one letter's width); free play with targets sets it so the targets fill the
   whole space above the board (fitFpTargets). 12px = the compact size. */
#fp-targets { --fpc: 12px; }
.fp-tgroups { display: flex; flex-direction: column; gap: calc(var(--fpc) * 0.5); }
.fp-tgroup { display: flex; align-items: flex-start; gap: 8px; }
.fp-tlabel { width: 38px; flex: none; font-size: 11px; font-weight: 900; opacity: 0.65; padding-top: calc(var(--fpc) * 1.25 - 7px); white-space: nowrap; }
.fp-twords { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: calc(var(--fpc) * 0.42); }
.fp-tword {
  height: calc(var(--fpc) * 2.5); padding: 0 calc(var(--fpc) * 0.5); border: none; border-radius: calc(var(--fpc) * 0.75);
  background: var(--surface); color: var(--fg);
  display: flex; align-items: center; gap: calc(var(--fpc) * 0.17); cursor: pointer; transition: background 0.3s, color 0.3s;
}
.fp-tword i {
  width: var(--fpc); height: calc(var(--fpc) * 1.75); display: flex; align-items: flex-end; justify-content: center; font-style: normal;
  font-family: var(--font-display); font-size: calc(var(--fpc) * 1.25); font-weight: 800; line-height: 1;
  border-bottom: max(2px, calc(var(--fpc) * 0.14)) solid rgba(var(--fg-rgb),0.35);
}
.fp-tword i.hint { border-bottom-color: var(--gold, #c28a12); color: var(--gold, #c28a12); }
.fp-tword.found { background: var(--c-green); color: #fff; }
.fp-tword.found i { border-bottom-color: transparent; }
.fp-tword.pop { animation: popin 0.45s ease-out; }
.fp-tword.hinted { animation: fp-hint 0.6s ease-out; }
@keyframes fp-hint { 0%,100% { transform: none; } 30% { transform: scale(1.15); box-shadow: 0 0 0 3px var(--star); } }
/* Free play hint pill: the count, and under it a thin bar toward the next hint (bonus points) */
#hint-btn { flex-direction: column; justify-content: center; gap: 3px; padding: 0 12px; }
#hint-btn .hb-row { display: flex; align-items: center; gap: 5px; line-height: 1; }
.fp-hbar { display: block; width: 100%; min-width: 34px; height: 4px; border-radius: 2px; background: rgba(var(--fg-rgb),0.16); overflow: hidden; }
.fp-hbar i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--fg); transition: width 0.4s ease-out; }
@media (max-width: 360px) {
  #fp-targets { --fpc: 11px; }
  .fp-tlabel { width: 34px; font-size: 10px; }
}
/* Free play with targets ("fp-mode" on #app): the targets take all the room between the top bar and the board.
   The found words aren't listed underneath any more: the book button (#fp-book) on the board's top-right corner
   opens them as a layer over the targets, and glows when a new word lands in it. */
/* Top-aligned: the progress bar stays right under the top bar; space the targets don't use is left above the
   corner buttons (centering split it, pushing the bar down on tall phones once found words widen the targets). */
#app.fp-mode #fp-targets { flex: 1 1 auto; min-height: 0; overflow: hidden; justify-content: flex-start; padding-bottom: 8px; }
#app.fp-mode .fp-tbar { flex: none; }
/* Levels with a picture ("pic-mode") use the same book: the found-words layer covers the picture. */
#app.fp-mode #found-words, #app.pic-mode #found-words { position: absolute; z-index: 5; display: none; box-sizing: border-box; padding: 12px 14px 54px;
  background: var(--bg1); -webkit-mask-image: none; mask-image: none; }
#app.fp-mode #found-words.open, #app.pic-mode #found-words.open { display: flex; animation: peekin 0.2s ease-out; }
#app.fp-mode #found-words:empty::before, #app.pic-mode #found-words:empty::before { content: 'Henüz kelime bulmadın.'; margin: auto; font-weight: 800; opacity: 0.6; }
/* One size in every mode (Nov 2026, Ibur: room and daily chips were smaller than the levels') */
#found-words .found-chip { font-size: 16px; padding: 5px 12px; }
/* Behind the book the list is hidden (display: none), so every chip's pop-in ran again on each opening and could stutter
   on long lists (Nov 2026, Ibur). New words fly into the book there anyway, so the chips don't animate. */
#app.fp-mode #found-words .found-chip, #app.pic-mode #found-words .found-chip { animation: none; }
/* Levels: the picture button sits where free play has its book (just above the board's top-right corner) and
   stays on top of the picture, so one tap shows it and the next hides it. */
#peek-btn { display: none; position: absolute; z-index: 46; width: 44px; height: 44px; padding: 0; border: none; border-radius: 50%;
  align-items: center; justify-content: center; cursor: pointer; background: var(--surface); color: var(--fg);
  box-shadow: 0 2px 10px rgba(0,0,0,0.16); }
#app.lvl-mode #peek-btn.has-pic { display: flex; }
#app.pic-mode #peek-btn.has-pic { display: none; } /* the picture is on screen: a tap on it enlarges it */
#peek-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#peek-btn.open { background: var(--primary); color: var(--on-primary, #fff); }
#app:not(.fp-mode) #found-words { padding-bottom: 54px; } /* the last chips can scroll out from under the corner buttons */
#fp-book { display: none; position: absolute; z-index: 7; width: 44px; height: 44px; padding: 0; border: none; border-radius: 50%;
  align-items: center; justify-content: center; cursor: pointer; background: var(--surface); color: var(--fg);
  box-shadow: 0 2px 10px rgba(0,0,0,0.16); }
#app.fp-mode #fp-book, #app.pic-mode #fp-book { display: flex; }
#fp-book svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#fp-book .n { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; box-sizing: border-box; padding: 0 5px;
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--on-primary, #fff); font-size: 11px; font-weight: 900; }
#fp-book .n:empty { display: none; }
#fp-book.open { background: var(--primary); color: var(--on-primary, #fff); }
#fp-book.open .n { background: var(--surface); color: var(--fg); }
#fp-book.glow { animation: bookglow 0.55s ease-in-out 2; }
@keyframes bookglow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.14); box-shadow: 0 0 0 3px var(--star), 0 0 18px 6px color-mix(in srgb, var(--star) 70%, transparent); }
}

.modal-box.fp-done-box { width: min(92vw, 380px); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.fp-done-box h3 { margin: 0; font-size: 28px; }
.fp-done-box p { margin: 0; font-size: 14px; font-weight: 700; }
.fp-done-ic { width: 60px; height: 60px; border-radius: 50%; background: var(--c-green); color: #fff; display: flex; align-items: center; justify-content: center; animation: popin 0.4s ease-out; }
.fp-done-ic svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.fp-done-stats { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fp-done-stats div { border-radius: 14px; padding: 9px 10px; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.fp-done-stats small { font-size: 11px; font-weight: 900; }
.fp-done-stats b { font-family: var(--font-display); font-size: 23px; font-weight: 800; line-height: 1; }
.fp-done-stats .t { background: color-mix(in srgb, var(--primary) 15%, var(--surface)); }
.fp-done-stats .t small { color: var(--primary); }
.fp-done-stats .s { background: color-mix(in srgb, var(--c-green) 15%, var(--surface)); }
.fp-done-stats .s small { color: var(--c-green); }
.fp-done-stats .b { background: color-mix(in srgb, var(--star) 28%, var(--surface)); }
.fp-done-facts { width: 100%; background: var(--surface-2); border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.fp-done-facts div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 800; }
.fp-done-facts span { opacity: 0.7; text-align: left; }
/* The words left on a completed board (fpRenderDoneMissed): one folding card, everyday words first */
.fp-done-missed { width: 100%; box-sizing: border-box; text-align: left; border: 1px solid var(--line-soft); border-radius: 14px;
  background: var(--surface); display: flex; flex-direction: column; }
.fp-done-missed[hidden] { display: none; }
.fpm-head { width: 100%; border: none; background: none; color: var(--fg); padding: 11px 14px; display: flex; align-items: center; gap: 8px;
  font: inherit; font-size: 14px; font-weight: 900; text-align: left; cursor: pointer; }
.fpm-head span { flex: 1; }
.fpm-head b { padding: 2px 8px; border-radius: 999px; background: var(--surface-2); font-size: 12px; }
.fpm-head svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.fpm-head .chev { transition: transform 0.2s; }
.fpm-head[aria-expanded="true"] .chev { transform: rotate(180deg); }
.fpm-head.locked { cursor: default; padding-bottom: 4px; }
.fp-done-box p.fpm-note { margin: 0; padding: 0 14px 10px; font-size: 13px; font-weight: 700; opacity: 0.8; }
.fp-done-box .fpm-head + p.fpm-note { padding-top: 0; }
.fp-done-box .fp-done-missed > p.fpm-note:first-child { padding-top: 10px; }
.fpm-signin { align-self: flex-start; margin: 0 14px 12px; height: 38px; padding: 0 16px; border: none; border-radius: 999px;
  background: var(--primary); color: var(--on-primary, #fff); font: inherit; font-size: 14px; font-weight: 900; cursor: pointer; }
.fpm-list { max-height: 34dvh; overflow-y: auto; border-top: 1px solid var(--line-soft); padding: 4px 0 8px; display: flex; flex-direction: column; }
.fpm-list[hidden] { display: none; }
.fpm-group { padding: 6px 14px 2px; font-size: 11px; font-weight: 900; letter-spacing: 1px; color: var(--c-green); }
.fpm-group.rare { color: var(--c-orange); padding-top: 10px; }
.fpm-row { padding: 5px 14px; display: flex; flex-direction: column; gap: 1px; }
.fpm-row div { display: flex; align-items: baseline; gap: 8px; }
.fpm-row b { font-family: var(--font-display); font-size: 16px; font-weight: 800; letter-spacing: 0.5px; }
.fpm-row .rare { padding: 1px 6px; border-radius: 999px; background: var(--surface-2); font-size: 10px; font-weight: 900; }
.fpm-row i { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 900; color: var(--c-green); }
.fpm-row small { font-size: 12px; font-weight: 700; opacity: 0.7; line-height: 1.35; }
.fpm-more { align-self: flex-start; margin: 4px 14px 0; border: none; background: none; padding: 4px 0; font: inherit; font-size: 13px;
  font-weight: 900; color: var(--primary); cursor: pointer; }
.fp-done-box .modal-close-btn { width: 100%; margin: 0; }
/* The free play family (Nov 2026): "Tahta değişsin mi?" and "Tahta özeti" share the "Tahta tamamlandı" look */
.fp-done-ic.orange { background: var(--c-orange); }
.fp-done-ic.primary { background: var(--primary); }
.fp-done-stats b small { font-size: 14px; opacity: 0.55; }
.fp-done-stats b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fp-done-box .lc-actions .menu-btn.cta, .fp-done-box .lc-actions .modal-close-btn { width: 100%; margin: 0; height: 50px; padding: 0 10px; font-size: 17px; }
.fp-done-box .lc-actions .modal-close-btn { font-size: 15px; }
.fp-done-box > * { flex-shrink: 0; }
.fp-done-box p.fp-change-warn { font-size: 14px; line-height: 1.45; }
.fp-change-warn b { color: var(--c-orange); }
.fp-sum-missed { width: 100%; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.fp-sum-missed .fp-missed-title { margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font-size: 12px; font-weight: 900; letter-spacing: 0; opacity: 0.75; }
.fp-sum-missed .fp-missed-title em { font-style: normal; font-weight: 800; }
.fp-sum-missed .fp-missed { margin: 0; padding: 4px; border-radius: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
.fp-sum-missed .fp-missed li, body.themed .fp-sum-missed .fp-missed li { margin: 0; padding: 6px 10px; border-radius: 10px; background: transparent; gap: 8px; font-size: 13.5px; font-weight: 800; }
.fp-sum-missed .fp-missed li:nth-child(odd), body.themed .fp-sum-missed .fp-missed li:nth-child(odd) { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.fp-sum-missed .fp-missed li:active, body.themed .fp-sum-missed .fp-missed li:active { background: color-mix(in srgb, var(--fg) 12%, transparent); }
.fp-sum-missed .fp-missed .w { font-family: var(--font-display); font-size: 16px; letter-spacing: 0.04em; }
.fp-sum-missed .fp-missed .p, body.themed .fp-sum-missed .fp-missed .p { color: var(--c-orange); text-shadow: none; font-variant-numeric: tabular-nums; }
.fp-done-box p.fp-missed-hint { margin: 0 !important; text-align: center; font-size: 11.5px; font-weight: 700; }
#modal-fp-summary .menu-btn.cta { margin-top: 2px; }
/* Level complete window (all three stars): same family as the free play "Tahta tamamlandı" window */
.modal-box.lc-box { width: min(92vw, 380px); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.lc-box h3 { margin: 0; font-size: 30px; }
.lc-box .lc-sub { margin: -6px 0 0; font-size: 14px; font-weight: 700; opacity: 0.7; }
.lc-box .lc-sub:empty { display: none; }
#modal-complete .complete-stars { align-items: flex-end; gap: 6px; margin: 2px 0 0; }
#modal-complete .complete-stars span { font-size: 50px; color: rgba(var(--fg-rgb, 255,255,255),0.15); }
#modal-complete .complete-stars span:nth-child(2) { font-size: 66px; margin-bottom: 8px; }
#modal-complete .complete-stars span.filled {
  color: var(--star); text-shadow: 0 0 18px color-mix(in srgb, var(--star) 70%, transparent);
  animation: popin 0.45s ease-out both, lc-star-glow 2.4s ease-in-out 1.2s infinite;
}
#modal-complete .complete-stars span.filled:nth-child(2) { animation-delay: 0.15s, 1.35s; }
#modal-complete .complete-stars span.filled:nth-child(3) { animation-delay: 0.3s, 1.5s; }
@keyframes lc-star-glow { 0%,100% { filter: none; } 50% { filter: brightness(1.15) drop-shadow(0 0 6px var(--star)); } }
.lc-box .fp-done-stats b small { font-size: 15px; opacity: 0.55; }
.lc-box .fp-done-stats div { animation: popin 0.4s ease-out both; }
.lc-box .fp-done-stats div:nth-child(1) { animation-delay: 0.35s; }
.lc-box .fp-done-stats div:nth-child(2) { animation-delay: 0.45s; }
.lc-box .fp-done-stats div:nth-child(3) { animation-delay: 0.55s; }
.lc-box .fp-done-facts:empty { display: none; }
.lc-box .complete-conds { width: 100%; margin: 0; font-size: 13.5px; font-weight: 700; }
.lc-box .complete-conds li { padding: 3px 2px; }
.lc-box .complete-conds li.met::before { color: var(--c-green); }
.lc-box .complete-conds li.info { opacity: 0.8; }
.lc-box .complete-conds li.info::before { content: '•  '; }
.lc-box .menu-btn.cta { margin: 2px 0 0; }
.lc-box .modal-close-btn { width: 100%; margin: 0; }
.lc-box > * { flex-shrink: 0; }
/* "Devam et" / "Kapat" and "Sonraki bölüm" side by side: one row instead of two keeps the window short */
.lc-actions { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; margin-top: 2px; }
.lc-actions .menu-btn.cta, .lc-actions .modal-close-btn { width: 100%; margin: 0; height: 50px; padding: 0 10px; font-size: 17px; }
.lc-box .fp-done-stats b { white-space: nowrap; }
.lc-box .fp-done-stats b small { font-size: 13px; } /* a tall window scrolls; its buttons never get squeezed */

/* Free play hints are teal, level hints stay gold, so the two wallets never look alike */
#hint-btn { background: color-mix(in srgb, var(--c-teal) 24%, var(--surface)); }
#hint-btn .fp-hbar i { background: var(--c-teal); }
.fp-tword i.hint { border-bottom-color: var(--c-teal); color: var(--c-teal); }
.fp-tword.hinted { animation-name: fp-hint-teal; }
@keyframes fp-hint-teal { 0%,100% { transform: none; } 30% { transform: scale(1.15); box-shadow: 0 0 0 3px var(--c-teal); } }
/* A new hint: the pill swells twice and a "+1" bubble floats up beside it */
#hint-btn.gain, #lvl-hint-btn.gain { animation: hint-gain 0.9s ease-in-out; }
@keyframes hint-gain { 0%,50%,100% { transform: scale(1); } 22%,72% { transform: scale(1.28); } }
.hint-plus {
  position: fixed; z-index: 3001; pointer-events: none; padding: 3px 9px; border-radius: 999px;
  background: var(--c-teal); color: #fff; font-family: var(--font-display); font-size: 16px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2); animation: hint-plus 1.3s ease-out forwards;
}
.hint-plus.level { background: var(--gold, #c28a12); }
@keyframes hint-plus {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(0.6); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
  70% { opacity: 1; transform: translate(-50%, -18px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -34px) scale(1); }
}

/* Editors' common/rare menu (hold a free play target word) */
.fp-tword { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.modal-box.word-mark-box { width: min(92vw, 340px); text-align: center; }
.word-mark-box h3 { margin: 4px 0 6px; font-size: 28px; letter-spacing: 1px; }
.word-mark-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); font-size: 11px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; }
.word-mark-box p { margin: 0 0 14px; }
#modal-word-mark .menu-btn.current { background: var(--primary); color: var(--on-primary); }
.word-mark-box .modal-close-btn { width: 100%; margin: 10px 0 0; }

/* ---- Board corner buttons: turn (every mode) and free word (free play), beside the book / picture button ---- */
#rotate-btn, #reveal-btn, #hand-btn { display: none; position: absolute; z-index: 46; width: 44px; height: 44px; padding: 0; border: none;
  border-radius: 50%; align-items: center; justify-content: center; cursor: pointer; background: var(--surface); color: var(--fg);
  box-shadow: 0 2px 10px rgba(0,0,0,0.16); }
#screen-game.active #rotate-btn, #screen-game.active #hand-btn { display: flex; }
#rotate-btn svg, #hand-btn svg, #reveal-btn .ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#rotate-btn:active, #hand-btn:active, #reveal-btn:active { transform: scale(0.94); }
#app.fp-mode #reveal-btn { display: flex; }
#reveal-btn { color: rgba(var(--fg-rgb), 0.55); transition: background 0.25s, color 0.25s; }
#reveal-btn .ring { position: absolute; inset: 0; width: 44px; height: 44px; transform: rotate(-90deg); pointer-events: none; }
#reveal-btn .ring circle { fill: none; stroke-width: 3; }
#reveal-btn .ring .track { stroke: rgba(var(--fg-rgb), 0.1); }
#reveal-btn .ring .fill { stroke: var(--c-teal); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p, 0) * 100); }
#reveal-btn.ready { background: var(--c-teal); color: #fff; animation: reveal-ready 1.2s ease-out 1; } /* one pulse when it fills, then calm */
#reveal-btn.ready .ring { display: none; }
#reveal-btn.empty { opacity: 0.45; }
@keyframes reveal-ready { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-teal) 45%, transparent), 0 2px 10px rgba(0,0,0,0.16); }
  50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--c-teal) 0%, transparent), 0 2px 10px rgba(0,0,0,0.16); } }

/* Turning the board: the board turns a quarter per tap and every tile turns back, so letters stay upright.
   The individual "rotate" property composes with the tiles' own transform animations. */
#board { rotate: calc(var(--turn, 0) * 90deg); transition: rotate 0.35s cubic-bezier(.3,.7,.3,1); }
#board .tile { rotate: calc(var(--turn, 0) * -90deg);
  transition: rotate 0.35s cubic-bezier(.3,.7,.3,1), transform 0.12s, background 0.12s, box-shadow 0.12s, color 0.12s; }
#board.no-turn-anim { transition: none; }
#board.no-turn-anim .tile { transition: transform 0.12s, background 0.12s, box-shadow 0.12s, color 0.12s; }

/* The free word: its tiles light up one after another, numbered */
#board .tile.reveal { background: linear-gradient(145deg, color-mix(in srgb, var(--c-teal) 65%, #fff), var(--c-teal)); color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-teal) 35%, transparent); animation: reveal-pop 0.3s ease-out; }
#board .tile .ord { position: absolute; top: -7px; left: -7px; width: 22px; height: 22px; border-radius: 50%; background: var(--primary);
  color: #fff; font-family: var(--font-ui); font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25); }
@keyframes reveal-pop { 0% { transform: scale(1); } 45% { transform: scale(1.12); } 100% { transform: scale(1); } }
#current-word.revealed { color: var(--c-teal); }

/* ---- Goal card hints (length / combo goal): a gold bulb on the card, and the panel above the board ---- */
.goal .goal-bulb { display: none; }
.goal.has-hints .goal-bulb {
  display: flex; position: absolute; left: -6px; bottom: -7px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--star); color: #3d2a00; box-shadow: 0 0 0 3px var(--bg1, #fff); align-items: center; justify-content: center; z-index: 1;
}
.goal.has-hints .goal-bulb svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.goal.has-hints, #star1-wrap, #star2-wrap, #star3-wrap { cursor: pointer; } /* every goal card opens its panel */
.goal.open { box-shadow: inset 0 0 0 3px var(--goal-c), 0 6px 14px color-mix(in srgb, var(--goal-c) 30%, transparent); }
.gh-panel {
  --gt: 36px; --gh-c: var(--c-teal);
  display: none; position: fixed; z-index: 60; box-sizing: border-box; padding: 14px 14px 12px; border-radius: 22px;
  background: var(--surface); color: var(--fg); flex-direction: column; gap: 8px; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  box-shadow: inset 0 0 0 2px var(--gh-c), 0 10px 24px rgba(0,0,0,0.14);
}
.gh-panel.combo { --gh-c: var(--c-orange); }
.gh-panel.show { display: flex; animation: peekin 0.2s ease-out; }
/* The head (title, hint balance, ✕) stays put while the panel scrolls: it sticks to the panel's top, over the content
   (its own background; the side margins keep the panel's 2px inset border visible). */
.gh-head { display: flex; align-items: center; gap: 10px; position: sticky; top: -14px; z-index: 2;
  margin: -14px -12px 0; padding: 14px 12px 6px; background: var(--surface); border-radius: 20px 20px 0 0; }
.gh-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.1; }
.gh-title b { font-family: var(--font-display); font-size: 19px; font-weight: 800; color: color-mix(in srgb, var(--gh-c) 70%, var(--fg)); }
.gh-title small { font-size: 12.5px; font-weight: 700; opacity: 0.7; }
.gh-balance {
  height: 32px; padding: 0 11px; border-radius: 999px; display: flex; align-items: center; gap: 5px; flex: none; font-size: 13px; font-weight: 900;
  background: color-mix(in srgb, var(--star) 30%, var(--surface)); color: color-mix(in srgb, var(--star) 45%, var(--fg));
}
.gh-balance.empty { background: var(--surface-2); color: var(--fg); opacity: 0.7; }
.gh-balance svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.gh-close { width: 36px; height: 36px; flex: none; border-radius: 50%; border: none; background: var(--surface-2); color: var(--fg); display: flex; align-items: center; justify-content: center; }
.gh-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; }
.gh-panel.score { --gh-c: var(--c-green); }
.gh-panel.key { --gh-c: var(--primary); }
/* The keyword card's panel: the keyword tiles, left-aligned with "Harf aç" on the right. */
#gh-keywords { align-items: stretch; margin: 0; }
#gh-keywords .kw-row { cursor: default; }
#gh-keywords .kw-row.blanks { cursor: pointer; }
#gh-keywords .kw-add { margin-left: auto; }
/* Pass rule or extra star, and whether it is met: the card's corner badge said in words. */
.gh-status { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.gh-status.met { background: color-mix(in srgb, var(--c-green) 14%, var(--surface)); }
.gh-badge { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 900; letter-spacing: 0.02em; background: var(--surface); box-shadow: inset 0 0 0 1.5px rgba(var(--fg-rgb),0.18); }
.gh-status.required .gh-badge { background: var(--gh-c); color: #fff; box-shadow: none; }
.gh-status.met .gh-badge { background: var(--c-green); color: #fff; box-shadow: none; }
.gh-badge svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.gh-status:not(.required) .gh-badge svg { fill: var(--star); stroke: var(--star); }
.gh-status.met:not(.required) .gh-badge svg { fill: #fff; stroke: #fff; }
.gh-state { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; line-height: 1.3; }
.gh-facts { margin: 0; font-size: 13px; font-weight: 700; line-height: 1.35; }
.gh-facts b { font-family: var(--font-display); font-size: 15px; color: color-mix(in srgb, var(--gh-c) 70%, var(--fg)); }
.gh-help { margin: 0; font-size: 12.5px; font-weight: 700; line-height: 1.35; opacity: 0.8; }
.gh-panel.tight .gh-help { display: none; }
.gh-rows { display: flex; flex-direction: column; gap: 7px; }
.gh-row { display: flex; align-items: center; gap: 6px; }
.gh-note { flex: 1; text-align: right; font-size: 12px; font-weight: 800; opacity: 0.65; white-space: nowrap; }
.gh-row.found .gh-note { color: var(--c-green); opacity: 1; }
.gh-t {
  width: var(--gt); height: calc(var(--gt) * 1.08); flex: none; box-sizing: border-box; border: none; border-radius: calc(var(--gt) * 0.26); padding: 0.08em 0 0;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; font-size: calc(var(--gt) * 0.6); line-height: 1; color: var(--fg);
}
.gh-t.r { background: var(--star); color: #3d2a00; }
.gh-t.f { background: var(--c-green); color: #fff; }
.gh-t.c { background: var(--combo-b, #ec9a62); color: var(--combo-text, #43200b); font-size: calc(var(--gt) * 0.44); }
.gh-t.e { background: var(--surface-2); box-shadow: inset 0 0 0 2px rgba(var(--fg-rgb),0.16); cursor: pointer; }
.gh-t.n { background: color-mix(in srgb, var(--star) 18%, var(--surface)); box-shadow: inset 0 0 0 2.5px var(--star); cursor: pointer; }
.gh-t.l { background: var(--surface-2); box-shadow: inset 0 0 0 2px rgba(var(--fg-rgb),0.22); color: rgba(var(--fg-rgb),0.55); cursor: help; }
.gh-t.l svg { width: 45%; height: 45%; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.gh-t.hinted { animation: fp-hint 0.6s ease-out; }

/* ---- Level picture above the board ("pic-mode" on #app, js/level-reveal.js) ----
   The picture takes all the room between the goal cards and the board (cropped at most a quarter of its height,
   fitLevelPicture). It starts blurred and clears tile by tile with the score; a tap enlarges it (#peek). */
/* Always the full width: fitLevelPicture reads the box's width, and a box shrunk to the picture kept a small picture small */
#lvl-pic { display: none; position: relative; flex: 1 1 auto; min-height: 0; box-sizing: border-box; padding: 2px 8px 8px;
  width: 100%; align-self: stretch;
  align-items: center; justify-content: center; cursor: pointer; }
#app.pic-mode #lvl-pic { display: flex; }
#lvl-pic-img { display: block; flex: none; max-width: 100%; border-radius: 16px; object-fit: cover; background: rgba(var(--fg-rgb),0.08); }
/* A slimmer top row, and the goal cards as one thin row of chips (label · value · badge, the bar under them):
   on a phone the picture needs every pixel. */
#app.pic-mode #hud-level { padding-top: 6px; }
#app.pic-mode .lvl-hud-top { margin-bottom: 6px; gap: 8px; }
#app.pic-mode #lvl-back-btn { width: 36px; height: 36px; }
#app.pic-mode .lvl-hud-title small { font-size: 11px; }
#app.pic-mode .lvl-hud-title span { font-size: 18px; }
#app.pic-mode .lvl-hud-score { height: 36px; padding: 0 13px; }
#app.pic-mode .lvl-hud-score span { font-size: 19px; }
/* Content-sized chips sharing what is left, so a long label ("5 HARF") takes room from a short one ("🔑 0/3") */
#app.pic-mode .goal-row { display: flex; gap: 5px; }
#app.pic-mode .goal-row .goal { flex: 1 1 auto; min-width: 0; }
#app.pic-mode .goal { height: 32px; padding: 0 4px 0 6px; border-radius: 10px; border-width: 1.5px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: 1fr 3px; column-gap: 3px; align-items: center; }
#app.pic-mode .goal-head { display: contents; }
#app.pic-mode .goal-label, #app.pic-mode .key-thumb { grid-column: 1; grid-row: 1; }
#app.pic-mode .goal-val { grid-column: 2; grid-row: 1; font-size: 14px; padding-top: 2px; overflow: hidden; text-overflow: clip; }
#app.pic-mode .goal-val small { font-size: 10px; }
#app.pic-mode .goal-badge { grid-column: 3; grid-row: 1; width: 16px; height: 16px; border-width: 1.2px; }
#app.pic-mode .goal-badge svg { width: 9px; height: 9px; }
#app.pic-mode .goal:not(.required).met .goal-badge svg { width: 10px; height: 10px; }
#app.pic-mode .goal-bar { grid-column: 1 / -1; grid-row: 2; height: 3px; margin: 0 -2px 3px -4px; }
#app.pic-mode .goal-label { font-size: 9px; letter-spacing: 0; }
#app.pic-mode .goal-label.combo-chip { height: 16px; padding: 0 4px; font-size: 10px; }
#app.pic-mode .goal-score .goal-label { display: none; } /* "58/200" says it; the green chip and its star do the rest */
#app.pic-mode .key-thumb { width: auto; height: 16px; background: none; font-size: 12px; }
#app.pic-mode .goal.has-hints .goal-bulb { width: 18px; height: 18px; left: -5px; bottom: -6px; box-shadow: 0 0 0 2px var(--bg1, #fff); }
#app.pic-mode .goal.has-hints .goal-bulb svg { width: 11px; height: 11px; }
@media (max-width: 370px) {
  #app.pic-mode .goal-row { gap: 4px; }
  #app.pic-mode .goal { padding: 0 3px 0 5px; }
  #app.pic-mode .goal-val { font-size: 13px; }
  #app.pic-mode .goal-label { font-size: 8.5px; }
}
/* 100%: the picture flashes, a ring and "Resim açıldı!" (for 3 s) */
.lvl-pic-done { position: absolute; left: 50%; top: 50%; z-index: 2; padding: 11px 20px 7px; border-radius: 999px; pointer-events: none;
  background: var(--c-orange); color: #fff; font-family: var(--font-display); font-size: 23px; font-weight: 800; white-space: nowrap;
  opacity: 0; transform: translate(-50%, -50%); box-shadow: 0 6px 18px rgba(0,0,0,0.22); }
#lvl-pic.opened .lvl-pic-done { animation: picDone 3s ease both; }
#lvl-pic.opened #lvl-pic-img { animation: picFlash 1.6s ease-out both, picRing 3s ease both; }
@keyframes picDone {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  22% { transform: translate(-50%, -50%) scale(1); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}
@keyframes picFlash { 0% { filter: brightness(1); } 18% { filter: brightness(1.35); } 100% { filter: brightness(1); } }
@keyframes picRing { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 15%, 80% { box-shadow: 0 0 0 4px var(--c-orange); } }
/* First time only: what the blurred picture is about */
#lvl-pic-tip { position: absolute; left: 50%; top: 50%; z-index: 3; width: min(250px, 80%); box-sizing: border-box; padding: 11px 13px;
  border-radius: 14px; background: #1f2b3a; color: #fff; font-size: 13.5px; font-weight: 700; line-height: 1.4; text-align: left;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28); pointer-events: none; opacity: 0; transform: translate(-50%, -46%); transition: opacity 0.2s, transform 0.2s; }
#lvl-pic-tip b { display: block; font-family: var(--font-display); font-size: 16px; font-weight: 800; margin-bottom: 2px; }
#lvl-pic-tip.show { opacity: 1; transform: translate(-50%, -50%); }

/* The locked picture (level-reveal.js): the tiny copy the server sends, blurred, and a ring in the middle that fills with
   the score; the picture itself opens all at once at the reveal score. "pic-reveal": plain "reveal" is the magnifier's lit tile.
   The same overlay sits on the picture above the board, the enlarged picture and the theme window's picture. */
.pic-reveal { --plr: 124px; position: absolute; display: none; overflow: hidden; pointer-events: none; }
.pic-reveal.show { display: block; }
.reveal-hidden { visibility: hidden; }
.reveal-in { position: absolute; overflow: hidden; }
.pic-reveal .reveal-in img { position: absolute; display: block; margin: 0; max-width: none; max-height: none; border-radius: 0; object-fit: fill; background: none; }
/* The copy is only ~12 px wide: blurred further so its pixels never show, a little larger so the blur has no pale rim */
.pic-reveal .reveal-in .reveal-ground { left: 0; top: 0; width: 100%; height: 100%; filter: blur(16px) saturate(0.85); transform: scale(1.2); }
.pic-lock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.pl-ring { position: relative; width: var(--plr); height: var(--plr); border-radius: 50%; background: rgba(255,253,248,0.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 4px 14px rgba(0,0,0,0.12); }
.pl-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.pl-track, .pl-fill { fill: none; stroke-width: 10; }
.pl-track { stroke: rgba(31,43,58,0.12); }
.pl-fill { stroke: #2f5682; stroke-linecap: round; transition: stroke-dasharray 0.6s ease; }
.pl-pct { position: relative; font-family: var(--font-display); font-size: calc(var(--plr) * 0.27); font-weight: 800; color: #2f5682; }
.pl-word { position: relative; margin-top: 4px; font-size: calc(var(--plr) * 0.09); font-weight: 900; letter-spacing: 1px; color: #1f2b3a; opacity: 0.7; }
.pl-text { max-width: 90%; box-sizing: border-box; padding: 6px 12px; border-radius: 999px; background: rgba(31,43,58,0.72); color: #fff;
  font-size: 13px; font-weight: 800; text-align: center; }
.pic-reveal.tiny .pic-lock { gap: 6px; }
.pic-reveal.tiny .pl-text { padding: 4px 10px; font-size: 11.5px; }
/* The theme window says the same in its text, and its box covers the middle of its picture: no ring there */
#modal-theme .pic-lock { display: none; }

/* The level's name, shown once its picture is clear, pops into the title */
.lvl-hud-title span.just-named { animation: nameIn 0.9s cubic-bezier(.3,1.5,.5,1) both; transform-origin: left center; }
@keyframes nameIn { 0% { opacity: 0; transform: scale(0.6); } 40% { opacity: 1; transform: scale(1.12); color: var(--c-orange); } 100% { transform: scale(1); } }

/* Zooming the enlarged picture (js/level-play.js): the frame clips the zoomed picture, so it never covers the board.
   The picture and its reveal overlay share the transform; corner tabs other than ✕ step aside while zoomed. */
#peek-pic { overflow: hidden; touch-action: none; }
#peek-img, #peek-pic .pic-reveal { transform-origin: 0 0; -webkit-user-drag: none; user-select: none; }
#peek-img.zoom-anim, #peek-pic .pic-reveal.zoom-anim { transition: transform 0.25s ease; }
#peek.zoomed .peek-tag, #peek.zoomed .key-btn, #peek.zoomed .key-tip { opacity: 0; pointer-events: none; }
#peek.zoomed .peek-pic { cursor: grab; }
#peek.zoomed #peek-img { border-radius: 0; }
#peek.zoomed #peek-pic .pic-reveal { border-radius: 0 !important; } /* its radius is set inline from the picture's */

/* ---- Multiplayer object cards (mp-objects.js): three objects above the board, their keywords ×2 ---- */
#mp-objects:not([hidden]) { display: block; margin-top: 8px; }
.mp-obj-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 5px; }
.mp-obj-head b { font-family: var(--font-display); font-size: 15px; font-weight: 800; line-height: 1; }
.mp-obj-head span { font-size: 11px; font-weight: 900; color: var(--gold, #f0b72f); }
.mp-obj-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mp-obj {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0;
  padding: 7px 6px 6px; border-radius: 14px; background: var(--surface);
}
.mp-obj.found { background: rgba(79,174,108,0.18); box-shadow: inset 0 0 0 2px var(--c-green); }
.mp-obj.pop { animation: mp-obj-pop 0.5s ease-out; }
@keyframes mp-obj-pop { 0% { transform: scale(1); } 40% { transform: scale(1.1); } 100% { transform: scale(1); } }
.mp-obj .tick {
  position: absolute; top: 5px; right: 5px; width: 18px; height: 18px; border-radius: 50%; background: var(--c-green);
  display: flex; align-items: center; justify-content: center;
}
.mp-obj .tick svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.mp-obj-ic {
  --ic: 46px; width: var(--ic); height: var(--ic); flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.mp-obj-ic img { width: 78%; height: 78%; -webkit-user-drag: none; user-select: none; pointer-events: none; }
.mp-obj-tiles { display: flex; gap: 2px; width: 100%; justify-content: center; }
.mp-obj-tiles .t {
  flex: 0 1 15px; min-width: 0; height: 19px; border-radius: 4px; box-shadow: inset 0 0 0 1.5px rgba(var(--fg-rgb),0.3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 12px; font-weight: 800; line-height: 1; color: #fff;
}
.mp-obj-tiles .t.on { background: var(--c-green); box-shadow: none; }
.mp-obj small { font-size: 10.5px; font-weight: 800; line-height: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mp-obj small.len { opacity: 0.55; }
.mp-obj small.pts { color: var(--c-green); font-weight: 900; }
/* Short screens: smaller icons, so the board keeps its size. */
@media (max-height: 700px) {
  .mp-obj-ic { --ic: 36px; }
  .mp-obj-head { display: none; }
}

/* Results: the objects with their keywords and who found them */
.mp-obj-results { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 12px; text-align: left; }
.mp-obj-res-head { font-family: var(--font-display); font-size: 16px; font-weight: 800; }
.mp-obj-res-head span { font-family: var(--font-body, inherit); font-size: 11px; font-weight: 900; color: var(--gold, #f0b72f); margin-left: 4px; }
.mp-obj-res { display: flex; align-items: center; gap: 10px; padding: 4px 10px; border-radius: 14px; background: rgba(var(--fg-rgb),0.07); }
.mp-obj-res.mine { box-shadow: inset 0 0 0 2px var(--c-green); }
.mp-obj-res .w { display: flex; flex-direction: column; min-width: 0; }
.mp-obj-res .w b { font-family: var(--font-display); font-size: 16px; font-weight: 800; letter-spacing: 1px; line-height: 1.1; }
.mp-obj-res .w small { font-size: 12px; font-weight: 700; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-obj-res .w small.none { color: var(--c-orange); opacity: 1; }

/* Series results between games: this game's words and the average under the name */
.mp-series-rank .num, .mp-table-head .num { width: 56px; white-space: nowrap; }
.mp-series-rank .pts, .mp-table-head .pts { width: 48px; }
.mp-series-rank .who { display: flex; flex-direction: column; line-height: 1.2; }
.mp-series-rank .who .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-series-rank .who .meta { font-size: 11px; font-weight: 700; opacity: 0.65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Keyword panel: "Harf aç" button on rows a hint can still open (level-theme.js) */
#kw-layer .kw-add, #gh-keywords .kw-add { display: inline-flex; align-items: center; gap: 4px; }
#kw-layer .kw-add svg, #gh-keywords .kw-add svg { width: 13px; height: 13px; flex: none; fill: #f0b72f; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }

/* ---- Level passed (level-pass.js): a card over the picture and a play button at the board's top-left ---- */
/* Near the picture's top, clear of the corner buttons over its bottom; compact so a short picture holds it. */
/* Above the corner buttons (z-index 46): no button shows on the card; on a short screen it may reach over the board */
#pass-card { position: absolute; left: 50%; top: 12px; z-index: 50; width: min(330px, calc(100% - 36px)); box-sizing: border-box;
  padding: 11px 12px 12px; border-radius: 18px; background: var(--surface); color: var(--fg); cursor: default;
  display: none; flex-direction: column; gap: 6px; text-align: left;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3); transform: translateX(-50%); }
#pass-card.show { display: flex; animation: passIn 0.45s cubic-bezier(.3,1.4,.5,1) both; }
@keyframes passIn { 0% { opacity: 0; transform: translateX(-50%) scale(0.7); } 100% { opacity: 1; transform: translateX(-50%) scale(1); } }
#pass-card .pass-head { display: flex; align-items: center; gap: 8px; }
#pass-card .pass-tick { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--c-green); display: flex; align-items: center; justify-content: center; }
#pass-card .pass-tick svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
#pass-card b { flex: 1; font-family: var(--font-display); font-size: 21px; font-weight: 800; line-height: 1; padding-top: 3px; }
#pass-card .pass-stars { display: flex; gap: 2px; font-size: 20px; line-height: 1; color: var(--surface-2); }
#pass-card .pass-stars .on { color: var(--star); }
#pass-card .pass-text { font-size: 13px; font-weight: 700; line-height: 1.35; opacity: 0.75; }
#pass-card .pass-actions { display: flex; gap: 8px; }
#pass-card .pass-actions button { flex: 1; height: 40px; border: none; border-radius: 999px; cursor: pointer;
  font-family: var(--font-display); font-size: 16px; font-weight: 800; white-space: nowrap; }
#pass-card .pass-stay { background: var(--surface-2); color: var(--fg); }
#pass-card .pass-next { flex: 1.35 !important; background: var(--c-green); color: #fff; }
#lvl-pic.passed #lvl-pic-img, #lvl-pic.passed .pic-reveal { box-shadow: 0 0 0 3px var(--c-green); }
#next-btn { display: none; position: absolute; z-index: 46; width: 44px; height: 44px; padding: 0; border: none; border-radius: 50%;
  align-items: center; justify-content: center; cursor: pointer;
  /* The same disc as the turn and book buttons */
  background: var(--surface); color: var(--fg); box-shadow: 0 2px 10px rgba(0,0,0,0.16); }
#screen-game.active #app.lvl-mode.lvl-passed #next-btn,
#screen-game.active #app.fp-mode.fp-passed #next-btn { display: flex; }
/* The enlarged picture puts its key button in that corner */
#screen-game.active #app.lvl-mode.lvl-passed.peek-open #next-btn { display: none; }
#next-btn svg { width: 22px; height: 22px; margin-left: 2px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
#next-btn:active { transform: scale(0.94); }
#next-btn.glow { animation: nextGlow 1.1s ease-in-out 3; }
@keyframes nextGlow {
  /* A gold halo (the stars' colour) spreading out, so it reads as a shine on any picture and theme */
  0%, 100% { box-shadow: 0 2px 10px rgba(0,0,0,0.16), 0 0 0 0 rgba(255,200,40,0.95), 0 0 0 0 rgba(255,200,40,0); transform: scale(1); }
  50% { box-shadow: 0 2px 10px rgba(0,0,0,0.16), 0 0 0 6px rgba(255,200,40,0.9), 0 0 22px 12px rgba(255,200,40,0.55); transform: scale(1.12); }
}


/* Free play while its board is fetched (newGame): the old board's tiles are hidden, only the board's frame shows. */
#board.board-wait .tile { visibility: hidden; }

/* Left-handed layout (Settings, body.hand-left): in landscape the board goes to the left, the HUD and the
   picture / targets / found words to the right. Mirrors the landscape grid in hud.css. */
@media (orientation: landscape) and (max-height: 600px), (orientation: landscape) and (hover: hover) and (pointer: fine) and (min-width: 900px) {
  body.hand-left #app-root #app { grid-template-columns: auto minmax(0, 1fr); }
  body.hand-left #app #topbar, body.hand-left #app #hud-level, body.hand-left #app #hud-multi,
  body.hand-left #app #fp-stats, body.hand-left #app #fp-targets, body.hand-left #app:not(.fp-mode):not(.pic-mode) #found-words,
  body.hand-left #app.pic-mode #lvl-pic { grid-column: 2; }
  body.hand-left #app #board-wrap { grid-column: 1; padding: 8px 4px 8px 12px; }
}
/* Landscape, both layouts: the found-words layer is absolutely placed by placeFpOverlay from the app's corner. With a
   grid column/row (hud.css gives it column 1, row 4) its offsets count from that grid area instead: the layer sat too
   low (right-handed) or off the screen (left-handed). */
@media (orientation: landscape) and (max-height: 600px), (orientation: landscape) and (hover: hover) and (pointer: fine) and (min-width: 900px) {
  #app.fp-mode #found-words, #app.pic-mode #found-words { grid-column: auto; grid-row: auto; }
}


/* ---- Landscape: the enlarged picture fills the whole screen (sizePeek adds "full"), above the board and its
   buttons. No key there: the keyword panel opens from the key on the small picture, over the board. ---- */
#peek.full { z-index: 55; }
#peek.full .key-btn, #peek.full .key-tip { display: none; }

/* Landscape level start window: the picture on one half, the name, text, keywords and "Başla" on the other, the
   button on the thumb's side (right; left in the left-handed layout), so it fits a phone held sideways. */
@media (orientation: landscape) and (max-height: 600px), (orientation: landscape) and (hover: hover) and (pointer: fine) and (min-width: 900px) {
  #modal-theme { padding: 8px; }
  /* The box takes the whole height and its one row is held to it (minmax(0, 1fr)): with an auto row the text column
     grew past a short screen and the box cut off "Başla" and the stars (Nokia 3, iPhone SE held sideways). */
  .modal-box.theme-box { width: min(100%, 880px); height: 100%; max-height: 100%; display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); overflow: hidden; }
  .theme-hero { margin: 0; display: flex; align-items: center; justify-content: center; background: var(--surface-2); min-height: 0; }
  .theme-box .theme-hero img { width: auto; max-width: 100%; max-height: 100%; margin: 0; }
  .theme-hero { position: relative; overflow: hidden; }
  .theme-stars { bottom: 10px; height: 40px; }
  .theme-stars span { font-size: 22px; }
  .theme-stars span:nth-child(2) { font-size: 26px; }
  .theme-body { justify-content: safe center; padding: 14px 16px; gap: 10px; overflow-y: auto; min-height: 0; }
  .theme-body h3 { font-size: 24px; }
  .theme-body p { font-size: 13px; line-height: 1.35; }
  body.hand-left .modal-box.theme-box { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
  /* Very short (a phone held sideways, browser bars on): half the width for the text, everything a bit tighter, so
     the goals and "Başla" fit without scrolling; the window still scrolls if they don't. */
  @media (max-height: 420px) {
    .modal-box.theme-box, body.hand-left .modal-box.theme-box { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .theme-body { padding: 10px 12px; gap: 7px; }
    .theme-body h3 { font-size: 20px; }
    .theme-body p { font-size: 12px; line-height: 1.3; }
    .theme-goals { gap: 6px; }
    .tg-group { padding: 6px 9px; gap: 3px; }
    .tg-head { font-size: 10.5px; }
    .tg-line { font-size: 12.5px; line-height: 1.25; gap: 7px; }
    .tg-icon { width: 20px; height: 20px; }
    .theme-body .modal-close-btn, .theme-body .menu-btn.cta { height: 44px; min-height: 44px; font-size: 16px; }
  }
  /* Shorter still (iPhone SE sideways in Safari, ~310 px): the line under the title goes, the goals say it all */
  @media (max-height: 340px) { .theme-body p { display: none; } }
  body.hand-left .theme-hero { order: 2; }

  /* Left-handed menu: the buttons on the left, the title on the right */
  body.hand-left #screen-menu #menu-title, body.hand-left #screen-menu #menu-sub { grid-column: 2; }
  body.hand-left #screen-menu #menu-center > .menu-btn, body.hand-left #screen-menu .menu-row,
  body.hand-left #screen-menu #menu-center > #daily-card { grid-column: 1; }
}

/* Theme window: the level's goals in two groups (pass rule, extra stars) instead of the keyword tiles. */
.theme-goals { width: 100%; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.tg-group { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 14px; background: var(--surface-2); }
.tg-head { font-size: 11.5px; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.65; }
.tg-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.tg-icon { flex: none; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--surface); box-shadow: inset 0 0 0 1.5px rgba(var(--fg-rgb),0.18); }
.tg-icon svg { width: 13px; height: 13px; fill: var(--star); stroke: var(--star); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tg-line.required .tg-icon { background: var(--primary); box-shadow: none; }
.tg-line.required .tg-icon svg { fill: none; stroke: #fff; }
.tg-line.met .tg-icon { background: var(--c-green); box-shadow: none; }
.tg-line.met .tg-icon svg { fill: #fff; stroke: #fff; }
.tg-line.required.met .tg-icon svg { fill: none; }
.tg-text { flex: 1; min-width: 0; }
.tg-val { flex: none; font-family: var(--font-display); font-weight: 800; font-size: 14px; opacity: 0.75; }
.tg-line.met .tg-val { color: var(--c-green); opacity: 1; }

/* Hint walkthrough (level-hint-coach.js): a dim layer that catches every tap, a spotlight ring on the target (its
   huge shadow is the dim), and a bubble with the step's text. Above the goal panel (60) and the pass card. */
#hint-coach { display: none; position: fixed; inset: 0; z-index: 300; touch-action: none; }
#hint-coach.show { display: block; }
#hint-coach .hc-ring { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(10,18,28,0.62), inset 0 0 0 3px var(--star);
  transition: left 0.3s ease, top 0.3s ease, width 0.3s ease, height 0.3s ease; pointer-events: none; }
#hint-coach .hc-ring.pulse { animation: hc-pulse 1.1s ease-out 2; }
@keyframes hc-pulse { 0% { outline: 0 solid transparent; } 40% { outline: 6px solid color-mix(in srgb, var(--star) 55%, transparent); } 100% { outline: 14px solid transparent; } }
#hint-coach .hc-bubble { position: fixed; box-sizing: border-box; padding: 14px 16px 12px; border-radius: 18px; background: var(--surface); color: var(--fg);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3); animation: peekin 0.2s ease-out; }
#hint-coach .hc-title { display: block; font-family: var(--font-display); font-size: 18px; font-weight: 800; color: color-mix(in srgb, var(--star) 50%, var(--fg)); }
#hint-coach .hc-text { margin: 4px 0 10px; font-size: 14px; font-weight: 700; line-height: 1.4; }
#hint-coach .hc-actions { display: flex; align-items: center; gap: 10px; }
#hint-coach .hc-dots { flex: 1; display: flex; justify-content: center; gap: 5px; }
#hint-coach .hc-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(var(--fg-rgb),0.2); }
#hint-coach .hc-dots i.on { background: var(--star); }
#hint-coach button { border: none; border-radius: 999px; font: inherit; font-weight: 900; font-size: 14px; padding: 8px 16px; cursor: pointer; }
#hint-coach .hc-skip { background: transparent; color: var(--fg); opacity: 0.6; padding: 8px 6px; }
#hint-coach .hc-next { background: var(--star); color: #3d2a00; }

/* Shared hint pool (body "hints-shared", #hint-btn "shared"): free play spends the same hints as levels, so its pill
   and opened letters turn gold like the level's, and it has no bar (free play earns no hints then). "free": the
   board's own free hint is still there, shown as a small gift dot. */
body.hints-shared #fp-reset-row { display: none; }
#hint-btn.shared { background: color-mix(in srgb, var(--star) 30%, var(--surface)); position: relative; }
#hint-btn.shared .fp-hbar { display: none; }
body.hints-shared .fp-tword i.hint { border-bottom-color: var(--gold, #c28a12); color: var(--gold, #c28a12); }
body.hints-shared .fp-tword.hinted { animation-name: fp-hint; }
#hint-btn.free::after {
  content: "\1F381"; position: absolute; top: -7px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px; background: var(--c-teal); color: #fff; border: 2px solid var(--surface);
  font-family: var(--font-display); font-size: 11px; font-weight: 800; line-height: 14px; text-align: center;
}

/* Free play XP (only for players who see XP): a pill floating up under the points toast, bigger for a long word or a
   completed board, and the board's total in "Tahta tamamlandı" and "Tahta özeti" */
.xp-float {
  position: fixed; left: 50%; top: calc(40% + 34px); z-index: 1001; pointer-events: none; white-space: nowrap;
  padding: 3px 10px; border-radius: 999px; background: #7a5cf0; color: #fff;
  font-family: var(--font-display); font-size: 15px; font-weight: 800; box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  animation: xp-float 1.2s ease-out forwards;
}
.xp-float.long { font-size: 19px; padding: 5px 14px; animation-duration: 1.7s; }
@keyframes xp-float {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(0.7); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  35% { transform: translate(-50%, 0) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -26px); }
}
.fp-sum-xp {
  width: 100%; padding: 8px 12px; border-radius: 14px; text-align: center; font-weight: 800;
  background: color-mix(in srgb, #7a5cf0 16%, var(--surface));
}
.fp-sum-xp b { color: #7a5cf0; font-family: var(--font-display); font-size: 18px; }
.fp-sum-xp[hidden] { display: none; }
.fp-done-facts .xp b { color: #7a5cf0; }

/* Free play: the corner row's left end (#fp-meta, placeFpMeta): one oval split in two (design E), the board count
   "21/174" and this board's XP "+45 XP" (violet, "XP" small). As tall as the round corner buttons, the same surface and
   shadow. Nothing flies into it (Ibur: too distracting); the number nudges when it grows. A tap on either half explains it. */
#fp-meta { display: none; position: absolute; z-index: 7; width: 44px; height: 44px; }
#app.fp-mode #fp-meta { display: block; }
#fp-stats-btn { position: relative; width: 44px; height: 44px; padding: 0; border: none; border-radius: 50%; cursor: pointer;
  background: var(--surface); color: var(--fg); box-shadow: 0 2px 10px rgba(0,0,0,0.16); display: flex; align-items: center; justify-content: center; }
#fp-stats-btn .ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
#fp-stats-btn .ring circle { fill: none; stroke-width: 3; }
#fp-stats-btn .ring .t { stroke: rgba(var(--fg-rgb),0.12); }
#fp-stats-btn .ring .f { stroke: var(--primary); stroke-linecap: round; transition: stroke-dasharray 0.5s ease-out; }
#fp-stats-btn .ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
#fp-xp-chip { position: absolute; top: -9px; right: -14px; padding: 0 6px; border-radius: 10px; background: #7a5cf0; color: #fff;
  line-height: 18px; pointer-events: none; }
#fp-xp-chip[hidden] { display: none; }
#fp-xp-chip.in { right: -2px; } /* near the screen's right edge (fitXpBadge): grows to the left, over the ring */
#fp-xp-chip b { font-family: var(--font-display); font-size: 12px; font-weight: 800; display: inline-block; }
#fp-xp-chip b.bump { animation: fpx-bump 0.35s ease-out; }
@keyframes fpx-bump { 40% { transform: scale(1.2); } }
/* The board's statistics (fpOpenStats, in modal-achv): words found by length and this board's XP */
.fps-tiles { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; text-align: left; }
.fps-tiles.one { grid-template-columns: minmax(0, 1fr); }
.fps-tile { border-radius: 16px; padding: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.fps-tile span { font-size: 12px; font-weight: 900; letter-spacing: 0.04em; opacity: 0.7; }
.fps-tile b { font-family: var(--font-display); font-size: 28px; font-weight: 800; line-height: 1; }
.fps-tile b small { font-size: 16px; opacity: 0.5; }
.fps-tile.xp b, .fps-tile.xp span { color: #7a5cf0; opacity: 1; }
.fps-line { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.fps-tile em { font-style: normal; font-size: 13px; font-weight: 800; opacity: 0.75; }
.fps-bar { height: 8px; border-radius: 4px; background: rgba(var(--fg-rgb),0.12); overflow: hidden; }
.fps-bar i { display: block; height: 100%; border-radius: 4px; background: var(--primary); }
#achv-sheet.fps-wide { width: calc(100vw - 20px); max-width: 520px; box-sizing: border-box; }
.fps-stars { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 8px; align-items: stretch; }
.fps-locked { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; border-radius: 16px; }
.fps-locked.on { padding: 4px; margin: -6px 0; border: 2px dashed #e0a419; }
.fps-locked > i { position: absolute; left: -13px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%;
  background: #e0a419; color: #1a2232; display: flex; align-items: center; justify-content: center; }
.fps-locked > i svg, .fps-star.key svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.fps-star { border-radius: 14px; padding: 9px 4px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.fps-star b { font-size: 20px; line-height: 1; letter-spacing: 1px; color: rgba(var(--fg-rgb),0.3); }
.fps-star.on b { color: #f2b82e; text-shadow: 0 0 8px rgba(242,184,46,0.55); }
.fps-star.half b { color: #f2b82e; opacity: 0.45; }
.fps-star.half { box-shadow: inset 0 0 0 1.5px rgba(242,184,46,0.45); }
.fps-star em { font-style: normal; font-size: 13px; font-weight: 900; line-height: 1.2; text-align: center; }
.fps-star em.ok { color: var(--c-green); }
.fps-star.key { box-shadow: inset 0 0 0 2px #e0a419; }
.fps-star.key span { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 900; color: #e0a419; }
.fps-star.key em { font-family: var(--font-display); font-size: 18px; }
button.fps-tile { border: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.fps-tile > span { display: flex; justify-content: space-between; align-items: center; }
.fps-tile .chev { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; transition: transform 0.2s; }
.fps-tile.open { box-shadow: inset 0 0 0 2px var(--primary); }
.fps-tile.open .chev { transform: rotate(180deg); }
.fps-tile.xp em { color: inherit; opacity: 0.7; font-size: 12px; }
.fps-more { width: 100%; display: flex; flex-direction: column; gap: 10px; animation: peekin 0.2s ease-out; }
.fps-more[hidden] { display: none; }
.fps-title { align-self: flex-start; font-size: 12px; font-weight: 900; letter-spacing: 0.06em; opacity: 0.65; margin-top: 4px; }
.fps-rows { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.fps-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) 62px 40px; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; text-align: left; }
.fps-row b { font-family: var(--font-display); font-size: 16px; text-align: right; }
.fps-row b small { font-size: 13px; opacity: 0.5; }
.fps-row em { font-style: normal; font-size: 12px; opacity: 0.65; text-align: right; }
/* A tap on the XP: the level, big, then this board's XP (fpOpenXpSheet, in modal-achv) */
.fpx-level { position: relative; width: 132px; height: 132px; align-self: center; display: flex; align-items: center; justify-content: center; }
.fpx-level svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.fpx-level .t { fill: none; stroke: rgba(122,92,240,0.15); stroke-width: 10; }
.fpx-level .f { fill: none; stroke: #7a5cf0; stroke-width: 10; stroke-linecap: round; }
.fpx-level div { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.fpx-level span { font-size: 12px; font-weight: 900; letter-spacing: 0.08em; opacity: 0.65; }
.fpx-level b { font-family: var(--font-display); font-size: 54px; font-weight: 800; color: #7a5cf0; }
.fpx-next { margin: 0; text-align: center; font-size: 15px; font-weight: 800; opacity: 0.85; }
.fpx-next .gift { color: var(--gold, #c28a12); }
.fpx-card { width: 100%; box-sizing: border-box; background: var(--surface-2); border-radius: 16px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px; }
.fpx-head { display: flex; justify-content: space-between; align-items: baseline; }
.fpx-head b:first-child { font-size: 14px; font-weight: 900; }
.fpx-total { font-family: var(--font-display); font-size: 24px; font-weight: 800; color: #7a5cf0; line-height: 1; }
.fpx-row { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; }
.fpx-row span { opacity: 0.75; }
.fpx-row.wait { opacity: 0.55; }
.fpx-link { align-self: center; border: none; background: none; padding: 6px 10px; font: inherit; font-weight: 900; font-size: 14px;
  color: var(--primary); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* The free play ladder (Nov 2026): the step beside the targets in the top bar ("TAHTA 12", a tap explains), and the
   letters a board shows from the start (easy steps), underlined in orange so they read apart from hint letters */
#title.stat .tstat.fp-step { border: none; background: none; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
#title.stat .tstat.fp-step .value { color: var(--c-orange); }
.fp-tword i.given { border-bottom-color: var(--c-orange); color: var(--fg); }

/* Tap input (body class "tap-input"): the round send button sits in the middle of the board, over the four
   middle tiles' inner corners (it is above them, so its shadow shows it lies on top of a selected tile). Faded
   and inert until the word has 2 letters (board class "tap-ready"). It turns back with the board like the tiles.
   The middle tiles show their points in the corner away from the button; tiles stay upright on a turned board,
   so the corner follows the board's quarter ("data-q", set in setBoardTurns). Bottom-right is the default. */
#tap-ok { position: absolute; left: 50%; top: 50%; z-index: 3; padding: 0; border: none; border-radius: 50%;
  width: calc(var(--board-size, 360px) * 0.14); height: calc(var(--board-size, 360px) * 0.14);
  margin: calc(var(--board-size, 360px) * -0.07) 0 0 calc(var(--board-size, 360px) * -0.07);
  background: var(--c-teal, #1D9E75); color: #fff; box-shadow: none;
  display: none; align-items: center; justify-content: center; cursor: pointer;
  rotate: calc(var(--turn, 0) * -90deg); opacity: 0.35; pointer-events: none;
  transition: opacity 0.18s, box-shadow 0.18s, scale 0.12s, rotate 0.35s cubic-bezier(.3,.7,.3,1); }
body.tap-input #tap-ok { display: flex; }
#tap-ok svg { width: 55%; height: 55%; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
#board.tap-ready #tap-ok { opacity: 1; pointer-events: auto;
  box-shadow: 0 3px 10px rgba(0,0,0,0.35), 0 0 0 3px var(--surface-2, #fff); }
#board.tap-ready #tap-ok:active { scale: 0.92; }
body.tap-input #board[data-q="0"] .tile[data-r="1"][data-c="1"] .pts,
body.tap-input #board[data-q="1"] .tile[data-r="2"][data-c="1"] .pts,
body.tap-input #board[data-q="2"] .tile[data-r="2"][data-c="2"] .pts,
body.tap-input #board[data-q="3"] .tile[data-r="1"][data-c="2"] .pts { top: 4px; left: 7px; bottom: auto; right: auto; }
body.tap-input #board[data-q="0"] .tile[data-r="1"][data-c="2"] .pts,
body.tap-input #board[data-q="1"] .tile[data-r="1"][data-c="1"] .pts,
body.tap-input #board[data-q="2"] .tile[data-r="2"][data-c="1"] .pts,
body.tap-input #board[data-q="3"] .tile[data-r="2"][data-c="2"] .pts { top: 4px; bottom: auto; }
body.tap-input #board[data-q="0"] .tile[data-r="2"][data-c="1"] .pts,
body.tap-input #board[data-q="1"] .tile[data-r="2"][data-c="2"] .pts,
body.tap-input #board[data-q="2"] .tile[data-r="1"][data-c="2"] .pts,
body.tap-input #board[data-q="3"] .tile[data-r="1"][data-c="1"] .pts { left: 7px; right: auto; }

/* Ladder star bar (Nov 2026): target slices up to star 1, then the score toward stars 2 and 3. */
.fp-sbar { position: relative; flex: none; height: 8px; margin: 7px 10px 7px; padding: 0; border: 0; border-radius: 4px;
  background: rgba(var(--fg-rgb),0.12); cursor: pointer; font: inherit; color: inherit; }
.fp-sbar[hidden], .fp-tbar[hidden] { display: none; }
.fp-sseg { position: absolute; left: 0; top: 0; bottom: 0; width: 30%; display: flex; gap: 2px; padding-right: 2px; box-sizing: border-box; }
.fp-sseg i { flex: 1; border-radius: 2px; background: rgba(var(--fg-rgb),0.12); transition: background 0.3s; }
.fp-sseg i:first-child { border-radius: 4px 2px 2px 4px; }
.fp-sseg i.on { background: var(--c-green); }
.fp-sfill { position: absolute; left: 30%; top: 0; bottom: 0; width: 0; border-radius: 0 4px 4px 0; background: #EF9F27;
  transition: width 0.5s cubic-bezier(.2,.8,.2,1); }
.fp-sstar { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1;
  background: var(--surface, var(--bg1)); border: 1.5px solid rgba(var(--fg-rgb),0.22); color: rgba(var(--fg-rgb),0.3); }
.fp-sstar svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.fp-sstar.locked { color: rgba(var(--fg-rgb),0.5); }
.fp-sstar.ready { color: #E8A21C; text-shadow: 0 0 4px rgba(250,199,117,0.9), 0 0 8px rgba(239,159,39,0.7); }
.fp-sstar.on { background: #FAC775; border-color: #BA7517; color: #633806; }
.fp-sstar.pop { animation: fpStarPop 0.6s cubic-bezier(.2,1.6,.4,1); }
@keyframes fpStarPop { 0% { transform: scale(0.6); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ---- A keyword found: celebration over the level picture (js/level-keyword-fx.js) ---- */
.kw-fx { position: absolute; z-index: 4; pointer-events: none; }
.kw-fx-dim { position: absolute; inset: 0; border-radius: 16px; background: radial-gradient(ellipse at center, rgba(20,24,40,0.62) 0%, rgba(20,24,40,0.30) 55%, rgba(20,24,40,0.08) 100%);
  animation: kwDim 0.5s ease-out both; }
.kw-fx.leaving .kw-fx-dim { animation: kwDimOut 0.5s ease-in both; }
.kw-fx-box { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; animation: kwRise 0.6s cubic-bezier(.25,.9,.35,1.05) both; flex-direction: column; align-items: center; gap: 10px; }
.kw-fx-ribbon { padding: 6px 16px 4px; border-radius: 999px; background: #F2B33D; color: #3d2600; white-space: nowrap;
  font-family: var(--font-display); font-size: 15px; font-weight: 800; letter-spacing: 1.5px; line-height: 1.3;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3); animation: kwRibbon 0.45s cubic-bezier(.3,1.6,.5,1) 0.5s both; }
.kw-fx.leaving .kw-fx-ribbon { animation: kwRibbonOut 0.3s ease-in both; }
.kw-fx-tiles { display: flex; gap: 5px; }
.kw-fx-t { width: var(--kwt); height: calc(var(--kwt) * 1.1); border-radius: calc(var(--kwt) * 0.22); display: flex; align-items: center; justify-content: center;
  background: #FFF6DF; color: #5a3a00; border: 2px solid #F2B33D; box-shadow: 0 3px 0 #C98A12, 0 6px 14px rgba(0,0,0,0.3);
  font-family: var(--font-display); font-size: calc(var(--kwt) * 0.62); font-weight: 800; line-height: 1; padding-top: 2px; box-sizing: border-box;
  opacity: 0; animation: kwTile 0.32s cubic-bezier(.3,1.7,.5,1) both; animation-delay: calc(var(--i) * 0.035s); }
.kw-fx-c { position: absolute; width: 7px; height: 11px; border-radius: 2px; }
#lvl-pic.kw-glow #lvl-pic-img { animation: kwGlow 2.6s ease both; }
.goal.goal-key.kw-bump { animation: kwBump 0.5s cubic-bezier(.3,1.8,.5,1); }
@keyframes kwDim { from { opacity: 0; } to { opacity: 1; } }
/* Starts on the picture's bottom edge (right above the board), rises to the middle */
@keyframes kwRise { from { top: 100%; transform: translate(-50%, calc(-100% - 6px)); } to { top: 50%; transform: translate(-50%, -50%); } }
@keyframes kwDimOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes kwRibbon { from { opacity: 0; transform: translateY(-14px) scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes kwRibbonOut { to { opacity: 0; transform: translateY(-8px) scale(0.9); } }
@keyframes kwTile { 0% { opacity: 0; transform: translateY(18px) scale(0.3) rotate(-12deg); } 100% { opacity: 1; transform: none; } }
@keyframes kwGlow { 0%, 100% { box-shadow: 0 0 0 0 transparent; filter: none; }
  12% { box-shadow: 0 0 0 5px #F2B33D, 0 0 26px 4px rgba(242,179,61,0.7); filter: brightness(1.12); }
  75% { box-shadow: 0 0 0 4px #F2B33D, 0 0 14px 2px rgba(242,179,61,0.45); filter: none; } }
@keyframes kwBump { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }

/* A word for the length (teal) or combo (orange) goal, rising into its chip (js/level-keyword-fx.js) */
.goal-fx { position: fixed; z-index: 60; display: flex; gap: 3px; pointer-events: none; transform: translate(-50%, -50%); }
.goal-fx span { width: 30px; height: 33px; border-radius: 7px; display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  padding-top: 2px; font-family: var(--font-display); font-size: 19px; font-weight: 800; line-height: 1; color: #fff;
  background: var(--c-teal); box-shadow: 0 3px 0 rgba(0,0,0,0.22), 0 6px 14px rgba(0,0,0,0.25);
  animation: goalFxIn 0.34s cubic-bezier(.3,1.7,.5,1) both; animation-delay: calc(var(--i) * 0.05s); }
.goal-fx.combo span { background: var(--c-orange); }
.goal-fx span.wide { width: 40px; font-size: 17px; }
.goal.goal-hit { animation: goalHit 0.75s ease; }
@keyframes goalFxIn { from { opacity: 0; transform: translateY(14px) scale(0.4); } to { opacity: 1; transform: none; } }
@keyframes goalHit {
  0% { transform: scale(1); filter: none; }
  20% { transform: scale(1.2); filter: brightness(1.5); box-shadow: 0 0 0 3px var(--goal-c), 0 0 16px var(--goal-c); }
  45% { transform: scale(1); filter: none; box-shadow: none; }
  65% { transform: scale(1.08); filter: brightness(1.35); box-shadow: 0 0 0 2px var(--goal-c); }
  100% { transform: scale(1); filter: none; box-shadow: none; } }

/* ---- Browsers' break where the app shows an interstitial (js/ads.js, webBreak) ---- */
.web-break-box { gap: 10px; }
.wb-head { width: 100%; display: flex; align-items: center; justify-content: space-between; }
.wb-tag { padding: 4px 11px 3px; border-radius: 999px; background: rgba(var(--fg-rgb),0.08); font-size: 12px; font-weight: 800; letter-spacing: 0.5px; }
.wb-ring { position: relative; width: 40px; height: 40px; }
.wb-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.wb-ring circle { fill: none; stroke-width: 3.5; }
.wb-ring-bg { stroke: rgba(var(--fg-rgb),0.1); }
.wb-ring-fg { stroke: var(--c-orange); stroke-linecap: round; stroke-dasharray: 97.4; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }
.wb-ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-top: 2px;
  font-family: var(--font-display); font-size: 16px; font-weight: 800; }
.wb-body { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.wb-body h3 { font-size: 24px; line-height: 1.15; }
.wb-opts { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.wb-opt { height: 46px; border-radius: 999px; border: 2px solid var(--primary); background: transparent; color: var(--fg);
  font-family: var(--font-display); font-size: 17px; font-weight: 800; cursor: pointer; }
.wb-opt.picked { background: var(--primary); color: #fff; }
.wb-opt:disabled:not(.picked) { opacity: 0.45; }
.wb-thanks { color: var(--c-green); }
.wb-store { display: flex; align-items: center; justify-content: center; width: 100%; height: 48px; text-decoration: none;
  background: var(--c-teal); color: #fff; font-family: var(--font-display); font-size: 18px; }
.wb-again { border: 0; background: none; color: var(--fg); opacity: 0.6; font-size: 12.5px; font-weight: 700; text-decoration: underline; cursor: pointer; }
.fp-done-box p.wb-why { font-size: 12px; font-weight: 600; opacity: 0.65; line-height: 1.4; }
#wb-go { width: 100%; }
#wb-go:disabled { opacity: 0.5; }

/* Computers with a wide window use the landscape layout (Nov 2026: no rotation sensor, so a computer used to get the
   phone column). On a big screen it stays a comfortable size, centered, instead of spreading edge to edge. */
@media (orientation: landscape) and (hover: hover) and (pointer: fine) and (min-width: 900px) {
  #app-root #app { max-width: 1180px; max-height: 760px; margin: auto; }
}

/* The goal panel's ✕ at its bottom-right corner (js/level-goal-hints.js), staying in view over the content while it
   scrolls. The panel is a flex column, so "sticky" to its bottom keeps it there. */
.gh-close.gh-close-bottom { position: sticky; bottom: 0; align-self: flex-end; z-index: 3; width: 44px; height: 44px; margin: 4px -4px -6px 0;
  background: var(--gh-c, var(--primary)); color: #fff; box-shadow: 0 3px 12px rgba(0,0,0,0.3); }
.gh-close.gh-close-bottom svg { width: 18px; height: 18px; }
#gh-keywords .kw-row.blanks { cursor: pointer; }

/* The hint bulb at a word's row end (js/level-theme.js, hintBulbHtml): the only place a hint is spent (Nov 2026).
   A tap on the word's boxes makes it glow (nudgeHintBulb). Gold for level hints, teal for free play's own wallet. */
.hint-bulb { flex: none; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; border-radius: 50%;
  background: color-mix(in srgb, var(--star) 28%, var(--surface)); box-shadow: inset 0 0 0 2px var(--star); color: var(--fg); cursor: pointer; }
.hint-bulb svg { width: 58%; height: 58%; fill: #f0b72f; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kw-row .hint-bulb { width: calc(var(--kt) * 1.05); height: calc(var(--kt) * 1.05); margin-left: auto; }
.theme-keywords.two .kw-row .hint-bulb { display: none; }
.gh-row .hint-bulb { width: var(--gt); height: var(--gt); }
.fp-tword .hint-bulb { width: calc(var(--fpc) * 1.6); height: calc(var(--fpc) * 1.6); margin-left: calc(var(--fpc) * 0.2); }
body:not(.hints-shared) .fp-tword .hint-bulb { background: color-mix(in srgb, var(--c-teal) 22%, var(--surface)); box-shadow: inset 0 0 0 2px var(--c-teal); }
.hint-bulb.nudge { animation: bulb-nudge 1s ease-in-out; }
@keyframes bulb-nudge {
  0%, 50%, 100% { transform: scale(1); filter: none; }
  20%, 70% { transform: scale(1.3); filter: brightness(1.25) drop-shadow(0 0 6px #f0b72f); }
}
.gh-t.e, .gh-t.n { cursor: default; }

/* Tahtalı Yol's top bar: the board number sits against the hint pill on the right, clear of a camera cutout in the
   middle (Nov 2026, Ibur). */
#title.stat #fp-step-stat { margin-left: auto; margin-right: 10px; }


/* The goal panel's floating ✕ (z-index 3) goes under the rows' hint bulbs when the panel scrolls, so a tap on a bulb
   it covers still spends the hint instead of closing the panel (Nov 2026, Ibur). */
.gh-panel .hint-bulb { position: relative; z-index: 4; }

/* Goal panel: the words found for the goal, as green pills that wrap (js/level-goal-hints.js) */
.gh-found { display: flex; flex-wrap: wrap; gap: 6px; }
.gh-fw { padding: 5px 11px 3px; border-radius: 999px; background: var(--c-green); color: #fff;
  font-family: var(--font-display); font-size: 15px; font-weight: 800; letter-spacing: 0.5px; line-height: 1.2; }
.gh-fw::after { content: ' ✓'; font-size: 12px; opacity: 0.85; }

/* The top row's goal badges (js/level-goal-hints.js, placeTopRowBadges): the double tap shortcut, in the colour and with
   the sign of the goal chip each tile opens. They take no taps; tracing goes on as ever. */
.tg-badge { position: absolute; left: 6%; top: 6%; z-index: 1; width: 27%; height: 27%; box-sizing: border-box; padding-top: 1px;
  border-radius: 30%; background: var(--tg-c, var(--primary)); color: #fff; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: calc(var(--board-size, 360px) * 0.036); font-weight: 800; line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.tg-badge.wide { width: auto; min-width: 27%; padding: 1px 4px 0; }
.tg-badge svg { width: 72%; height: 72%; fill: none; stroke: #fff; stroke-width: 2.8; stroke-linecap: round; }
.tg-badge svg .fill { fill: #fff; stroke: none; }

/* TV remote / keyboard ring on the board (js/remote.js): coral, thick enough to see from the sofa */
#board .tile.kb-focus { outline: 5px solid #EC7A52 !important; outline-offset: 3px; z-index: 2; }
#board:focus { outline: none; }

/* The hand button is a quiet helper: lighter than the turn button */
#hand-btn { color: rgba(var(--fg-rgb), 0.55); }
