:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #202434;
  --ink-soft: #697084;
  --muted: #747d90;
  --line: #e4e7ef;
  --line-strong: #ccd2df;
  --blue: #2763df;
  --blue-soft: #e9f0ff;
  --mint: #0f9f6e;
  --mint-soft: #e8f8f1;
  --gold: #c48619;
  --gold-soft: #fff3d9;
  --rose: #de4f74;
  --rose-soft: #ffe9ef;
  --violet: #7556d9;
  --violet-soft: #f0ecff;
  --amber: #d06b1d;
  --amber-soft: #fff0df;
  --shadow: 0 18px 40px rgba(33, 39, 57, 0.16);
  --tap: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font-game: "Nunito", "Segoe UI Rounded", "Aptos", "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-board: "Nunito", "Segoe UI Rounded", "Aptos", "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --text-2xs: 0.75rem;
  --text-3xs: 0.625rem;
  --text-xs: 0.8125rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.0625rem;
  --text-lg: 1.125rem;
  --text-xl: 1.3125rem;
  --text-2xl: 1.625rem;
  --text-3xl: 2rem;
  --text-title: clamp(2.25rem, 9vw, 3rem);
  --text-title-tablet: clamp(3.125rem, 6.8vw, 3.75rem);
  --text-title-desktop: clamp(3.5rem, 4.8vw, 4.75rem);
  --text-title-wide: clamp(4rem, 4.6vw, 5.375rem);
  --text-screen-title-desktop: clamp(2.5rem, 3.1vw, 2.875rem);
  --text-detail-title-desktop: clamp(3.125rem, 4.4vw, 4.5rem);
  --text-board-cell: clamp(1rem, 5.1vw, 1.625rem);
  --text-board-cell-desktop: clamp(1.25rem, 2.2vw, 2rem);
  --text-mini-board: clamp(0.6875rem, 2.8vw, 1rem);
  --text-mini-board-desktop: clamp(0.75rem, 1.2vw, 1.0625rem);
  --leading-tight: 1.08;
  --leading-snug: 1.18;
  --leading-normal: 1.42;
  --weight-body: 600;
  --weight-ui: 700;
  --weight-strong: 800;
  --weight-title: 900;
  --control-sm: 2.125rem;
  --control-md: 2.625rem;
  --control-lg: 3.375rem;
  font-family: var(--font-game);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111827;
  --surface: #182133;
  --ink: #f4f7fb;
  --ink-soft: #b9c2d0;
  --muted: #8c96a8;
  --line: #2d384b;
  --line-strong: #435066;
  --blue: #75a8ff;
  --blue-soft: rgba(117, 168, 255, 0.16);
  --mint: #4ed19d;
  --mint-soft: rgba(78, 209, 157, 0.14);
  --gold: #f0bf5b;
  --gold-soft: rgba(240, 191, 91, 0.16);
  --rose: #ff789b;
  --rose-soft: rgba(255, 120, 155, 0.14);
  --violet: #b9a4ff;
  --violet-soft: rgba(185, 164, 255, 0.15);
  --amber: #ffae69;
  --amber-soft: rgba(255, 174, 105, 0.14);
  --shadow: 0 22px 52px rgba(2, 6, 14, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: var(--weight-body);
  line-height: var(--leading-normal);
  letter-spacing: 0;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

[x-cloak] {
  display: none !important;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a,
input,
textarea {
  line-height: var(--leading-snug);
}

h1,
h2,
h3,
p {
  text-wrap: balance;
}

button,
[href] {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

[hidden] {
  display: none !important;
}

main {
  min-height: 100svh;
}

:focus-visible {
  outline: 3px solid #f2b84b;
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ws-game {
  min-height: 100svh;
  background:
    linear-gradient(180deg, #f8f9fd 0%, #eef2f8 100%);
  overflow: hidden;
}

.ws-shell {
  min-height: 100svh;
  display: grid;
  place-items: stretch center;
}

.ws-surface {
  width: 100%;
  max-width: 430px;
  height: 100svh;
  min-height: 620px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.ws-topbar {
  padding: max(14px, env(safe-area-inset-top)) 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(246, 247, 251, 0.96);
  backdrop-filter: blur(12px);
  z-index: 3;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.install-app-cta {
  min-height: var(--control-sm);
  border: 1px solid rgba(39, 99, 223, 0.16);
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
}

.install-app-cta i {
  font-size: 0.92rem;
}

.theme-toggle-cta {
  width: var(--control-sm);
  height: var(--control-sm);
  border: 1px solid rgba(39, 99, 223, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--blue);
  display: inline-grid;
  place-items: center;
  position: relative;
  box-shadow: 0 7px 18px rgba(34, 40, 59, 0.08);
}

.theme-toggle-cta i {
  grid-area: 1 / 1;
  font-size: 0.94rem;
  transition: transform 160ms var(--tap), opacity 160ms var(--tap);
}

.theme-icon-sun {
  opacity: 0;
  transform: rotate(-45deg) scale(0.72);
}

html[data-theme="dark"] .theme-icon-moon {
  opacity: 0;
  transform: rotate(45deg) scale(0.72);
}

html[data-theme="dark"] .theme-icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.route-topbar {
  min-height: 58px;
}

.route-back-link {
  min-height: var(--control-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.route-back-link i {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
}

.offline-ribbon {
  position: fixed;
  left: 50%;
  bottom: max(6px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 80;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  background: rgba(23, 29, 42, 0.86);
  color: #ffffff;
  padding: 3px 8px;
  font-size: 0.56rem;
  font-weight: var(--weight-title);
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 8px 20px rgba(5, 9, 18, 0.24);
}

.offline-toast {
  position: fixed;
  left: 50%;
  bottom: calc(34px + env(safe-area-inset-bottom));
  width: min(92vw, 430px);
  transform: translate(-50%, 12px);
  z-index: 1200;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(23, 29, 42, 0.94);
  color: #ffffff;
  padding: 12px 14px;
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
  line-height: var(--leading-normal);
  box-shadow: 0 18px 44px rgba(5, 9, 18, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms var(--tap), transform 160ms var(--tap);
}

.offline-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.is-offline-disabled {
  cursor: not-allowed;
  filter: grayscale(0.25);
  opacity: 0.58;
}

.create-sheet-form {
  display: grid;
  gap: 14px;
}

.counter-row {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.counter-row::-webkit-scrollbar {
  display: none;
}

.counter-pill {
  min-height: var(--control-sm);
  min-width: 104px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 7px 18px rgba(34, 40, 59, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 5px 11px 5px 7px;
  color: var(--ink);
  font-weight: var(--weight-ui);
  font-variant-numeric: tabular-nums;
}

.counter-mark {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
}

.counter-mark svg,
.counter-mark i {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #ffffff;
  font-size: 0.9rem;
}

.counter-copy {
  min-width: 0;
  display: grid;
  gap: 0;
  line-height: 1.05;
}

.counter-value {
  font-size: var(--text-md);
  font-weight: var(--weight-title);
}

.counter-label {
  color: var(--ink-soft);
  font-size: var(--text-3xs);
  font-weight: var(--weight-strong);
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tone-aqua .counter-mark {
  background: #74d7db;
}

.tone-gold .counter-mark {
  background: #f1bc3d;
}

.tone-flame .counter-mark {
  background: #f05e67;
}

.round-action,
.icon-action {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  display: inline-grid;
  place-items: center;
  transition: transform 140ms var(--tap), color 140ms var(--tap), background 140ms var(--tap);
}

.round-action {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--blue);
  box-shadow: 0 7px 18px rgba(34, 40, 59, 0.08);
}

.round-action svg,
.round-action i,
.icon-action svg,
.icon-action i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.round-action:active,
.icon-action:active,
.primary-cta:active,
.danger-cta:active,
.ghost-cta:active,
.card-play:active,
.difficulty-option:active,
.topic-pill:active,
.nav-item:active {
  transform: scale(0.96);
}

.ws-main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.screen {
  display: none;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 96px;
  scrollbar-width: none;
}

.screen::-webkit-scrollbar {
  display: none;
}

.screen.is-active {
  display: block;
  animation: screen-in 260ms var(--tap) both;
}

.screen-play.is-active {
  display: flex;
  flex-direction: column;
  padding: 0 10px 14px;
}

.home-mobile-content {
  display: contents;
}

.home-desktop-content {
  display: none;
}

.challenge-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 14px 16px 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.challenge-track::-webkit-scrollbar {
  display: none;
}

.challenge-card {
  width: 172px;
  min-height: 196px;
  flex: 0 0 auto;
  scroll-snap-align: start;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 14px;
  box-shadow: 0 12px 30px rgba(34, 40, 59, 0.1);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 8px;
  overflow: hidden;
  position: relative;
  animation: card-rise 420ms var(--tap) both;
  animation-delay: calc(var(--card-index) * 70ms);
}

.challenge-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--card-soft), transparent 54%);
  opacity: 0.85;
}

.challenge-card > * {
  position: relative;
  z-index: 1;
}

.challenge-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-ui);
}

.challenge-head span:last-child {
  color: var(--ink);
  white-space: nowrap;
}

.challenge-art {
  display: grid;
  place-items: center;
  min-height: 84px;
  position: relative;
}

.art-ring {
  width: 74px;
  height: 74px;
  border-radius: 999px;
  border: 8px solid var(--card-ring);
  animation: soft-float 3.4s ease-in-out infinite;
}

.art-tile {
  position: absolute;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface);
  color: var(--card-ink);
  font-size: var(--text-2xl);
  font-weight: var(--weight-strong);
  box-shadow: 0 10px 22px rgba(32, 36, 52, 0.16);
}

.challenge-card h2 {
  margin: 0;
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.card-play {
  height: var(--control-md);
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--card-ink);
  font-size: var(--text-md);
  font-weight: var(--weight-strong);
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow: 0 8px 18px rgba(34, 40, 59, 0.1);
  transition: transform 140ms var(--tap), background 140ms var(--tap);
}

.home-hero {
  min-height: 395px;
  padding: 58px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
}

.app-logo-mark {
  width: 96px;
  height: 96px;
  margin-bottom: 30px;
  object-fit: contain;
  border-radius: 22px;
  filter: drop-shadow(0 14px 22px rgba(24, 55, 120, 0.16));
  animation: tile-pop 520ms var(--tap) both;
}

.mode-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  text-transform: uppercase;
}

.home-hero h1 {
  margin: 0 0 58px;
  color: #7d8696;
  font-size: var(--text-title);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.primary-cta,
.danger-cta,
.ghost-cta,
.outline-cta,
.card-play,
.tool-button,
.nav-item,
.difficulty-option,
.topic-pill {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.primary-cta {
  width: min(100%, 320px);
  min-height: var(--control-lg);
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  box-shadow: 0 13px 24px rgba(39, 99, 223, 0.22);
  font-size: var(--text-xl);
  font-weight: var(--weight-title);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-align: center;
  transition: transform 140ms var(--tap), filter 140ms var(--tap);
}

.primary-cta.compact {
  min-height: 48px;
  margin: 18px auto 0;
  font-size: var(--text-md);
  display: inline-flex;
}

.primary-cta.mini {
  width: auto;
  min-height: var(--control-md);
  padding: 0 18px;
  font-size: var(--text-sm);
}

.primary-cta:hover {
  filter: brightness(1.03);
}

.primary-cta.is-loading,
.ghost-cta.is-loading {
  cursor: wait;
  pointer-events: none;
}

.button-spinner {
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 auto;
  animation: spin 740ms linear infinite;
}

.danger-cta {
  width: min(100%, 320px);
  min-height: var(--control-lg);
  border: 0;
  border-radius: 8px;
  background: var(--rose);
  color: #ffffff;
  box-shadow: 0 13px 24px rgba(231, 48, 75, 0.2);
  font-size: var(--text-xl);
  font-weight: var(--weight-title);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-align: center;
  transition: transform 140ms var(--tap), filter 140ms var(--tap);
}

.danger-cta.compact {
  min-height: 48px;
  margin: 18px auto 0;
  font-size: var(--text-md);
}

.danger-cta:hover {
  filter: brightness(1.03);
}

.ghost-cta {
  margin-top: 14px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.play-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 2px 10px;
}

.icon-action {
  width: 40px;
  height: 40px;
  border-radius: 999px;
}

.icon-action:hover {
  background: rgba(255, 255, 255, 0.72);
  color: var(--blue);
}

.play-streak {
  font-size: var(--text-lg);
  font-weight: var(--weight-strong);
}

.play-streak strong {
  color: var(--blue);
}

.play-actions {
  display: flex;
  gap: 4px;
}

.play-score {
  text-align: center;
  padding: 12px 0 8px;
  color: var(--blue);
  font-size: var(--text-lg);
  font-weight: var(--weight-title);
}

.play-score small {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: var(--weight-body);
}

.play-meta {
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: var(--weight-ui);
  padding: 0 0 8px;
}

.board-wrap {
  display: grid;
  place-items: center;
}

.word-board {
  width: min(100%, 410px);
  aspect-ratio: var(--grid-cols) / var(--grid-rows);
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  border: 1px solid rgba(105, 112, 132, 0.28);
  background: rgba(154, 161, 178, 0.28);
  gap: 1px;
  contain: layout paint;
  transform-origin: center center;
  touch-action: none;
}

.play-cell {
  border: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  color: #2e3542;
  font-family: var(--font-board);
  font-size: var(--text-board-cell);
  font-weight: var(--weight-strong);
  line-height: 1;
  padding: 0;
  transition: background 120ms var(--tap), color 120ms var(--tap), transform 120ms var(--tap);
  touch-action: none;
  user-select: none;
  position: relative;
}

.word-board[data-large-hits] .play-cell::before {
  content: "";
  position: absolute;
  inset: -4px;
  z-index: 1;
}

.play-cell-letter {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  transform: rotate(0deg);
  transition: transform 180ms var(--tap);
  pointer-events: none;
}

.play-cell.is-found {
  background: var(--wc-bg, var(--mint-soft));
  color: var(--wc-tx, var(--mint));
}

.play-cell.just-found {
  animation: cell-found 280ms var(--tap) both;
}

.play-cell.is-selected {
  background: var(--blue-soft);
  color: var(--blue);
}

.play-cell.is-dragging {
  background: rgba(39, 99, 223, 0.14);
  color: var(--blue);
  transform: scale(0.94);
}

.word-board.is-invalid .play-cell.is-dragging {
  background: rgba(222, 79, 116, 0.12);
  color: var(--rose);
}

.play-cell:active {
  transform: scale(0.92);
}

.word-bank {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 12px 2px 10px;
  scrollbar-width: none;
}

.word-bank::-webkit-scrollbar {
  display: none;
}

.word-chip {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 140ms var(--tap), background 140ms var(--tap), color 140ms var(--tap);
}

.word-chip.is-done {
  background: var(--wc-bg, var(--mint-soft));
  border-color: transparent;
  color: var(--wc-tx, var(--mint));
  text-decoration: line-through;
}

.word-chip.is-failed {
  background: var(--rose-soft);
  color: var(--rose);
  border-color: transparent;
  text-decoration: none;
}

.word-chip.just-found {
  animation: chip-bounce 360ms var(--tap) both;
}

.tool-row {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-top: 8px;
}

.tool-button {
  min-height: 66px;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  display: grid;
  place-items: center;
  gap: 4px;
  box-shadow: 0 8px 18px rgba(34, 40, 59, 0.08);
  transition: transform 140ms var(--tap), color 140ms var(--tap), background 140ms var(--tap);
}

.tool-button svg,
.tool-button i {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
}

.hint-tool-button {
  position: relative;
}

.hint-tool-button small {
  position: absolute;
  top: 7px;
  right: 12px;
}

.hint-tool-button.is-active {
  background: var(--blue);
  color: #ffffff;
}

.hint-tool-button.is-active small {
  background: #ffffff;
  color: var(--blue);
}

.tool-primary {
  background: var(--blue);
  color: white;
}

.screen-title {
  padding: 28px 22px 16px;
}

.screen-title p {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.screen-title h1 {
  margin: 0;
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.stack-list {
  display: grid;
  gap: 10px;
  padding: 0 16px;
}

.list-card {
  min-height: 78px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  box-shadow: 0 8px 18px rgba(34, 40, 59, 0.06);
}

.avatar-mark {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--card-soft);
  color: var(--card-ink);
  font-weight: var(--weight-title);
}

.list-card h2,
.collection-card h2 {
  margin: 0;
  font-size: var(--text-md);
  font-weight: var(--weight-strong);
}

.list-card p,
.collection-card p,
.profile-card p,
.profile-stats p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
}

.list-card strong {
  color: var(--card-ink);
  font-size: var(--text-xs);
  text-align: right;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px;
}

.collection-card {
  min-height: 132px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 14px;
  box-shadow: 0 8px 18px rgba(34, 40, 59, 0.06);
  color: var(--ink);
  transition: transform 140ms var(--tap), border-color 140ms var(--tap);
}

.collection-card:hover {
  border-color: var(--card-ink);
}

.collection-card span {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  border-radius: 999px;
  background: var(--card-soft);
  color: var(--card-ink);
  padding: 0 9px;
  margin-bottom: 18px;
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
}

.explore-title {
  padding-bottom: 10px;
}

.category-carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 16px 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.category-carousel::-webkit-scrollbar {
  display: none;
}

.category-tile {
  flex: 0 0 176px;
  min-height: 132px;
  scroll-snap-align: start;
  border-radius: 8px;
  border: 1px solid var(--card-ring, var(--line));
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.26)),
    var(--card-soft, var(--surface));
  color: var(--ink);
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 9px;
  box-shadow: 0 10px 22px rgba(34, 40, 59, 0.08);
}

.category-tile span,
.category-result span {
  color: var(--card-ink, var(--blue));
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.category-tile strong {
  font-size: var(--text-md);
  line-height: var(--leading-tight);
}

.category-tile small,
.category-result small {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
}

.category-search-panel {
  margin: 10px 16px 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  padding: 14px;
  box-shadow: 0 8px 18px rgba(34, 40, 59, 0.06);
}

.category-search-box {
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
}

.category-search-box input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 14px;
  font: inherit;
  font-size: var(--text-base);
  font-weight: var(--weight-ui);
}

.category-results {
  max-height: min(55svh, 520px);
  overflow-y: auto;
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-right: 5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(97, 107, 125, 0.42) transparent;
}

.category-results::-webkit-scrollbar {
  width: 6px;
}

.category-results::-webkit-scrollbar-track {
  background: transparent;
}

.category-results::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(97, 107, 125, 0.42);
}

.category-result {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 11px 12px;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: center;
}

.category-result span,
.category-result strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-result strong {
  font-size: var(--text-md);
  font-weight: var(--weight-title);
}

.category-result small {
  grid-row: 1 / span 2;
  grid-column: 2;
  white-space: nowrap;
}

.category-result[hidden],
.category-load-more[hidden] {
  display: none;
}

.category-load-more {
  margin: 14px auto 0;
}

.explore-step-page,
.category-step-page {
  display: grid;
  gap: 16px;
  padding-bottom: 94px;
}

.explore-hero-panel,
.category-detail-hero,
.category-puzzle-section {
  margin: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(34, 40, 59, 0.07);
}

.explore-hero-panel {
  padding: 20px;
  background:
    linear-gradient(115deg, rgba(39, 99, 223, 0.11), rgba(255, 255, 255, 0) 48%),
    #ffffff;
}

.explore-hero-panel h1,
.category-detail-hero h1,
.category-puzzle-section h2 {
  margin: 4px 0;
  color: var(--ink);
  font-size: clamp(2rem, 8vw, 3.1rem);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.explore-hero-panel p,
.category-detail-hero p,
.category-puzzle-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-base);
  font-weight: var(--weight-ui);
}

.explore-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 16px;
}

.explore-steps article {
  min-height: 104px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 12px 10px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  text-align: center;
  box-shadow: 0 8px 18px rgba(34, 40, 59, 0.05);
}

.explore-steps i {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 1rem;
}

.explore-steps article:nth-child(2) i {
  background: var(--mint-soft);
  color: var(--mint);
}

.explore-steps article:nth-child(3) i {
  background: var(--gold-soft);
  color: var(--gold);
}

.explore-steps span {
  color: var(--ink-soft);
  font-size: var(--text-3xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.explore-steps strong {
  color: var(--ink);
  font-size: var(--text-xs);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.explore-picker-panel {
  margin-top: 0;
}

.category-search-box span i {
  color: var(--blue);
}

.explore-featured-head {
  margin: 18px 0 8px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.explore-featured-head h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.explore-topic-grid {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.explore-topic-grid:empty {
  display: none;
}

.explore-topic-card {
  min-width: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 18px;
  display: grid;
  gap: 14px;
  box-shadow: 0 10px 22px rgba(34, 40, 59, 0.06);
}

.explore-topic-card[hidden],
[data-explore-community][hidden],
.explore-empty-state[hidden] {
  display: none;
}

.explore-topic-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.explore-topic-head h3 {
  min-width: 0;
  margin: 0;
  color: var(--card-ink, var(--ink));
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.explore-topic-head h3 i {
  margin-right: 6px;
  color: var(--card-ink, var(--blue));
  font-size: 0.9em;
}

.explore-new-badge {
  flex: 0 0 auto;
  min-height: 28px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #9a5a00;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
}

.explore-topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.explore-topic-meta span {
  min-height: 30px;
  border-radius: 999px;
  background: var(--card-soft, #f7f9ff);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
}

.explore-topic-meta i {
  color: var(--card-ink, var(--blue));
}

.explore-topic-puzzles {
  display: grid;
  gap: 2px;
}

.explore-topic-puzzles a {
  min-width: 0;
  min-height: 44px;
  border-radius: 8px;
  color: #00838b;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon title"
    "icon time";
  gap: 1px 9px;
  align-items: center;
  padding: 7px 8px;
  text-decoration: none;
}

.explore-topic-puzzles a:hover,
.explore-topic-puzzles a:focus-visible {
  background: rgba(39, 99, 223, 0.07);
}

.explore-topic-puzzles a > i {
  grid-area: icon;
  color: #c7d3f7;
  font-size: 0.78rem;
}

.explore-topic-puzzles a > span {
  grid-area: title;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-base);
  font-weight: var(--weight-ui);
}

.explore-topic-puzzles small {
  grid-area: time;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-ui);
}

.explore-topic-puzzles small i {
  margin-right: 4px;
  color: #c7d3f7;
}

.explore-browse-link {
  width: fit-content;
  min-height: 36px;
  justify-self: center;
  color: #cf4f1d;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  font-size: var(--text-sm);
  font-weight: var(--weight-ui);
  text-decoration: none;
}

.explore-browse-link:hover,
.explore-browse-link:focus-visible {
  color: var(--card-ink, var(--blue));
}

.explore-topic-card mark {
  border-radius: 4px;
  background: rgba(255, 214, 102, 0.55);
  color: inherit;
  padding: 0 2px;
}

.explore-empty-state {
  margin: 16px 0 0;
  color: var(--ink-soft);
  text-align: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-ui);
}

.explore-community-head {
  margin-top: 28px;
}

.explore-topic-rail {
  padding: 0 0 12px;
}

.explore-category-list {
  max-height: min(48svh, 460px);
}

.category-detail-hero {
  position: relative;
  overflow: hidden;
  padding: 20px;
  background:
    linear-gradient(115deg, rgba(39, 99, 223, 0.12), transparent 50%),
    linear-gradient(180deg, #ffffff, #f8fbff);
}

.category-detail-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, var(--blue), rgba(39, 99, 223, 0.18));
}

.category-back-link {
  margin: 0 0 12px;
}

.category-quick-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.category-quick-stats span,
.category-puzzle-meta span {
  min-height: 32px;
  border-radius: 999px;
  background: #f7f9ff;
  color: var(--ink-soft);
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
}

.category-quick-stats i,
.category-puzzle-meta i {
  color: var(--blue);
}

.category-quick-stats span:nth-child(2) i,
.category-puzzle-meta span:nth-child(2) i {
  color: var(--mint);
}

.category-quick-stats span:nth-child(3) i,
.category-puzzle-meta span:nth-child(3) i {
  color: var(--gold);
}

.category-puzzle-section {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.category-puzzle-grid {
  display: grid;
  gap: 12px;
}

.category-puzzle-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 16px;
  display: grid;
  gap: 12px;
  box-shadow: 0 8px 18px rgba(34, 40, 59, 0.05);
}

.category-puzzle-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--card-ink, var(--blue));
}

.category-puzzle-card h3 {
  margin: 2px 0 6px;
  color: var(--ink);
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.category-puzzle-meta,
.category-puzzle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-puzzle-actions .primary-cta,
.category-puzzle-actions .ghost-cta {
  flex: 1 1 130px;
  margin: 0;
}

.category-puzzle-actions .ghost-cta {
  min-height: 48px;
  border-radius: 8px;
  background: #f7f9ff;
  border: 1px solid rgba(39, 99, 223, 0.12);
}

.category-puzzle-actions .primary-cta i {
  color: var(--gold-soft);
}

.category-puzzle-actions .ghost-cta i {
  color: var(--mint);
}

.profile-card {
  margin: 26px 16px 12px;
  padding: 22px;
  text-align: center;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(34, 40, 59, 0.06);
}

.profile-avatar {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: var(--text-3xl);
  font-weight: var(--weight-title);
}

.profile-card h1 {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: var(--weight-title);
}

.profile-stats {
  display: grid;
  gap: 10px;
  padding: 0 16px;
}

.profile-stats article {
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
}

.profile-stats span {
  color: var(--ink-soft);
  font-weight: var(--weight-strong);
}

.profile-stats strong {
  color: var(--blue);
  font-size: var(--text-lg);
  font-weight: var(--weight-title);
}

.profile-stats p {
  grid-column: 1 / -1;
}

.profile-dashboard {
  display: grid;
  gap: 18px;
  width: min(100%, 1320px);
  justify-self: center;
  padding: 18px 16px 96px;
  background:
    linear-gradient(180deg, rgba(39, 99, 223, 0.04), rgba(15, 159, 110, 0.025) 42%, transparent 74%);
}

.profile-hero-card,
.profile-created-section,
.profile-empty-created,
.profile-created-card {
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(34, 40, 59, 0.07);
}

.profile-hero-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  background:
    linear-gradient(115deg, rgba(39, 99, 223, 0.11), transparent 44%),
    linear-gradient(180deg, #ffffff, #f7fbff);
}

.profile-hero-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, var(--blue), rgba(39, 99, 223, 0.18));
}

.profile-avatar-wrap {
  width: 78px;
  height: 78px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: var(--text-3xl);
  font-weight: var(--weight-title);
  border: 6px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 12px 28px rgba(39, 99, 223, 0.16),
    inset 0 -4px 0 rgba(34, 40, 59, 0.06);
}

.profile-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-hero-copy {
  min-width: 0;
}

.profile-name-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-hero-copy h1 {
  margin: 3px 0;
  color: var(--ink);
  font-size: clamp(1.8rem, 6vw, 2.75rem);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.profile-icon-edit {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid rgba(196, 134, 25, 0.18);
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  display: inline-grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(196, 134, 25, 0.12);
}

.profile-icon-edit i {
  font-size: 0.92rem;
}

.profile-hero-copy p,
.profile-created-card p,
.profile-empty-created p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: var(--weight-ui);
}

.profile-action-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.profile-action-row form {
  margin: 0;
}

.profile-action-row .ghost-cta,
.profile-action-row .primary-cta {
  width: auto;
  margin: 0;
}

.profile-login-button {
  min-width: 142px;
  justify-content: center;
}

.profile-action-row .ghost-cta i,
.profile-action-row .primary-cta i,
.profile-created-actions .ghost-cta i,
.profile-created-meta i {
  color: var(--icon-tone, var(--blue));
}

.profile-action-row .profile-login-button i {
  color: #ffffff;
}

.profile-action-row [data-action="open-profile-edit"] {
  --icon-tone: var(--amber);
}

.profile-action-row [data-action="open-profile-password"] {
  --icon-tone: var(--mint);
}

.profile-action-row form .ghost-cta {
  --icon-tone: var(--rose);
}

.profile-hero-copy .route-kicker i {
  color: var(--blue);
}

.profile-section-head .route-kicker i {
  color: var(--violet);
}

.profile-progress-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 10px 0 8px;
}

.profile-progress-strip article {
  --stat-tone: var(--blue);
  position: relative;
  overflow: hidden;
  min-height: 126px;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f7f9ff);
  border: 1px solid var(--line);
  padding: 16px;
  display: grid;
  align-content: center;
  gap: 3px;
  box-shadow: 0 10px 22px rgba(34, 40, 59, 0.05);
}

.profile-progress-strip article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--stat-tone);
}

.profile-progress-strip article::after {
  position: absolute;
  right: 14px;
  top: 14px;
  color: var(--stat-tone);
  font-family: "Font Awesome 6 Free";
  font-size: 1rem;
  font-weight: 900;
  opacity: 0.32;
}

.profile-progress-strip article:nth-child(1)::after {
  content: "\f058";
}

.profile-progress-strip article:nth-child(2) {
  --stat-tone: var(--mint);
}

.profile-progress-strip article:nth-child(2)::after {
  content: "\f017";
}

.profile-progress-strip article:nth-child(3) {
  --stat-tone: var(--amber);
}

.profile-progress-strip article:nth-child(3)::after {
  content: "\f06d";
}

.profile-progress-strip article:nth-child(4) {
  --stat-tone: var(--gold);
}

.profile-progress-strip article:nth-child(4)::after {
  content: "\f091";
}

.profile-progress-strip span,
.profile-created-meta span {
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.profile-progress-strip strong {
  color: var(--ink);
  font-size: clamp(1.65rem, 6vw, 2.55rem);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.profile-progress-strip p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-ui);
}

.profile-created-section {
  margin-top: 8px;
  padding: 18px;
  display: grid;
  gap: 14px;
  background:
    linear-gradient(180deg, #ffffff, #f8fbff);
}

.profile-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.profile-section-head h2,
.profile-empty-created strong,
.profile-created-card h3 {
  margin: 0;
  color: var(--ink);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.profile-section-head h2 {
  font-size: clamp(1.55rem, 5vw, 2.25rem);
}

.profile-created-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 2px 2px 12px;
  scrollbar-width: thin;
}

.profile-created-carousel .ws-puzzle-card {
  flex: 0 0 clamp(180px, 52vw, 238px);
  scroll-snap-align: start;
}

.home-puzzle-strip,
.explore-puzzle-grid,
.category-puzzle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.home-puzzle-strip {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.ws-puzzle-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px;
  display: grid;
  gap: 8px;
  box-shadow: 0 12px 26px rgba(34, 40, 59, 0.08);
}

.ws-puzzle-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), rgba(39, 99, 223, 0.18));
}

.ws-puzzle-thumb {
  position: relative;
  aspect-ratio: 4 / 2.45;
  border-radius: 8px;
  overflow: hidden;
  background: #f7f9ff;
  border: 1px solid var(--line);
  display: block;
}

.ws-puzzle-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ws-puzzle-play {
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--mint);
  color: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 16px rgba(15, 159, 110, 0.2);
}

.ws-puzzle-body {
  min-width: 0;
}

.ws-puzzle-title {
  color: inherit;
}

.ws-puzzle-title h3 {
  margin: 2px 0 3px;
  color: var(--ink);
  font-size: var(--text-md);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-puzzle-body p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-puzzle-meta,
.ws-puzzle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ws-puzzle-meta span {
  min-height: 28px;
  border-radius: 999px;
  background: #f4f7fc;
  color: var(--ink-soft);
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
}

.ws-puzzle-actions .ghost-cta.compact {
  flex: 1 1 86px;
  min-height: 36px;
  margin: 0;
  justify-content: center;
  font-size: var(--text-xs);
}

.profile-created-card {
  position: relative;
  overflow: hidden;
  flex: 0 0 clamp(188px, 58vw, 260px);
  scroll-snap-align: start;
  padding: 10px;
  display: grid;
  gap: 8px;
  background: #ffffff;
  transition: transform 160ms var(--tap), box-shadow 160ms var(--tap);
}

.profile-created-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--blue), rgba(39, 99, 223, 0.18));
}

