/* WordSpin — browser demo. Builds on tokens from /styles.css. */

.play-main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.play-head { max-width: 640px; margin: 0 auto 1.75rem; text-align: center; }
.play-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.9rem, 4.5vw, 2.75rem);
  margin: 0.5rem 0 0.6rem;
  color: var(--ink);
}
.play-sub { color: var(--mute); margin: 0; line-height: 1.55; }
.play-sub a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- board ---------- */

.board {
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-1);
  padding: 1.25rem 1.25rem 1.5rem;
}

.board-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.board-level {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
}
.board-world { color: var(--accent); font-weight: 600; }

.board-dots { display: flex; gap: 5px; list-style: none; margin: 0; padding: 0; }
.board-dots li {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--rule-strong);
}
.board-dots li.done { background: var(--accent); }
.board-dots li.now { background: var(--ink); }

/* ---------- crossword grid ---------- */

.grid-wrap { display: flex; justify-content: center; }
.grid {
  display: grid;
  gap: 5px;
  --cell: clamp(30px, 8.5vw, 46px);
}
.grid-cell {
  width: var(--cell);
  height: var(--cell);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: calc(var(--cell) * 0.5);
  color: var(--ink);
  background: var(--bg-tint);
  border: 1px solid var(--rule);
}
.grid-cell.blank { background: transparent; border: none; }
.grid-cell span { opacity: 0; transform: scale(0.6); }
.grid-cell.revealed { background: var(--surface); border-color: var(--rule-strong); }
.grid-cell.revealed span {
  opacity: 1; transform: scale(1);
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.grid-cell.pulse { animation: cell-pulse 0.45s ease; }
@keyframes cell-pulse {
  0% { background: var(--accent-soft); }
  100% { background: var(--surface); }
}

/* ---------- word preview ---------- */

.word-preview {
  min-height: 2.6rem;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem 0 0.4rem;
}
.word-preview-inner {
  display: inline-block;
  min-width: 2.6rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.14em;
  color: var(--ink);
  background: var(--bg-tint);
  visibility: hidden;
}
.word-preview-inner.active { visibility: visible; }
.word-preview-inner.good { background: var(--accent); color: #fff; }
.word-preview-inner.shake { animation: preview-shake 0.35s ease; }
@keyframes preview-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

/* ---------- wheel ---------- */

.wheel-zone {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 0.4rem;
}
.wheel-wrap {
  position: relative;
  width: min(280px, 72vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bg-tint);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.wheel-trace { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wheel-trace polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.55;
}

.wheel-letter {
  position: absolute;
  width: 22%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  touch-action: none;
}
.wheel-letter.sel { background: var(--accent); color: #fff; }

.wheel-side { display: flex; flex-direction: column; gap: 0.6rem; }
.round-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.round-btn:hover { border-color: var(--ink); color: var(--ink); }
.round-btn-accent { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.round-btn-accent:hover { background: color-mix(in srgb, var(--ink) 88%, var(--accent)); color: var(--bg); }

/* ---------- extras + toast ---------- */

.board-extra {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--mute);
}
.board-toast {
  min-height: 1.4rem;
  margin: 0.5rem 0 0;
  text-align: center;
  font-size: 0.92rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.board-toast.show { opacity: 1; }

/* ---------- win modal ---------- */

.win-modal {
  border: none;
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-2);
  padding: 0;
  max-width: min(92vw, 480px);
}
.win-modal::backdrop { background: rgba(26, 23, 20, 0.45); backdrop-filter: blur(3px); }
.win-modal-body { padding: 2rem 1.75rem 1.75rem; text-align: center; }
.win-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.win-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 2rem;
  margin: 0 0 0.6rem;
}
.win-copy { color: var(--mute); line-height: 1.55; margin: 0; }
.win-ctas { justify-content: center; }
.win-next {
  margin-top: 1.1rem;
  border: none;
  background: none;
  color: var(--ink-soft);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.win-next:hover { color: var(--ink); }

/* ---------- below the board ---------- */

.play-below {
  max-width: 640px;
  margin: 2.5rem auto 0;
  color: var(--ink-soft);
}
.play-below h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--ink);
  margin: 0 0 0.5rem;
}
.play-below p { line-height: 1.6; margin: 0; }

@media (max-width: 560px) {
  .wheel-zone { flex-direction: column; }
  .wheel-side { flex-direction: row; }
  .board { padding: 1rem 0.85rem 1.25rem; }
}
