/* Betűkerék (spellbee) — prefix sb-. Always rendered on the dark stage. */
.sb-frame {
  width: min(420px, 100cqw);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  --sb-hex: min(104px, 27vw);          /* hexagon width (flat-top) */
  --sb-cell: #1c1c1e;
  --sb-ink-on-game: #000000;
}

/* --- Rank + progress ------------------------------------------------------------------ */
.sb-status {
  width: 100%; padding: 12px 16px 14px; border-radius: 18px;
  background: #1c1c1e;
}
.sb-rankline { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sb-rank { font-family: var(--font); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.02em; color: #fff; }
.sb-score { display: inline-block; font-weight: 550; color: var(--muted); }
.sb-progress { position: relative; height: 14px; margin: 0 6px; }
.sb-bar { position: absolute; left: 0; right: 0; top: 5px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.sb-fill { height: 100%; width: 0; background: var(--game); border-radius: 4px; transition: width .6s var(--ease-out); }
.sb-steps { position: absolute; inset: 0; }
.sb-step {
  position: absolute; top: 2px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
  background: #1c1c1e; border: 2px solid rgba(255, 255, 255, .2);
  transition: background-color .25s, border-color .25s, transform .35s var(--ease-spring);
}
.sb-step.sb-on { background: var(--game); border-color: var(--game); }
.sb-step:last-child { width: 14px; height: 14px; margin-left: -7px; top: 0; }

/* --- Typed word ------------------------------------------------------------------------- */
.sb-entry {
  min-height: 46px; max-width: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font); font-weight: 600; font-size: clamp(1.4rem, 7vw, 1.9rem); letter-spacing: .06em; color: #fff;
  overflow: hidden; white-space: nowrap;
}
.sb-typed span { display: inline-block; }
.sb-typed .sb-in { animation: sb-in .25s var(--ease-spring); }
@keyframes sb-in { 0% { transform: translateY(6px) scale(.7); opacity: 0; } }
.sb-typed .sb-c { color: var(--game); }
.sb-caret { width: 2px; height: 1.1em; margin-left: 3px; border-radius: 2px; background: var(--game); animation: sb-blink 1s steps(1) infinite; }
@keyframes sb-blink { 50% { opacity: 0; } }
.sb-locked .sb-caret, .sb-revealed .sb-caret { display: none; }

.sb-pill {
  min-height: 30px; padding: 5px 14px; border-radius: 999px;
  font-weight: 650; font-size: .95rem; opacity: 0; transform: translateY(6px) scale(.9);
  transition: opacity .2s, transform .35s var(--ease-spring);
}
.sb-pill.sb-show { opacity: 1; transform: none; }
.sb-pill-good { background: var(--good); color: #000; }
.sb-pill-pangram { background: var(--game); color: var(--sb-ink-on-game); }

/* --- Honeycomb --------------------------------------------------------------------------- */
.sb-hive {
  position: relative;
  width: calc(var(--sb-hex) * 2.5 + 12px);
  height: calc(var(--sb-hex) * 0.866 * 3 + 12px);
  touch-action: manipulation;
}
.sb-cell {
  position: absolute; left: 50%; top: 50%;
  width: var(--sb-hex); height: calc(var(--sb-hex) * 0.866);
  transform: translate(-50%, -50%)
    translate(calc(var(--dx) * (var(--sb-hex) + 6px)), calc(var(--dy) * (var(--sb-hex) * 0.866 + 5px)));
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  border: 0; padding: 0; cursor: pointer;
  background: var(--sb-cell); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font); font-weight: 600; font-size: clamp(1.4rem, 7vw, 2rem);
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, scale .25s var(--ease-spring);
}
.sb-cell.sb-center { background: var(--game); color: var(--sb-ink-on-game); }
.sb-cell span { pointer-events: none; }
@media (hover: hover) {
  .sb-cell:not(.sb-center):hover { background: #2c2c2e; }
  .sb-cell.sb-center:hover { background: color-mix(in srgb, var(--game) 88%, white); }
}
.sb-cell:active { scale: .93; }
/* Individual `scale` composes with the positioning transform, so cells can pop in place. */
.sb-cell.sb-press { animation: sb-press .3s var(--ease-spring); }
@keyframes sb-press { 0% { scale: .86; filter: brightness(1.35); } }
.sb-cell.sb-wave { animation: sb-wave .6s var(--ease-spring) both; animation-delay: calc(var(--d, 0) * 1ms); }
@keyframes sb-wave { 40% { scale: 1.09; filter: brightness(1.45); } }
.sb-cell.sb-spin span { display: inline-block; animation: sb-spin .4s var(--ease-spring); }
@keyframes sb-spin { from { opacity: 0; transform: scale(.4) rotate(-40deg); } to { opacity: 1; transform: none; } }

/* --- Buttons ---------------------------------------------------------------------------------- */
.sb-actions { display: flex; gap: 10px; justify-content: center; }
.sb-btn { min-width: 92px; touch-action: manipulation; border-radius: 999px; }
.sb-btn:not(.btn-game) { background: rgba(255, 255, 255, .1); color: #fff; border: 0; }
.sb-btn:not(.btn-game):hover { background: rgba(255, 255, 255, .16); }
.sb-shuffle { min-width: 48px; display: inline-flex; align-items: center; justify-content: center; padding-left: 0; padding-right: 0; }
.sb-shuffle.sb-turn { animation: sb-turn .45s var(--ease-out); }
@keyframes sb-turn { from { transform: rotate(-180deg); } }
.sb-busy .sb-btn[data-a="enter"] { opacity: .6; }
.sb-locked .sb-actions, .sb-locked .sb-hive { opacity: .55; pointer-events: none; }

/* --- Found words ------------------------------------------------------------------------------- */
.sb-found {
  width: 100%; padding: 12px 14px; border-radius: 18px;
  background: #1c1c1e;
}
.sb-found-head { font-weight: 550; color: var(--muted); font-size: .88rem; margin-bottom: 9px; }
.sb-words { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; max-height: 220px; overflow-y: auto; }
.sb-word {
  padding: 4px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); color: #fff; font-weight: 550; font-size: .88rem; letter-spacing: .03em;
}
.sb-word.sb-pangram { background: var(--game); color: var(--sb-ink-on-game); }
.sb-word.sb-missed { background: transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); color: var(--muted); font-weight: 500; }
.sb-word.sb-pangram.sb-missed { box-shadow: inset 0 0 0 1px var(--game); color: var(--muted); }
.sb-word.sb-new { animation: sb-new .45s var(--ease-spring); background: var(--accent-soft); }
.sb-word.sb-new.sb-pangram { background: var(--game); }
@keyframes sb-new { from { transform: scale(.6); opacity: 0; } }
.sb-empty-note { color: var(--muted); font-size: .9rem; }

/* --- Finish ("Befejezem" with an inline confirmation) --------------------------------------------- */
.sb-finish { min-height: 36px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; text-align: center; }
.sb-finish[hidden] { display: none; }
.sb-finish .btn { border-radius: 999px; }
.sb-finish .btn:not(.btn-game) { background: rgba(255, 255, 255, .1); color: #fff; border: 0; }
.sb-finish .btn.sb-finish-btn { background: transparent; color: var(--muted); }
.sb-finish .btn.sb-finish-btn:not(:disabled):hover { background: rgba(255, 255, 255, .1); color: #fff; }
.sb-finish-btn:disabled { opacity: .5; cursor: default; }
.sb-finish-q { font-weight: 550; font-size: .92rem; color: #fff; animation: fx-pop .35s var(--ease-spring); }
.sb-finish-btns { display: inline-flex; gap: 8px; }

/* --- After the end: missed words ------------------------------------------------------------------- */
.sb-revealed .sb-words { max-height: none; }
.sb-missed-wrap { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }

/* Letters pointed out by a hint (the hexagon clip hides shadows, so the fill changes). */
.sb-cell.sb-hint:not(.sb-center) { background: #f5f5f7; color: #111; }
.sb-cell.sb-hint.sb-center { filter: brightness(1.2) saturate(1.2); }
.sb-cell.sb-hint span { animation: sb-hint-pulse 1.6s ease-in-out infinite; }
@keyframes sb-hint-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .sb-cell.sb-hint span { animation: none; } }