.profile-created-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(34, 40, 59, 0.11);
}

.profile-created-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(39, 99, 223, 0.09), rgba(15, 159, 110, 0.08)),
    #f7f9ff;
  border: 1px solid var(--line);
  display: block;
}

.profile-created-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-created-thumb img[src=""],
.profile-created-thumb img:not([src]) {
  display: none;
}

.private-mini-badge {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(196, 134, 25, 0.92);
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(34, 40, 59, 0.18);
}

.profile-created-meta,
.profile-created-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-created-title-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 2px 0 4px;
}

.profile-created-play-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--mint);
  color: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 16px rgba(15, 159, 110, 0.2);
}

.profile-created-play-icon i {
  font-size: 0.82rem;
}

.profile-created-title-link {
  min-width: 0;
  color: inherit;
}

.profile-created-title-link h3 {
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-created-meta span {
  min-height: 28px;
  border-radius: 999px;
  background: #f4f7fc;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-created-meta span:first-child {
  --icon-tone: var(--gold);
}

.profile-created-meta span:nth-child(2) {
  --icon-tone: var(--ink-soft);
}

.profile-created-actions .ghost-cta {
  --icon-tone: var(--blue);
  flex: 1 1 96px;
  width: auto;
  min-height: 38px;
  margin: 0;
  background: #f7f9ff;
  justify-content: center;
}

.profile-created-actions .ghost-cta:first-child {
  --icon-tone: var(--gold);
}

.profile-empty-created {
  padding: 22px;
  display: grid;
  justify-items: start;
  gap: 10px;
  background:
    linear-gradient(135deg, rgba(39, 99, 223, 0.07), rgba(246, 185, 49, 0.08)),
    #ffffff;
}

.profile-empty-created > i {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 1.35rem;
}

.profile-form-sheet {
  display: grid;
  gap: 14px;
  background:
    linear-gradient(180deg, #ffffff, #f8fbff);
}

.profile-more-button {
  margin-left: auto;
}

.profile-more-links {
  display: grid;
  gap: 8px;
}

.profile-more-links a,
.profile-more-link {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: inherit;
  padding: 12px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon hint";
  gap: 1px 10px;
  text-align: left;
  box-shadow: 0 10px 22px rgba(34, 40, 59, 0.06);
}

.profile-more-links a i,
.profile-more-link i {
  grid-area: icon;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
}

.profile-more-links a:nth-child(2) i {
  background: var(--mint-soft);
  color: var(--mint);
}

.profile-more-links a:nth-child(3) i {
  background: var(--violet-soft);
  color: var(--violet);
}

.profile-more-links a:nth-child(4) i {
  background: var(--amber-soft);
  color: var(--amber);
}

.profile-more-links a:nth-child(5) i {
  background: rgba(24, 119, 242, 0.12);
  color: #1877f2;
}

.profile-more-link i {
  background: var(--rose-soft);
  color: var(--rose);
}

.profile-more-links span,
.profile-more-link span {
  grid-area: label;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.profile-more-links small,
.profile-more-link small {
  grid-area: hint;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-ui);
}

.profile-more-account {
  margin-top: 6px;
}

.profile-delete-note {
  border: 1px solid rgba(203, 74, 74, 0.18);
  border-radius: 8px;
  background: rgba(203, 74, 74, 0.08);
  color: var(--ink);
  padding: 12px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
}

.profile-delete-note > i {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--rose-soft);
  color: var(--rose);
}

.profile-delete-note strong {
  display: block;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.profile-delete-note p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-ui);
  line-height: var(--leading-normal);
}

.profile-remove-submit {
  --icon-tone: var(--rose);
  color: var(--rose);
}

.legal-page {
  min-height: 100svh;
  width: min(100%, 860px);
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 16px max(38px, env(safe-area-inset-bottom));
  display: grid;
  align-content: start;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(39, 99, 223, 0.05), rgba(15, 159, 110, 0.025) 40%, transparent 78%);
}

.legal-back-link {
  width: max-content;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
  box-shadow: 0 8px 18px rgba(34, 40, 59, 0.06);
}

.legal-page h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 8vw, 3.8rem);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.legal-page > p {
  margin: 0;
  max-width: 64ch;
  color: var(--ink-soft);
  font-size: var(--text-lg);
  font-weight: var(--weight-ui);
  line-height: var(--leading-normal);
}

.legal-stack {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.legal-stack article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  box-shadow: 0 10px 24px rgba(34, 40, 59, 0.07);
}

.legal-stack h2 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.legal-stack p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: var(--weight-ui);
  line-height: var(--leading-normal);
}

.legal-stack a {
  color: var(--blue);
  font-weight: var(--weight-title);
}

.profile-scoreboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.profile-rank-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: inherit;
  padding: 12px;
  display: grid;
  gap: 6px;
  box-shadow: 0 12px 26px rgba(34, 40, 59, 0.08);
}

.profile-rank-badge {
  width: max-content;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--gold);
  padding: 4px 9px;
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
}

.profile-rank-card strong {
  color: var(--ink);
  font-size: var(--text-sm);
  line-height: var(--leading-tight);
}

.profile-rank-card small {
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
}

.bottom-nav {
  height: calc(68px + env(safe-area-inset-bottom));
  padding: 6px 12px max(8px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  z-index: 4;
}

.nav-brand {
  display: none;
}

.nav-brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.nav-item {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 6px 3px;
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  transition: transform 140ms var(--tap), background 140ms var(--tap), color 140ms var(--tap);
}

.nav-item svg,
.nav-item i {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  stroke-width: 2.2;
}

.nav-item.is-active {
  background: var(--blue-soft);
  color: var(--blue);
}

.nav-item[href="/explore"].is-active {
  background: var(--mint-soft);
  color: var(--mint);
}

.nav-item[href="/create"].is-active {
  background: var(--violet-soft);
  color: var(--violet);
}

.nav-item[href="/profile"].is-active {
  background: var(--amber-soft);
  color: var(--amber);
}

.ws-surface.is-playing .bottom-nav {
  display: none;
}

.ws-surface.is-playing .ws-topbar {
  display: none;
}

.sheet-backdrop,
.result-modal {
  position: fixed;
  inset: 0;
}

.sheet-backdrop {
  background: rgba(25, 29, 40, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms var(--tap);
  z-index: 10;
}

.ws-game.sheet-open .sheet-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.ws-game-play.sheet-open .sheet-backdrop {
  z-index: 50;
}

.bottom-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: min(430px, calc(100vw - 16px));
  max-height: min(82svh, 720px);
  overflow-y: auto;
  transform: translate(-50%, 110%);
  border-radius: 22px 22px 0 0;
  background: var(--bg);
  padding: 8px 16px max(18px, env(safe-area-inset-bottom));
  box-shadow: 0 -18px 38px rgba(25, 29, 40, 0.18);
  transition: transform 250ms var(--tap);
  z-index: 12;
}

.ws-game-play .bottom-sheet {
  z-index: 52;
}

.bottom-sheet.is-open {
  transform: translate(-50%, 0);
}

.login-sheet {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 253, 0.98)),
    var(--bg);
}

.sheet-handle {
  width: 42px;
  height: 5px;
  border-radius: 999px;
  margin: 4px auto 18px;
  background: #d4d8e3;
}

.sheet-title {
  text-align: center;
  margin-bottom: 18px;
}

.sheet-title h2 {
  margin: 0;
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.sheet-title p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: var(--text-md);
}

.sheet-title strong {
  color: var(--blue);
}

.login-sheet-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.login-sheet-head .sheet-title {
  margin-bottom: 0;
  text-align: left;
}

.login-sheet-head .sheet-title h2 {
  font-size: var(--text-xl);
}

.login-sheet-head .sheet-title p {
  font-size: var(--text-sm);
}

.login-sheet-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 1.25rem;
}

.login-provider-list {
  display: grid;
  gap: 10px;
}

.login-provider {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(34, 40, 59, 0.07);
  transition: transform 140ms var(--tap), border-color 140ms var(--tap), box-shadow 140ms var(--tap);
}

.login-provider:hover,
.login-provider:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(47, 107, 232, 0.32);
  box-shadow: 0 14px 28px rgba(34, 40, 59, 0.1);
}

.login-provider > i:first-child {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #f4f6fa;
  font-size: 1rem;
}

.login-provider strong,
.login-provider small {
  display: block;
}

.login-provider strong {
  font-size: var(--text-base);
  font-weight: var(--weight-title);
}

.login-provider small {
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
}

.login-provider > i:last-child {
  color: var(--muted);
  font-size: 0.78rem;
}

.login-sheet-note {
  margin: 14px 2px 0;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
}

.difficulty-list {
  display: grid;
  gap: 10px;
}

.difficulty-option {
  min-height: 73px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "label"
    "meta"
    "bar";
  gap: 4px;
  text-align: left;
  box-shadow: 0 8px 18px rgba(34, 40, 59, 0.06);
  transition: transform 140ms var(--tap), border-color 140ms var(--tap);
}

.difficulty-option:hover {
  border-color: var(--card-ink);
}

.difficulty-option > span:first-child {
  grid-area: label;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.difficulty-option strong {
  font-size: var(--text-lg);
  font-weight: var(--weight-strong);
}

.difficulty-option small {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
}

.difficulty-meta {
  grid-area: meta;
  color: var(--ink-soft);
  font-size: var(--text-xs);
}

.difficulty-bar {
  grid-area: bar;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.difficulty-bar span {
  display: block;
  height: 100%;
  width: var(--value);
  border-radius: inherit;
  background: var(--card-ink, var(--blue));
  transition: width 320ms var(--tap);
}

.create-sheet {
  padding-bottom: max(26px, env(safe-area-inset-bottom));
}

.topic-input {
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
}

.topic-input input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
  font-size: var(--text-lg);
  font-weight: var(--weight-strong);
}

.topic-stack {
  display: grid;
  gap: 8px;
}

.topic-stack.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 14px 0;
}

.topic-pill {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  color: var(--ink);
  display: grid;
  align-content: center;
  text-align: left;
  transition: transform 140ms var(--tap), border-color 140ms var(--tap);
}

.topic-pill span {
  color: var(--card-ink);
  font-weight: var(--weight-title);
}

.topic-pill small {
  color: var(--muted);
  font-weight: var(--weight-strong);
}

.creator-preview {
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.creator-preview span {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
}

.creator-preview strong {
  display: block;
  margin-top: 3px;
}

.result-modal {
  position: fixed;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(247, 248, 251, 0.62);
  -webkit-backdrop-filter: blur(8px) saturate(0.88);
  backdrop-filter: blur(8px) saturate(0.88);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms var(--tap);
  z-index: 14;
}

.ws-game-play .result-modal {
  inset: auto;
  left: var(--play-popup-left, 0);
  top: var(--play-popup-top, 0);
  width: var(--play-popup-width, 100vw);
  height: var(--play-popup-height, 100svh);
}

.result-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  pointer-events: none;
  z-index: 0;
}

.result-card {
  position: relative;
  width: min(100%, 354px);
  border-radius: 18px;
  background: var(--surface);
  padding: 30px 22px 22px;
  text-align: center;
  transform: translateY(18px) scale(0.98);
  transition: transform 220ms var(--tap);
}

.celebration-card {
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.78);
  background:
    radial-gradient(circle at 20% 14%, rgba(255, 205, 71, 0.18), transparent 30%),
    radial-gradient(circle at 84% 20%, rgba(59, 132, 255, 0.14), transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(45, 219, 118, 0.14), transparent 32%),
    #ffffff;
  box-shadow:
    0 28px 80px rgba(12, 18, 31, 0.34),
    inset 0 0 0 1px rgba(31, 36, 51, 0.08);
}

.celebration-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(39, 99, 223, 0.1);
  border-radius: 12px;
  pointer-events: none;
}

.result-modal.is-open .result-card {
  transform: translateY(0) scale(1);
}

.result-stars {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}

.result-stars span {
  width: 42px;
  height: 42px;
  clip-path: polygon(50% 0, 61% 34%, 96% 35%, 67% 56%, 78% 91%, 50% 70%, 22% 91%, 33% 56%, 4% 35%, 39% 34%);
  background: #f4c345;
  box-shadow: 0 8px 14px rgba(196, 134, 25, 0.2);
}

.result-card h2 {
  position: relative;
  margin: 0;
  color: #171d2b;
  font-size: clamp(2rem, 9vw, 3rem);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
  text-shadow:
    3px 3px 0 rgba(244, 195, 79, 0.44),
    -2px 2px 0 rgba(59, 132, 255, 0.26);
}

.result-card p {
  position: relative;
  color: var(--ink-soft);
  line-height: var(--leading-normal);
}

.result-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.result-grid span {
  border-radius: 8px;
  background: var(--bg);
  padding: 12px;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
}

.result-grid strong {
  display: block;
  color: var(--blue);
  font-size: var(--text-lg);
  font-weight: var(--weight-title);
}

.result-actions {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.result-actions .primary-cta,
.result-actions .outline-cta,
.result-actions .danger-cta {
  width: 100%;
  min-height: 46px;
  margin: 0;
}

.result-share-wrap {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 12px;
}

.result-share-toggle {
  min-width: min(100%, 220px);
}

.result-share-panel {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(130, 143, 166, 0.18);
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
}

.result-share-panel[hidden] {
  display: none;
}

.scoreboard-name-box {
  position: relative;
  margin: 16px 0;
  border-radius: 12px;
  border: 1px solid rgba(39, 99, 223, 0.16);
  background:
    linear-gradient(135deg, rgba(39, 99, 223, 0.08), rgba(246, 185, 49, 0.08)),
    #ffffff;
  padding: 14px;
  display: grid;
  gap: 10px;
  text-align: left;
}

.scoreboard-name-box[hidden] {
  display: none;
}

.scoreboard-rank-note {
  color: var(--blue);
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.scoreboard-name-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.scoreboard-name-summary i {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(47, 107, 232, 0.12);
  color: var(--blue);
  display: grid;
  place-items: center;
}

.scoreboard-name-summary span {
  min-width: 0;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
  line-height: var(--leading-normal);
}

.scoreboard-name-summary .ghost-cta {
  min-height: 34px;
  padding-inline: 10px;
  font-size: var(--text-2xs);
}

.scoreboard-name-editor {
  display: grid;
  gap: 10px;
}

.scoreboard-name-editor[hidden],
.scoreboard-name-summary [hidden] {
  display: none;
}

.scoreboard-name-box label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
}

.scoreboard-name-box input {
  width: 100%;
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-weight: var(--weight-ui);
}

.scoreboard-name-box p {
  margin: 0;
  color: var(--rose);
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
}

.result-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: 100%;
  display: grid;
  gap: 12px;
  transform: translateY(18px) scale(0.98);
  transition: transform 220ms var(--tap), opacity 180ms var(--tap);
}

.result-modal.is-open .result-shell {
  transform: translateY(0) scale(1);
}

.result-modal.is-celebrating .result-shell {
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px) scale(0.98);
}

.result-main-card {
  width: 100%;
  max-height: 100%;
  overflow: auto;
}

.result-side-panel {
  display: none;
}

.result-secondary-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.result-secondary-actions .ghost-cta {
  width: auto;
  min-height: 38px;
  margin: 0;
  padding: 0 14px;
}

.result-modal.has-score-name .result-shell {
  width: min(100%, 480px);
}

.result-modal.has-score-name .scoreboard-name-box {
  padding: 18px;
  gap: 12px;
}

@media (max-width: 767px) {
  .result-modal {
    padding: 0;
    align-items: stretch;
  }

  .result-shell {
    width: 100%;
    min-height: 100%;
  }

  .result-main-card {
    min-height: 100%;
    border-radius: 0;
    padding: max(32px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
    display: grid;
    align-content: center;
  }
}

@media (min-width: 900px) {
  .result-shell {
    width: min(100%, 720px);
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .result-modal.has-score-name .result-shell {
    width: min(100%, 760px);
    grid-template-columns: minmax(0, 1fr);
  }

  .result-side-panel {
    display: none;
  }
}

.print-page {
  min-height: 100svh;
  background:
    linear-gradient(180deg, #f7f9fd, #eef3fa);
  padding: 24px 24px calc(92px + env(safe-area-inset-bottom));
}

.print-toolbar {
  width: min(100%, 1180px);
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.print-toolbar-copy {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.print-home-link,
.print-kicker {
  color: var(--blue);
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.print-home-link {
  min-height: 38px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(196, 203, 216, 0.8);
  padding: 0 13px;
  box-shadow: 0 8px 20px rgba(21, 30, 45, 0.06);
}

.print-home-link i {
  color: var(--blue);
}

.print-kicker i {
  color: var(--mint);
}

.print-toolbar p {
  margin: 0;
  color: var(--muted);
  font-weight: var(--weight-strong);
  flex-basis: 100%;
}

.print-toolbar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.print-export-link {
  width: auto;
  min-height: 42px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--blue);
  padding: 0 8px;
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
  cursor: pointer;
}

.print-export-link:hover {
  background: rgba(39, 99, 223, 0.08);
}

.print-export-link .fa-file-pdf {
  color: #e04f6b;
}

.print-export-link .fa-file-image {
  color: var(--mint);
}

.print-export-link .fa-play {
  color: var(--gold);
}

.print-sheet {
  width: min(100%, 1180px);
  margin: 0 auto;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid rgba(196, 203, 216, 0.82);
  box-shadow: 0 22px 60px rgba(21, 30, 45, 0.1);
  padding: clamp(20px, 3vw, 34px);
}

.print-sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 22px;
}

.print-sheet-head h2 {
  margin: 3px 0 0;
  color: #151b2c;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.print-sheet-head span {
  color: var(--blue);
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.print-sheet-head strong {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.print-brand-lockup {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.print-brand-lockup img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.print-puzzle-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(220px, 0.28fr);
  gap: clamp(24px, 3vw, 36px);
  align-items: start;
}

.print-board {
  width: min(100%, 760px);
  aspect-ratio: var(--print-grid-cols) / var(--print-grid-rows);
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(var(--print-grid-cols), 1fr);
  grid-template-rows: repeat(var(--print-grid-rows), minmax(0, 1fr));
  border: 1px solid rgba(158, 166, 180, 0.65);
  background: rgba(226, 231, 239, 0.82);
  gap: 1px;
  box-shadow: 0 14px 30px rgba(34, 40, 59, 0.05);
  overflow: hidden;
}

.print-board span {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #202636;
  font-size: clamp(1rem, min(2.3vw, 2.3svh), 1.72rem);
  font-weight: var(--weight-title);
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.print-words {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, #ffffff, #f8fbff);
  padding: 20px;
}

.print-words h3 {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.print-words span {
  color: #2b3344;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  line-height: var(--leading-normal);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.print-signature {
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-ui);
}

.print-bottom-nav .bottom-nav {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 0;
  width: min(100%, 720px);
  transform: translateX(-50%);
  height: calc(68px + env(safe-area-inset-bottom));
  padding: 6px 12px max(8px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  border-top: 1px solid var(--line);
  border-right: 0;
  border-radius: 18px 18px 0 0;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -14px 34px rgba(21, 30, 45, 0.12);
  backdrop-filter: blur(12px);
  z-index: 20;
}

.print-bottom-nav .nav-brand {
  display: none;
}

.print-bottom-nav .nav-item {
  min-height: auto;
}

@media (max-width: 720px) {
  .print-page {
    padding: 14px 14px calc(92px + env(safe-area-inset-bottom));
  }

  .print-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .print-toolbar-actions {
    flex-wrap: wrap;
  }

  .print-sheet {
    padding: 16px;
  }

  .print-puzzle-layout {
    grid-template-columns: 1fr;
  }

  .print-board {
    width: min(100%, 560px);
  }

  .print-words {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
  }

  .print-words h3 {
    flex-basis: 100%;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .print-toolbar {
    display: none;
  }

  .print-bottom-nav {
    display: none;
  }

  .print-page {
    min-height: auto;
    padding: 0;
    background: #ffffff;
  }

  .print-sheet {
    width: 100%;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .print-board {
    width: min(100%, 7in);
  }
}

.tone-daily,
.tone-blue,
.tone-sky {
  --card-soft: var(--blue-soft);
  --card-ring: #bdd0ff;
  --card-ink: var(--blue);
}

.tone-event,
.tone-rose {
  --card-soft: var(--rose-soft);
  --card-ring: #ffc2d0;
  --card-ink: var(--rose);
}

.tone-creator,
.tone-mint,
.tone-lime {
  --card-soft: var(--mint-soft);
  --card-ring: #bdebd7;
  --card-ink: var(--mint);
}

.tone-amber {
  --card-soft: var(--amber-soft);
  --card-ring: #ffd2a7;
  --card-ink: var(--amber);
}

.tone-violet {
  --card-soft: var(--violet-soft);
  --card-ring: #d2c8ff;
  --card-ink: var(--violet);
}

.tone-ink {
  --card-soft: #eef0f4;
  --card-ring: #cfd4df;
  --card-ink: #293140;
}

.mode-grid {
  display: grid;
  gap: 10px;
  padding: 0 16px 12px;
}

.route-panel,
.detail-hero,
.create-panel {
  margin: 14px 16px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 18px;
  box-shadow: 0 8px 18px rgba(34, 40, 59, 0.06);
}

.detail-hero {
  min-height: 264px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  overflow: hidden;
  position: relative;
}

.detail-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 20%, var(--card-ring), transparent 28%),
    linear-gradient(135deg, var(--card-soft), transparent 62%);
  opacity: 0.9;
}

.detail-hero > * {
  position: relative;
  z-index: 1;
}

.route-kicker {
  color: var(--card-ink, var(--blue));
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.route-panel h2,
.detail-hero h1 {
  margin: 8px 0 8px;
  line-height: var(--leading-tight);
}

.route-panel h2 {
  font-size: var(--text-xl);
  font-weight: var(--weight-title);
}

.detail-hero h1 {
  max-width: 620px;
  font-size: var(--text-title);
  font-weight: var(--weight-title);
}

.route-panel p,
.detail-hero p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.detail-grid {
  display: grid;
  gap: 0;
}

.create-panel {
  display: grid;
  gap: 14px;
}

.mini-board {
  width: min(100%, 320px);
  aspect-ratio: var(--grid-cols) / var(--grid-rows);
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  gap: 1px;
  border: 1px solid rgba(105, 112, 132, 0.22);
  background: rgba(154, 161, 178, 0.24);
}

.mini-board span {
  display: grid;
  place-items: center;
  background: #fbfcfd;
  color: #394252;
  font-family: var(--font-board);
  font-size: var(--text-mini-board);
  font-weight: var(--weight-title);
  line-height: 1;
}

.word-bank.static {
  flex-wrap: wrap;
  overflow: visible;
  padding: 14px 0 0;
}

.create-layout {
  display: grid;
  gap: 0;
}

.create-layout.is-busy {
  cursor: wait;
}

.create-layout.is-busy > :not(.create-busy-panel) {
  pointer-events: none;
  user-select: none;
}

.create-busy-panel {
  position: fixed;
  inset: auto 18px 92px;
  z-index: 22;
  max-width: 420px;
  margin: 0 auto;
  border: 1px solid rgba(47, 107, 232, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 38px rgba(34, 40, 59, 0.18);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  align-items: center;
}

.create-busy-panel[hidden] {
  display: none;
}

.create-busy-spinner {
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(47, 107, 232, 0.22);
  border-top-color: var(--blue);
  border-radius: 999px;
  animation: spin 760ms linear infinite;
}

.create-busy-panel strong {
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.create-busy-panel p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
}

.create-layout.is-busy input:not([type="hidden"]),
.create-layout.is-busy textarea,
.create-layout.is-busy select,
.create-layout.is-busy button {
  cursor: wait;
  opacity: 0.62;
}

.create-layout.is-busy input:not([type="hidden"]),
.create-layout.is-busy textarea,
.create-layout.is-busy select {
  background: #f2f5fa;
}

.create-hero-panel {
  margin: 14px 16px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(236, 242, 255, 0.78)),
    repeating-linear-gradient(90deg, rgba(39, 99, 223, 0.08) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(0deg, rgba(39, 99, 223, 0.08) 0 1px, transparent 1px 44px);
  border: 1px solid rgba(191, 205, 239, 0.9);
  padding: 18px;
  display: grid;
  gap: 16px;
  box-shadow: 0 14px 30px rgba(34, 40, 59, 0.08);
}

.create-word-entry-panel {
  position: relative;
  overflow: hidden;
}

.create-word-entry-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, var(--blue), rgba(39, 99, 223, 0.18));
}

.create-hero-copy h1 {
  margin: 8px 0 8px;
  color: var(--ink);
  font-size: clamp(1.9rem, 9vw, 3rem);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.create-hero-copy p {
  max-width: 700px;
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.creator-prompt,
.creator-seeds {
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
}

.creator-prompt-area {
  display: grid;
  gap: 10px;
}

.creator-prompt input,
.creator-prompt textarea {
  width: 100%;
  border: 1px solid rgba(143, 162, 210, 0.8);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font: inherit;
  box-shadow: 0 8px 18px rgba(34, 40, 59, 0.05);
}

.creator-prompt input {
  min-height: 58px;
  padding: 0 16px;
  font-size: var(--text-lg);
  font-weight: var(--weight-title);
}

.creator-prompt textarea {
  min-height: 96px;
  resize: vertical;
  padding: 12px 16px;
  font-size: var(--text-base);
  font-weight: var(--weight-ui);
  line-height: var(--leading-normal);
}

.topic-picker {
  position: relative;
}

.topic-picker-button {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(143, 162, 210, 0.8);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--blue);
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
  box-shadow: 0 8px 18px rgba(34, 40, 59, 0.05);
}

.topic-menu {
  position: absolute;
  inset: calc(100% + 8px) 0 auto;
  z-index: 6;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  padding: 8px;
  display: grid;
  gap: 6px;
  scrollbar-width: thin;
}

.topic-menu[hidden] {
  display: none;
}

.topic-menu-item {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
  text-align: left;
}

.topic-menu-item:hover,
.topic-menu-item:focus-visible {
  background: var(--blue-soft);
  color: var(--blue);
}

.creator-seeds textarea {
  width: 100%;
  min-height: 124px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
  font-size: var(--text-base);
  font-weight: var(--weight-ui);
}

.creator-seeds-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.creator-seeds-head label,
.creator-seeds-head > span {
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
}

.create-word-rules-trigger {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(47, 107, 232, 0.18);
  border-radius: 999px;
  background: rgba(47, 107, 232, 0.08);
  color: var(--blue);
  display: grid;
  place-items: center;
}

.creator-seeds.is-invalid textarea {
  border-color: rgba(222, 79, 116, 0.55);
  background: rgba(255, 246, 249, 0.88);
  box-shadow: 0 0 0 3px rgba(222, 79, 116, 0.08);
}

.creator-seeds.has-guidance textarea {
  border-color: rgba(47, 107, 232, 0.34);
  box-shadow: 0 0 0 3px rgba(47, 107, 232, 0.06);
}

.create-word-validation {
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  line-height: var(--leading-normal);
}

.create-word-validation.is-error {
  color: var(--rose);
}

.create-word-validation[hidden] {
  display: none;
}

.create-hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.create-ai-primary {
  border: 1px solid rgba(47, 107, 232, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(47, 107, 232, 0.08), rgba(18, 163, 109, 0.08)),
    rgba(255, 255, 255, 0.86);
  padding: 14px;
  display: grid;
  gap: 8px;
}

.create-ai-button-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.create-ai-inline-status {
  color: var(--blue);
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
  line-height: var(--leading-snug);
  max-width: 32ch;
}

.create-ai-inline-status::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border: 2px solid rgba(47, 107, 232, 0.26);
  border-top-color: var(--blue);
  border-radius: 999px;
  display: inline-block;
  vertical-align: -1px;
  animation: spin 700ms linear infinite;
}

.create-ai-inline-status.is-error {
  color: var(--rose);
}

.create-ai-inline-status.is-error::before {
  animation: none;
  border-color: currentColor;
  border-radius: 999px;
  color: currentColor;
  content: "!";
  display: inline-grid;
  font-size: 8px;
  font-weight: var(--weight-title);
  line-height: 1;
  place-items: center;
}

.create-ai-primary p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
}

.create-ai-resume {
  border: 1px solid rgba(47, 107, 232, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.create-ai-resume[hidden] {
  display: none;
}

.create-ai-resume span,
.create-ai-resume small {
  display: block;
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
}

.create-ai-resume strong {
  display: block;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.create-ai-resume-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.create-ai-resume-actions .primary-cta.compact,
.create-ai-resume-actions .ghost-cta.compact {
  width: auto;
  min-height: 44px;
  margin: 0;
  padding: 0 16px;
  white-space: nowrap;
}

.create-ai-resume-actions .primary-cta.compact {
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(39, 99, 223, 0.2);
}

.create-ai-resume-actions .ghost-cta.compact {
  border: 1px solid rgba(47, 107, 232, 0.18);
  border-radius: 8px;
  background: rgba(47, 107, 232, 0.08);
  color: var(--blue);
  font-weight: var(--weight-title);
}

.create-ai-resume-actions .create-start-over {
  border-color: rgba(143, 162, 210, 0.32);
  background: rgba(143, 162, 210, 0.12);
  color: var(--ink-soft);
}

.create-word-counter {
  border: 1px solid rgba(143, 162, 210, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.create-word-counter span {
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.create-word-counter span.is-ready {
  color: var(--mint);
}

.create-word-counter span.is-invalid {
  color: var(--rose);
}

.create-word-counter small {
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  text-align: right;
}

.create-ai-submit {
  width: 100%;
  margin: 0;
  min-height: 54px;
}

@media (max-width: 720px) {
  .create-ai-button-row,
  .create-ai-resume {
    grid-template-columns: 1fr;
  }

  .create-ai-resume-actions {
    justify-content: stretch;
  }

  .create-ai-resume-actions > button {
    flex: 1 1 150px;
  }

  .create-ai-resume-actions .primary-cta.compact,
  .create-ai-resume-actions .ghost-cta.compact {
    width: 100%;
  }
}

.create-ai-submit:disabled {
  cursor: not-allowed;
  filter: grayscale(0.2);
  opacity: 0.55;
  box-shadow: none;
}

.create-status {
  border-radius: 8px;
  background: rgba(232, 248, 241, 0.92);
  border: 1px solid rgba(15, 159, 110, 0.2);
  color: var(--mint);
  padding: 10px 12px;
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
}

.create-status.is-error {
  background: var(--rose-soft);
  border-color: rgba(222, 79, 116, 0.24);
  color: var(--rose);
}

.creator-topic-strip {
  margin: 0;
}

.create-section-head {
  display: grid;
  gap: 4px;
}

.create-section-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.create-compose,
.create-difficulty,
.create-ai,
.create-shape-panel,
.placement-panel,
.sync-panel {
  align-content: start;
}

.form-row {
  display: grid;
  gap: 12px;
}

.topic-input textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
  font-size: var(--text-base);
  font-weight: var(--weight-ui);
}

.seed-mode-grid,
.create-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.seed-mode,
.difficulty-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px;
  display: grid;
  gap: 5px;
  text-align: left;
  transition: transform 140ms var(--tap), border-color 140ms var(--tap), background 140ms var(--tap);
}

.difficulty-card {
  min-height: 104px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px 10px;
}

.seed-mode input,
.difficulty-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seed-mode strong,
.difficulty-card strong {
  color: var(--card-ink, var(--blue));
  font-size: var(--text-md);
  font-weight: var(--weight-title);
}

.difficulty-card strong,
.difficulty-card > span:not(.difficulty-icon) {
  grid-column: 2;
}

.difficulty-icon {
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--card-soft, var(--blue-soft));
  color: var(--card-ink, var(--blue));
  display: grid;
  place-items: center;
  box-shadow: inset 0 -2px 0 rgba(34, 40, 59, 0.06);
}

.seed-mode span,
.difficulty-card span,
.difficulty-card small,
.difficulty-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
}

.seed-mode.is-selected,
.difficulty-card.is-selected {
  border-color: var(--card-ink, var(--blue));
  background: var(--card-soft, var(--blue-soft));
}

.create-ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.create-ai-head h2,
.placement-panel h2,
.sync-panel h2 {
  margin: 4px 0 0;
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
}

.create-words {
  gap: 10px;
}

.create-word-review .word-bank.static {
  padding: 10px 2px 2px;
  overflow: visible;
}

.create-word-review .word-chip {
  margin: 0 0 4px;
}

.create-ai-draft-summary {
  border: 1px solid rgba(47, 107, 232, 0.16);
  border-radius: 8px;
  background: rgba(238, 244, 255, 0.72);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.create-ai-draft-summary[hidden] {
  display: none;
}

.create-ai-draft-summary > span {
  color: var(--blue);
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.create-ai-draft-summary strong {
  color: var(--ink);
  font-size: var(--text-md);
  font-weight: var(--weight-title);
}

.create-fact-card {
  border: 1px solid rgba(39, 195, 124, 0.22);
  border-radius: 8px;
  background: rgba(239, 255, 247, 0.72);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.create-fact-card[hidden] {
  display: none;
}

.create-fact-kicker {
  color: var(--green);
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.create-fact-carousel {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
}

.create-fact-carousel button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(39, 195, 124, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--green);
  display: grid;
  place-items: center;
}

.create-fact-card p {
  margin: 0;
  color: var(--ink);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.create-fact-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.create-fact-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(39, 195, 124, 0.28);
}

.create-fact-dots span.is-active {
  width: 18px;
  background: var(--green);
}

.create-facts-trigger {
  position: relative;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--amber);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-soft);
}

.create-facts-trigger[hidden] {
  display: none;
}

.create-facts-trigger.is-ready i {
  animation: fact-wiggle 1.8s ease-in-out infinite;
}

.create-facts-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 21px;
  height: 21px;
  border-radius: 999px;
  background: #f43f5e;
  color: #fff;
  border: 2px solid var(--surface);
  display: grid;
  place-items: center;
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  line-height: 1;
}

.create-word-rules-list {
  display: grid;
  gap: 10px;
  padding: 4px 4px 6px;
}

.create-word-rules-list div {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
}

.create-word-rules-list i {
  color: var(--mint);
}

.create-word-rules-list .fa-xmark {
  color: var(--rose);
}

.create-facts-badge[hidden] {
  display: none;
}

@keyframes fact-wiggle {
  0%, 62%, 100% {
    transform: rotate(0deg) scale(1);
  }

  68% {
    transform: rotate(-12deg) scale(1.08);
  }

  76% {
    transform: rotate(10deg) scale(1.08);
  }

  84% {
    transform: rotate(-6deg) scale(1.04);
  }
}

.create-facts-sheet {
  display: grid;
  gap: 14px;
}

.create-facts-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.sheet-icon-back {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  display: grid;
  place-items: center;
}

.create-facts-list {
  display: grid;
  gap: 8px;
}

.create-fact-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  padding: 10px 10px 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.create-fact-remove {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  display: grid;
  place-items: center;
}

.create-facts-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink-soft);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
}

.create-facts-empty[hidden] {
  display: none;
}

.create-custom-fact-form,
.create-facts-actions {
  display: grid;
  gap: 10px;
}

.create-custom-fact-form textarea {
  resize: vertical;
}

@media (prefers-reduced-motion: reduce) {
  .create-facts-trigger.is-ready i {
    animation: none;
  }
}

.create-title-editor,
.create-description-editor {
  display: grid;
  gap: 6px;
}

.create-title-editor span,
.create-description-editor span {
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.create-title-editor input,
.create-description-editor textarea {
  width: 100%;
  border: 1px solid rgba(143, 162, 210, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.create-title-editor input {
  min-height: 46px;
  font-weight: var(--weight-title);
}

.create-description-editor textarea {
  min-height: 78px;
  resize: vertical;
}

.create-title-editor input:focus,
.create-description-editor textarea:focus {
  outline: 3px solid rgba(47, 107, 232, 0.18);
  border-color: rgba(47, 107, 232, 0.7);
}

.create-shape-panel {
  display: grid;
  gap: 16px;
}

.create-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.create-review-head strong {
  color: var(--ink);
  font-size: var(--text-md);
  font-weight: var(--weight-title);
}

.create-review-head .ghost-cta.compact {
  min-height: 38px;
  padding: 0 12px;
  font-size: var(--text-xs);
}

.create-private-toggle {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.create-private-toggle input {
  width: 22px;
  height: 22px;
  accent-color: var(--blue);
}

.create-private-toggle span {
  display: grid;
  gap: 2px;
}

.create-private-toggle strong {
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.create-private-toggle small {
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
}

.edit-code-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.edit-code-box label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
}

.edit-code-box input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.create-publish-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.create-publish-actions .primary-cta.compact {
  flex: 1 1 170px;
}

.create-publish-actions .primary-cta.compact,
.create-publish-actions .ghost-cta {
  margin: 0;
}

.create-modal-actions {
  justify-content: center;
}

.create-preview-panel {
  display: none;
}

.create-preview-board-wrap {
  position: relative;
  width: min(100%, 520px);
  aspect-ratio: var(--create-cols) / var(--create-rows);
  border: 1px solid rgba(105, 112, 132, 0.18);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 30px rgba(34, 40, 59, 0.08);
}

.create-preview-board {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(var(--create-cols), minmax(0, 1fr));
  background: transparent;
}

.create-preview-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.create-preview-board span {
  display: grid;
  place-items: center;
  min-width: 0;
  background: transparent;
  border: 1px solid rgba(143, 152, 168, 0.12);
  color: var(--ink);
  font-family: var(--font-board);
  font-size: clamp(0.82rem, 3.1vw, 1.18rem);
  font-weight: var(--weight-title);
  line-height: 1;
  position: relative;
  z-index: 3;
}

.create-solution-line {
  stroke: rgba(47, 107, 232, 0.62);
  stroke-linecap: round;
  filter: drop-shadow(0 2px 2px rgba(34, 40, 59, 0.12));
}

.create-solution-line.wc-0 { stroke: rgba(255, 72, 128, 0.68); }
.create-solution-line.wc-1 { stroke: rgba(47, 107, 232, 0.68); }
.create-solution-line.wc-2 { stroke: rgba(19, 195, 148, 0.68); }
.create-solution-line.wc-3 { stroke: rgba(244, 181, 45, 0.68); }
.create-solution-line.wc-4 { stroke: rgba(146, 92, 238, 0.68); }
.create-solution-line.wc-5 { stroke: rgba(255, 128, 49, 0.68); }
.create-solution-line.wc-6 { stroke: rgba(44, 196, 218, 0.68); }
.create-solution-line.wc-7 { stroke: rgba(94, 207, 87, 0.68); }
.create-solution-line.wc-8 { stroke: rgba(235, 91, 182, 0.68); }
.create-solution-line.wc-9 { stroke: rgba(115, 104, 255, 0.68); }

.create-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.create-preview-meta span {
  min-height: 34px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-soft);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
}

.create-preview-empty {
  min-height: 190px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(238, 244, 255, 0.64)),
    repeating-linear-gradient(90deg, rgba(47, 107, 232, 0.06) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(0deg, rgba(47, 107, 232, 0.06) 0 1px, transparent 1px 34px);
  color: var(--ink-soft);
  padding: 18px;
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
}

.create-preview-empty i {
  color: var(--blue);
  font-size: 2rem;
}

.create-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 20, 31, 0.58);
  -webkit-backdrop-filter: blur(14px) saturate(0.86);
  backdrop-filter: blur(14px) saturate(0.86);
  overscroll-behavior: contain;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms var(--tap);
  display: grid;
  place-items: center;
  padding: 18px;
}

.create-preview-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.create-preview-dialog {
  width: min(100%, 560px);
  max-height: min(88svh, 720px);
  overflow: auto;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px;
  position: relative;
  display: grid;
  gap: 14px;
}

.create-preview-dialog .create-preview-board {
  margin: 0 auto;
}

.ws-game.is-create-preview-open {
  overflow: hidden;
}

.ws-game.is-create-preview-open .screen.is-active {
  animation: none;
  transform: none;
}

@media (max-width: 1023px) {
  .create-preview-overlay {
    padding: 0;
    place-items: stretch;
    align-items: stretch;
  }

  .create-preview-dialog {
    width: 100%;
    height: 100dvh;
    max-height: none;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    padding:
      max(14px, env(safe-area-inset-top))
      clamp(14px, 4vw, 20px)
      max(16px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-content: stretch;
    gap: 8px;
    transform: none;
    transition: none;
    box-shadow: none;
    --create-preview-chrome: calc(128px + env(safe-area-inset-top) + env(safe-area-inset-bottom));
  }

  .create-preview-dialog .create-section-head {
    margin: 0;
  }

  .create-preview-dialog .create-section-head h2 {
    max-width: calc(100% - 48px);
    font-size: clamp(1.35rem, 7vw, 2rem);
    line-height: var(--leading-tight);
  }

  .create-preview-dialog::before {
    content: none;
  }

  .create-preview-dialog .overlay-close {
    top: 14px;
    right: 14px;
  }

  .create-preview-dialog .create-preview-board-wrap {
    width: min(
      calc(100vw - 28px),
      calc((100dvh - var(--create-preview-chrome)) * var(--create-cols) / var(--create-rows))
    );
    height: auto;
    max-width: 100%;
    max-height: 100%;
    align-self: center;
    justify-self: center;
  }

  .create-modal-actions {
    position: static;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 10px 0 max(4px, env(safe-area-inset-bottom));
    margin-top: 0;
  }
}

.created-layout {
  display: grid;
  gap: 14px;
  padding: 14px 16px 96px;
}

.created-edit-layout {
  display: grid;
  gap: 14px;
  padding: 14px 16px 96px;
}

.created-hero,
.created-actions-panel,
.created-share-panel {
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(34, 40, 59, 0.06);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.created-hero {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(238, 244, 255, 0.74)),
    repeating-linear-gradient(90deg, rgba(47, 107, 232, 0.06) 0 1px, transparent 1px 40px);
}

.created-hero h1 {
  margin: 7px 0;
  color: var(--ink);
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.created-hero p,
.created-share-panel p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-sm);
}

.created-code-card {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px dashed rgba(47, 107, 232, 0.36);
  padding: 14px;
  display: grid;
  gap: 8px;
}

.created-code-card span {
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.created-code-card strong {
  color: var(--blue);
  font-size: var(--text-xl);
  font-weight: var(--weight-title);
  word-break: break-word;
}

.created-actions-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.created-actions-panel .primary-cta.compact,
.created-actions-panel .ghost-cta {
  width: 100%;
  margin: 0;
}

.created-print-card {
  width: 100%;
  margin: 0;
}

.created-teacher-hero {
  align-content: start;
}

.created-preview-stage {
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(34, 40, 59, 0.06);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.created-preview-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.created-preview-head h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.created-preview-head > span {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.created-solve-preview {
  position: relative;
  width: min(100%, 620px);
  aspect-ratio: var(--create-cols) / var(--create-rows);
  justify-self: center;
  border: 1px solid rgba(105, 112, 132, 0.22);
  background: #ffffff;
  overflow: hidden;
}

.created-solve-board {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(var(--create-cols), minmax(0, 1fr));
}

.created-solve-board span {
  display: grid;
  place-items: center;
  min-width: 0;
  border: 1px solid rgba(143, 152, 168, 0.14);
  color: var(--ink);
  font-family: var(--font-board);
  font-size: clamp(1rem, 3.4vw, 1.75rem);
  line-height: 1;
  font-weight: var(--weight-title);
}

.created-solve-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.created-solve-lines .create-solution-line {
  opacity: 0;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: opacity 180ms var(--tap), stroke-dashoffset 620ms var(--tap);
}

.created-solve-lines .create-solution-line.is-active {
  opacity: 1;
  stroke-dashoffset: 0;
}

.created-preview-words {
  justify-content: center;
  padding-top: 0;
}

.created-edit-form.create-layout {
  padding: 0;
}

.placement-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.placement-stats span {
  border-radius: 8px;
  background: var(--bg);
  padding: 10px;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
}

.placement-stats strong {
  display: block;
  color: var(--card-ink, var(--blue));
  font-size: var(--text-md);
}

.failed-words {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.failed-words span {
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--rose);
  padding: 6px 10px;
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
}

.sync-panel {
  margin: 14px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  padding: 16px;
  box-shadow: 0 8px 18px rgba(34, 40, 59, 0.05);
}

.sync-panel p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.sync-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.sync-button {
  min-height: var(--control-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--blue);
  font: inherit;
  font-weight: var(--weight-title);
}

.sync-actions .login-open-button {
  grid-column: 1 / -1;
}

.sync-actions.compact .login-open-button {
  flex: 0 1 180px;
}

.provider-email,
.sync-button.provider-email,
.login-provider.provider-email > i:first-child {
  color: var(--blue);
}

.provider-google,
.sync-button.provider-google,
.login-provider.provider-google > i:first-child {
  color: #ea4335;
}

.provider-facebook,
.sync-button.provider-facebook,
.login-provider.provider-facebook > i:first-child {
  color: #1877f2;
}

.sync-button.provider-facebook {
  background: #1877f2;
  border-color: #1877f2;
  color: #ffffff;
}

.sync-note {
  color: var(--rose) !important;
}

.account-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(238, 243, 251, 0.92)),
    var(--bg);
}

.account-login-card {
  width: min(100%, 440px);
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 22px;
  display: grid;
  gap: 20px;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: var(--text-xl);
  font-weight: var(--weight-title);
}

.account-login-copy {
  display: grid;
  gap: 6px;
}

.account-login-copy h1,
.account-panel h2,
.admin-panel h2,
.admin-form-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.account-login-copy p,
.admin-panel p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-sm);
}

.account-login-form,
.account-grid,
.account-panel,
.admin-form-panel {
  display: grid;
  gap: 14px;
}

.account-field {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
}

.account-field > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.account-field input,
.account-field select,
.account-field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 14px;
  font: inherit;
  font-size: var(--text-base);
  font-weight: var(--weight-ui);
}

.account-field textarea {
  min-height: 118px;
  padding: 12px 14px;
  resize: vertical;
  line-height: var(--leading-normal);
}

.account-field span[data-valmsg-for],
.account-validation {
  color: var(--rose);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
}

.account-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: var(--weight-ui);
}

.account-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.account-panel,
.admin-form-panel {
  margin: 14px 16px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 16px;
  box-shadow: 0 10px 24px rgba(34, 40, 59, 0.07);
}

.account-alert {
  margin: 10px 16px 0;
  border-radius: 8px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
}

.account-alert.is-success {
  background: var(--mint-soft);
  color: var(--mint);
}

.account-alert.is-error {
  background: var(--rose-soft);
  color: var(--rose);
}

.admin-inline-link {
  margin-top: 10px;
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #ffffff;
  padding: 0 14px;
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.admin-shell {
  min-height: 100svh;
  background: #f8f9fc;
  color: var(--ink);
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  isolation: isolate;
  transition: grid-template-columns 180ms var(--tap);
}

.admin-shell.is-sidebar-collapsed {
  grid-template-columns: 82px minmax(0, 1fr);
}

.admin-sidebar {
  min-height: 100svh;
  height: 100svh;
  position: sticky;
  top: 0;
  z-index: 20;
  background: #ffffff;
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: grid;
  align-content: start;
  gap: 28px;
  overflow-y: auto;
  scrollbar-width: thin;
  transition: transform 180ms var(--tap), padding 180ms var(--tap), box-shadow 180ms var(--tap);
}

.admin-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: var(--text-xl);
  font-weight: var(--weight-title);
  min-width: 0;
}

.admin-brand img {
  flex: 0 0 auto;
}

.admin-sidebar-close,
.admin-menu-toggle {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(34, 40, 59, 0.05);
}

.admin-sidebar-close {
  display: none;
  flex: 0 0 auto;
}

.admin-menu-toggle {
  flex: 0 0 auto;
}

.admin-sidebar-close:hover,
.admin-menu-toggle:hover {
  color: var(--blue);
  border-color: rgba(39, 99, 223, 0.3);
  background: var(--blue-soft);
}

.admin-sidebar-backdrop {
  display: none;
}

.admin-menu {
  display: grid;
  gap: 7px;
}

.admin-menu a {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
  min-width: 0;
  position: relative;
}

.admin-menu a i {
  width: 18px;
  text-align: center;
}

.admin-menu a.is-active,
.admin-menu a:hover {
  background: var(--amber-soft);
  color: var(--amber);
}

.admin-shell.is-sidebar-collapsed .admin-sidebar {
  padding-inline: 10px;
}

.admin-shell.is-sidebar-collapsed .admin-sidebar-header,
.admin-shell.is-sidebar-collapsed .admin-brand,
.admin-shell.is-sidebar-collapsed .admin-menu a {
  justify-content: center;
}

.admin-shell.is-sidebar-collapsed .admin-brand span,
.admin-shell.is-sidebar-collapsed .admin-menu a span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-shell.is-sidebar-collapsed .admin-menu a {
  padding: 0;
}

.admin-shell.is-sidebar-collapsed .admin-menu a i {
  width: auto;
}

.admin-main {
  min-width: 0;
  padding: 28px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.admin-form-main {
  max-width: 860px;
}

.admin-topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.admin-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-heading > div {
  min-width: 0;
}

.admin-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.admin-topbar h1 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: clamp(2rem, 3vw, 2.75rem);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.admin-user-chip {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 5px 6px 5px 16px;
  box-shadow: 0 8px 18px rgba(34, 40, 59, 0.05);
}

.admin-user-chip span {
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.admin-user-chip strong {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #ffffff;
}

.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.admin-metric {
  min-height: 120px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card-soft, var(--blue-soft));
  color: var(--card-ink, var(--blue));
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.admin-metric span,
.admin-metric small {
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: var(--weight-ui);
}

.admin-metric strong {
  color: var(--ink);
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.admin-metric.is-warning {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
}

.admin-metric.has-api-error {
  border-color: rgba(239, 86, 107, 0.5);
  background: rgba(239, 86, 107, 0.08);
}

.admin-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 14px;
}

.admin-panel-grid.wide {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.admin-panel {
  min-height: 260px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 22px;
  box-shadow: 0 12px 28px rgba(34, 40, 59, 0.06);
  display: grid;
  align-content: start;
  gap: 10px;
}

.admin-panel.is-loading {
  opacity: 0.86;
}

.admin-panel.is-loading .admin-table-wrap {
  transition: opacity 0.16s ease;
}

.admin-filter-bar {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(5, minmax(128px, 1fr)) auto;
  align-items: end;
  gap: 10px;
  box-shadow: 0 10px 22px rgba(34, 40, 59, 0.05);
}

.admin-source-legend {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  box-shadow: 0 10px 22px rgba(34, 40, 59, 0.05);
}

.admin-source-chip,
.admin-source-badge {
  width: fit-content;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  font: inherit;
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  line-height: 1;
  text-transform: uppercase;
}

.admin-source-chip {
  cursor: pointer;
}

.admin-source-badge {
  margin-top: 8px;
}

.admin-source-chip.is-daily,
.admin-source-badge.is-daily {
  background: var(--amber-soft);
  border-color: rgba(246, 185, 49, 0.28);
  color: var(--amber);
}

.admin-source-chip.is-system,
.admin-source-badge.is-system {
  background: var(--blue-soft);
  border-color: rgba(91, 141, 239, 0.28);
  color: var(--blue);
}

.admin-source-chip.is-user_registered,
.admin-source-badge.is-user_registered {
  background: var(--mint-soft);
  border-color: rgba(14, 165, 127, 0.28);
  color: var(--mint);
}

.admin-source-chip.is-user_guest,
.admin-source-badge.is-user_guest {
  background: rgba(124, 92, 255, 0.12);
  border-color: rgba(124, 92, 255, 0.26);
  color: #6d5bd0;
}

.admin-source-chip.is-bot,
.admin-source-badge.is-bot {
  background: rgba(239, 86, 107, 0.12);
  border-color: rgba(239, 86, 107, 0.28);
  color: #c22b44;
}

.admin-source-chip.is-active {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.admin-filter-bar.compact {
  grid-template-columns: repeat(2, minmax(140px, 220px)) auto;
  justify-content: start;
}

.admin-filter-bar label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.admin-filter-bar input,
.admin-filter-bar select,
.account-field select,
.account-field textarea {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-ui);
  text-transform: none;
}

.account-field textarea {
  min-height: 108px;
  resize: vertical;
  padding: 12px;
  line-height: var(--leading-normal);
}

.admin-filter-bar .primary-cta.compact {
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 0 16px;
  font-size: var(--text-sm);
}

.admin-command-bar {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: 0 10px 22px rgba(34, 40, 59, 0.05);
}

.admin-command-bar form {
  margin: 0;
}

.admin-command-bar .primary-cta.compact,
.admin-command-bar .secondary-cta.compact {
  width: auto;
  min-height: 42px;
  margin: 0;
  padding: 0 16px;
  font-size: var(--text-sm);
}

.secondary-cta {
  min-height: var(--control-md);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--blue);
  font: inherit;
  font-weight: var(--weight-title);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 20px rgba(34, 40, 59, 0.05);
}

.admin-command-bar p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-ui);
}

.admin-ai-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-ai-tools .primary-cta.compact,
.admin-ai-tools .secondary-cta.compact {
  width: auto;
  min-height: 40px;
  margin: 0;
  padding: 0 14px;
  font-size: var(--text-sm);
}

.admin-topic-combo {
  position: relative;
}

.admin-topic-combo-shell {
  position: relative;
}

.admin-topic-combo-shell input {
  width: 100%;
  padding-right: 44px;
}

.admin-topic-combo-shell > button[aria-label] {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 40px;
  height: calc(100% - 2px);
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
  background: #f7f9fc;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.admin-topic-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(34, 40, 59, 0.18);
  padding: 6px;
}

.admin-topic-menu button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-ui);
  text-align: left;
  cursor: pointer;
}

.admin-topic-menu button:hover,
.admin-topic-menu button:focus-visible {
  background: rgba(59, 130, 246, 0.12);
  color: var(--blue-strong);
  outline: none;
}

.admin-topic-menu i {
  color: var(--blue);
}

.admin-command-message {
  border-radius: 8px;
  border: 1px solid rgba(14, 165, 127, 0.2);
  background: rgba(14, 165, 127, 0.08);
  color: #08785d;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.admin-command-message.is-error {
  border-color: rgba(239, 86, 107, 0.26);
  background: rgba(239, 86, 107, 0.08);
  color: #b9233c;
}

.admin-jobs-hero {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 12px 28px rgba(34, 40, 59, 0.06);
}

.admin-jobs-hero h1 {
  margin: 4px 0 4px;
  color: var(--ink);
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
}

.admin-jobs-hero p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: var(--weight-ui);
}

.admin-hero-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.admin-cache-action {
  display: flex;
}

.admin-cache-action .secondary-cta.compact {
  min-height: 62px;
  white-space: nowrap;
}

.admin-harke-kicker {
  width: fit-content;
}

.admin-harke-kicker img {
  width: auto;
  height: clamp(52px, 7vw, 84px);
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.admin-heartbeat {
  min-width: 220px;
  min-height: 62px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff7fb;
  color: #c02662;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-heartbeat i {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(236, 72, 153, 0.12);
  color: #db2777;
}

.admin-heartbeat strong,
.admin-heartbeat span {
  display: block;
}

.admin-heartbeat strong {
  color: var(--ink);
  font-size: var(--text-sm);
  line-height: var(--leading-tight);
}

.admin-heartbeat span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-ui);
}

.admin-heartbeat.is-stale {
  background: var(--amber-soft);
  color: var(--amber);
}

.admin-heartbeat.is-stale i {
  background: rgba(246, 185, 49, 0.16);
  color: var(--amber);
}

.admin-heartbeat.is-quiet {
  background: #f8faff;
  color: var(--ink-soft);
}

.admin-heartbeat.is-quiet i {
  background: var(--line);
  color: var(--ink-soft);
}

.admin-status {
  width: fit-content;
  min-height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 0 10px;
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.admin-status.tone-rose {
  background: var(--rose-soft);
  color: var(--rose);
}

.admin-status.tone-amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.admin-status.is-failed,
.admin-status.is-cancelled {
  background: var(--rose-soft);
  color: var(--rose);
}

.admin-status.is-pending,
.admin-status.is-retry {
  background: var(--amber-soft);
  color: var(--amber);
}

.admin-status.is-running {
  background: var(--blue-soft);
  color: var(--blue);
}

.admin-status.is-succeeded {
  background: var(--mint-soft);
  color: var(--mint);
}

.admin-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-status-grid div {
  min-height: 78px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f8faff;
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 2px;
}

.admin-status-grid span {
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.admin-status-grid strong {
  color: var(--ink);
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
}

.admin-coverage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}

.admin-coverage-card {
  min-height: 108px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f9fbff;
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.admin-coverage-card span,
.admin-coverage-card small {
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-ui);
}

.admin-coverage-card strong {
  color: var(--ink);
  font-size: var(--text-lg);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
  text-transform: capitalize;
}

.admin-coverage-card.is-ready {
  border-color: rgba(15, 159, 110, 0.32);
  background: var(--mint-soft);
}

.admin-coverage-card.is-pending,
.admin-coverage-card.is-running,
.admin-coverage-card.is-retry {
  border-color: rgba(246, 185, 49, 0.38);
  background: var(--amber-soft);
}

.admin-coverage-card.is-missing,
.admin-coverage-card.is-failed {
  border-color: rgba(239, 86, 107, 0.38);
  background: var(--rose-soft);
}

.admin-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.admin-action-row a {
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #ffffff;
  padding: 0 14px;
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.admin-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.admin-table td {
  color: var(--ink);
  font-weight: var(--weight-ui);
}

.admin-content-table td strong,
.admin-table td small {
  display: block;
}

.admin-table td small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-ui);
}

.admin-origin-stack {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.admin-origin-chip,
.admin-loading-inline {
  width: fit-content;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
}

.admin-origin-chip.is-pwa {
  background: var(--mint-soft);
  border-color: rgba(14, 165, 127, 0.28);
  color: var(--mint);
}

.admin-origin-chip.is-browser {
  background: var(--blue-soft);
  border-color: rgba(91, 141, 239, 0.28);
  color: var(--blue);
}

.admin-loading-inline {
  color: var(--blue);
  background: var(--blue-soft);
}

.admin-inline-status {
  width: fit-content;
  min-height: 26px;
  border-radius: 999px;
  background: rgba(103, 114, 135, 0.1);
  color: var(--ink-soft);
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.admin-inline-status.tone-mint {
  background: var(--mint-soft);
  color: var(--mint);
}

.admin-inline-status.tone-rose {
  background: var(--rose-soft);
  color: var(--rose);
}

.admin-error-text {
  color: var(--rose);
  font-weight: var(--weight-title);
}

.admin-table tr.has-api-error td {
  background: rgba(239, 86, 107, 0.045);
}

.admin-jobs-table {
  min-width: 1040px;
}

.admin-job-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-job-actions form {
  margin: 0;
}

.admin-job-actions .admin-icon-button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  text-decoration: none;
}

.admin-icon-button.tone-amber {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: rgba(246, 185, 49, 0.32);
}

.admin-icon-button.tone-rose {
  color: var(--rose);
  background: var(--rose-soft);
  border-color: rgba(239, 86, 107, 0.32);
}

.admin-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-check-grid.compact {
  align-content: end;
  align-items: center;
}

.admin-form-actions,
.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-form-actions {
  align-items: center;
}

.admin-form-actions .primary-cta.compact,
.admin-form-actions .secondary-cta.compact {
  width: auto;
  min-height: 44px;
  margin: 0;
  padding: 0 16px;
  font-size: var(--text-sm);
}

.admin-row-actions {
  min-width: 180px;
}

.admin-row-actions a,
.admin-row-actions button,
.admin-inline-form button,
.admin-topic-row button,
.admin-topic-delete button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--blue);
  padding: 0 10px;
  font: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.admin-row-actions button,
.admin-topic-delete button {
  color: var(--rose);
}

.admin-pagination {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.admin-pagination form {
  margin: 0;
  display: inline-flex;
}

.admin-pagination a,
.admin-pagination button {
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--blue);
  padding: 0 12px;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.admin-pagination a.is-disabled,
.admin-pagination button:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.admin-editor-form {
  margin: 0;
}

.admin-inline-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 260px;
}

.admin-inline-form input,
.admin-topic-form input,
.admin-topic-row input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-ui);
}

.harke-market-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  min-width: 260px;
}

.harke-tabs {
  display: grid;
  gap: 14px;
}

.harke-tab-list {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 8px;
  scrollbar-width: thin;
}

.harke-tab-button {
  flex: 0 0 auto;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
  white-space: nowrap;
}

.harke-tab-button i {
  color: currentColor;
}

.harke-tab-button small {
  min-width: 24px;
  border-radius: 999px;
  background: rgba(47, 107, 232, 0.12);
  color: var(--blue);
  padding: 3px 7px;
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  line-height: 1;
}

.harke-tab-button:hover,
.harke-tab-button:focus-visible {
  border-color: rgba(47, 107, 232, 0.24);
  background: rgba(47, 107, 232, 0.08);
  color: var(--ink);
}

.harke-tab-button.is-active {
  border-color: transparent;
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(47, 107, 232, 0.24);
}

.harke-tab-button.is-active small {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.harke-tab-panel {
  min-width: 0;
}

.admin-panel-note {
  margin: -2px 0 14px;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: var(--weight-ui);
}

.harke-market-total {
  width: fit-content;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(103, 114, 135, 0.08);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  margin-bottom: 12px;
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
}

.harke-market-total.is-balanced {
  background: var(--mint-soft);
  border-color: rgba(15, 159, 110, 0.22);
  color: var(--mint);
}

.harke-market-total.is-warning {
  background: var(--amber-soft);
  border-color: rgba(244, 181, 45, 0.28);
  color: var(--amber);
}

.harke-market-table {
  min-width: 880px;
}

.harke-market-table td {
  vertical-align: middle;
}

.harke-market-table td strong {
  display: block;
}

.harke-market-table input[type="text"],
.harke-market-table input[type="number"] {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-ui);
}

.harke-market-table .admin-mini-number {
  max-width: 86px;
}

.harke-market-table .admin-market-name {
  max-width: 220px;
  margin-top: 5px;
}

.harke-share-cell {
  display: grid;
  grid-template-columns: 76px minmax(90px, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 180px;
}

.harke-share-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(103, 114, 135, 0.14);
  overflow: hidden;
}

.harke-share-meter span {
  display: block;
  width: calc(var(--share) * 1%);
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--mint));
}

@media (max-width: 720px) {
  .harke-tab-list {
    gap: 6px;
    padding: 6px;
  }

  .harke-tab-button {
    min-height: 42px;
    padding: 0 11px;
    font-size: var(--text-xs);
  }

  .harke-tab-button small {
    min-width: 22px;
    padding: 3px 6px;
  }
}

.harke-settings-list,
.harke-market-grid,
.harke-signal-list {
  display: grid;
  gap: 12px;
}

.harke-settings-list {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.harke-market-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.harke-setting-card,
.harke-market-card,
.harke-signal-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.harke-setting-card,
.harke-market-card {
  display: grid;
  gap: 12px;
}

.harke-card-head,
.harke-card-foot,
.harke-signal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.harke-card-head strong,
.harke-signal-row strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
}

.harke-card-head small,
.harke-card-foot span,
.harke-signal-row small {
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-ui);
}

.harke-setting-fields,
.harke-market-fields {
  display: grid;
  gap: 10px;
}

.harke-setting-fields {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}

.harke-market-fields {
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
}

.harke-setting-fields .account-field,
.harke-market-fields .account-field {
  margin: 0;
}

.harke-card-foot {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.harke-signal-row span {
  border-radius: 999px;
  background: rgba(112, 163, 255, 0.14);
  color: var(--blue);
  min-width: 58px;
  padding: 6px 10px;
  text-align: center;
  font-weight: var(--weight-strong);
}

.admin-mini-input {
  display: grid;
  gap: 4px;
  min-width: 92px;
}

.admin-mini-input span {
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-ui);
  text-transform: uppercase;
}

.admin-mini-input input {
  width: 92px;
  min-height: 36px;
}

.account-check.compact {
  min-height: 36px;
  margin: 0;
  padding: 0 8px;
}

.admin-topic-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.admin-topic-form .primary-cta.compact {
  width: 100%;
  min-height: 42px;
  margin: 0;
  font-size: var(--text-sm);
}

.admin-topic-list {
  display: grid;
  gap: 9px;
}

.admin-topic-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(160px, 1.2fr) 80px auto auto auto;
  gap: 8px;
  align-items: center;
}

.admin-topic-row.compact {
  grid-template-columns: minmax(140px, 1fr) 80px auto auto;
}

.admin-topic-delete {
  display: flex;
  justify-content: flex-end;
  margin: -6px 0 4px;
}

.admin-topic-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.admin-topic-card strong,
.admin-topic-card small {
  display: block;
}

.admin-topic-card small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-ui);
}

.admin-word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.admin-word-bank span {
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 5px 9px;
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
}

.admin-board-preview {
  width: min(100%, 420px);
  display: grid;
  grid-template-columns: repeat(var(--admin-grid-cols), minmax(0, 1fr));
  gap: 3px;
}

.admin-board-preview span {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #f2f5fb;
  color: var(--ink);
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
}

.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
  background: rgba(16, 20, 31, 0.54);
  backdrop-filter: blur(3px);
}

.admin-modal {
  width: min(760px, 90vw);
  max-width: 100vw;
  min-height: 100svh;
  height: 100svh;
  border-left: 1px solid var(--line);
  background: #ffffff;
  box-shadow: -24px 0 64px rgba(14, 20, 35, 0.24);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: adminDrawerIn 180ms var(--tap);
}

.admin-modal.is-lg {
  width: min(90vw, 1440px);
}

.admin-modal.is-md {
  width: min(760px, 90vw);
}

.admin-modal.is-sm,
.admin-modal.compact {
  width: min(520px, 90vw);
}

@keyframes adminDrawerIn {
  from {
    opacity: 0.72;
    transform: translateX(44px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.admin-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex: 0 0 auto;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.admin-modal-head h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.admin-modal > p {
  margin: 0;
  padding: 18px 24px;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.admin-modal > .admin-form-actions,
.admin-modal .admin-editor-form .admin-form-actions {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -12px 26px rgba(34, 40, 59, 0.06);
}

.admin-modal > .admin-form-actions {
  margin-top: auto;
  padding: 16px 24px max(16px, env(safe-area-inset-bottom));
}

.admin-modal .admin-editor-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px 24px 0;
}

.admin-modal .admin-editor-form .admin-form-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 6px -24px 0;
  padding: 16px 24px max(16px, env(safe-area-inset-bottom));
}

.admin-icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink-soft);
  display: inline-grid;
  place-items: center;
}

.admin-icon-button:hover {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: rgba(39, 99, 223, 0.26);
}

.admin-modal-head .admin-icon-button {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: var(--text-lg);
  box-shadow: 0 8px 18px rgba(34, 40, 59, 0.1);
}

.admin-editor-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.error-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 18% 12%, rgba(39, 99, 223, 0.08), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #eef3fb 100%);
}

.error-shell {
  width: min(100%, 1040px);
  min-height: min(720px, calc(100svh - 36px));
  border-radius: 8px;
  border: 1px solid rgba(204, 210, 223, 0.82);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  align-items: center;
  gap: 0;
}

.error-copy {
  padding: clamp(24px, 7vw, 56px);
  display: grid;
  align-content: center;
  gap: 14px;
}

.error-brand {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: var(--text-xl);
  font-weight: var(--weight-title);
}

.error-code {
  width: fit-content;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 7px 12px;
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.error-copy h1 {
  max-width: 620px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.25rem, 11vw, 4.5rem);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.error-copy p {
  max-width: 620px;
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.error-actions .ghost-cta {
  min-height: 46px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink);
  padding: 0 18px;
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.error-meta {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
}

.error-meta div {
  min-width: 0;
  border-radius: 8px;
  background: rgba(238, 242, 248, 0.88);
  border: 1px solid var(--line);
  padding: 9px 11px;
}

.error-meta dt {
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.error-meta dd {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  overflow-wrap: anywhere;
}

.error-board {
  display: grid;
  place-items: center;
  padding: 0 24px 30px;
}

.error-board-card {
  --error-cell: clamp(34px, 9.6vw, 58px);
  --error-gap: clamp(5px, 1.6vw, 10px);
  --error-pad: clamp(12px, 3vw, 18px);
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, var(--error-cell));
  grid-auto-rows: var(--error-cell);
  gap: var(--error-gap);
  padding: var(--error-pad);
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 48px rgba(34, 40, 59, 0.14);
}

.error-board-card span {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f5f7fb;
  color: var(--ink);
  font-size: clamp(1.05rem, 5vw, 1.65rem);
  line-height: 1;
  font-weight: var(--weight-title);
}

.error-board-card span.is-marked {
  background: transparent;
}

.error-selection {
  position: absolute;
  z-index: 1;
  height: calc(var(--error-cell) - 10px);
  border-radius: 999px;
  opacity: 0.82;
  transform-origin: left center;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.32), 0 14px 24px rgba(34, 40, 59, 0.12);
}

.error-selection.one {
  top: calc(var(--error-pad) + var(--error-cell) + var(--error-gap) + 5px);
  left: var(--error-pad);
  width: calc(
    var(--error-cell) + var(--error-cell) + var(--error-cell) + var(--error-cell) +
    var(--error-cell) + var(--error-cell) + var(--error-cell) +
    var(--error-gap) + var(--error-gap) + var(--error-gap) +
    var(--error-gap) + var(--error-gap) + var(--error-gap)
  );
  background: linear-gradient(90deg, #ff6b8f, #8d61ff);
}

.error-selection.two {
  top: calc(var(--error-pad) + 5px);
  left: calc(var(--error-pad) + 5px);
  width: calc(
    var(--error-cell) + var(--error-cell) + var(--error-cell) + var(--error-cell) +
    var(--error-gap) + var(--error-gap) + var(--error-gap)
  );
  background: linear-gradient(90deg, #39c46f, #14b8c4);
  transform: rotate(90deg);
}

@media (max-width: 900px) {
  body.admin-sidebar-open {
    overflow: hidden;
  }

  .admin-shell {
    display: block;
  }

  .admin-sidebar {
    width: min(86vw, 320px);
    max-width: calc(100vw - 32px);
    min-height: 100svh;
    height: 100svh;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
    gap: 18px;
    transform: translateX(-105%);
    box-shadow: 22px 0 44px rgba(34, 40, 59, 0.18);
  }

  .admin-shell.is-sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  .admin-sidebar-close {
    display: inline-grid;
  }

  .admin-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: block;
    border: 0;
    background: rgba(32, 36, 52, 0.42);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms var(--tap);
  }

  .admin-shell.is-sidebar-open .admin-sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .admin-shell.is-sidebar-collapsed .admin-sidebar {
    padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  }

  .admin-shell.is-sidebar-collapsed .admin-sidebar-header {
    justify-content: space-between;
  }

  .admin-shell.is-sidebar-collapsed .admin-brand,
  .admin-shell.is-sidebar-collapsed .admin-menu a {
    justify-content: flex-start;
  }

  .admin-shell.is-sidebar-collapsed .admin-brand span,
  .admin-shell.is-sidebar-collapsed .admin-menu a span {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  .admin-shell.is-sidebar-collapsed .admin-menu a {
    padding: 0 14px;
  }

  .admin-shell.is-sidebar-collapsed .admin-menu a i {
    width: 18px;
  }

  .admin-menu {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .admin-menu a {
    min-height: 50px;
    justify-content: flex-start;
    padding: 0 14px;
    text-align: left;
  }

  .admin-main {
    padding: 14px;
    gap: 14px;
  }

  .admin-jobs-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-hero-actions {
    flex-direction: column;
  }

  .admin-heartbeat {
    width: 100%;
  }

  .admin-cache-action,
  .admin-cache-action .secondary-cta.compact {
    width: 100%;
  }

  .admin-topbar {
    min-height: auto;
    position: sticky;
    top: 0;
    z-index: 15;
    margin: -14px -14px 0;
    padding: max(12px, env(safe-area-inset-top)) 14px 12px;
    background: rgba(248, 249, 252, 0.94);
    border-bottom: 1px solid rgba(228, 231, 239, 0.82);
    backdrop-filter: blur(12px);
  }

  .admin-metric-grid,
  .admin-panel-grid,
  .admin-panel-grid.wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-filter-bar,
  .admin-filter-bar.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-panel {
    min-height: auto;
    padding: 18px;
  }
}

@media (min-width: 860px) {
  .error-shell {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  }

  .error-board {
    min-height: 100%;
    padding: 34px;
    background:
      linear-gradient(135deg, rgba(39, 99, 223, 0.08), rgba(15, 159, 110, 0.08)),
      #f8faff;
  }

  .error-board-card {
    --error-cell: clamp(42px, 4.2vw, 62px);
  }
}

@media (max-width: 560px) {
  .admin-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .admin-heading {
    align-items: center;
    gap: 10px;
  }

  .admin-menu-toggle {
    width: 42px;
    height: 42px;
  }

  .admin-topbar h1 {
    font-size: var(--text-2xl);
  }

  .admin-user-chip {
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    padding: 4px 5px 4px 12px;
  }

  .admin-user-chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-menu,
  .admin-metric-grid,
  .admin-panel-grid,
  .admin-panel-grid.wide,
  .admin-filter-bar,
  .admin-filter-bar.compact {
    grid-template-columns: 1fr;
  }

  .admin-status-grid,
  .admin-coverage-grid,
  .admin-field-grid {
    grid-template-columns: 1fr;
  }

  .admin-command-bar {
    display: grid;
    align-items: stretch;
  }

  .admin-jobs-hero h1 {
    font-size: var(--text-2xl);
  }

  .admin-command-bar form,
  .admin-command-bar .primary-cta.compact,
  .admin-command-bar .secondary-cta.compact {
    width: 100%;
  }

  .admin-main {
    padding: 12px;
  }

  .admin-topbar {
    margin: -12px -12px 0;
    padding-inline: 12px;
  }

  .admin-panel,
  .account-panel,
  .admin-form-panel {
    padding: 14px;
    margin-inline: 0;
  }

  .admin-form-actions .primary-cta.compact,
  .admin-form-actions .secondary-cta.compact,
  .admin-ai-tools .primary-cta.compact,
  .admin-ai-tools .secondary-cta.compact,
  .admin-row-actions,
  .admin-row-actions a,
  .admin-row-actions button,
  .admin-inline-form,
  .admin-topic-row,
  .admin-topic-row.compact,
  .admin-topic-card {
    width: 100%;
  }

  .admin-inline-form,
  .admin-topic-row,
  .admin-topic-row.compact,
  .admin-topic-card {
    grid-template-columns: 1fr;
  }

  .admin-pagination {
    justify-content: stretch;
  }

  .admin-pagination form {
    flex: 1 1 0;
  }

  .admin-pagination a,
  .admin-pagination button,
  .admin-pagination span {
    flex: 1 1 0;
    text-align: center;
  }

  .admin-responsive-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .admin-responsive-table thead {
    display: none;
  }

  .admin-responsive-table tbody,
  .admin-responsive-table tr,
  .admin-responsive-table td {
    display: block;
    width: 100%;
  }

  .admin-responsive-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
  }

  .admin-responsive-table td {
    min-height: 42px;
    border-bottom: 1px solid var(--line);
    padding: 9px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    text-align: right;
  }

  .admin-responsive-table td:last-child {
    border-bottom: 0;
  }

  .admin-responsive-table td::before {
    content: attr(data-label);
    color: var(--ink-soft);
    font-size: var(--text-2xs);
    font-weight: var(--weight-title);
    text-align: left;
    text-transform: uppercase;
  }

  .admin-responsive-table td[colspan] {
    text-align: left;
    justify-content: flex-start;
  }

  .admin-responsive-table td[colspan]::before {
    content: "";
    display: none;
  }

  .admin-modal-backdrop {
    align-items: stretch;
  }

  .admin-modal {
    width: 100vw;
    min-height: 100svh;
    height: 100svh;
    border-left: 0;
    border-radius: 0;
  }

  .admin-modal.is-lg,
  .admin-modal.is-md,
  .admin-modal.is-sm,
  .admin-modal.compact {
    width: 100vw;
  }

  .admin-modal-head {
    padding: max(16px, env(safe-area-inset-top)) 16px 14px;
  }

  .admin-modal > p {
    padding: 16px;
  }

  .admin-modal .admin-editor-form {
    padding: 16px 16px 0;
  }

  .admin-modal > .admin-form-actions,
  .admin-modal .admin-editor-form .admin-form-actions {
    padding-inline: 16px;
  }

  .admin-modal .admin-editor-form .admin-form-actions {
    margin-inline: -16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-modal {
    animation: none;
  }
}

@media (max-width: 430px) {
  .error-page {
    padding: 0;
  }

  .error-shell {
    min-height: 100svh;
    border-radius: 0;
    border: 0;
  }

  .error-copy {
    padding: 22px 18px;
  }

  .error-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .error-board {
    padding: 0 18px 28px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .ws-shell {
    padding: 22px;
    align-items: center;
  }

  .ws-surface {
    max-width: 760px;
    height: min(900px, calc(100svh - 44px));
    border-radius: 26px;
    box-shadow: var(--shadow);
  }

  .challenge-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
    padding: 18px;
  }

  .challenge-card {
    width: auto;
    min-height: 190px;
  }

  .home-hero {
    min-height: 430px;
  }

  .home-hero h1 {
    max-width: 620px;
    font-size: var(--text-title-tablet);
  }

  .bottom-sheet {
    width: min(720px, calc(100vw - 44px));
  }

  .difficulty-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 18px 16px;
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-hero {
    min-height: 320px;
  }
}

@media (min-width: 1024px) {
  .ws-game {
    overflow: auto;
  }

  .ws-shell {
    width: min(100%, 1480px);
    min-height: 100svh;
    margin: 0 auto;
    padding: 24px;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 0;
  }

  .ws-surface {
    max-width: none;
    width: 100%;
    height: auto;
    min-height: calc(100svh - 48px);
    max-height: none;
    border-radius: 28px;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .ws-topbar {
    grid-column: 2;
    grid-row: 1;
    min-height: 78px;
    padding: 18px 28px 14px;
    border-bottom: 1px solid var(--line);
  }

  .counter-pill {
    flex: 0 0 auto;
  }

  .round-action {
    width: auto;
    min-width: 126px;
    padding: 0 16px;
    display: inline-flex;
    gap: 8px;
    font-weight: var(--weight-title);
  }

  .round-action::after {
    content: "Create";
  }

  .ws-main {
    grid-column: 2;
    grid-row: 2;
  }

  .bottom-nav {
    grid-column: 1;
    grid-row: 1 / 3;
    height: auto;
    padding: 18px 12px;
    border-top: 0;
    border-right: 1px solid var(--line);
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    align-content: start;
    background: rgba(255, 255, 255, 0.68);
  }

  .nav-brand {
    min-height: 84px;
    display: grid;
    place-items: center;
    border-radius: 8px;
  }

  .nav-brand img {
    width: 58px;
    height: 58px;
    filter: drop-shadow(0 10px 14px rgba(24, 55, 120, 0.14));
  }

  .nav-item {
    min-height: 72px;
    align-content: center;
  }

  .nav-item svg,
  .nav-item i {
    width: 28px;
    height: 28px;
    font-size: 1.55rem;
  }

  .screen {
    padding: 0;
  }

  /* ── Home: mobile/desktop content toggle ────────────── */
  .home-mobile-content {
    display: none;
  }

  .home-desktop-content {
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding: 28px 32px 40px;
    overflow-y: auto;
    flex: 1;
  }

  .screen-home.is-active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* ── Daily Feature Card ──────────────────────────────── */
  .daily-feature {
    display: flex;
    align-items: center;
    gap: 24px;
    background: linear-gradient(130deg, #141c32 0%, #1e2a48 60%, #0f1a2e 100%);
    border-radius: 18px;
    padding: 28px 32px;
    color: #ffffff;
    box-shadow: 0 24px 56px rgba(10, 15, 38, 0.32);
    flex-shrink: 0;
  }

  .daily-trophy {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(255, 210, 60, 0.12);
    border: 2px solid rgba(255, 210, 60, 0.38);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #ffd43b;
  }

  .daily-trophy svg,
  .daily-trophy i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    font-size: 1.75rem;
  }

  .daily-body {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 4px;
  }

  .daily-tag {
    font-size: var(--text-2xs);
    font-weight: var(--weight-title);
    color: #ffd43b;
    letter-spacing: 0.09em;
    text-transform: uppercase;
  }

  .daily-feature h2 {
    margin: 0;
    font-size: var(--text-2xl);
    color: #ffffff;
    font-weight: var(--weight-title);
    line-height: var(--leading-tight);
  }

  .daily-meta {
    color: rgba(255, 255, 255, 0.55);
    font-size: var(--text-sm);
  }

  .daily-play-cta {
    flex-shrink: 0;
    min-height: 52px;
    padding: 0 30px;
    display: inline-flex;
    align-items: center;
    background: #ffd43b;
    color: #141c32;
    border-radius: 999px;
    font-weight: var(--weight-title);
    font-size: var(--text-md);
    transition: transform 140ms var(--tap), background 140ms var(--tap);
  }

  .daily-play-cta:hover {
    background: #ffe87a;
    transform: translateY(-2px);
  }

  /* ── My Games carousel ───────────────────────────────── */
  .my-games-section {
    min-width: 0;
    flex-shrink: 0;
  }

  .section-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
  }

  .section-row-head h3 {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: var(--weight-title);
    color: var(--ink);
  }

  .see-all-link {
    font-size: var(--text-sm);
    font-weight: var(--weight-strong);
    color: var(--blue);
  }

  .my-games-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
  }

  .my-games-track::-webkit-scrollbar {
    display: none;
  }

  .my-game-card {
    flex: 0 0 auto;
    width: 196px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid var(--line);
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(32, 36, 52, 0.07);
    transition: transform 160ms var(--tap), box-shadow 160ms var(--tap);
    cursor: pointer;
  }

  .my-game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(32, 36, 52, 0.14);
  }

  .my-game-thumb {
    height: 108px;
    background: linear-gradient(135deg, #edf1f9 0%, #dce4f3 100%);
    display: grid;
    place-items: center;
  }

  .thumb-grid {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border: 1.5px solid #c2cde0;
    background: #ffffff;
    border-radius: 6px;
    font-size: var(--text-2xl);
    color: var(--ink-soft);
    font-weight: var(--weight-title);
    letter-spacing: 0.04em;
  }

  .my-game-info {
    padding: 11px 14px 13px;
    display: grid;
    gap: 2px;
  }

  .my-game-info strong {
    font-size: var(--text-sm);
    font-weight: var(--weight-title);
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .my-game-info span {
    font-size: var(--text-2xs);
    color: var(--blue);
    font-weight: var(--weight-strong);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .my-game-info small {
    font-size: var(--text-2xs);
    color: var(--muted);
  }

  /* ── Create CTA ──────────────────────────────────────── */
  .home-create-row {
    display: flex;
    justify-content: flex-start;
    flex-shrink: 0;
  }

  .create-dark-btn {
    min-height: 52px;
    padding: 0 32px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #111827;
    color: #ffffff;
    border-radius: 12px;
    font-size: var(--text-md);
    font-weight: var(--weight-title);
    letter-spacing: 0.02em;
    transition: transform 140ms var(--tap), background 140ms var(--tap);
  }

  .create-dark-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
  }

  .create-dark-btn:hover {
    background: #1f2937;
    transform: translateY(-2px);
  }

  .primary-cta {
    width: min(100%, 360px);
  }

  .topic-stack:not(.compact) {
    gap: 9px;
  }

  .screen-play.is-active {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 220px);
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    gap: 0 24px;
    padding: 20px 28px 24px;
  }

  .play-top {
    grid-column: 1 / -1;
    padding: 0 0 12px;
  }

  .play-score {
    grid-column: 1;
    grid-row: 2;
    padding-top: 0;
  }

  .play-meta {
    grid-column: 1;
    grid-row: 3;
    align-self: start;
  }

  .board-wrap {
    grid-column: 1;
    grid-row: 4;
    align-content: start;
  }

  .word-board {
    width: min(100%, 660px, calc((100svh - 250px) * var(--grid-cols) / var(--grid-rows)));
  }

  .play-cell {
    font-size: var(--text-board-cell-desktop);
  }

  .word-bank {
    grid-column: 2;
    grid-row: 2 / 5;
    display: flex;
    flex-wrap: wrap;
    align-content: start;
    gap: 9px;
    overflow: visible;
    padding-top: 44px;
  }

  .word-chip {
    min-height: 38px;
  }

  .tool-row {
    grid-column: 1 / -1;
    grid-row: 5;
    grid-template-columns: repeat(4, minmax(88px, 1fr));
    max-width: 720px;
    margin: 18px auto 0;
    width: 100%;
  }

  .ws-surface.is-playing .bottom-nav {
    display: grid;
  }

  .ws-surface.is-playing .ws-topbar {
    display: flex;
  }

  .screen-title {
    padding: 34px 32px 18px;
  }

  .screen-title h1 {
    font-size: var(--text-screen-title-desktop);
  }

  .stack-list,
  .profile-stats {
    padding: 0 32px;
  }

  .collection-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0 32px;
  }

  .category-carousel {
    padding: 0 32px 18px;
    gap: 14px;
  }

  .category-tile {
    flex-basis: 220px;
    min-height: 154px;
    padding: 18px;
  }

  .category-search-panel {
    margin: 12px 32px 28px;
    padding: 20px;
  }

  .category-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: min(58svh, 560px);
  }

  .explore-topic-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .explore-topic-card {
    align-content: start;
    min-height: 360px;
  }

  .explore-step-page,
  .category-step-page {
    gap: 22px;
    padding-bottom: 42px;
  }

  .explore-hero-panel,
  .category-detail-hero,
  .category-puzzle-section {
    margin-left: 32px;
    margin-right: 32px;
  }

  .explore-hero-panel,
  .category-detail-hero {
    padding: 28px;
  }

  .explore-steps {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 14px;
    margin-left: 32px;
    margin-right: 32px;
  }

  .explore-steps article {
    min-height: 126px;
  }

  .explore-steps strong {
    font-size: var(--text-md);
  }

  .explore-topic-rail {
    padding-left: 0;
    padding-right: 0;
  }

  .category-puzzle-section {
    padding: 24px;
  }

  .category-puzzle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .mode-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0 32px 18px;
  }

  .create-layout {
    grid-template-columns: minmax(460px, 720px) minmax(360px, 520px);
    justify-content: center;
    gap: 20px;
    align-items: start;
  }

  .create-hero-panel {
    grid-column: 1;
    margin: 18px 0 14px;
    padding: 24px;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .create-hero-copy {
    align-self: center;
  }

  .create-hero-copy h1 {
    font-size: clamp(2.2rem, 3.2vw, 3.2rem);
  }

  .creator-prompt-area {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .create-difficulty,
  .create-shape-panel,
  .create-word-review {
    grid-column: 1;
    margin-left: 0;
    margin-right: 0;
  }

  .create-preview-panel {
    display: grid;
    grid-column: 2;
    grid-row: 1 / span 3;
    margin: 18px 0;
    position: sticky;
    top: 18px;
  }

  .create-mode-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .create-shape-panel .difficulty-card {
    min-height: 68px;
    padding: 9px 10px;
    gap: 3px 8px;
  }

  .create-shape-panel .difficulty-icon {
    width: 32px;
    height: 32px;
  }

  .create-shape-panel .difficulty-card strong {
    font-size: var(--text-sm);
  }

  .create-shape-panel .difficulty-card > span:not(.difficulty-icon) {
    font-size: var(--text-2xs);
  }

  .create-shape-panel .create-private-toggle {
    min-height: 54px;
  }

  .create-preview-trigger,
  .create-preview-overlay {
    display: none;
  }

  .created-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    padding: 24px 32px 40px;
    align-items: start;
  }

  .created-edit-layout {
    grid-template-columns: minmax(520px, 1fr) minmax(340px, 440px);
    padding: 24px 32px 40px;
    align-items: start;
    gap: 18px;
  }

  .created-hero,
  .created-print-card {
    grid-column: 1;
  }

  .created-teacher-hero,
  .created-preview-stage,
  .created-edit-form,
  .created-print-card {
    grid-column: 1;
  }

  .created-actions-panel,
  .created-share-panel {
    grid-column: 2;
  }

  .created-action-dock,
  .created-share-dock {
    grid-column: 2;
  }

  .created-actions-panel {
    position: sticky;
    top: 20px;
  }

  .created-share-dock {
    position: sticky;
    top: 188px;
  }

  .created-edit-form.create-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 16px;
  }

  .created-edit-form .create-hero-panel,
  .created-edit-form .create-panel.create-shape-panel {
    margin: 0;
  }

  .created-edit-form .create-preview-panel {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin: 0;
    top: 18px;
  }

  .route-panel,
  .detail-hero,
  .create-panel {
    margin: 18px 32px;
    padding: 22px;
  }

  .create-panel.create-shape-panel {
    margin: 14px 0 18px;
    padding: 18px;
  }

  .create-panel.create-preview-panel {
    margin: 18px 0;
  }

  .detail-grid {
    grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1fr);
  }

  .detail-hero {
    min-height: 340px;
  }

  .detail-hero h1 {
    font-size: var(--text-detail-title-desktop);
  }

  .mini-board span {
    font-size: var(--text-mini-board-desktop);
  }

  .profile-card {
    margin: 34px 32px 16px;
  }

  .profile-dashboard {
    padding: 28px 32px 42px;
    gap: 20px;
  }

  .profile-hero-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 24px;
  }

  .profile-action-row {
    grid-column: auto;
    justify-content: end;
  }

  .profile-progress-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 14px 0 12px;
  }

  .profile-created-section {
    margin-top: 10px;
    padding: 22px;
  }

  .profile-created-card {
    flex-basis: 320px;
  }

  .bottom-sheet {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: min(430px, calc(100vw - 48px));
    max-height: calc(100svh - 48px);
    border-radius: 22px;
    transform: translateX(115%);
  }

  .bottom-sheet.is-open {
    transform: translateX(0);
  }
}

@media (min-width: 1440px) {
  .ws-shell {
    width: min(100%, 1560px);
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 28px;
  }

  .ws-surface {
    min-height: calc(100svh - 56px);
    grid-template-columns: 106px minmax(0, 1fr);
  }

  .challenge-track {
    gap: 18px;
    padding: 26px 34px 18px;
  }

  .challenge-card {
    min-height: 230px;
    padding: 16px;
  }

  .home-hero h1 {
    font-size: var(--text-title-wide);
  }

  .word-board {
    width: min(100%, 720px, calc((100svh - 250px) * var(--grid-cols) / var(--grid-rows)));
  }

  .screen-play.is-active {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
  }

  .category-puzzle-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 370px) {
  .counter-pill {
    min-width: 0;
    min-height: 32px;
    gap: 6px;
    padding: 4px 7px 4px 5px;
  }

  .counter-mark {
    width: 23px;
    height: 23px;
  }

  .counter-mark svg,
  .counter-mark i {
    width: 13px;
    height: 13px;
    font-size: 0.75rem;
  }

  .counter-value {
    font-size: var(--text-sm);
  }

  .counter-label {
    font-size: 0.52rem;
  }

  .challenge-card {
    width: 154px;
  }

  .home-hero {
    padding-left: 18px;
    padding-right: 18px;
  }

  .tool-row {
    gap: 6px;
  }

  .tool-button {
    min-height: 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tile-pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes soft-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Word color palette */
.wc-0 { --wc-bg: var(--rose-soft);   --wc-tx: var(--rose); }
.wc-1 { --wc-bg: var(--violet-soft); --wc-tx: var(--violet); }
.wc-2 { --wc-bg: var(--amber-soft);  --wc-tx: var(--amber); }
.wc-3 { --wc-bg: var(--mint-soft);   --wc-tx: var(--mint); }
.wc-4 { --wc-bg: var(--gold-soft);   --wc-tx: var(--gold); }
.wc-5 { --wc-bg: var(--blue-soft);   --wc-tx: var(--blue); }
.wc-6 { --wc-bg: #ffe0dc; --wc-tx: #c0391d; }
.wc-7 { --wc-bg: #dff4ff; --wc-tx: #1a7fa8; }
.wc-8 { --wc-bg: #e8fde0; --wc-tx: #3a8a28; }
.wc-9 { --wc-bg: #f5e0ff; --wc-tx: #8a1ab0; }

/* Board compress-and-rotate */
@keyframes board-flip-to-rotated {
  0%   { transform: scale(1) rotate(0deg); }
  35%  { transform: scale(0.42) rotate(0deg); }
  65%  { transform: scale(0.42) rotate(180deg); }
  100% { transform: scale(1) rotate(180deg); }
}

@keyframes board-flip-to-normal {
  0%   { transform: scale(1) rotate(180deg); }
  35%  { transform: scale(0.42) rotate(180deg); }
  65%  { transform: scale(0.42) rotate(360deg); }
  100% { transform: scale(1) rotate(360deg); }
}

.board-wrap.is-rotated .word-board {
  transform: rotate(180deg);
}

.board-wrap.is-rotated .play-cell-letter,
.board-wrap.is-flipping.is-rotating-to-rotated .play-cell-letter {
  transform: rotate(180deg);
}

.board-wrap:not(.is-rotated):not(.is-flipping) .word-board {
  transform: rotate(0deg);
}

.board-wrap.is-flipping.is-rotating-to-rotated .word-board {
  animation: board-flip-to-rotated 680ms cubic-bezier(0.4, 0, 0.2, 1) both;
  pointer-events: none;
}

.board-wrap.is-flipping.is-rotating-to-normal .word-board {
  animation: board-flip-to-normal 680ms cubic-bezier(0.4, 0, 0.2, 1) both;
  pointer-events: none;
}

/* Word found animations */
@keyframes cell-found {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.22); }
  100% { transform: scale(1); }
}

@keyframes chip-bounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.14); }
  70%  { transform: scale(0.94); }
  100% { transform: scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Full-window play mode */
.ws-game-play {
  --play-board-max: 430px;
  min-height: 100svh;
  background: #f7f8fb;
}

.ws-game-play .ws-shell {
  width: 100%;
  min-height: 100svh;
  display: block;
  padding: 0;
}

.ws-game-play .ws-surface {
  width: 100%;
  max-width: none;
  height: 100svh;
  min-height: 0;
  border-radius: 0;
  box-shadow: none;
  display: block;
  overflow: hidden;
  background: #f7f8fb;
}

.ws-game-play .ws-main {
  height: 100svh;
  overflow: hidden;
}

.ws-game-play .ws-topbar,
.ws-game-play .bottom-nav {
  display: none !important;
}

.ws-game-play:fullscreen,
.ws-game-play:fullscreen .ws-shell,
.ws-game-play:fullscreen .ws-surface,
.ws-game-play:fullscreen .ws-main,
.ws-game-play:fullscreen .screen-play.is-active {
  width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--play-page-bg);
  color: var(--play-text);
}

.ws-game-play:fullscreen .play-stage {
  width: 100%;
  height: 100%;
  max-height: 100%;
  background: var(--play-page-bg);
  color: var(--play-text);
}

.ws-game-play:fullscreen .word-board {
  background: var(--play-board-bg);
  border-color: var(--play-board-border);
}

.ws-game-play:fullscreen .play-word-list {
  background: var(--play-word-panel-bg);
  color: var(--play-word-text);
}

.ws-game-play .screen-play.is-active {
  height: 100svh;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
  padding: 0;
  background: #f7f8fb;
}

.ws-game-play .screen-play.is-active.is-fullscreen-mode {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.play-session-topbar {
  display: none;
  min-width: 0;
  border-bottom: 1px solid rgba(57, 66, 82, 0.16);
  background: #ffffff;
  z-index: 5;
}

.screen-play:not(.is-fullscreen-mode) .play-session-topbar {
  display: grid;
  grid-template-rows: auto auto;
}

.screen-play.is-waiting .play-session-topbar {
  display: grid;
  grid-template-rows: auto auto;
}

.screen-play.is-fullscreen-mode.is-running:not(.is-paused) .play-session-topbar,
.screen-play.is-fullscreen-mode.is-counting-down:not(.is-paused) .play-session-topbar {
  display: none !important;
}

.play-title-strip {
  min-width: 0;
  padding: max(8px, env(safe-area-inset-top)) 12px 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 38%),
    #2c150b;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 12px;
}

.play-title-strip h1 {
  max-width: 860px;
  margin: 0;
  min-width: 0;
  color: inherit;
  font-size: clamp(1.5rem, 7vw, 2.45rem);
  line-height: 1.1;
  font-weight: var(--weight-ui);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-home-link {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  transition: transform 140ms var(--tap), background 140ms var(--tap);
}

.title-home-link:hover,
.title-home-link:focus-visible {
  background: rgba(255, 255, 255, 0.18);
}

.title-home-link:active {
  transform: scale(0.96);
}

.title-home-link svg,
.title-home-link i {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  font-size: 1rem;
}

.play-session-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #ffffff;
}

.top-score {
  min-width: 0;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #2e3542;
  font-size: var(--text-sm);
  font-weight: var(--weight-ui);
  text-align: left;
}

.top-score svg,
.top-score i {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: #d9a018;
}

.top-score span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-score-copy-mobile {
  display: none;
}

.top-score strong {
  font-weight: var(--weight-title);
}

.play-difficulty-chip {
  flex: 0 0 auto;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(47, 107, 232, 0.18);
  background: rgba(47, 107, 232, 0.08);
  color: #1f56c7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  letter-spacing: 0;
  white-space: nowrap;
}

.play-session-actions {
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.screen-play.is-running .play-session-meta,
.screen-play.is-counting-down .play-session-meta {
  display: none;
}

.play-command {
  position: relative;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #ffffff;
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.facts-command {
  background: #f0a51f;
}

.facts-command-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border: 2px solid #111a2b;
  border-radius: 999px;
  background: #2f6be8;
  color: #ffffff;
  display: grid;
  place-items: center;
  padding: 0 4px;
  font-size: 0.66rem;
  font-weight: var(--weight-title);
  line-height: 1;
}

.play-command svg,
.play-command i {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}

.print-command {
  background: var(--mint);
}

.score-command {
  background: #dc3545;
}

@media (max-width: 640px) {
  .top-score {
    gap: 5px;
    font-size: var(--text-xs);
  }

  .top-score svg,
  .top-score i {
    width: 17px;
    height: 17px;
    font-size: 0.82rem;
  }

  .top-score-copy-desktop {
    display: none;
  }

  .top-score-copy-mobile {
    display: inline;
  }

  .play-difficulty-chip {
    min-height: 24px;
    padding-inline: 8px;
    font-size: 0.68rem;
  }

  .facts-command,
  .print-command,
  .score-command {
    width: 40px;
    min-width: 40px;
    padding: 0;
  }

  .facts-command span,
  .print-command span,
  .score-command span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (max-width: 767px) {
  .screen-play.is-waiting .play-session-meta {
    display: flex;
  }

  .screen-play.is-waiting .play-session-actions {
    gap: 6px;
  }

  .screen-play.is-waiting .facts-command,
  .screen-play.is-waiting .print-command,
  .screen-play.is-waiting .score-command {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
  }

  .screen-play.is-waiting .facts-command span,
  .screen-play.is-waiting .print-command span,
  .screen-play.is-waiting .score-command span {
    display: none;
  }

  .screen-play.is-waiting .facts-command i,
  .screen-play.is-waiting .facts-command svg,
  .screen-play.is-waiting .print-command i,
  .screen-play.is-waiting .print-command svg,
  .screen-play.is-waiting .score-command i,
  .screen-play.is-waiting .score-command svg {
    width: 20px;
    height: 20px;
  }
}

.play-hud {
  min-height: 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: max(8px, env(safe-area-inset-top)) 14px 8px;
  border-bottom: 1px solid rgba(57, 66, 82, 0.12);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(31, 36, 51, 0.06);
  z-index: 3;
}

.hud-cluster {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-cluster-right {
  justify-content: flex-end;
}

.screen-play:not(.is-fullscreen-mode) .hud-home {
  display: none;
}

.hud-prog-wrap {
  width: 72px;
  height: 5px;
  border-radius: 999px;
  background: rgba(39, 99, 223, 0.14);
  overflow: hidden;
}

.hud-prog-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--blue);
  width: var(--prog, 0%);
  transition: width 320ms var(--tap);
}

.hud-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #2b303a;
  font-size: var(--text-md);
  font-weight: var(--weight-title);
  letter-spacing: 0;
  white-space: nowrap;
}

.sound-toggle,
.hud-icon {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #313844;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 140ms var(--tap), color 140ms var(--tap), background 140ms var(--tap);
}

.sound-toggle {
  gap: 7px;
  min-height: 38px;
  padding: 0 2px;
}

.sound-toggle svg,
.sound-toggle i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 1rem;
}

.toggle-track {
  width: 42px;
  height: 22px;
  border-radius: 999px;
  padding: 3px;
  background: #1f72ff;
  display: inline-flex;
  justify-content: flex-end;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.toggle-track span {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 2px 5px rgba(23, 31, 45, 0.22);
}

.sound-toggle.is-muted {
  color: var(--muted);
}

.sound-toggle.is-muted .toggle-track {
  justify-content: flex-start;
  background: #d7dce6;
}

.hud-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.hud-back-home,
.hud-rotate-board {
  width: auto;
  min-width: 0;
  padding: 0 12px;
  gap: 8px;
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
  white-space: nowrap;
}

.hud-back-home {
  min-height: 38px;
  border: 1px solid rgba(49, 56, 68, 0.12);
  background: rgba(49, 56, 68, 0.06);
  color: #313844;
}

.hud-rotate-board {
  min-height: 44px;
  border: 1px solid rgba(47, 107, 232, 0.2);
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(47, 107, 232, 0.2);
}

.hud-icon.hud-rotate-board:hover {
  background: #1f56c7;
  color: #ffffff;
}

.hud-icon:hover {
  background: rgba(39, 99, 223, 0.09);
  color: var(--blue);
}

.hint-icon {
  position: relative;
  background: rgba(39, 99, 223, 0.09);
  color: var(--blue);
}

.hint-icon.is-active {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(39, 99, 223, 0.22);
}

.hint-icon.is-empty {
  color: #8d96a7;
  background: rgba(141, 150, 167, 0.1);
}

.hint-count-badge,
.hint-tool-button small {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #2f6be8;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: var(--weight-title);
  line-height: 1;
}

.hint-count-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  border: 2px solid var(--play-panel-bg, #ffffff);
}

.hint-icon.is-active .hint-count-badge {
  background: #ffffff;
  color: var(--blue);
}

.hint-icon.is-empty .hint-count-badge,
.hint-tool-button.is-empty small {
  background: #8d96a7;
}

.hint-icon.has-video-refill .hint-count-badge,
.hint-tool-button.has-video-refill small {
  background: #f75381;
  color: #ffffff;
}

.hint-count-badge i,
.hint-tool-button small i {
  width: 12px;
  height: 12px;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  line-height: 1;
}

.hint-status {
  max-width: 210px;
  border: 1px solid rgba(39, 99, 223, 0.16);
  border-radius: 999px;
  background: rgba(39, 99, 223, 0.08);
  color: var(--blue);
  padding: 6px 10px;
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  line-height: var(--leading-tight);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-icon svg,
.hud-icon i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 1rem;
}

.hud-back-home i,
.hud-rotate-board i {
  width: 18px;
  height: 18px;
}

.fullscreen-icon {
  background: #20222b;
  color: #ffec3f;
}

.fullscreen-icon:hover {
  background: #11131a;
  color: #ffec3f;
}

.play-timer {
  color: #2e3542;
  font-size: var(--text-md);
  font-weight: var(--weight-title);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.play-progress-rail {
  height: 7px;
  overflow: hidden;
  background: #ffffff;
  border-block: 1px solid rgba(47, 107, 232, 0.08);
  box-shadow: inset 0 1px 2px rgba(18, 28, 44, 0.05);
}

.play-progress-rail span {
  width: var(--progress, 0%);
  height: 100%;
  display: block;
  border-radius: 0 999px 999px 0;
  background:
    linear-gradient(90deg, #8fd8ff 0%, #2f6be8 56%, #11284f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 4px 12px rgba(47, 107, 232, 0.2);
  position: relative;
  transition: width 420ms var(--tap);
}

.play-stage {
  min-height: 0;
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 0;
  container-type: inline-size;
}

.ws-game-play .board-wrap {
  min-height: 0;
  width: 100%;
  grid-column: 1;
  grid-row: 1;
  position: relative;
  display: grid;
  place-items: center;
}

.ws-game-play .word-board {
  width: min(100%, var(--play-board-max), calc((100svh - 276px) * var(--grid-cols) / var(--grid-rows)));
  aspect-ratio: var(--grid-cols) / var(--grid-rows);
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  overflow: hidden;
  gap: 0;
  border: 1px solid rgba(24, 34, 52, 0.16);
  border-radius: 5px;
  background: #ffffff;
  box-shadow:
    0 18px 34px rgba(31, 36, 51, 0.07),
    inset 0 0 0 1px rgba(255, 255, 255, 0.84);
  touch-action: none;
}

.selection-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.selection-line {
  stroke: var(--wc-line, rgba(32, 186, 102, 0.86));
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  opacity: 0.72;
  filter: drop-shadow(0 2px 2px rgba(34, 40, 59, 0.12));
}

.selection-line.is-preview {
  stroke: rgba(249, 72, 127, 0.72);
  opacity: 0.72;
}

.selection-line.is-invalid {
  stroke: rgba(222, 79, 116, 0.82);
}

.ws-game-play .play-cell {
  position: relative;
  z-index: 3;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(58, 64, 76, 0.045);
  color: #111722;
  font-size: clamp(1.05rem, calc(90vw / var(--grid-cols) * 0.62), 1.72rem);
  font-weight: var(--weight-title);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
  transition: none;
}

.ws-game-play .play-cell.is-dragging {
  background: transparent;
  color: #111722;
  transform: none;
}

.ws-game-play .play-cell.is-found {
  background: transparent;
  color: #111722;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.ws-game-play .word-board.is-invalid .play-cell.is-dragging {
  background: transparent;
  color: #111722;
}

.play-word-list {
  min-height: 54px;
  max-height: 132px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 7px 14px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 4px 10px;
  scroll-behavior: smooth;
  scrollbar-color: rgba(97, 107, 125, 0.42) transparent;
  scrollbar-width: thin;
}

.play-word-list::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.play-word-list::-webkit-scrollbar-track {
  background: transparent;
}

.play-word-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(97, 107, 125, 0.42);
}

.play-word-list .word-chip {
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 28px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: #1f2633;
  box-shadow: none;
  font-size: var(--text-sm);
  letter-spacing: 0;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.play-word-list .word-chip.is-done {
  background: transparent;
  color: #6d7482;
  text-decoration: line-through;
  text-decoration-color: var(--wc-line, var(--wc-tx));
  text-decoration-thickness: 3px;
}

.ws-game-play .tool-row {
  display: none;
}

.ws-game-play .tool-button {
  min-height: 54px;
  box-shadow: none;
  border: 1px solid rgba(228, 231, 239, 0.9);
}

.play-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  grid-template-columns:
    minmax(0, var(--play-overlay-left, 0px))
    minmax(0, var(--play-overlay-width, 100%))
    minmax(0, 1fr);
  grid-template-rows:
    minmax(0, var(--play-overlay-top, 0px))
    minmax(0, var(--play-overlay-height, 100%))
    minmax(0, 1fr);
  place-items: center;
  padding: 0;
  background: rgba(247, 248, 251, 0.62);
  -webkit-backdrop-filter: blur(8px) saturate(0.88);
  backdrop-filter: blur(8px) saturate(0.88);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms var(--tap);
}

.play-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.play-overlay > .play-overlay-card,
.play-overlay > .countdown-card,
.play-overlay > .complete-actions-card {
  grid-column: 2;
  grid-row: 2;
}

.leaderboard-overlay {
  z-index: 11;
}

.play-start-overlay,
.play-countdown-overlay,
.play-pause-overlay,
.play-leave-overlay,
.howto-overlay {
  z-index: 10;
}

.howto-card {
  position: relative;
  align-content: start;
  justify-items: stretch;
  gap: 14px;
  text-align: left;
}

.howto-card h2 {
  padding-right: 32px;
  font-size: var(--text-xl);
  margin: 0;
}

.howto-steps {
  margin: 0;
  padding: 0 0 0 20px;
  display: grid;
  gap: 10px;
  color: var(--ink);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.howto-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--blue-soft);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--blue);
  font-size: var(--text-sm);
  font-weight: var(--weight-ui);
}

.howto-tip i {
  flex: 0 0 auto;
  margin-top: 2px;
}

.howto-close-btn {
  width: 100%;
}

.howto-large-hits-prompt,
.start-large-hits-prompt {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  gap: 10px;
}

.howto-large-hits-prompt p,
.start-large-hits-prompt p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--ink-soft);
}

.leaderboard-card {
  position: relative;
  align-content: start;
  justify-items: stretch;
  gap: 14px;
  text-align: left;
}

.leaderboard-card h2 {
  padding-right: 32px;
  font-size: var(--text-xl);
}

.overlay-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(31, 36, 51, 0.08);
  color: #2b303a;
}

.overlay-close svg,
.overlay-close i {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}

.leaderboard-list {
  width: 100%;
  max-height: min(52svh, 360px);
  display: grid;
  gap: 8px;
  overflow-y: auto;
  padding: 0 4px 0 0;
  margin: 0;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(97, 107, 125, 0.42) transparent;
}

.leaderboard-list li {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 6px 10px;
  align-items: center;
  border: 1px solid rgba(214, 220, 231, 0.88);
  border-radius: 10px;
  padding: 10px;
  background: #ffffff;
}

.leader-rank {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eef4ff;
  color: var(--blue);
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
}

.leaderboard-list .leader-player {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #202636;
  font-weight: var(--weight-title);
}

.leaderboard-list strong {
  color: var(--mint);
}

.leaderboard-list time {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
}

.play-overlay-card {
  width: min(calc(100% - 24px), 486px);
  min-height: min(320px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(43, 48, 58, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 70px rgba(16, 23, 36, 0.22);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 20px;
  padding: 30px;
  text-align: center;
}

.leave-card {
  min-height: min(300px, calc(100% - 24px));
}

.overlay-kicker {
  color: var(--blue);
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.overlay-action-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 12px;
  width: min(100%, 380px);
}

.play-facts-trigger {
  position: relative;
  min-height: 44px;
  border: 1px solid rgba(196, 134, 25, 0.28);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 243, 217, 0.98), rgba(255, 255, 255, 0.96));
  color: #8b560e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 42px 0 16px;
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
  box-shadow: 0 12px 26px rgba(196, 134, 25, 0.16);
}

.play-facts-trigger[hidden] {
  display: none;
}

.play-facts-trigger i {
  color: var(--gold);
  font-size: 1rem;
}

.play-facts-trigger.is-ready i {
  animation: fact-wiggle 1.8s ease-in-out infinite;
}

.play-facts-badge {
  position: absolute;
  top: 50%;
  right: 12px;
  min-width: 22px;
  height: 22px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #f43f5e;
  color: #ffffff;
  border: 2px solid #fff8e6;
  display: grid;
  place-items: center;
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  line-height: 1;
}

.leaderboard-facts-trigger {
  justify-self: start;
}

.result-actions .play-facts-trigger {
  width: 100%;
  margin: 0;
}

.play-facts-modal {
  position: fixed;
  inset: 0;
  z-index: 34;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms var(--tap);
}

.play-facts-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.play-facts-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 25, 36, 0.52);
  -webkit-backdrop-filter: blur(11px) saturate(0.88);
  backdrop-filter: blur(11px) saturate(0.88);
}

.play-facts-card {
  position: relative;
  width: min(100%, 520px);
  max-height: min(78svh, 620px);
  overflow-y: auto;
  border: 1px solid rgba(196, 134, 25, 0.22);
  border-radius: 22px;
  background:
    radial-gradient(circle at 12% 10%, rgba(246, 185, 49, 0.2), transparent 32%),
    linear-gradient(180deg, #ffffff, #fffaf0);
  color: var(--ink);
  box-shadow: 0 32px 86px rgba(16, 23, 36, 0.32);
  display: grid;
  gap: 16px;
  padding: 28px;
}

.play-facts-card .overlay-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--gold);
}

.play-facts-card h2 {
  margin: 0;
  padding-right: 38px;
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.play-facts-track {
  display: grid;
}

.play-fact-slide {
  grid-area: 1 / 1;
  display: grid;
  gap: 10px;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 180ms var(--tap), transform 180ms var(--tap);
}

.play-fact-slide.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.play-fact-slide strong {
  color: var(--blue);
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.play-fact-slide p {
  margin: 0;
  color: var(--ink);
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  font-weight: var(--weight-ui);
}

.play-fact-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.play-fact-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.play-fact-dots button {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(196, 134, 25, 0.24);
  padding: 0;
}

.play-fact-dots button.is-active {
  width: 22px;
  background: var(--gold);
}

@media (max-width: 767px) {
  .play-facts-trigger {
    width: 48px;
    height: 48px;
    min-height: 48px;
    padding: 0;
    border-radius: 999px;
    background: var(--surface);
    color: var(--amber);
    box-shadow: var(--shadow-soft, 0 12px 24px rgba(25, 29, 40, 0.12));
  }

  .play-facts-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .play-facts-badge {
    top: -4px;
    right: -4px;
    transform: none;
    border-color: var(--surface);
  }

  .result-actions .play-facts-trigger {
    width: 54px;
    justify-self: center;
  }

  .play-facts-modal {
    align-items: end;
    padding: 10px;
  }

  .play-facts-card {
    width: 100%;
    max-height: min(74svh, 540px);
    border-radius: 24px 24px 12px 12px;
    padding: 24px 18px max(22px, env(safe-area-inset-bottom));
  }

  .play-facts-card h2 {
    font-size: var(--text-lg);
  }

  .play-fact-slide p {
    font-size: var(--text-base);
  }

  .play-fact-controls {
    grid-template-columns: 1fr;
  }

  .play-fact-controls .outline-cta,
  .play-fact-controls .primary-cta {
    width: 100%;
  }
}

.play-overlay-card h2 {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: var(--weight-title);
}

.play-overlay-card p {
  max-width: 340px;
  margin: -8px 0 0;
  color: var(--ink-soft);
  font-size: var(--text-md);
}

.play-start-button {
  width: auto;
  min-width: 220px;
  display: inline-flex;
  gap: 10px;
  background: var(--mint);
  box-shadow: 0 13px 24px rgba(15, 159, 110, 0.22);
}

.resume-start-button {
  width: auto;
  min-width: 220px;
  display: inline-flex;
  gap: 10px;
  background: var(--blue);
}

.play-start-button svg,
.play-start-button i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.play-no-fullscreen {
  margin-top: 0;
  color: #d64f27;
  font-size: var(--text-md);
}

.outline-cta {
  min-height: 44px;
  border: 1px solid var(--rose);
  border-radius: 8px;
  background: #ffffff;
  color: var(--rose);
  padding: 0 14px;
  font-size: var(--text-base);
  font-weight: var(--weight-ui);
}

.play-another-cta {
  color: var(--rose);
}

.play-countdown-overlay {
  z-index: 9;
  background: rgba(247, 248, 251, 0.58);
}

.play-complete-actions {
  z-index: 10;
  background: rgba(247, 248, 251, 0.38);
}

.complete-actions-card {
  width: min(calc(100% - 24px), 318px);
  min-height: 62px;
  align-self: end;
  justify-self: center;
  margin-bottom: 20px;
  border: 1px solid rgba(43, 48, 58, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(16, 23, 36, 0.2);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
}

.complete-actions-card .primary-cta,
.complete-actions-card .danger-cta {
  width: 100%;
  min-height: 46px;
  margin: 0;
}

.countdown-card {
  width: min(calc(100% - 24px), 300px);
  min-height: 240px;
  max-height: calc(100% - 24px);
  border-radius: 30px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 26px 70px rgba(22, 30, 44, 0.2);
}

.countdown-card span {
  color: var(--ink-soft);
  font-size: var(--text-md);
  font-weight: var(--weight-title);
}

.countdown-card strong {
  width: 112px;
  height: 112px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: white;
  font-size: clamp(3.4rem, 16vw, 5rem);
  font-weight: var(--weight-title);
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.58), transparent 27%),
    linear-gradient(145deg, var(--blue), #12a36d);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.24),
    0 18px 30px rgba(39, 99, 223, 0.24);
  animation: countdown-pop 720ms var(--tap) infinite;
}

.countdown-progress {
  width: min(100%, 220px);
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce3ec;
}

.countdown-progress span {
  width: 0%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #f3a532, #f4c34f, #26c67a);
  transition: width 260ms var(--tap);
}

.mobile-orientation-lock {
  display: none;
}

.screen-play.is-waiting .word-board,
.screen-play.is-waiting .play-word-list {
  filter: none;
  opacity: 1;
}

.screen-play.is-waiting .play-only-command,
.screen-play.is-counting-down .play-only-command,
.screen-play.is-paused .play-only-command,
.screen-play.is-complete .play-only-command {
  display: none !important;
}

.screen-play.is-paused .word-board,
.screen-play.is-paused .play-word-list {
  filter: none;
  opacity: 1;
}

.wc-0 { --wc-line: rgba(249, 72, 127, 0.88); }
.wc-1 { --wc-line: rgba(128, 85, 238, 0.86); }
.wc-2 { --wc-line: rgba(255, 171, 43, 0.9); }
.wc-3 { --wc-line: rgba(42, 201, 82, 0.88); }
.wc-4 { --wc-line: rgba(120, 211, 28, 0.86); }
.wc-5 { --wc-line: rgba(57, 125, 255, 0.86); }
.wc-6 { --wc-line: rgba(255, 99, 75, 0.88); }
.wc-7 { --wc-line: rgba(28, 201, 166, 0.88); }
.wc-8 { --wc-line: rgba(111, 218, 42, 0.88); }
.wc-9 { --wc-line: rgba(203, 92, 237, 0.86); }

@media (min-width: 768px) {
  .ws-game-play .screen-play.is-active {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  .screen-play.is-waiting .play-session-topbar {
    grid-template-rows: auto auto;
  }

  .play-title-strip {
    padding: 8px 24px 12px;
  }

  .play-title-strip h1 {
    font-size: clamp(2rem, 4vw, 2.9rem);
  }

  .play-session-meta {
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 24px;
  }

  .top-score {
    gap: 8px;
    font-size: var(--text-xl);
  }

  .top-score svg,
  .top-score i {
    width: 22px;
    height: 22px;
    color: #d9a018;
  }

  .top-score strong {
    font-weight: var(--weight-title);
  }

  .play-command {
    min-height: 46px;
    padding: 0 14px;
    font-size: var(--text-md);
  }

  .play-command svg,
  .play-command i {
    width: 20px;
    height: 20px;
  }

  .play-hud {
    min-height: 64px;
    padding: 8px 40px;
  }

  .hud-status,
  .play-timer {
    font-size: var(--text-xl);
  }
}

@media (min-width: 1024px) {
  .ws-game-play .ws-shell {
    max-width: none;
  }

  .ws-game-play .screen-play.is-waiting .play-session-topbar {
    display: grid;
  }

  .ws-game-play .screen-play.is-active {
    grid-template-rows: auto auto auto minmax(0, 1fr);
    width: 100%;
    max-width: 100vw;
    min-width: 0;
  }

  .ws-game-play .play-hud {
    padding: 0 56px;
    min-height: 68px;
    border-bottom: 1px solid rgba(57, 66, 82, 0.12);
    background: #ffffff;
  }

  .ws-game-play .play-stage {
    grid-template-columns: minmax(0, 4fr) minmax(190px, 1fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    gap: 34px;
    overflow: hidden;
    padding: 20px 42px 30px;
    scrollbar-color: rgba(97, 107, 125, 0.42) transparent;
    scrollbar-width: thin;
  }

  .ws-game-play .board-wrap {
    grid-column: 1;
    grid-row: 1;
    align-self: stretch;
    place-items: center;
    overflow: hidden;
  }

  .ws-game-play .word-board {
    --play-board-max: 1040px;
    width: min(100%, var(--play-board-max), calc((100svh - 210px) * var(--grid-cols) / var(--grid-rows)));
    gap: 0;
    border-width: 1px;
    background: #ffffff;
  }

  .ws-game-play .play-cell {
    background: transparent;
    box-shadow: inset 0 0 0 1px rgba(58, 64, 76, 0.04);
    font-size: clamp(1.45rem, calc((100svh - 160px) / var(--grid-rows) * 0.58), 3.25rem);
    letter-spacing: 0;
  }

  .screen-play.is-fullscreen-mode .word-board {
    width: min(100%, var(--play-board-max), calc((100svh - 118px) * var(--grid-cols) / var(--grid-rows)));
  }

  .ws-game-play .play-cell.is-found {
    background: transparent;
  }

  .play-word-list {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
    max-height: none;
    height: min(100%, calc(100svh - 122px));
    display: grid;
    grid-auto-rows: min-content;
    align-content: start;
    gap: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 8px 16px 0;
    scroll-behavior: smooth;
  }

  .play-word-list::-webkit-scrollbar {
    width: 6px;
  }

  .play-word-list .word-chip {
    min-height: 38px;
    width: 100%;
    justify-content: flex-start;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 4px 0;
    color: #1a2035;
    font-size: clamp(1.05rem, 1.4vw, 1.45rem);
    font-weight: var(--weight-title);
    letter-spacing: 0;
    text-decoration: none;
    text-transform: uppercase;
  }

  .play-word-list .word-chip.is-done {
    background: transparent;
    color: #a0aab8;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
  }

  .ws-game-play .tool-row {
    display: none;
  }

  .play-overlay {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .ws-game-play,
  .ws-game-play .ws-shell,
  .ws-game-play .ws-surface,
  .ws-game-play .ws-main,
  .ws-game-play .screen-play.is-active {
    height: var(--play-viewport-height, 100dvh);
    min-height: 0;
    max-height: var(--play-viewport-height, 100dvh);
    overflow: hidden;
  }

  .ws-game-play .screen-play.is-active {
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  .ws-game-play .play-hud {
    min-height: 54px;
    padding: 6px 12px;
    grid-template-columns: minmax(112px, 1fr) minmax(190px, auto) minmax(112px, 1fr);
    gap: 8px;
    overflow: hidden;
  }

  .ws-game-play .hud-cluster {
    min-width: 0;
    gap: 6px;
    overflow: hidden;
  }

  .ws-game-play .hud-back-home,
  .ws-game-play .hud-rotate-board {
    width: 38px;
    min-width: 38px;
    padding: 0;
  }

  .ws-game-play .hud-back-home span,
  .ws-game-play .hud-rotate-board span {
    display: none;
  }

  .ws-game-play .hud-status {
    min-width: 0;
    gap: 8px;
    overflow: hidden;
  }

  .ws-game-play .hud-prog-wrap {
    width: 88px;
  }

  .ws-game-play .hud-cluster-right {
    justify-content: end;
  }

  .ws-game-play .play-stage {
    width: 100%;
    max-width: 100dvw;
    min-height: 0;
    height: 100%;
    box-sizing: border-box;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: stretch;
    align-content: stretch;
    justify-items: stretch;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    gap: 8px;
    overflow: hidden;
  }

  .ws-game-play .board-wrap {
    min-height: 0;
    max-width: 100%;
    overflow: hidden;
    place-items: start center;
  }

  .ws-game-play .word-board,
  .ws-game-play .screen-play.is-fullscreen-mode .word-board {
    --play-board-max: 1000px;
    width: min(100%, 100dvw);
    max-height: 100%;
    justify-self: center;
    align-self: center;
  }

  .ws-game-play .play-word-list,
  .ws-game-play .screen-play.is-fullscreen-mode .play-word-list {
    min-height: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    height: auto;
    align-self: stretch;
    overflow-x: clip;
    overflow-y: visible;
    overscroll-behavior: contain;
    padding: 4px 8px max(4px, env(safe-area-inset-bottom));
    gap: 6px 10px;
  }

  .ws-game-play .play-word-list.is-scrollable {
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .ws-game-play .play-word-list .word-chip {
    flex: 0 1 auto;
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    min-height: 28px;
    padding: 2px 8px;
    font-size: clamp(0.86rem, 1.8vw, 1rem);
    line-height: 1.05;
  }
}

@media (min-width: 1440px) {
  .ws-game-play .play-stage {
    grid-template-columns: minmax(0, 4fr) minmax(230px, 1fr);
    gap: 48px;
    padding-left: 58px;
    padding-right: 58px;
  }

  .ws-game-play .word-board {
    --play-board-max: 1180px;
    width: min(100%, var(--play-board-max), calc((100svh - 220px) * var(--grid-cols) / var(--grid-rows)));
  }

  .screen-play.is-fullscreen-mode .word-board {
    width: min(100%, var(--play-board-max), calc((100svh - 124px) * var(--grid-cols) / var(--grid-rows)));
  }
}

@media (max-width: 767px) {
  .ws-game-play .screen-play.is-active {
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  .play-session-meta {
    gap: 8px;
    padding: 8px 10px;
  }

  .play-command {
    min-height: 34px;
    padding: 0 9px;
  }

  .score-command {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .play-hud {
    min-height: 46px;
    gap: 6px;
    padding: max(6px, env(safe-area-inset-top)) 8px 6px;
    grid-template-columns: minmax(0, 0.9fr) auto minmax(0, 0.9fr);
  }

  .hud-cluster {
    gap: 4px;
  }

  .sound-toggle {
    min-height: 30px;
    gap: 4px;
  }

  .sound-toggle svg,
  .sound-toggle i {
    width: 16px;
    height: 16px;
    font-size: 0.82rem;
  }

  .toggle-track {
    width: 32px;
    height: 18px;
    padding: 2px;
  }

  .toggle-track span {
    width: 14px;
    height: 14px;
  }

  .hud-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
  }

  .hud-back-home {
    width: 30px;
    padding: 0;
  }

  .hud-back-home span {
    display: none;
  }

  .hud-rotate-board {
    width: auto;
    min-height: 32px;
    padding: 0 9px;
    gap: 6px;
    font-size: 0.78rem;
  }

  .hud-icon svg,
  .hud-icon i {
    width: 17px;
    height: 17px;
    font-size: 0.82rem;
  }

  .fullscreen-icon {
    background: rgba(31, 34, 43, 0.08);
    color: #20222b;
  }

  .hud-status {
    gap: 6px;
    font-size: 0.78rem;
    line-height: 1;
  }

  .hud-difficulty {
    font-size: 0.78rem;
  }

  .hud-sep {
    display: none;
  }

  .hud-prog-wrap {
    width: 48px;
    height: 4px;
  }

  .hud-count,
  .play-timer {
    font-size: 0.82rem;
  }

  .play-no-fullscreen {
    display: none;
  }

  .play-overlay-card {
    width: min(calc(100% - 18px), 388px);
    min-height: auto;
    max-height: calc(100% - 18px);
    gap: 14px;
    padding: 22px 18px;
    border-radius: 20px;
  }

  .play-overlay-card h2 {
    font-size: var(--text-xl);
  }

  .play-overlay-card p {
    margin-top: -4px;
    font-size: var(--text-base);
  }

  .start-large-hits-prompt {
    gap: 8px;
    padding-top: 10px;
  }

  .play-stage {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    overflow: visible;
    grid-template-rows: auto auto;
    align-content: start;
    justify-items: stretch;
    gap: 14px;
    padding: 8px 8px max(12px, env(safe-area-inset-bottom));
  }

  .ws-game-play .ws-main {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ws-game-play .screen-play.is-active {
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }

  .ws-game-play .board-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-items: stretch;
    place-items: start stretch;
  }

  .ws-game-play .word-board {
    width: 100%;
    max-width: none;
  }

  .screen-play.is-fullscreen-mode .word-board {
    width: 100%;
    max-width: none;
  }

  .play-word-list {
    width: 100%;
    max-width: none;
    justify-self: stretch;
    max-height: none;
    overflow: visible;
    gap: 7px 14px;
    padding: 8px 2px 18px;
  }

  .screen-play.is-fullscreen-mode .play-word-list {
    width: 100%;
    max-width: none;
  }

  .play-word-list .word-chip {
    font-size: 0.9rem;
    font-weight: var(--weight-title);
  }
}

@media (max-width: 480px) {
  .screen-play.is-waiting .play-session-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .screen-play.is-waiting .print-command span {
    display: none;
  }
}

@media (max-width: 767px) and (orientation: landscape),
  (max-height: 520px) and (max-width: 950px) and (orientation: landscape) {
  .screen-play.is-orientation-paused .mobile-orientation-lock {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 22px;
    background: #172235;
    color: white;
    text-align: center;
  }

  .mobile-orientation-lock div {
    display: grid;
    justify-items: center;
    gap: 10px;
  }

  .mobile-orientation-lock svg,
  .mobile-orientation-lock i {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    color: #f4c34f;
    font-size: 2.3rem;
  }

  .mobile-orientation-lock strong {
    font-size: var(--text-xl);
    font-weight: var(--weight-title);
  }

  .mobile-orientation-lock span {
    color: rgba(255, 255, 255, 0.72);
  }
}

@media (max-width: 370px) {
  .hud-status {
    gap: 8px;
    font-size: var(--text-sm);
  }

  .play-timer {
    font-size: var(--text-sm);
  }

  .hud-icon {
    width: 32px;
    height: 32px;
  }

  .toggle-track {
    width: 36px;
    height: 20px;
  }

  .toggle-track span {
    width: 14px;
    height: 14px;
  }
}

@keyframes countdown-pop {
  0%,
  100% { transform: scale(1); }
  45% { transform: scale(1.08); }
}

/* Home lobby refresh */
.home-lobby-content {
  min-height: 100%;
  display: grid;
  gap: 14px;
  padding: 14px 16px 96px;
}

.home-lobby-content .daily-feature {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.92), transparent 32%),
    linear-gradient(135deg, #e6f5ff 0%, #d9ecff 52%, #eef8ff 100%);
  color: var(--ink);
  padding: 18px;
  border: 1px solid rgba(125, 178, 232, 0.38);
  box-shadow: 0 18px 42px rgba(55, 116, 177, 0.14);
  overflow: hidden;
  position: relative;
}

.home-lobby-content .daily-feature::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--blue), rgba(39, 99, 223, 0.18));
}

.home-lobby-content .daily-trophy {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.72);
  color: var(--blue);
  border: 1px solid rgba(125, 178, 232, 0.34);
}

.home-lobby-content .daily-trophy svg,
.home-lobby-content .daily-trophy i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 1.55rem;
}

.home-lobby-content .daily-body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.home-lobby-content .daily-tag {
  color: var(--blue);
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.home-lobby-content .daily-feature h2 {
  margin: 0;
  color: var(--ink);
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.home-lobby-content .daily-meta {
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: var(--weight-ui);
}

.home-lobby-content .daily-play-cta {
  grid-column: 1 / -1;
  min-height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #ffffff;
  font-size: var(--text-md);
  font-weight: var(--weight-title);
  box-shadow: 0 10px 22px rgba(4, 10, 23, 0.18);
}

.home-lobby-grid {
  display: grid;
  gap: 14px;
}

.home-panel-card,
.home-collections-section {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(209, 216, 229, 0.9);
  box-shadow: 0 12px 30px rgba(34, 40, 59, 0.08);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.home-panel-card h1,
.home-panel-card h2,
.home-collections-section h2 {
  margin: 0;
  color: var(--ink);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.home-panel-card h1 {
  font-size: var(--text-title);
}

.home-panel-card h2,
.home-collections-section h2 {
  font-size: var(--text-xl);
}

.home-panel-card p,
.home-collections-section p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.mode-launch-card {
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 255, 255, 0.96), transparent 34%),
    linear-gradient(145deg, #edf8ff 0%, #dcebff 58%, #f4fbff 100%);
  border-color: rgba(125, 178, 232, 0.34);
}

.mode-launch-card p {
  color: var(--ink-soft);
}

.mode-launch-brand {
  display: grid;
  justify-items: center;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.mode-launch-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(39, 99, 223, 0.16));
}

.mode-launch-card h1 {
  color: var(--ink);
  text-align: center;
}

.home-mode-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.home-game-launcher {
  display: grid;
  gap: 10px;
}

.home-launch-action {
  width: 100%;
  min-height: 76px;
  border-radius: 8px;
  border: 1px solid rgba(39, 99, 223, 0.2);
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 14px 16px;
  text-align: center;
  font: inherit;
  transition: transform 140ms var(--tap), border-color 140ms var(--tap), background 140ms var(--tap), box-shadow 140ms var(--tap);
}

.home-launch-action strong {
  color: inherit;
  font-size: var(--text-lg);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.home-launch-action span {
  color: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  opacity: 0.78;
}

.home-continue-action {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(39, 99, 223, 0.22);
}

.home-new-game-action {
  background: rgba(255, 255, 255, 0.86);
  color: var(--blue);
  cursor: pointer;
}

.home-launch-action:hover,
.home-launch-action:focus-visible {
  transform: translateY(-2px);
}

.home-new-game-action:hover,
.home-new-game-action:focus-visible {
  background: #ffffff;
  border-color: rgba(39, 99, 223, 0.34);
}

.home-game-launcher:not(.has-progress) .home-new-game-action {
  min-height: 92px;
}

.mode-mini-link {
  min-height: 76px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--card-soft, var(--blue-soft)) 0%, rgba(255, 255, 255, 0.94) 100%);
  border: 1px solid var(--card-ring, rgba(39, 99, 223, 0.22));
  color: var(--card-ink, var(--blue));
  padding: 11px;
  display: grid;
  align-content: center;
  gap: 3px;
  transition: transform 140ms var(--tap), background 140ms var(--tap);
}

.mode-mini-link strong {
  font-size: var(--text-md);
  font-weight: var(--weight-title);
}

.mode-mini-link span {
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  line-height: var(--leading-normal);
}

.mode-mini-link:hover {
  transform: translateY(-2px);
  background:
    linear-gradient(135deg, var(--card-soft, var(--blue-soft)) 0%, #ffffff 100%);
}

.home-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mode-stat-card {
  border-radius: 8px;
  background: var(--card-soft, #f3f6fb);
  border: 1px solid rgba(121, 138, 169, 0.18);
  padding: 12px;
  display: grid;
  gap: 3px;
}

.mode-stat-card strong {
  color: var(--card-ink, var(--blue));
  font-size: var(--text-md);
  font-weight: var(--weight-title);
}

.mode-stat-card span {
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.mode-stat-card small {
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
}

.home-topic-row,
.home-collection-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.home-topic-row::-webkit-scrollbar,
.home-collection-strip::-webkit-scrollbar {
  height: 5px;
}

.home-topic-row::-webkit-scrollbar-thumb,
.home-collection-strip::-webkit-scrollbar-thumb {
  background: rgba(143, 152, 168, 0.38);
  border-radius: 999px;
}

.topic-mini,
.collection-chip {
  flex: 0 0 auto;
  border-radius: 8px;
  border: 1px solid rgba(121, 138, 169, 0.16);
  background: var(--card-soft, #f4f7fb);
  color: var(--card-ink, var(--blue));
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
}

.topic-mini {
  padding: 9px 12px;
}

.collection-chip {
  width: 168px;
  min-height: 104px;
  padding: 12px;
  display: grid;
  align-content: space-between;
  gap: 4px;
}

.collection-chip strong {
  color: var(--card-ink, var(--blue));
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.collection-chip span {
  color: var(--ink);
  font-size: var(--text-md);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.collection-chip small {
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
}

/* Share controls */
.share-panel {
  gap: 10px;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(130, 143, 166, 0.22);
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
  cursor: pointer;
  transition: transform 140ms var(--tap), border-color 140ms var(--tap), background 140ms var(--tap);
}

.share-button:hover,
.share-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(47, 107, 232, 0.45);
}

.share-button.is-copied {
  background: #eaf7ef;
  border-color: rgba(26, 145, 80, 0.28);
  color: #15824a;
}

.share-facebook {
  color: #1877f2;
}

.share-whatsapp {
  color: #128c53;
}

.share-native {
  color: #1f63d6;
}

.share-classroom {
  color: #1a8754;
}

.share-teams {
  color: #5357c8;
}

.result-share-actions {
  justify-content: center;
}

/* Create login lock */
.create-auth-alert,
.ai-login-lock {
  border-radius: 8px;
  border: 1px solid rgba(47, 107, 232, 0.22);
  background: rgba(238, 244, 255, 0.84);
  padding: 12px;
  display: grid;
  gap: 7px;
}

.create-auth-alert.is-strong {
  border-color: rgba(216, 71, 86, 0.36);
  background: rgba(255, 238, 240, 0.88);
}

.create-auth-alert strong,
.ai-login-lock strong {
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.create-auth-alert span,
.ai-login-lock span {
  color: var(--ink-soft);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
}

.sync-actions.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seed-mode.is-disabled {
  cursor: not-allowed;
  opacity: 0.62;
  background: #f5f7fb;
}

.seed-mode.is-disabled small {
  color: #d84756;
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
}

.create-ai.is-locked {
  border: 1px solid rgba(47, 107, 232, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(238, 244, 255, 0.76)),
    repeating-linear-gradient(90deg, rgba(47, 107, 232, 0.06) 0 1px, transparent 1px 38px);
  padding: 16px;
  border-radius: 8px;
}

.create-words.is-muted {
  opacity: 0.52;
}

.word-chip.is-placeholder {
  color: rgba(94, 104, 120, 0.68);
  background: rgba(255, 255, 255, 0.72);
  border-style: dashed;
}

.primary-cta[disabled],
.ghost-cta[disabled] {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
}

.offline-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.offline-panel {
  width: min(100%, 520px);
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid;
  gap: 12px;
  justify-items: start;
}

.offline-panel img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.offline-panel h1 {
  margin: 0;
  color: var(--ink);
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.offline-panel p {
  margin: 0;
  color: var(--ink-soft);
  line-height: var(--leading-normal);
}

@media (min-width: 768px) {
  .home-lobby-content {
    padding: 20px 24px 104px;
    gap: 18px;
  }

  .home-lobby-content .daily-feature {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 22px 24px;
  }

  .home-lobby-content .daily-play-cta {
    grid-column: auto;
    min-width: 128px;
    padding: 0 24px;
  }

  .home-lobby-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-panel-card,
  .home-collections-section {
    padding: 18px;
  }
}

@media (min-width: 1024px) {
  .home-mobile-content,
  .home-desktop-content {
    display: none;
  }

  .home-lobby-content {
    height: 100%;
    overflow-y: auto;
    padding: 28px 32px 40px;
    gap: 22px;
    scrollbar-width: thin;
  }

  .home-lobby-content::-webkit-scrollbar {
    width: 7px;
  }

  .home-lobby-content::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(143, 152, 168, 0.34);
  }

  .home-lobby-grid {
    grid-template-columns: minmax(360px, 1.08fr) minmax(300px, 0.92fr);
    align-items: stretch;
  }

  .mode-launch-card {
    grid-row: span 2;
    align-content: space-between;
    min-height: 430px;
    padding: 28px;
  }

  .mode-launch-card h1 {
    max-width: 520px;
    font-size: var(--text-title-tablet);
  }

  .home-mode-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-collections-section {
    padding: 20px;
  }

  .collection-chip {
    width: 190px;
  }
}

@media (min-width: 1380px) {
  .home-lobby-grid {
    grid-template-columns: minmax(460px, 1.15fr) repeat(2, minmax(280px, 0.8fr));
  }

  .mode-launch-card {
    grid-row: span 2;
  }

}

/* Created puzzle studio */
.created-studio-surface .created-studio-main {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

.created-studio-page {
  min-height: 100%;
  padding: 16px 16px 98px;
  display: grid;
  gap: 16px;
}

.created-ready-view {
  display: grid;
  gap: 16px;
}

.created-ready-view[hidden],
.created-revise-section[hidden] {
  display: none;
}

.created-studio-header,
.created-preview-stage,
.created-command-panel,
.created-revise-section {
  border: 1px solid rgba(210, 216, 228, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 36px rgba(28, 38, 60, 0.08);
}

.created-studio-header {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.created-back-link {
  width: max-content;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 0 14px;
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
  cursor: pointer;
}

.created-title-block h1 {
  margin: 4px 0 6px;
  color: var(--ink);
  font-size: clamp(1.75rem, 8vw, 2.6rem);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.created-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.created-title-row h1 {
  margin: 4px 0 6px;
}

.created-private-badge {
  min-height: 48px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--rose-soft);
  color: var(--rose);
  padding: 0 16px;
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.created-private-badge i {
  font-size: 1.1rem;
}

.created-title-block p,
.created-revise-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: var(--weight-ui);
}

.created-code-strip {
  border: 1px dashed rgba(47, 99, 223, 0.32);
  border-radius: 8px;
  background: rgba(244, 248, 255, 0.88);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.created-code-strip > span {
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.created-code-strip strong {
  color: var(--blue);
  font-size: clamp(1.1rem, 5vw, 1.55rem);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
  word-break: break-word;
}

.created-workspace {
  display: grid;
  gap: 16px;
}

.created-preview-stage {
  padding: clamp(16px, 2.4vw, 28px);
}

.created-preview-head {
  margin-bottom: 16px;
}

.created-preview-head h2 {
  font-size: clamp(1.45rem, 4vw, 2.4rem);
}

.created-preview-composition {
  display: grid;
  gap: 16px;
}

.created-solve-preview {
  position: relative;
  width: min(100%, 860px);
  aspect-ratio: var(--create-cols) / var(--create-rows);
  justify-self: center;
  border: 1px solid rgba(100, 111, 130, 0.24);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 18px 46px rgba(21, 30, 45, 0.12);
}

.created-solve-board {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(var(--create-cols), minmax(0, 1fr));
}

.created-solve-board span {
  display: grid;
  place-items: center;
  min-width: 0;
  border: 1px solid rgba(118, 128, 146, 0.13);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-board);
  font-size: clamp(1.2rem, 5.8vw, 2.6rem);
  line-height: 1;
  font-weight: var(--weight-title);
}

.created-solve-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.created-solve-lines .create-solution-line {
  opacity: 0;
  stroke-width: 0.5;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: opacity 180ms var(--tap), stroke-dashoffset 620ms var(--tap);
}

.created-solve-lines .create-solution-line.is-active {
  opacity: 1;
  stroke-dashoffset: 0;
}

.created-play-now-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: min(86%, 760px);
  max-height: 54%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 18px 28px rgba(4, 19, 57, 0.34));
}

.created-play-now-overlay img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.created-word-rail {
  border: 1px solid rgba(218, 223, 234, 0.9);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  padding: 14px;
  min-width: 0;
}

.created-word-list {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.created-word-list span {
  color: var(--ink);
  font-size: clamp(0.86rem, 2.4vw, 1.05rem);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.created-command-panel {
  padding: 16px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.created-command-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.created-command-group .primary-cta,
.created-command-group .ghost-cta {
  width: 100%;
  margin: 0;
}

.created-command-group .primary-cta {
  grid-column: 1 / -1;
}

.created-share-block {
  display: grid;
  gap: 10px;
}

.created-private-note {
  border: 1px solid rgba(244, 181, 45, 0.28);
  border-radius: 8px;
  background: rgba(244, 181, 45, 0.1);
  color: var(--ink);
  padding: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
  line-height: var(--leading-normal);
}

.created-private-note i {
  color: var(--amber);
  margin-top: 2px;
}

.created-share-block h2 {
  margin: 0;
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
}

.created-share-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.created-revise-section {
  padding: clamp(16px, 2.2vw, 24px);
  display: grid;
  gap: 16px;
}

.created-revise-head h2 {
  margin: 4px 0 6px;
  color: var(--ink);
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: var(--leading-tight);
}

.created-revise-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.created-studio-page .created-edit-form.create-layout {
  padding: 0;
}

.created-studio-page .created-edit-form .create-hero-panel,
.created-studio-page .created-edit-form .create-panel {
  margin: 0;
}

.created-studio-page .created-edit-form .create-hero-panel {
  min-height: auto;
}

.created-studio-page .created-edit-form .create-hero-copy {
  display: none;
}

.created-studio-page .created-edit-form .creator-seeds textarea {
  min-height: 190px;
}

.created-studio-page .created-edit-form .create-mode-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.created-studio-page .created-edit-form .difficulty-card {
  min-height: 76px;
  padding: 10px 12px;
  gap: 4px 10px;
}

.created-studio-page .created-edit-form .difficulty-card > span:not(.difficulty-icon) {
  white-space: nowrap;
}

.created-studio-page .created-print-card {
  display: none !important;
}

@media (min-width: 760px) {
  .created-studio-header {
    grid-template-columns: auto minmax(0, 1fr) minmax(260px, 360px);
    align-items: center;
  }

  .created-code-strip {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .created-code-strip > span {
    grid-column: 1 / -1;
  }

  .created-preview-composition {
    grid-template-columns: minmax(0, 4fr) minmax(176px, 1fr);
    align-items: start;
  }

  .created-word-list {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  .created-studio-surface .created-studio-main {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .created-studio-page {
    padding: 28px 32px 42px;
    gap: 22px;
  }

  .created-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 380px);
    align-items: start;
    gap: 22px;
  }

  .created-ready-stage {
    min-width: 0;
  }

  .created-solve-preview {
    width: min(100%, 880px);
  }

  .created-solve-board span {
    font-size: clamp(1.8rem, 2.7vw, 3rem);
  }

  .created-command-panel {
    position: sticky;
    top: 28px;
  }

  .created-studio-page .created-edit-form.create-layout {
    display: grid;
    grid-template-columns: minmax(360px, 0.82fr) minmax(0, 1.18fr);
    gap: 18px;
  }

  .created-studio-page .created-edit-form .create-preview-panel {
    grid-column: 2;
    grid-row: 1 / span 2;
    position: static;
  }
}

@media (min-width: 1440px) {
  .created-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  }

  .created-solve-preview {
    width: min(100%, 980px);
  }
}

/* Phase I shell refinements */
html[data-theme="dark"] body,
html[data-theme="dark"] .ws-game,
html[data-theme="dark"] .offline-page,
html[data-theme="dark"] .print-page {
  background: var(--bg);
  color: var(--ink);
}

html[data-theme="dark"] .ws-game {
  background: linear-gradient(180deg, #101827 0%, #172033 100%);
}

html[data-theme="dark"] .ws-surface,
html[data-theme="dark"] .home-panel-card,
html[data-theme="dark"] .home-collections-section,
html[data-theme="dark"] .bottom-sheet,
html[data-theme="dark"] .offline-panel,
html[data-theme="dark"] .create-panel,
html[data-theme="dark"] .create-hero-panel,
html[data-theme="dark"] .created-command-panel,
html[data-theme="dark"] .created-preview-card,
html[data-theme="dark"] .admin-card {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

html[data-theme="dark"] .ws-topbar,
html[data-theme="dark"] .bottom-nav {
  background: rgba(24, 33, 51, 0.88);
  border-color: var(--line);
}

html[data-theme="dark"] .counter-pill,
html[data-theme="dark"] .home-panel-card,
html[data-theme="dark"] .home-collections-section,
html[data-theme="dark"] .word-chip,
html[data-theme="dark"] .difficulty-card,
html[data-theme="dark"] .seed-mode,
html[data-theme="dark"] .account-field input,
html[data-theme="dark"] .account-field select,
html[data-theme="dark"] .account-field textarea,
html[data-theme="dark"] .admin-filter-bar select {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
  color: var(--ink);
}

html[data-theme="dark"] .play-cell {
  background: #22304a;
  color: var(--ink);
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .word-board,
html[data-theme="dark"] .play-overlay-card,
html[data-theme="dark"] .countdown-card,
html[data-theme="dark"] .leaderboard-card,
html[data-theme="dark"] .complete-actions-card {
  background: rgba(24, 33, 51, 0.96);
  border-color: var(--line);
  color: var(--ink);
}

html[data-theme="dark"] .result-modal {
  background: rgba(9, 14, 24, 0.68);
}

html[data-theme="dark"] .celebration-card,
html[data-theme="dark"] .scoreboard-name-box,
html[data-theme="dark"] .result-side-panel {
  background:
    radial-gradient(circle at 20% 14%, rgba(240, 191, 91, 0.14), transparent 30%),
    radial-gradient(circle at 84% 20%, rgba(117, 168, 255, 0.12), transparent 26%),
    var(--surface);
  border-color: var(--line);
}

html[data-theme="dark"] .result-card h2,
html[data-theme="dark"] .result-grid strong {
  color: var(--ink);
  text-shadow: none;
}

html[data-theme="dark"] .result-grid span {
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .scoreboard-name-box input {
  background: #111827;
  border-color: var(--line-strong);
  color: var(--ink);
}

html[data-theme="dark"] .primary-cta,
html[data-theme="dark"] .resume-start-button {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 13px 24px rgba(37, 99, 235, 0.22);
}

html[data-theme="dark"] .danger-cta {
  background: #be123c;
  color: #ffffff;
  box-shadow: 0 13px 24px rgba(190, 18, 60, 0.24);
}

html[data-theme="dark"] .print-command,
html[data-theme="dark"] .play-start-button {
  background: #047857;
  color: #ffffff;
  box-shadow: 0 13px 24px rgba(4, 120, 87, 0.24);
}

html[data-theme="dark"] .facts-command {
  background: #b7791f;
  color: #ffffff;
  box-shadow: 0 13px 24px rgba(183, 121, 31, 0.22);
}

html[data-theme="dark"] .facts-command-badge {
  border-color: #111827;
  background: #2f6be8;
}

html[data-theme="dark"] .play-facts-trigger {
  background:
    linear-gradient(135deg, rgba(240, 191, 91, 0.2), rgba(255, 255, 255, 0.06));
  border-color: rgba(240, 191, 91, 0.32);
  color: #ffe3a3;
  box-shadow: 0 13px 24px rgba(240, 191, 91, 0.12);
}

html[data-theme="dark"] .play-facts-trigger i {
  color: #f0bf5b;
}

html[data-theme="dark"] .play-facts-badge {
  border-color: #1c2435;
}

html[data-theme="dark"] .play-facts-backdrop {
  background: rgba(3, 7, 18, 0.72);
}

html[data-theme="dark"] .play-facts-card {
  background:
    radial-gradient(circle at 12% 10%, rgba(240, 191, 91, 0.14), transparent 34%),
    var(--surface);
  border-color: rgba(240, 191, 91, 0.22);
  color: var(--ink);
}

html[data-theme="dark"] .play-fact-slide p {
  color: var(--ink);
}

html[data-theme="dark"] .mode-launch-brand {
  justify-items: center;
  text-align: center;
}

.mode-launch-brand {
  justify-items: center;
  text-align: center;
}

/* Dark mode route coverage */
html[data-theme="dark"] .theme-toggle-cta {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line);
  color: var(--gold);
  box-shadow: none;
}

html[data-theme="dark"] .create-preview-overlay {
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(0.72);
  backdrop-filter: blur(16px) saturate(0.72);
}

html[data-theme="dark"] .route-back-link {
  color: var(--ink);
}

html[data-theme="dark"] .route-back-link i {
  background: var(--blue-soft);
}

html[data-theme="dark"] .screen-route,
html[data-theme="dark"] .create-studio,
html[data-theme="dark"] .explore-step-page,
html[data-theme="dark"] .category-step-page,
html[data-theme="dark"] .profile-dashboard {
  background:
    linear-gradient(180deg, rgba(117, 168, 255, 0.05), rgba(78, 209, 157, 0.025) 44%, transparent 78%),
    var(--bg);
}

html[data-theme="dark"] .create-hero-panel,
html[data-theme="dark"] .create-panel,
html[data-theme="dark"] .create-preview-dialog,
html[data-theme="dark"] .create-ai-primary,
html[data-theme="dark"] .create-ai-resume,
html[data-theme="dark"] .create-word-counter,
html[data-theme="dark"] .create-ai-draft-summary,
html[data-theme="dark"] .create-fact-card,
html[data-theme="dark"] .create-private-toggle,
html[data-theme="dark"] .create-preview-empty,
html[data-theme="dark"] .creator-preview,
html[data-theme="dark"] .topic-menu,
html[data-theme="dark"] .category-search-panel,
html[data-theme="dark"] .category-result,
html[data-theme="dark"] .category-tile,
html[data-theme="dark"] .explore-topic-card,
html[data-theme="dark"] .collection-card,
html[data-theme="dark"] .list-card,
html[data-theme="dark"] .explore-hero-panel,
html[data-theme="dark"] .explore-steps article,
html[data-theme="dark"] .category-detail-hero,
html[data-theme="dark"] .category-puzzle-section,
html[data-theme="dark"] .category-puzzle-card,
html[data-theme="dark"] .ws-puzzle-card,
html[data-theme="dark"] .profile-rank-card,
html[data-theme="dark"] .profile-more-links a,
html[data-theme="dark"] .profile-more-link,
html[data-theme="dark"] .legal-stack article,
html[data-theme="dark"] .legal-back-link,
html[data-theme="dark"] .create-busy-panel,
html[data-theme="dark"] .profile-hero-card,
html[data-theme="dark"] .profile-created-section,
html[data-theme="dark"] .profile-empty-created,
html[data-theme="dark"] .profile-created-card,
html[data-theme="dark"] .profile-progress-strip article,
html[data-theme="dark"] .profile-form-sheet,
html[data-theme="dark"] .sync-panel {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: 0 14px 32px rgba(2, 6, 14, 0.28);
}

html[data-theme="dark"] .create-ai-resume-actions .ghost-cta.compact {
  background: rgba(117, 168, 255, 0.13);
  border-color: rgba(117, 168, 255, 0.26);
  color: var(--blue-light);
}

html[data-theme="dark"] .create-ai-resume-actions .create-start-over {
  background: rgba(143, 162, 210, 0.12);
  border-color: rgba(143, 162, 210, 0.24);
  color: var(--ink-soft);
}

html[data-theme="dark"] .create-hero-panel,
html[data-theme="dark"] .explore-hero-panel,
html[data-theme="dark"] .profile-hero-card,
html[data-theme="dark"] .profile-created-section,
html[data-theme="dark"] .profile-empty-created {
  background:
    linear-gradient(115deg, rgba(117, 168, 255, 0.12), transparent 46%),
    var(--surface);
}

html[data-theme="dark"] .legal-page {
  background:
    linear-gradient(180deg, rgba(117, 168, 255, 0.08), rgba(29, 185, 125, 0.035) 42%, transparent 78%);
}

html[data-theme="dark"] .profile-delete-note {
  background: rgba(255, 122, 122, 0.09);
  border-color: rgba(255, 122, 122, 0.24);
}

html[data-theme="dark"] .creator-prompt input,
html[data-theme="dark"] .creator-prompt textarea,
html[data-theme="dark"] .creator-seeds textarea,
html[data-theme="dark"] .topic-input textarea,
html[data-theme="dark"] .topic-picker-button,
html[data-theme="dark"] .create-title-editor input,
html[data-theme="dark"] .create-description-editor textarea,
html[data-theme="dark"] .edit-code-box input,
html[data-theme="dark"] .category-search-box input,
html[data-theme="dark"] .created-code-strip,
html[data-theme="dark"] .profile-created-meta span,
html[data-theme="dark"] .ws-puzzle-meta span,
html[data-theme="dark"] .ws-puzzle-actions .ghost-cta,
html[data-theme="dark"] .profile-created-actions .ghost-cta {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-strong);
  color: var(--ink);
  box-shadow: none;
}

html[data-theme="dark"] .create-layout.is-busy input:not([type="hidden"]),
html[data-theme="dark"] .create-layout.is-busy textarea,
html[data-theme="dark"] .create-layout.is-busy select {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .create-word-rules-trigger {
  background: rgba(117, 168, 255, 0.13);
  border-color: rgba(117, 168, 255, 0.26);
  color: var(--blue-light);
}

html[data-theme="dark"] .creator-seeds.is-invalid textarea {
  background: rgba(255, 122, 122, 0.08);
  border-color: rgba(255, 122, 122, 0.38);
  box-shadow: 0 0 0 3px rgba(255, 122, 122, 0.08);
}

html[data-theme="dark"] .creator-seeds.has-guidance textarea {
  border-color: rgba(117, 168, 255, 0.28);
  box-shadow: 0 0 0 3px rgba(117, 168, 255, 0.07);
}

html[data-theme="dark"] .create-word-rules-list div {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

html[data-theme="dark"] .create-preview-board-wrap,
html[data-theme="dark"] .profile-created-thumb,
html[data-theme="dark"] .ws-puzzle-thumb,
html[data-theme="dark"] .created-solve-preview {
  background: #111827;
  border-color: var(--line);
  box-shadow: none;
}

html[data-theme="dark"] .mini-cell,
html[data-theme="dark"] .create-preview-board span,
html[data-theme="dark"] .created-solve-board span {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

html[data-theme="dark"] .difficulty-card.is-selected {
  background: rgba(112, 163, 255, 0.16);
  border-color: rgba(112, 163, 255, 0.62);
}

html[data-theme="dark"] .difficulty-card strong,
html[data-theme="dark"] .ws-puzzle-title h3,
html[data-theme="dark"] .profile-rank-card strong,
html[data-theme="dark"] .create-busy-panel strong {
  color: var(--ink);
}

html[data-theme="dark"] .difficulty-card > span:not(.difficulty-icon),
html[data-theme="dark"] .ws-puzzle-body p,
html[data-theme="dark"] .profile-rank-card small,
html[data-theme="dark"] .create-busy-panel p {
  color: var(--ink-soft);
}

html[data-theme="dark"] .category-tile {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--surface);
}

html[data-theme="dark"] .category-result:hover,
html[data-theme="dark"] .topic-menu-item:hover,
html[data-theme="dark"] .topic-menu-item:focus-visible {
  background: var(--blue-soft);
}

html[data-theme="dark"] .profile-avatar-wrap {
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .private-mini-badge {
  background: rgba(240, 191, 91, 0.9);
  color: #111827;
}

html[data-theme="dark"] .admin-shell {
  background: var(--bg);
  color: var(--ink);
}

html[data-theme="dark"] .admin-sidebar,
html[data-theme="dark"] .admin-panel,
html[data-theme="dark"] .admin-form-panel,
html[data-theme="dark"] .admin-command-bar,
html[data-theme="dark"] .admin-filter-bar,
html[data-theme="dark"] .admin-source-legend,
html[data-theme="dark"] .admin-jobs-hero,
html[data-theme="dark"] .admin-user-chip,
html[data-theme="dark"] .admin-sidebar-close,
html[data-theme="dark"] .admin-menu-toggle,
html[data-theme="dark"] .admin-metric,
html[data-theme="dark"] .admin-status-grid div,
html[data-theme="dark"] .admin-coverage-card,
html[data-theme="dark"] .secondary-cta {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: 0 14px 32px rgba(2, 6, 14, 0.24);
}

html[data-theme="dark"] .admin-source-chip.is-user_guest,
html[data-theme="dark"] .admin-source-badge.is-user_guest {
  background: rgba(151, 128, 255, 0.18);
  border-color: rgba(151, 128, 255, 0.32);
  color: #b8a8ff;
}

html[data-theme="dark"] .admin-source-chip.is-bot,
html[data-theme="dark"] .admin-source-badge.is-bot {
  background: rgba(255, 107, 129, 0.16);
  border-color: rgba(255, 107, 129, 0.34);
  color: #ff8fa3;
}

html[data-theme="dark"] .admin-origin-chip.is-pwa {
  background: rgba(60, 210, 146, 0.16);
  border-color: rgba(60, 210, 146, 0.34);
  color: #65e0ad;
}

html[data-theme="dark"] .admin-origin-chip.is-browser,
html[data-theme="dark"] .admin-loading-inline {
  background: rgba(112, 163, 255, 0.16);
  border-color: rgba(112, 163, 255, 0.34);
  color: #8db6ff;
}

html[data-theme="dark"] .admin-menu a {
  color: var(--ink-soft);
}

html[data-theme="dark"] .admin-menu a.is-active,
html[data-theme="dark"] .admin-menu a:hover {
  background: var(--amber-soft);
  color: var(--gold);
}

html[data-theme="dark"] .admin-filter-bar input,
html[data-theme="dark"] .admin-filter-bar select,
html[data-theme="dark"] .admin-filter-bar textarea,
html[data-theme="dark"] .account-field input,
html[data-theme="dark"] .account-field select,
html[data-theme="dark"] .account-field textarea,
html[data-theme="dark"] .admin-form-panel input,
html[data-theme="dark"] .admin-form-panel select,
html[data-theme="dark"] .admin-form-panel textarea {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-strong);
  color: var(--ink);
}

html[data-theme="dark"] .admin-filter-bar select option,
html[data-theme="dark"] .account-field select option,
html[data-theme="dark"] .admin-form-panel select option {
  background: #182133;
  color: #edf4ff;
}

html[data-theme="dark"] .admin-topic-combo-shell > button[aria-label] {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

html[data-theme="dark"] .admin-topic-menu {
  background: #182133;
  border-color: var(--line-strong);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

html[data-theme="dark"] .admin-topic-menu button {
  color: var(--ink);
}

html[data-theme="dark"] .admin-topic-menu button:hover,
html[data-theme="dark"] .admin-topic-menu button:focus-visible {
  background: rgba(112, 163, 255, 0.16);
  color: #9fc1ff;
}

html[data-theme="dark"] .admin-modal,
html[data-theme="dark"] .admin-modal-head,
html[data-theme="dark"] .admin-modal > .admin-form-actions,
html[data-theme="dark"] .admin-modal .admin-editor-form .admin-form-actions,
html[data-theme="dark"] .admin-editor-preview,
html[data-theme="dark"] .admin-topic-form,
html[data-theme="dark"] .admin-topic-card,
html[data-theme="dark"] .harke-setting-card,
html[data-theme="dark"] .harke-market-card,
html[data-theme="dark"] .harke-signal-row {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: 0 14px 32px rgba(2, 6, 14, 0.26);
}

html[data-theme="dark"] .admin-modal-head {
  background: rgba(24, 33, 51, 0.96);
}

html[data-theme="dark"] .admin-modal .admin-editor-form .admin-form-actions {
  background: rgba(24, 33, 51, 0.98);
}

html[data-theme="dark"] .admin-modal-backdrop {
  background: rgba(2, 6, 14, 0.62);
}

html[data-theme="dark"] .admin-icon-button,
html[data-theme="dark"] .admin-row-actions a,
html[data-theme="dark"] .admin-row-actions button,
html[data-theme="dark"] .admin-inline-form button,
html[data-theme="dark"] .admin-topic-row button,
html[data-theme="dark"] .admin-topic-delete button,
html[data-theme="dark"] .admin-pagination a,
html[data-theme="dark"] .admin-pagination button {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
  color: var(--ink);
}

html[data-theme="dark"] .harke-card-foot {
  border-color: var(--line);
}

html[data-theme="dark"] .harke-signal-row span {
  background: rgba(112, 163, 255, 0.18);
  color: #8db6ff;
}

html[data-theme="dark"] .harke-tab-list {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

html[data-theme="dark"] .harke-tab-button {
  color: var(--ink-soft);
}

html[data-theme="dark"] .harke-tab-button small {
  background: rgba(117, 168, 255, 0.16);
  color: var(--blue-light);
}

html[data-theme="dark"] .harke-tab-button:hover,
html[data-theme="dark"] .harke-tab-button:focus-visible {
  background: rgba(117, 168, 255, 0.12);
  border-color: rgba(117, 168, 255, 0.22);
  color: var(--ink);
}

html[data-theme="dark"] .harke-tab-button.is-active {
  background: #2f6be8;
  color: #ffffff;
}

html[data-theme="dark"] .harke-tab-button.is-active small {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

html[data-theme="dark"] .harke-market-total {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
  color: var(--ink-soft);
}

html[data-theme="dark"] .harke-market-total.is-balanced {
  background: rgba(50, 211, 147, 0.12);
  border-color: rgba(50, 211, 147, 0.22);
  color: #72e0b6;
}

html[data-theme="dark"] .harke-market-total.is-warning {
  background: rgba(244, 181, 45, 0.12);
  border-color: rgba(244, 181, 45, 0.28);
  color: #f7c861;
}

html[data-theme="dark"] .harke-market-table input[type="text"],
html[data-theme="dark"] .harke-market-table input[type="number"] {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-strong);
  color: var(--ink);
}

html[data-theme="dark"] .harke-share-meter {
  background: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .admin-icon-button:hover,
html[data-theme="dark"] .admin-row-actions a:hover,
html[data-theme="dark"] .admin-row-actions button:hover,
html[data-theme="dark"] .admin-pagination a:hover,
html[data-theme="dark"] .admin-pagination button:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

html[data-theme="dark"] .admin-board-preview span {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

html[data-theme="dark"] .admin-word-bank span {
  background: var(--blue-soft);
  color: #9fc1ff;
}

html[data-theme="dark"] .admin-table th,
html[data-theme="dark"] .admin-table td {
  border-color: var(--line);
}

html[data-theme="dark"] .admin-table th {
  color: var(--ink-soft);
}

html[data-theme="dark"] .admin-table tr.has-api-error td {
  background: rgba(255, 107, 129, 0.08);
}

@media (max-width: 560px) {
  html[data-theme="dark"] .admin-responsive-table tr {
    background: var(--surface);
    border-color: var(--line);
  }
}

html[data-theme="dark"] .admin-heartbeat,
html[data-theme="dark"] .admin-heartbeat.is-quiet {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

html[data-theme="dark"] .admin-heartbeat.is-stale {
  background: var(--amber-soft);
}

/* Play board color and fit fixes */
.ws-game-play {
  --play-page-bg: #f7f8fb;
  --play-panel-bg: rgba(255, 255, 255, 0.94);
  --play-panel-border: rgba(57, 66, 82, 0.12);
  --play-text: #2b303a;
  --play-text-muted: #687386;
  --play-board-bg: #ffffff;
  --play-board-border: rgba(58, 64, 76, 0.14);
  --play-board-line: rgba(58, 64, 76, 0.07);
  --play-board-letter: #222a39;
  --play-board-found-letter: #1c2635;
  --play-board-drag-letter: #2763df;
  --play-word-panel-bg: transparent;
  --play-word-chip-bg: rgba(32, 40, 58, 0.07);
  --play-word-chip-border: rgba(32, 40, 58, 0.08);
  --play-word-text: #20283a;
  --play-word-done: #6d7482;
  --play-fullscreen-icon-bg: rgba(32, 40, 58, 0.08);
  --play-fullscreen-icon-text: #20283a;
  --play-fullscreen-icon-hover-bg: rgba(47, 107, 232, 0.14);
  --play-fullscreen-icon-hover-text: #1f56c7;
  --play-board-shadow: 0 18px 34px rgba(31, 36, 51, 0.09);
}

html[data-theme="dark"] .ws-game-play {
  --play-page-bg: #0f1726;
  --play-panel-bg: rgba(20, 29, 45, 0.96);
  --play-panel-border: rgba(126, 144, 171, 0.2);
  --play-text: #f4f7fb;
  --play-text-muted: #a9b5c8;
  --play-board-bg: #17243a;
  --play-board-border: rgba(150, 170, 202, 0.22);
  --play-board-line: rgba(255, 255, 255, 0.06);
  --play-board-letter: #f7fbff;
  --play-board-found-letter: #ffffff;
  --play-board-drag-letter: #91bdff;
  --play-word-panel-bg: transparent;
  --play-word-chip-bg: rgba(255, 255, 255, 0.075);
  --play-word-chip-border: rgba(255, 255, 255, 0.06);
  --play-word-text: #edf4ff;
  --play-word-done: #93a0b4;
  --play-fullscreen-icon-bg: rgba(255, 255, 255, 0.1);
  --play-fullscreen-icon-text: #f4f7fb;
  --play-fullscreen-icon-hover-bg: rgba(145, 189, 255, 0.18);
  --play-fullscreen-icon-hover-text: #91bdff;
  --play-board-shadow: 0 22px 44px rgba(2, 6, 14, 0.34);
}

.ws-game-play,
.ws-game-play .ws-surface,
.ws-game-play .ws-main,
.ws-game-play .screen-play.is-active,
.ws-game-play .play-stage {
  background: var(--play-page-bg);
  color: var(--play-text);
}

.ws-game-play .play-session-topbar,
.ws-game-play .play-session-meta,
.ws-game-play .play-hud {
  background: var(--play-panel-bg);
  border-color: var(--play-panel-border);
  color: var(--play-text);
}

.ws-game-play .top-score,
.ws-game-play .hud-status,
.ws-game-play .sound-toggle,
.ws-game-play .hud-icon,
.ws-game-play .play-timer {
  color: var(--play-text);
}

.ws-game-play .fullscreen-icon {
  background: var(--play-fullscreen-icon-bg);
  color: var(--play-fullscreen-icon-text);
}

.ws-game-play .fullscreen-icon:hover,
.ws-game-play .fullscreen-icon:focus-visible {
  background: var(--play-fullscreen-icon-hover-bg);
  color: var(--play-fullscreen-icon-hover-text);
}

.ws-game-play .top-score span,
.ws-game-play .top-score strong {
  color: inherit;
}

html[data-theme="dark"] .ws-game-play .play-difficulty-chip {
  border-color: rgba(145, 189, 255, 0.22);
  background: rgba(145, 189, 255, 0.12);
  color: #b7d2ff;
}

html[data-theme="dark"] .ws-game-play .play-progress-rail {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(145, 189, 255, 0.1);
}

.ws-game-play .word-board {
  background: var(--play-board-bg);
  border-color: var(--play-board-border);
  box-shadow:
    var(--play-board-shadow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.62);
}

.ws-game-play .play-cell {
  color: var(--play-board-letter);
  box-shadow: inset 0 0 0 1px var(--play-board-line);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
}

.ws-game-play .selection-layer {
  z-index: 2;
  overflow: visible;
}

.ws-game-play .selection-line {
  opacity: 0.58;
  filter: none;
}

.ws-game-play .play-cell.is-dragging,
.ws-game-play .play-cell.is-selected {
  color: var(--play-board-letter);
  transform: none;
}

.ws-game-play .play-cell.is-found {
  background: transparent;
  color: var(--play-board-letter);
}

html[data-theme="dark"] .ws-game-play .play-cell,
html[data-theme="dark"] .ws-game-play .play-cell.is-dragging,
html[data-theme="dark"] .ws-game-play .play-cell.is-selected,
html[data-theme="dark"] .ws-game-play .play-cell.is-found {
  background: transparent;
}

.ws-game-play .play-word-list {
  background: var(--play-word-panel-bg);
  color: var(--play-word-text);
  align-self: start;
  height: auto;
  min-height: 0;
}

.ws-game-play .play-word-list .word-chip {
  min-height: 30px;
  border: 1px solid var(--play-word-chip-border);
  border-radius: 6px;
  background: var(--play-word-chip-bg);
  color: var(--play-word-text);
  opacity: 1;
  padding: 3px 8px;
  text-shadow: none;
}

.ws-game-play .play-word-list .word-chip.is-done {
  background: transparent;
  color: var(--play-word-done);
}

html[data-theme="dark"] .ws-game-play .word-board {
  box-shadow:
    var(--play-board-shadow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .ws-game-play .play-cell {
  text-shadow: 0 1px 0 rgba(2, 6, 14, 0.18);
}

.play-ad-slot {
  min-height: 88px;
  width: 100%;
  border-radius: 8px;
  border: 1px dashed rgba(126, 144, 171, 0.24);
  background: rgba(126, 144, 171, 0.06);
  color: var(--play-text-muted);
}

.play-ad-slot[hidden] {
  display: none !important;
}

@media (min-width: 1024px) {
  .ws-game-play .play-stage {
    grid-template-columns: minmax(0, 3.5fr) minmax(280px, 0.92fr);
  }

  .ws-game-play .play-word-list {
    max-height: none;
    height: min(100%, calc(100svh - 124px));
    gap: 6px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 12px;
    border: 1px solid rgba(57, 66, 82, 0.1);
    border-radius: 8px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(241, 245, 250, 0.82));
    box-shadow: 0 16px 34px rgba(31, 36, 51, 0.07);
  }

  .ws-game-play .play-word-list .word-chip {
    min-height: 36px;
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid rgba(57, 66, 82, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow:
      inset 4px 0 0 rgba(39, 99, 223, 0.28),
      0 8px 18px rgba(31, 36, 51, 0.045);
    padding: 4px 10px 4px 12px;
    color: var(--play-word-text);
    font-size: clamp(0.98rem, 1.08vw, 1.18rem);
    line-height: 1.08;
    overflow-wrap: normal;
    white-space: nowrap;
  }

  .ws-game-play .play-word-list .word-chip::after {
    content: "";
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(39, 99, 223, 0.2);
    box-shadow: 0 0 0 4px rgba(39, 99, 223, 0.08);
  }

  .ws-game-play .play-word-list .word-chip.is-done {
    box-shadow:
      inset 4px 0 0 var(--wc-line, rgba(38, 198, 122, 0.8)),
      0 8px 18px rgba(31, 36, 51, 0.035);
  }

  .ws-game-play .play-word-list .word-chip.is-done::after {
    background: var(--wc-line, rgba(38, 198, 122, 0.8));
    box-shadow: 0 0 0 4px rgba(38, 198, 122, 0.12);
  }

  html[data-theme="dark"] .ws-game-play .play-word-list {
    border-color: rgba(150, 170, 202, 0.12);
    background:
      linear-gradient(180deg, rgba(25, 36, 56, 0.92), rgba(17, 27, 44, 0.9));
    box-shadow: 0 18px 38px rgba(2, 6, 14, 0.22);
  }

  html[data-theme="dark"] .ws-game-play .play-word-list .word-chip {
    border-color: rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.065);
    box-shadow:
      inset 4px 0 0 rgba(117, 168, 255, 0.32),
      0 8px 18px rgba(2, 6, 14, 0.14);
  }

  .ws-game-play .play-ad-slot:not([hidden]) {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
  }
}

@media (min-width: 1440px) {
  .ws-game-play .play-stage {
    grid-template-columns: minmax(0, 3.6fr) minmax(300px, 0.82fr);
  }
}

@media (max-width: 767px) {
  .ws-game-play .ws-main {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ws-game-play .screen-play.is-active {
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }

  .ws-game-play .play-stage {
    max-width: 100vw;
    overflow: visible;
    justify-items: stretch;
    align-content: start;
    padding-inline: 8px;
  }

  .ws-game-play .board-wrap {
    justify-items: stretch;
    place-items: start stretch;
  }

  .ws-game-play .word-board,
  .ws-game-play .screen-play.is-fullscreen-mode .word-board {
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }

  .ws-game-play .play-cell {
    font-size: clamp(0.94rem, calc((100vw - 20px) / var(--grid-cols) * 0.66), 1.45rem);
  }

  .ws-game-play .play-word-list,
  .ws-game-play .screen-play.is-fullscreen-mode .play-word-list {
    width: 100%;
    max-width: none;
    justify-self: stretch;
    max-height: none;
    overflow: visible;
    padding: 8px 0 10px;
    gap: 6px;
  }

  .ws-game-play .play-word-list .word-chip {
    min-height: 30px;
    flex: 0 0 auto;
    padding-inline: 8px;
  }

  .ws-game-play .play-ad-slot:not([hidden]) {
    min-height: 96px;
    margin-top: 2px;
  }
}

/* Mobile completion modal fit */
@media (max-width: 767px) {
  .ws-game-play .play-start-overlay,
  .ws-game-play .play-countdown-overlay,
  .ws-game-play .play-pause-overlay,
  .ws-game-play .play-leave-overlay,
  .ws-game-play .howto-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    place-items: center;
    padding: 14px;
  }

  .ws-game-play .play-start-overlay > .play-overlay-card,
  .ws-game-play .play-countdown-overlay > .countdown-card,
  .ws-game-play .play-pause-overlay > .play-overlay-card,
  .ws-game-play .play-leave-overlay > .play-overlay-card,
  .ws-game-play .howto-overlay > .play-overlay-card {
    grid-column: 1;
    grid-row: 1;
  }

  .ws-game-play .result-modal {
    left: 0;
    top: var(--play-popup-top, 0px);
    width: 100vw;
    height: calc(100dvh - var(--play-popup-top, 0px));
    padding: 0 10px max(10px, env(safe-area-inset-bottom));
    align-items: stretch;
    justify-items: stretch;
    overflow: hidden;
  }

  .ws-game-play .result-shell {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    align-self: stretch;
    justify-self: stretch;
    overflow: hidden;
  }

  .ws-game-play .result-main-card {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 8px;
    padding: 12px 18px max(18px, env(safe-area-inset-bottom));
    display: grid;
    align-content: start;
    justify-items: stretch;
    gap: 12px;
  }

  .ws-game-play .celebration-card::before {
    inset: 10px;
    border-radius: 8px;
  }

  .ws-game-play .result-stars {
    gap: 8px;
    margin-bottom: 2px;
  }

  .ws-game-play .result-stars span {
    width: 40px;
    height: 40px;
  }

  .ws-game-play .result-card h2 {
    font-size: clamp(2rem, 8.5vw, 2.85rem);
  }

  .ws-game-play .result-card p {
    margin: 0;
    font-size: var(--text-sm);
  }

  .ws-game-play .result-grid {
    gap: 10px;
    margin: 4px 0;
  }

  .ws-game-play .result-grid span {
    padding: 10px;
  }

  .ws-game-play .result-share-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .ws-game-play .result-share-actions .share-button {
    width: 100%;
    min-height: 42px;
    padding: 0 8px;
    border-radius: 8px;
  }

  .ws-game-play .result-share-actions .share-copy {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(100%, 164px);
  }

  .ws-game-play .result-actions {
    gap: 10px;
    margin-top: 2px;
  }

  .ws-game-play .result-actions .primary-cta,
  .ws-game-play .result-actions .outline-cta,
  .ws-game-play .result-actions .danger-cta {
    min-height: 54px;
    padding-inline: 10px;
    font-size: clamp(1rem, 4.5vw, 1.25rem);
  }

  .ws-game-play .result-secondary-actions {
    margin-top: 0;
  }

  .ws-game-play .result-secondary-actions .ghost-cta {
    min-height: 38px;
  }

  .ws-game-play .scoreboard-name-box {
    margin: 2px 0;
    border-radius: 8px;
    padding: 12px;
    gap: 8px;
  }
}

@media (max-width: 380px) {
  .ws-game-play .result-main-card {
    padding-inline: 14px;
    gap: 10px;
  }

  .ws-game-play .result-stars span {
    width: 34px;
    height: 34px;
  }

  .ws-game-play .result-card h2 {
    font-size: clamp(1.75rem, 8.4vw, 2.35rem);
  }

  .ws-game-play .result-actions {
    grid-template-columns: 1fr;
  }
}

/* Dark completion buttons */
html[data-theme="dark"] .share-button {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  box-shadow: none;
}

html[data-theme="dark"] .share-button:hover,
html[data-theme="dark"] .share-button:focus-visible {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(117, 168, 255, 0.35);
}

html[data-theme="dark"] .share-facebook {
  color: #8bb9ff;
}

html[data-theme="dark"] .share-whatsapp {
  color: #66d8a4;
}

html[data-theme="dark"] .share-native {
  color: #8bb9ff;
}

html[data-theme="dark"] .share-classroom {
  color: #7fd9a9;
}

html[data-theme="dark"] .share-teams {
  color: #b9a4ff;
}

html[data-theme="dark"] .share-button.is-copied {
  background: rgba(78, 209, 157, 0.14);
  border-color: rgba(78, 209, 157, 0.28);
  color: #79e3b1;
}

html[data-theme="dark"] .outline-cta,
html[data-theme="dark"] .result-secondary-actions .ghost-cta {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--ink);
}

html[data-theme="dark"] .outline-cta:hover,
html[data-theme="dark"] .outline-cta:focus-visible,
html[data-theme="dark"] .result-secondary-actions .ghost-cta:hover,
html[data-theme="dark"] .result-secondary-actions .ghost-cta:focus-visible {
  background: rgba(117, 168, 255, 0.14);
  border-color: rgba(117, 168, 255, 0.32);
  color: #dce9ff;
}

html[data-theme="dark"] .share-copy:disabled,
html[data-theme="dark"] .share-button[disabled] {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(237, 244, 255, 0.42);
}

/* Play/detail/profile polish */
.title-home-link {
  width: auto;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.title-home-link span {
  display: inline-block;
}

.play-title-strip h1 {
  flex: 1 1 auto;
  max-width: none;
  font-size: clamp(1.25rem, 3vw, 2.25rem);
}

.ws-game-play .play-start-overlay {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  padding: clamp(12px, 2.4vw, 28px);
}

.ws-game-play .play-start-overlay > .play-overlay-card {
  grid-column: 1;
  grid-row: 1;
  width: min(94vw, 380px);
  min-height: 0;
  max-height: none;
  overflow: visible;
  gap: 12px;
  padding: clamp(18px, 2.2vw, 28px);
  border-radius: 8px;
}

.ws-game-play .play-start-overlay .overlay-kicker {
  font-size: var(--text-2xs);
  line-height: var(--leading-tight);
}

.ws-game-play .play-start-overlay h2 {
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  line-height: var(--leading-tight);
}

.ws-game-play .play-start-overlay p {
  max-width: 290px;
  margin: -4px 0 0;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.ws-game-play .play-start-overlay .play-start-button,
.ws-game-play .play-start-overlay .resume-start-button {
  min-width: min(100%, 210px);
}

.detail-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.detail-hero-actions .primary-cta,
.detail-hero-actions .ghost-cta {
  margin: 0;
}

.detail-download-panel {
  display: grid;
  gap: 16px;
}

.detail-download-head {
  display: grid;
  gap: 4px;
}

.detail-download-head h2 {
  margin-bottom: 0;
}

.detail-download-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-download-button {
  min-height: 82px;
  border: 1px solid rgba(121, 138, 169, 0.2);
  border-radius: 8px;
  background: rgba(247, 249, 255, 0.92);
  color: var(--ink);
  padding: 14px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.detail-download-button i {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(47, 107, 232, 0.1);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-size: var(--text-lg);
}

.detail-download-button .fa-file-image {
  background: rgba(18, 163, 109, 0.12);
  color: var(--mint);
}

.detail-download-button span {
  display: grid;
  gap: 2px;
}

.detail-download-button strong {
  color: var(--ink);
  font-size: var(--text-base);
  font-weight: var(--weight-title);
}

.detail-download-button small {
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
}

.detail-print-sheet {
  width: 100%;
  box-shadow: 0 14px 30px rgba(21, 30, 45, 0.08);
}

.puzzle-fun-facts {
  display: grid;
  gap: 12px;
}

.detail-fact-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.detail-fact-head h2 {
  margin-bottom: 0;
}

.detail-fact-controls {
  display: flex;
  gap: 8px;
}

.detail-fact-controls button {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(240, 191, 91, 0.28);
  border-radius: 999px;
  background: rgba(255, 247, 225, 0.82);
  color: var(--gold);
  display: grid;
  place-items: center;
}

.detail-fact-track {
  position: relative;
  min-height: 92px;
}

.detail-fact-slide {
  min-height: 92px;
  border-radius: 8px;
  border: 1px solid rgba(121, 138, 169, 0.18);
  background: rgba(247, 249, 255, 0.92);
  padding: 14px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  position: absolute;
  inset: 0;
  transition: opacity 180ms var(--tap), transform 180ms var(--tap);
}

.detail-fact-slide.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
}

.detail-fact-slide i {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--gold-soft);
  color: var(--gold);
}

.detail-fact-slide span {
  color: var(--ink);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  font-weight: var(--weight-ui);
}

.detail-fact-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
}

.detail-fact-dots button {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(240, 191, 91, 0.32);
  padding: 0;
}

.detail-fact-dots button.is-active {
  width: 20px;
  background: var(--gold);
}

.profile-inline-edit {
  width: max-content;
  margin: 10px 0 0;
}

.profile-action-row .primary-cta {
  display: inline-flex;
  gap: 8px;
}

.account-home-link {
  width: max-content;
  min-height: 40px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: rgba(47, 107, 232, 0.08);
  color: var(--blue);
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.created-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.created-detail-link {
  width: max-content;
  min-height: 40px;
  border-radius: 999px;
  background: var(--mint-soft);
  color: var(--mint);
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.created-detail-link:hover,
.created-detail-link:focus-visible,
.account-home-link:hover,
.account-home-link:focus-visible {
  transform: translateY(-1px);
}

@media (min-width: 760px) {
  .created-studio-header {
    grid-template-columns: minmax(130px, auto) minmax(0, 1fr) minmax(260px, 360px);
  }
}

@media (max-width: 767px) {
  .detail-download-actions {
    grid-template-columns: 1fr;
  }

  .ws-topbar.has-install-cta .counter-row {
    gap: 6px;
  }

  .ws-topbar.has-install-cta .counter-pill {
    min-width: 0;
    padding: 4px 8px 4px 5px;
  }

  .ws-topbar.has-install-cta .counter-copy {
    display: block;
  }

  .ws-topbar.has-install-cta .counter-label {
    display: none;
  }

  .ws-topbar.has-install-cta .install-app-cta {
    padding-inline: 9px;
  }

  .profile-name-row {
    align-items: center;
  }

  .profile-hero-copy h1 {
    min-width: 0;
  }

  .profile-icon-edit {
    width: 34px;
    height: 34px;
  }

  .profile-login-button {
    width: 100%;
    justify-content: center;
    gap: 8px;
  }

  .profile-action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-items: stretch;
  }

  .profile-action-row form {
    width: 100%;
  }

  .profile-action-row .ghost-cta,
  .profile-action-row .primary-cta {
    width: 100%;
    justify-content: center;
  }

  .profile-action-row .profile-login-button {
    grid-column: 1 / -1;
  }

  .profile-created-card {
    flex-basis: min(78vw, 292px);
  }

  .profile-created-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ws-game-play,
  .ws-game-play .ws-shell,
  .ws-game-play .ws-surface,
  .ws-game-play .ws-main,
  .ws-game-play .screen-play.is-active {
    height: var(--play-viewport-height, 100dvh);
    min-height: 0;
    max-height: var(--play-viewport-height, 100dvh);
    overflow: hidden;
  }

  .ws-game-play .screen-play.is-active {
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  .play-title-strip {
    gap: 8px;
    padding-inline: 10px;
  }

  .play-title-strip h1 {
    font-size: clamp(1.1rem, 5.2vw, 1.65rem);
  }

  .title-home-link {
    height: 36px;
    min-height: 36px;
    padding: 0 10px;
    gap: 6px;
    font-size: 0.78rem;
  }

  .title-home-link i {
    width: 16px;
    height: 16px;
    font-size: 0.8rem;
  }

  .ws-game-play .play-hud {
    grid-template-columns: minmax(78px, 1fr) minmax(112px, auto) minmax(88px, 1fr);
    gap: 4px;
    padding-inline: 6px;
    overflow: hidden;
  }

  .ws-game-play .hud-cluster {
    min-width: 0;
    gap: 3px;
    overflow: hidden;
  }

  .ws-game-play .hud-rotate-board {
    width: 32px;
    min-width: 32px;
    padding: 0;
  }

  .ws-game-play .hud-rotate-board span {
    display: none;
  }

  .ws-game-play .sound-toggle {
    max-width: 58px;
  }

  .ws-game-play .sound-toggle i {
    display: none;
  }

  .ws-game-play .hud-status {
    min-width: 0;
    gap: 4px;
    overflow: hidden;
  }

  .ws-game-play .hud-prog-wrap {
    width: 42px;
  }

  .ws-game-play .hud-cluster-right {
    justify-content: end;
  }

  .ws-game-play .play-timer {
    min-width: 42px;
    text-align: right;
  }

  .ws-game-play .play-stage {
    width: 100%;
    max-width: 100dvw;
    min-height: 0;
    height: 100%;
    box-sizing: border-box;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: stretch;
    align-content: stretch;
    padding-inline: 0;
    padding-block: 6px max(6px, env(safe-area-inset-bottom));
    gap: 6px;
    overflow: hidden;
  }

  .ws-game-play .board-wrap {
    min-height: 0;
    overflow: hidden;
    place-items: center;
  }

  .ws-game-play .word-board,
  .ws-game-play .screen-play.is-fullscreen-mode .word-board {
    width: min(100%, 100dvw);
    max-height: 100%;
    justify-self: center;
    align-self: center;
  }

  .ws-game-play .play-word-list,
  .ws-game-play .screen-play.is-fullscreen-mode .play-word-list {
    min-height: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    height: auto;
    align-self: stretch;
    overflow-x: clip;
    overflow-y: visible;
    overscroll-behavior: contain;
    padding: 4px 6px max(4px, env(safe-area-inset-bottom));
    gap: 5px;
  }

  .ws-game-play .play-word-list.is-scrollable {
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .ws-game-play .play-word-list .word-chip {
    flex: 0 1 auto;
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    min-height: 27px;
    padding: 2px 7px;
    font-size: clamp(0.76rem, 3.3vw, 0.92rem);
    line-height: 1.05;
  }

  .ws-game-play .play-start-overlay > .play-overlay-card {
    width: min(100%, 360px);
    max-height: calc(100dvh - var(--play-popup-top, 0px) - 28px);
    overflow-y: auto;
  }
}

@media (max-width: 360px) {
  .title-home-link span {
    display: none;
  }

  .title-home-link {
    width: 36px;
    padding: 0;
  }

  .ws-game-play .play-hud {
    grid-template-columns: minmax(58px, 0.85fr) minmax(96px, auto) minmax(78px, 0.9fr);
  }

  .ws-game-play .hud-prog-wrap {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .ws-game-play .board-wrap {
    place-items: start center;
  }

  .ws-game-play .word-board,
  .ws-game-play .screen-play.is-fullscreen-mode .word-board {
    align-self: start;
  }
}

html[data-theme="dark"] .route-panel,
html[data-theme="dark"] .detail-hero,
html[data-theme="dark"] .share-panel,
html[data-theme="dark"] .puzzle-fun-facts,
html[data-theme="dark"] .detail-download-panel,
html[data-theme="dark"] .created-studio-header,
html[data-theme="dark"] .created-preview-stage,
html[data-theme="dark"] .created-command-panel,
html[data-theme="dark"] .created-revise-section,
html[data-theme="dark"] .created-word-rail,
html[data-theme="dark"] .created-preview-dialog,
html[data-theme="dark"] .account-login-card,
html[data-theme="dark"] .login-provider {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: 0 14px 32px rgba(2, 6, 14, 0.28);
}

html[data-theme="dark"] .detail-hero {
  background:
    linear-gradient(135deg, rgba(240, 191, 91, 0.11), rgba(117, 168, 255, 0.06) 58%, transparent),
    var(--surface);
}

html[data-theme="dark"] .detail-hero::before {
  opacity: 0.35;
}

html[data-theme="dark"] .mini-board {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .mini-board span,
html[data-theme="dark"] .detail-fact-slide,
html[data-theme="dark"] .detail-download-button,
html[data-theme="dark"] .explore-topic-meta span,
html[data-theme="dark"] .category-quick-stats span,
html[data-theme="dark"] .category-puzzle-meta span,
html[data-theme="dark"] .category-puzzle-actions .ghost-cta,
html[data-theme="dark"] .account-home-link,
html[data-theme="dark"] .created-detail-link,
html[data-theme="dark"] .profile-icon-edit,
html[data-theme="dark"] .profile-created-actions .ghost-cta {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-strong);
  color: var(--ink);
}

html[data-theme="dark"] .explore-topic-puzzles a:hover,
html[data-theme="dark"] .explore-topic-puzzles a:focus-visible {
  background: rgba(117, 168, 255, 0.12);
}

html[data-theme="dark"] .explore-topic-puzzles a {
  color: #7ed9df;
}

html[data-theme="dark"] .explore-topic-puzzles small {
  color: var(--ink-soft);
}

html[data-theme="dark"] .explore-new-badge {
  background: rgba(240, 191, 91, 0.16);
  color: var(--gold);
}

html[data-theme="dark"] .profile-created-play-icon {
  background: rgba(78, 209, 157, 0.22);
  color: #9ff0cf;
}

html[data-theme="dark"] .detail-fact-slide i,
html[data-theme="dark"] .detail-fact-controls button {
  background: rgba(240, 191, 91, 0.16);
  color: var(--gold);
}

html[data-theme="dark"] .login-sheet {
  background:
    linear-gradient(180deg, rgba(24, 33, 51, 0.98), rgba(18, 26, 40, 0.98)),
    var(--surface);
}

html[data-theme="dark"] .login-sheet-icon,
html[data-theme="dark"] .login-provider > i:first-child {
  background: rgba(117, 168, 255, 0.12);
  color: #9fc2ff;
}

html[data-theme="dark"] .login-provider small,
html[data-theme="dark"] .login-sheet-note {
  color: var(--ink-soft);
}

html[data-theme="dark"] .account-page {
  background:
    linear-gradient(180deg, rgba(117, 168, 255, 0.08), transparent 46%),
    var(--bg);
  color: var(--ink);
}

html[data-theme="dark"] .error-page {
  background:
    radial-gradient(circle at 18% 12%, rgba(117, 168, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #101827 0%, #172033 100%);
  color: var(--ink);
}

html[data-theme="dark"] .error-shell,
html[data-theme="dark"] .error-board-card {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

html[data-theme="dark"] .error-copy h1,
html[data-theme="dark"] .error-brand {
  color: var(--ink);
}

html[data-theme="dark"] .error-copy p,
html[data-theme="dark"] .error-meta dd {
  color: var(--ink-soft);
}

html[data-theme="dark"] .error-code,
html[data-theme="dark"] .error-meta div,
html[data-theme="dark"] .error-actions .ghost-cta,
html[data-theme="dark"] .error-board-card span {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-strong);
  color: var(--ink);
}

html[data-theme="dark"] .error-board-card span.is-marked {
  background: transparent;
}

html[data-theme="dark"] .created-studio-surface,
html[data-theme="dark"] .created-studio-page,
html[data-theme="dark"] .created-studio-main {
  background: var(--bg);
  color: var(--ink);
}

html[data-theme="dark"] .created-title-block h1,
html[data-theme="dark"] .created-preview-head h2,
html[data-theme="dark"] .created-share-block h2,
html[data-theme="dark"] .created-revise-head h2,
html[data-theme="dark"] .category-puzzle-card h3,
html[data-theme="dark"] .category-detail-hero h1,
html[data-theme="dark"] .category-puzzle-section h2 {
  color: var(--ink);
}

html[data-theme="dark"] .created-title-block p,
html[data-theme="dark"] .created-revise-head p,
html[data-theme="dark"] .category-detail-hero p,
html[data-theme="dark"] .category-puzzle-card p {
  color: var(--ink-soft);
}

/* P1 public experience completion */
.counter-pill {
  max-width: clamp(96px, 28vw, 152px);
}

.counter-value,
.counter-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-lobby-content .daily-feature {
  isolation: isolate;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.92), transparent 32%),
    linear-gradient(135deg, #e6f5ff 0%, #d9ecff 52%, #eef8ff 100%);
}

.home-lobby-content .daily-feature::after {
  content: "";
  position: absolute;
  inset: auto 18px 16px auto;
  width: min(34vw, 130px);
  height: min(34vw, 130px);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(39, 99, 223, 0.12), transparent 66%);
  pointer-events: none;
  z-index: -1;
}

.home-lobby-content .daily-feature h2 {
  max-width: 780px;
}

.home-lobby-content .daily-play-cta {
  white-space: nowrap;
}

.mode-launch-brand {
  grid-template-columns: 1fr;
  justify-items: center;
  align-items: center;
  text-align: center;
}

.mode-launch-card h1 {
  min-width: 0;
}

.mode-mini-link,
.home-launch-action,
.mode-stat-card,
.ws-puzzle-card {
  min-width: 0;
}

.home-launch-action strong,
.home-launch-action span,
.mode-mini-link strong,
.mode-mini-link span,
.mode-stat-card strong,
.mode-stat-card span,
.mode-stat-card small {
  overflow-wrap: anywhere;
}

.play-cell.is-hint {
  color: var(--play-board-drag-letter, var(--blue));
  background: rgba(39, 99, 223, 0.1);
}

.play-word-list.is-hint-armed .word-chip:not(.is-done) {
  border-color: rgba(39, 99, 223, 0.3);
  cursor: help;
}

.play-word-list .word-chip.is-previewing {
  border-color: rgba(39, 99, 223, 0.34);
  color: var(--play-board-drag-letter, var(--blue));
  box-shadow: 0 0 0 3px rgba(39, 99, 223, 0.1);
}

.result-modal[aria-hidden="true"] {
  visibility: hidden;
}

.result-modal.is-open {
  visibility: visible;
}

.ws-game-play .result-modal {
  background: rgba(9, 14, 24, 0.44);
}

.ws-game-play .result-shell {
  width: min(100%, 760px);
}

.ws-game-play .result-main-card {
  border-radius: 8px;
}

.ws-game-play .result-side-panel {
  display: none !important;
}

.ws-game-play .result-share-actions .share-button,
.ws-game-play .result-actions .primary-cta,
.ws-game-play .result-actions .outline-cta,
.ws-game-play .result-actions .danger-cta,
.ws-game-play .result-secondary-actions .ghost-cta {
  min-width: 0;
}

@media (min-width: 900px) {
  .ws-game-play .result-modal {
    padding: 18px;
    align-items: center;
    justify-items: center;
  }

  .ws-game-play .result-shell {
    width: min(100%, 760px);
    height: auto;
    max-height: calc(100% - 36px);
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
  }

  .ws-game-play .result-main-card {
    height: auto;
    max-height: 100%;
    align-content: start;
  }

  .ws-game-play .result-side-panel {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .home-lobby-content {
    padding-inline: 12px;
  }

  .home-lobby-content .daily-feature {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    padding: 16px 14px;
  }

  .home-lobby-content .daily-trophy {
    width: 44px;
    height: 44px;
  }

  .home-lobby-content .daily-feature h2 {
    font-size: clamp(1.25rem, 6vw, 1.75rem);
  }

  .mode-launch-brand {
    grid-template-columns: 1fr;
  }

  .mode-launch-logo {
    width: 48px;
    height: 48px;
  }

  .mode-launch-card h1 {
    font-size: clamp(2rem, 10vw, 2.75rem);
  }

  .ws-game-play .result-modal {
    top: 0;
    height: 100dvh;
    padding: 0;
  }

  .ws-game-play .result-shell {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .ws-game-play .result-main-card {
    border-radius: 0;
    padding:
      max(14px, env(safe-area-inset-top))
      clamp(14px, 4vw, 20px)
      max(16px, env(safe-area-inset-bottom));
    align-content: start;
    gap: clamp(9px, 2.4vh, 13px);
  }

  .ws-game-play .result-stars span {
    width: clamp(30px, 9vw, 42px);
    height: clamp(30px, 9vw, 42px);
  }

  .ws-game-play .result-card h2 {
    font-size: clamp(1.8rem, 9vw, 3rem);
  }

  .ws-game-play .result-grid,
  .ws-game-play .result-share-actions,
  .ws-game-play .result-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ws-game-play .result-share-actions .share-copy {
    grid-column: auto;
    width: 100%;
  }

  .ws-game-play .result-secondary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
}

@media (max-width: 380px) {
  .ws-game-play .result-share-actions,
  .ws-game-play .result-actions,
  .ws-game-play .result-secondary-actions {
    grid-template-columns: 1fr;
  }
}

html[data-theme="dark"] .home-lobby-content .daily-feature {
  background:
    radial-gradient(circle at 12% 12%, rgba(117, 168, 255, 0.2), transparent 34%),
    linear-gradient(135deg, #13243c 0%, #18345b 56%, #102236 100%);
  border-color: rgba(117, 168, 255, 0.24);
  box-shadow: 0 18px 42px rgba(2, 6, 14, 0.28);
}

html[data-theme="dark"] .home-lobby-content .daily-trophy {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(117, 168, 255, 0.24);
  color: var(--blue);
}

html[data-theme="dark"] .mode-launch-card {
  background:
    radial-gradient(circle at 14% 12%, rgba(117, 168, 255, 0.18), transparent 34%),
    linear-gradient(145deg, #13243c 0%, #182f52 58%, #122237 100%);
  border-color: rgba(117, 168, 255, 0.22);
  color: var(--ink);
}

html[data-theme="dark"] .mode-launch-card h1 {
  color: var(--ink);
}

html[data-theme="dark"] .mode-launch-card p,
html[data-theme="dark"] .mode-mini-link span {
  color: var(--ink-soft);
}

html[data-theme="dark"] .mode-mini-link {
  background:
    linear-gradient(135deg, var(--card-soft, rgba(117, 168, 255, 0.16)) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--card-ink, var(--blue));
}

html[data-theme="dark"] .mode-mini-link:hover {
  background:
    linear-gradient(135deg, var(--card-soft, rgba(117, 168, 255, 0.16)) 0%, rgba(255, 255, 255, 0.1) 100%);
}

html[data-theme="dark"] .home-new-game-action {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #91bdff;
}

html[data-theme="dark"] .home-new-game-action:hover,
html[data-theme="dark"] .home-new-game-action:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(145, 189, 255, 0.28);
}

html[data-theme="dark"] .hint-status {
  border-color: rgba(145, 189, 255, 0.22);
  background: rgba(145, 189, 255, 0.12);
  color: #b7d2ff;
}

html[data-theme="dark"] .play-cell.is-hint {
  background: rgba(117, 168, 255, 0.14);
}

html[data-theme="dark"] .play-word-list.is-hint-armed .word-chip:not(.is-done) {
  border-color: rgba(117, 168, 255, 0.32);
}

html[data-theme="dark"] .play-word-list .word-chip.is-previewing {
  border-color: rgba(117, 168, 255, 0.38);
  box-shadow: 0 0 0 3px rgba(117, 168, 255, 0.12);
}

html[data-theme="dark"] .ws-game-play .result-side-panel {
  background:
    radial-gradient(circle at 16% 12%, rgba(117, 168, 255, 0.12), transparent 34%),
    var(--surface);
}

/* Result popup final theme/scroll pass */
.result-share-panel {
  background: rgba(248, 250, 252, 0.98);
  border-color: rgba(130, 143, 166, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 12px 28px rgba(15, 23, 42, 0.08);
}

.result-share-panel .share-button {
  background: #ffffff;
  border-color: rgba(130, 143, 166, 0.26);
  color: #243044;
  box-shadow: none;
}

.result-share-panel .share-button:hover,
.result-share-panel .share-button:focus-visible {
  background: #f3f7ff;
  border-color: rgba(47, 107, 232, 0.36);
}

html[data-theme="dark"] .ws-game-play .result-modal {
  background: rgba(3, 7, 18, 0.68);
}

html[data-theme="dark"] .ws-game-play .celebration-card,
html[data-theme="dark"] .ws-game-play .scoreboard-name-box {
  background:
    radial-gradient(circle at 18% 12%, rgba(117, 168, 255, 0.12), transparent 30%),
    radial-gradient(circle at 86% 22%, rgba(240, 191, 91, 0.1), transparent 28%),
    #172235;
  border-color: rgba(145, 189, 255, 0.18);
  color: #edf4ff;
}

html[data-theme="dark"] .ws-game-play .result-card h2,
html[data-theme="dark"] .ws-game-play .scoreboard-name-summary span {
  color: #f7fbff;
}

html[data-theme="dark"] .ws-game-play .result-card p,
html[data-theme="dark"] .ws-game-play .result-grid span,
html[data-theme="dark"] .ws-game-play .scoreboard-name-box label {
  color: #b9c6da;
}

html[data-theme="dark"] .ws-game-play .result-grid span {
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .ws-game-play .result-grid strong,
html[data-theme="dark"] .ws-game-play .scoreboard-rank-note {
  color: #91bdff;
}

html[data-theme="dark"] .ws-game-play .result-share-toggle,
html[data-theme="dark"] .ws-game-play .result-secondary-actions .ghost-cta {
  background: rgba(145, 189, 255, 0.08);
  border-color: rgba(145, 189, 255, 0.22);
  color: #dce9ff;
}

html[data-theme="dark"] .result-share-panel,
html[data-theme="dark"] .ws-game-play .result-share-panel {
  background: rgba(15, 23, 38, 0.96);
  border-color: rgba(145, 189, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 38px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .result-share-panel .share-button,
html[data-theme="dark"] .ws-game-play .result-share-panel .share-button {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.12);
  color: #edf4ff;
}

html[data-theme="dark"] .result-share-panel .share-button:hover,
html[data-theme="dark"] .result-share-panel .share-button:focus-visible,
html[data-theme="dark"] .ws-game-play .result-share-panel .share-button:hover,
html[data-theme="dark"] .ws-game-play .result-share-panel .share-button:focus-visible {
  background: rgba(117, 168, 255, 0.14);
  border-color: rgba(117, 168, 255, 0.34);
}

html[data-theme="dark"] .ws-game-play .scoreboard-name-box input {
  background: #101827;
  border-color: rgba(145, 189, 255, 0.18);
  color: #f7fbff;
}

@media (min-width: 900px) {
  .result-modal .result-shell,
  .ws-game-play .result-shell {
    max-height: min(760px, calc(100dvh - 56px));
    min-height: 0;
    overflow: hidden;
  }

  .ws-game-play .result-shell {
    max-height: min(760px, calc(var(--play-popup-height, 100dvh) - 36px));
  }

  .result-modal .result-main-card {
    max-height: inherit;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(130, 143, 166, 0.42) transparent;
    scrollbar-gutter: stable;
  }

  .ws-game-play .result-main-card {
    max-height: inherit;
  }

  .result-modal .result-main-card::-webkit-scrollbar {
    width: 8px;
  }

  .result-modal .result-main-card::-webkit-scrollbar-track {
    background: transparent;
  }

  .result-modal .result-main-card::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(130, 143, 166, 0.38);
  }

  html[data-theme="dark"] .result-modal .result-main-card::-webkit-scrollbar-thumb {
    background: rgba(145, 189, 255, 0.34);
  }
}

@media (max-width: 1023px) {
  .ws-game-play .hud-cluster-right {
    overflow: visible;
  }

  .ws-game-play .hint-status {
    display: none;
  }
}

@media (max-width: 767px) {
  .ws-game-play .play-title-strip {
    min-height: 48px;
    gap: 8px;
    padding: max(6px, env(safe-area-inset-top)) 8px 7px;
  }

  .ws-game-play .title-home-link {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 8px;
  }

  .ws-game-play .title-home-link span {
    display: none;
  }

  .ws-game-play .play-title-strip h1 {
    font-size: clamp(1.05rem, 4.8vw, 1.35rem);
  }

  .ws-game-play .screen-play.is-waiting .play-session-meta,
  .ws-game-play .play-session-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
  }

  .ws-game-play .top-score {
    min-width: 0;
    gap: 5px;
    font-size: 0.78rem;
  }

  .ws-game-play .top-score svg,
  .ws-game-play .top-score i {
    width: 15px;
    height: 15px;
    font-size: 0.76rem;
  }

  .ws-game-play .top-score-copy-desktop {
    display: none;
  }

  .ws-game-play .top-score-copy-mobile {
    display: inline;
  }

  .ws-game-play .play-difficulty-chip {
    min-height: 22px;
    padding-inline: 7px;
    font-size: 0.64rem;
  }

  .ws-game-play .play-session-actions {
    margin-left: 0;
    gap: 5px;
  }

  .ws-game-play .screen-play.is-waiting .print-command,
  .ws-game-play .screen-play.is-waiting .score-command,
  .ws-game-play .facts-command,
  .ws-game-play .print-command,
  .ws-game-play .score-command {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 8px;
  }

  .ws-game-play .screen-play.is-waiting .print-command span,
  .ws-game-play .screen-play.is-waiting .score-command span,
  .ws-game-play .facts-command span,
  .ws-game-play .print-command span,
  .ws-game-play .score-command span {
    display: none;
  }

  .ws-game-play .screen-play.is-waiting .facts-command i,
  .ws-game-play .screen-play.is-waiting .facts-command svg,
  .ws-game-play .screen-play.is-waiting .print-command i,
  .ws-game-play .screen-play.is-waiting .print-command svg,
  .ws-game-play .screen-play.is-waiting .score-command i,
  .ws-game-play .screen-play.is-waiting .score-command svg,
  .ws-game-play .facts-command i,
  .ws-game-play .facts-command svg,
  .ws-game-play .print-command i,
  .ws-game-play .print-command svg,
  .ws-game-play .score-command i,
  .ws-game-play .score-command svg {
    width: 16px;
    height: 16px;
    font-size: 0.82rem;
  }

  .ws-game-play .play-hud {
    min-height: 44px;
    grid-template-columns: minmax(44px, 0.75fr) minmax(42px, auto) minmax(132px, 1.15fr);
    gap: 5px;
    padding: 5px 6px;
  }

  .ws-game-play .hud-status {
    font-size: 0.8rem;
  }

  .ws-game-play .hud-cluster-right {
    min-width: 0;
    gap: 4px;
  }

  .ws-game-play .play-timer {
    min-width: 38px;
    font-size: 0.78rem;
  }
}

/* Performance and encouragement */
.result-stars .result-star {
  position: relative;
  overflow: hidden;
  background: #e9eef7;
  box-shadow: inset 0 0 0 1px rgba(130, 143, 166, 0.16);
}

.result-stars .result-star::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--fill, 60%);
  background: #f4c345;
  box-shadow: 0 8px 14px rgba(196, 134, 25, 0.2);
}

.result-percentile-message {
  margin: 8px 0 0;
  color: #2f6be8;
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
}

.result-ranking-wrap {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 12px;
}

.result-ranking-wrap[hidden],
.result-ranking-panel[hidden] {
  display: none;
}

.result-ranking-toggle {
  width: auto;
  min-height: 38px;
  padding-inline: 14px;
}

.result-ranking-panel {
  width: 100%;
  border: 1px solid rgba(130, 143, 166, 0.2);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.96);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.result-rank-graph {
  position: relative;
  height: 84px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(232, 244, 255, 0.96), rgba(244, 249, 255, 0.7));
}

.rank-bars {
  position: absolute;
  inset: 12px 10px 18px;
  display: flex;
  align-items: end;
  gap: 4px;
}

.rank-bar {
  flex: 1 1 0;
  min-width: 3px;
  height: max(6px, var(--h, 20%));
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, rgba(58, 151, 237, 0.72), rgba(37, 194, 179, 0.7));
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.42) inset;
}

.rank-bar.is-empty {
  opacity: 0.26;
}

.rank-marker {
  position: absolute;
  top: 10px;
  bottom: 12px;
  left: var(--x, 50%);
  width: 3px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #172033;
  box-shadow: 0 0 0 4px rgba(23, 32, 51, 0.1), 0 6px 16px rgba(23, 32, 51, 0.18);
}

.rank-marker.is-best {
  background: #14b8a6;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.16);
}

.rank-marker.is-average {
  background: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.16);
}

.rank-marker.is-player {
  background: #172033;
}

.result-rank-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.result-rank-grid span {
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink-soft);
  padding: 10px 8px;
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
}

.result-rank-grid strong {
  display: block;
  color: #172033;
  font-size: var(--text-sm);
}

.play-encouragement {
  position: absolute;
  left: 50%;
  top: clamp(10px, 3vw, 18px);
  z-index: 7;
  max-width: min(92%, 360px);
  transform: translate(-50%, -6px);
  border: 1px solid rgba(47, 107, 232, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #1f56c7;
  padding: 8px 13px;
  font-size: var(--text-xs);
  font-weight: var(--weight-title);
  line-height: var(--leading-tight);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms var(--tap), transform 160ms var(--tap);
}

.play-encouragement.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.difficulty-option {
  grid-template-areas:
    "label"
    "meta"
    "rank"
    "bar";
}

.difficulty-rank {
  grid-area: rank;
  min-width: 0;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  line-height: var(--leading-tight);
}

.difficulty-rank.is-empty {
  color: var(--muted);
}

.profile-mode-rank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.profile-mode-rank-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  display: grid;
  gap: 5px;
  box-shadow: 0 10px 22px rgba(34, 40, 59, 0.06);
}

.profile-mode-rank-card span {
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  font-weight: var(--weight-title);
  text-transform: uppercase;
}

.profile-mode-rank-card strong {
  color: var(--card-ink, var(--blue));
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  line-height: var(--leading-tight);
  font-weight: var(--weight-title);
}

.profile-mode-rank-card p {
  margin: 0;
  color: var(--ink);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  line-height: var(--leading-snug);
}

.profile-mode-rank-card small {
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
}

html[data-theme="dark"] .result-stars .result-star {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .result-percentile-message {
  color: #91bdff;
}

html[data-theme="dark"] .result-ranking-panel {
  border-color: rgba(145, 189, 255, 0.16);
  background: rgba(15, 23, 38, 0.92);
}

html[data-theme="dark"] .result-rank-grid span {
  background: rgba(255, 255, 255, 0.07);
  color: #b9c6da;
}

html[data-theme="dark"] .result-rank-grid strong {
  color: #f7fbff;
}

html[data-theme="dark"] .result-rank-graph {
  background: linear-gradient(180deg, rgba(19, 34, 56, 0.96), rgba(15, 23, 38, 0.92));
  box-shadow: inset 0 0 0 1px rgba(145, 189, 255, 0.1);
}

html[data-theme="dark"] .rank-bar {
  background: linear-gradient(180deg, rgba(116, 185, 255, 0.76), rgba(45, 212, 191, 0.66));
}

html[data-theme="dark"] .rank-marker {
  background: #f7fbff;
  box-shadow: 0 0 0 4px rgba(247, 251, 255, 0.12);
}

html[data-theme="dark"] .rank-marker.is-best {
  background: #2dd4bf;
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.16);
}

html[data-theme="dark"] .rank-marker.is-average {
  background: #93c5fd;
  box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.16);
}

html[data-theme="dark"] .rank-marker.is-player {
  background: #f7fbff;
}

html[data-theme="dark"] .play-encouragement {
  border-color: rgba(145, 189, 255, 0.2);
  background: rgba(15, 23, 38, 0.92);
  color: #b7d2ff;
}

html[data-theme="dark"] .profile-mode-rank-card {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .profile-mode-rank-card p {
  color: #edf4ff;
}

@media (max-width: 767px) {
  .result-rank-grid {
    grid-template-columns: 1fr;
  }

  .result-rank-graph {
    height: 68px;
  }

  .play-encouragement {
    top: 8px;
    max-width: calc(100% - 28px);
    font-size: 0.72rem;
  }
}

/* Leaderboard modal v2 */
.leaderboard-overlay {
  padding: clamp(10px, 2vw, 20px);
  background: rgba(15, 23, 42, 0.28);
}

.leaderboard-overlay > .leaderboard-card {
  width: min(100%, 680px);
  min-height: 0;
  max-height: min(720px, calc(100% - 20px));
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(130, 143, 166, 0.26);
  background: #ffffff;
  color: #172033;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  align-content: stretch;
  justify-items: stretch;
  gap: 0;
  padding: 0;
  text-align: left;
}

.leaderboard-card .overlay-close {
  top: 14px;
  right: 14px;
  background: rgba(15, 23, 42, 0.06);
  color: #526071;
  z-index: 2;
}

.leaderboard-card .overlay-close:hover,
.leaderboard-card .overlay-close:focus-visible {
  background: rgba(47, 107, 232, 0.12);
  color: #1f56c7;
}

.leaderboard-card .overlay-kicker {
  justify-self: center;
  margin: 20px 56px 0;
  line-height: var(--leading-tight);
  text-align: center;
}

.leaderboard-card h2 {
  margin: 6px 56px 0;
  padding: 0;
  color: #172033;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  line-height: var(--leading-tight);
  text-align: center;
  overflow-wrap: anywhere;
}

.leaderboard-card .leaderboard-facts-trigger {
  grid-row: 3;
  justify-self: center;
  margin: 14px 18px 0;
}

.leaderboard-list {
  grid-row: 4;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0 clamp(14px, 2.6vw, 22px) clamp(14px, 2.6vw, 22px);
  scrollbar-width: thin;
  scrollbar-color: rgba(130, 143, 166, 0.46) transparent;
}

.leaderboard-list::-webkit-scrollbar {
  width: 8px;
}

.leaderboard-list::-webkit-scrollbar-track {
  background: transparent;
}

.leaderboard-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(130, 143, 166, 0.42);
}

.leaderboard-list li {
  min-width: 0;
  min-height: 72px;
  border: 1px solid rgba(130, 143, 166, 0.18);
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.leader-rank {
  width: 38px;
  height: 38px;
  background: #eaf2ff;
  color: #2f6be8;
  font-size: var(--text-xs);
}

.leader-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.leader-player {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #172033;
  font-size: var(--text-base);
  font-weight: var(--weight-title);
  line-height: var(--leading-tight);
}

.leaderboard-list .leader-date {
  grid-column: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7c8798;
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  line-height: var(--leading-tight);
}

.leader-stats {
  min-width: 82px;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 9px;
  white-space: nowrap;
}

.leaderboard-list .leader-score {
  color: #23b981;
  font-size: var(--text-lg);
  line-height: 1;
}

.leaderboard-list .leader-time {
  color: #526071;
  font-size: var(--text-sm);
  font-weight: var(--weight-title);
  line-height: 1;
}

html[data-theme="dark"] .leaderboard-overlay {
  background: rgba(3, 7, 18, 0.62);
}

html[data-theme="dark"] .leaderboard-overlay > .leaderboard-card {
  border-color: rgba(145, 189, 255, 0.18);
  background: #172235;
  color: #edf4ff;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.36);
}

html[data-theme="dark"] .leaderboard-card .overlay-close {
  background: rgba(255, 255, 255, 0.08);
  color: #b9c6da;
}

html[data-theme="dark"] .leaderboard-card .overlay-close:hover,
html[data-theme="dark"] .leaderboard-card .overlay-close:focus-visible {
  background: rgba(145, 189, 255, 0.14);
  color: #edf4ff;
}

html[data-theme="dark"] .leaderboard-card h2 {
  color: #f7fbff;
}

html[data-theme="dark"] .leaderboard-list {
  scrollbar-color: rgba(145, 189, 255, 0.38) transparent;
}

html[data-theme="dark"] .leaderboard-list::-webkit-scrollbar-thumb {
  background: rgba(145, 189, 255, 0.34);
}

html[data-theme="dark"] .leaderboard-list li {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .leader-rank {
  background: rgba(117, 168, 255, 0.14);
  color: #91bdff;
}

html[data-theme="dark"] .leaderboard-list .leader-player {
  color: #f7fbff;
}

html[data-theme="dark"] .leaderboard-list .leader-date {
  color: #9dadc5;
}

html[data-theme="dark"] .leaderboard-list .leader-score {
  color: #65dca8;
}

html[data-theme="dark"] .leaderboard-list .leader-time {
  color: #c8d4e6;
}

@media (min-width: 768px) {
  .leaderboard-overlay > .leaderboard-card {
    width: min(100%, 680px);
  }
}

@media (max-width: 767px) {
  .leaderboard-overlay {
    grid-template-columns: minmax(0, var(--play-overlay-left, 0px)) minmax(0, var(--play-overlay-width, 100%)) minmax(0, 1fr);
    grid-template-rows: minmax(0, var(--play-overlay-top, 0px)) minmax(0, var(--play-overlay-height, 100%)) minmax(0, 1fr);
    padding: 8px;
  }

  .leaderboard-overlay > .leaderboard-card {
    width: min(100%, 520px);
    max-height: calc(100% - 16px);
    border-radius: 10px;
  }

  .leaderboard-card .overlay-close {
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
  }

  .leaderboard-card .overlay-kicker {
    margin: 16px 46px 0;
    font-size: 0.72rem;
  }

  .leaderboard-card h2 {
    margin: 6px 46px 0;
    font-size: clamp(1.45rem, 6.2vw, 2rem);
  }

  .leaderboard-card .leaderboard-facts-trigger {
    margin-top: 10px;
  }

  .leaderboard-list {
    gap: 8px;
    margin-top: 14px;
    padding: 0 10px 12px;
  }

  .leaderboard-list li {
    min-height: 66px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px;
  }

  .leader-rank {
    width: 34px;
    height: 34px;
  }

  .leaderboard-list .leader-player {
    font-size: var(--text-sm);
  }

  .leaderboard-list .leader-date {
    font-size: 0.72rem;
  }

  .leader-stats {
    min-width: 54px;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
  }

  .leaderboard-list .leader-score {
    font-size: var(--text-base);
  }

  .leaderboard-list .leader-time {
    font-size: var(--text-xs);
  }
}
