/* ==========================================================================
   Game: Word Search Movies
   Self-contained — every class is prefixed .wsm-. Cinematic look: velvet
   curtain red, marquee gold and a film-strip motif. The game panel is always
   dark in both site themes. Uses site tokens from common.css.
   ========================================================================== */

.wsm {
  --wsm-bg: #14090d;
  --wsm-red: #c81d3a;
  --wsm-gold: #ffcc4d;
  --wsm-card: rgba(255, 255, 255, .06);
  --wsm-card-hover: rgba(255, 255, 255, .11);
  --wsm-line: rgba(255, 255, 255, .13);
  --wsm-text: #fff;
  --wsm-sub: rgba(255, 255, 255, .72);
  --wsm-good: #19c28f;
  --wsm-bad: #ff5c8a;
  --wsm-warn: #ffb547;
  --wsm-accent: var(--wsm-gold);
  --wsm-tile: #fbf5e6;

  position: relative;
  margin: 10px 0 40px;
  padding: 36px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(70% 60% at 50% -10%, rgba(255, 204, 77, .18), transparent 60%),
    radial-gradient(110% 90% at 100% 0%, rgba(200, 29, 58, .45), transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(120, 12, 40, .55), transparent 60%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .16) 0 18px, rgba(255, 255, 255, .015) 18px 36px),
    var(--wsm-bg);
  color: var(--wsm-text);
  isolation: isolate;
  min-height: 520px;
}

:root[data-theme="dark"] .wsm { border: 1px solid var(--line); }

/* Decorative film strip across the bottom corner */
.wsm::before {
  content: "";
  position: absolute;
  right: -80px;
  bottom: 60px;
  z-index: -1;
  width: 560px;
  height: 74px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .22) 0 12px, transparent 12px 26px) left 0 top 7px / 100% 9px no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .22) 0 12px, transparent 12px 26px) left 0 bottom 7px / 100% 9px no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 204, 77, .12) 0 76px, rgba(0, 0, 0, .5) 76px 82px) left 0 top 23px / 100% 28px no-repeat,
    rgba(0, 0, 0, .55);
  transform: rotate(-9deg);
  opacity: .55;
}

.wsm-screen[hidden] { display: none !important; }
.wsm-screen { animation: wsm-fade .35s var(--ease); }

@keyframes wsm-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.wsm-ico {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Shared buttons ---------- */
.wsm-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 18px;
  border: 1px solid var(--wsm-line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--wsm-text);
  font: 600 .875rem/1.2 var(--font);
  cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.wsm-ghost:hover { background: var(--wsm-card-hover); }
.wsm-ghost--danger { color: var(--wsm-sub); }
.wsm-ghost--danger.is-confirm { border-color: var(--wsm-bad); color: var(--wsm-bad); }
.wsm-ghost .wsm-ico--off { display: none; }
.wsm-ghost.is-off .wsm-ico--on { display: none; }
.wsm-ghost.is-off .wsm-ico--off { display: block; }

.wsm-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 1px solid var(--wsm-line);
  border-radius: 50%;
  background: var(--wsm-card);
  color: var(--wsm-text);
  cursor: pointer;
  transition: background-color .2s var(--ease);
}
.wsm-icon-btn:hover { background: var(--wsm-card-hover); }

.wsm .btn-pill { min-height: 46px; padding: 11px 24px; }
.wsm .btn-pill:not(.btn-pill--hot) { background: #fff; color: #2a1418; }
.wsm .btn-pill--hot { background: var(--wsm-gold); color: #1a0a0e; }

.wsm button:focus-visible,
.wsm select:focus-visible { outline: 3px solid var(--wsm-accent); outline-offset: 2px; }

/* ==========================================================================
   Screen 1: home
   ========================================================================== */
.wsm-home__head {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  max-width: 760px;
}

/* Clapperboard logo */
.wsm-logo {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: none;
  width: 84px;
  padding-top: 4px;
}
.wsm-logo__clap {
  height: 18px;
  border-radius: 4px 4px 2px 2px;
  background: repeating-linear-gradient(-45deg, #fff 0 9px, #111 9px 18px);
  box-shadow: 0 0 0 2px #111;
  transform-origin: 6% 100%;
  animation: wsm-clap 3.2s ease-in-out infinite;
}
@keyframes wsm-clap {
  0%, 80%, 100% { transform: rotate(0); }
  86% { transform: rotate(-18deg); }
  92% { transform: rotate(0); }
}
.wsm-logo__board {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  height: 62px;
  padding: 7px;
  border-radius: 6px;
  background: #111;
  box-shadow: 0 12px 30px rgba(200, 29, 58, .45), inset 0 0 0 2px rgba(255, 255, 255, .12);
}
.wsm-logo__board span {
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--wsm-gold);
  color: #111;
  font-size: .8rem;
  font-weight: 800;
  line-height: 1;
}
.wsm-logo__board span:nth-child(2), .wsm-logo__board span:nth-child(3) { background: #fff; }

.wsm-kicker {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(200, 29, 58, .3);
  color: var(--wsm-accent);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.wsm-title {
  margin: 0 0 8px;
  text-shadow: 0 0 28px rgba(255, 204, 77, .25);
  font-size: clamp(2rem, 4.4vw, 3rem);
  letter-spacing: -.035em;
  line-height: 1.05;
}
.wsm-lead { margin: 0; color: var(--wsm-sub); }

.wsm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 28px 0 20px;
}
.wsm-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.wsm-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--wsm-line);
  border-radius: var(--radius-pill);
  background: var(--wsm-card);
}
.wsm-chip__label { color: var(--wsm-sub); font-size: .78rem; font-weight: 500; }
.wsm-chip strong { color: var(--wsm-accent); font-size: 1rem; }
.wsm-toolbar__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Daily card + theme picker */
.wsm-daily-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 280px);
  gap: 14px;
  margin-bottom: 28px;
}
.wsm-daily {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-width: 0;
  padding: 16px 18px;
  border: 1px dashed rgba(255, 204, 77, .6);
  border-radius: var(--radius-md);
  background: linear-gradient(120deg, rgba(200, 29, 58, .35), rgba(255, 204, 77, .06));
  color: var(--wsm-text);
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: transform .2s var(--ease), background-color .2s var(--ease);
}
.wsm-daily:hover { transform: translateY(-2px); }
.wsm-daily__cal {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 14px;
  background: var(--wsm-accent);
  color: var(--night);
}
.wsm-daily__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.wsm-daily__title { font-weight: 700; }
.wsm-daily__meta { color: var(--wsm-sub); font-size: .84rem; }
.wsm-daily__go {
  flex: none;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  background: var(--wsm-accent);
  color: var(--night);
  font-size: .84rem;
  font-weight: 700;
}
.wsm-daily.is-done .wsm-daily__go { background: rgba(255, 255, 255, .14); color: var(--wsm-text); }
.wsm-daily.is-done .wsm-daily__go::before { content: "✓ "; }

.wsm-theme-pick {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--wsm-line);
  border-radius: var(--radius-md);
  background: var(--wsm-card);
}
.wsm-theme-pick__label {
  color: var(--wsm-sub);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.wsm-select {
  width: 100%;
  min-height: 40px;
  padding: 6px 34px 6px 12px;
  border: 1px solid var(--wsm-line);
  border-radius: 10px;
  background: #1d0c12 url("../../svg/icons/chevron-down-gold.svg") no-repeat right 10px center / 16px;
  color: var(--wsm-text);
  font: 600 .9rem/1.2 var(--font);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.wsm-select option { background: #1d0c12; color: #fff; }

.wsm-subtitle {
  margin: 0 0 14px;
  font-size: 1rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--wsm-sub);
}

.wsm-stages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.wsm-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  height: 100%;
  padding: 18px;
  border: 1px solid var(--wsm-line);
  border-radius: var(--radius-md);
  background: var(--wsm-card);
  color: var(--wsm-text);
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: transform .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease);
}
.wsm-stage:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: rgba(255, 204, 77, .6);
  background: var(--wsm-card-hover);
  box-shadow: 0 10px 30px rgba(200, 29, 58, .25);
}
.wsm-stage.is-cleared { border-color: rgba(25, 194, 143, .45); }
.wsm-stage.is-locked { cursor: not-allowed; opacity: .5; }
.wsm-stage__num {
  display: grid;
  place-items: center;
  width: 48px;
  height: 36px;
  border-radius: 6px;
  -webkit-mask: radial-gradient(circle 6px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 6px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 6px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 6px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
  background: var(--wsm-accent);
  color: var(--night);
  font-size: 1.1rem;
  font-weight: 700;
}
.wsm-stage.is-locked .wsm-stage__num { background: rgba(255, 255, 255, .14); color: var(--wsm-text); }
.wsm-stage__body { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.wsm-stage__name { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.wsm-stage__blurb { color: var(--wsm-sub); font-size: .82rem; line-height: 1.45; }
.wsm-stage__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.wsm-tag {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .08);
  color: var(--wsm-sub);
  font-size: .68rem;
  font-weight: 600;
}
.wsm-stage__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--wsm-line);
}
.wsm-stage__best { color: var(--wsm-sub); font-size: .78rem; font-weight: 600; }

.wsm-star { color: rgba(255, 255, 255, .22); font-size: 1.05rem; line-height: 1; }
.wsm-star.is-on { color: var(--wsm-accent); text-shadow: 0 0 12px rgba(255, 216, 77, .5); }

.wsm-noscript { margin: 16px 0 0; padding: 14px 18px; border-radius: var(--radius-sm); background: rgba(255, 92, 138, .15); }

/* ==========================================================================
   Screen 2: playing
   ========================================================================== */
.wsm-play { position: relative; }

.wsm-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-bottom: 18px;
}
.wsm-hud__info { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.wsm-hud__stage {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--wsm-red);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
}
.wsm-hud__theme {
  padding: 6px 14px;
  border: 1px solid var(--wsm-line);
  border-radius: var(--radius-pill);
  font-size: .8rem;
  font-weight: 600;
}
.wsm-hud__stats { display: flex; gap: 22px; margin-left: auto; }
.wsm-stat { display: flex; flex-direction: column; line-height: 1.2; }
.wsm-stat__label { color: var(--wsm-sub); font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.wsm-stat strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.wsm-stat--time.is-over strong { color: var(--wsm-warn); }
.wsm-hud__actions { display: flex; align-items: center; gap: 8px; }

.wsm-tool {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 16px 8px 12px;
  border: 1px dashed rgba(255, 255, 255, .35);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--wsm-text);
  font: 600 .85rem/1.2 var(--font);
  cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), opacity .2s var(--ease);
}
.wsm-tool .wsm-ico { color: var(--wsm-accent); }
.wsm-tool:hover:not(:disabled) { border-style: solid; border-color: var(--wsm-accent); background: rgba(255, 216, 77, .1); }
.wsm-tool:disabled { cursor: not-allowed; opacity: .4; }
.wsm-tool__badge {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--wsm-accent);
  color: var(--night);
  font-size: .75rem;
  font-weight: 800;
}

/* Board */
.wsm-board {
  display: grid;
  grid-template-columns: minmax(0, 600px) minmax(220px, 1fr);
  align-items: start;
  gap: 26px;
}

.wsm-gridwrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  background: radial-gradient(120% 90% at 50% 0%, #fffdf6, var(--wsm-tile) 60%, #f0e6cc);
  box-shadow: 0 0 0 6px #0b0507, 0 0 0 7px rgba(255, 204, 77, .35), 0 0 60px rgba(255, 204, 77, .22), 0 24px 50px rgba(0, 0, 0, .5);
  container-type: inline-size;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  outline: none;
}
.wsm-gridwrap.has-focus:focus-visible { box-shadow: 0 0 0 6px #0b0507, 0 0 0 9px var(--wsm-accent), 0 24px 50px rgba(0, 0, 0, .5); }

.wsm-svg,
.wsm-grid {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
}
.wsm-svg { overflow: visible; pointer-events: none; }
.wsm-grid {
  display: grid;
  grid-template-columns: repeat(var(--n, 10), minmax(0, 1fr));
  grid-template-rows: repeat(var(--n, 10), minmax(0, 1fr));
}
.wsm-row { display: contents; }
.wsm-cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  color: #2a1418;
  font-family: var(--font);
  font-size: calc((100cqw - 20px) / var(--n, 10) * .5);
  font-weight: 700;
  line-height: 1;
  transition: color .2s var(--ease), transform .15s var(--ease);
}
.wsm-cell.is-sel { color: #000; transform: scale(1.12); }
.wsm-cell.is-found { color: #10142a; }
.wsm-cell.is-revealed { color: #6a6f88; }
.wsm-cell.is-hint { color: var(--wsm-red); }
.wsm-cell.is-anchor { color: #000; }
.wsm-gridwrap.has-focus.is-kb .wsm-cell.is-cursor::after,
.wsm-gridwrap:focus-visible .wsm-cell.is-cursor::after {
  content: "";
  position: absolute;
  inset: 8%;
  border: 2px solid var(--wsm-red);
  border-radius: 6px;
}

/* SVG lines are in cell units (1 = one cell) */
.wsm-found-line {
  stroke-width: .74;
  stroke-linecap: round;
  opacity: .62;
  animation: wsm-draw .35s var(--ease);
}
.wsm-found-line.is-revealed { stroke: #9aa0b8 !important; opacity: .45; stroke-dasharray: .3 .2; stroke-width: .6; }
@keyframes wsm-draw { from { opacity: 0; stroke-width: .2; } }
.wsm-sel {
  stroke: var(--wsm-red);
  stroke-width: .78;
  stroke-linecap: round;
  opacity: .32;
}
.wsm-sel.is-miss { stroke: var(--wsm-bad); opacity: .4; animation: wsm-miss .26s ease; }
@keyframes wsm-miss { 50% { opacity: .1; } }
.wsm-hint-ring {
  fill: rgba(200, 29, 58, .12);
  stroke: var(--wsm-red);
  stroke-width: .07;
  animation: wsm-pulse 1.1s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes wsm-pulse { to { transform: scale(1.12); } }

/* Word list */
.wsm-side {
  padding: 18px;
  border: 1px solid var(--wsm-line);
  border-radius: var(--radius-md);
  background: var(--wsm-card);
}
.wsm-side__title {
  margin: 0 0 12px;
  color: var(--wsm-sub);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.wsm-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.wsm-word {
  --wc: transparent;
  position: relative;
  padding: 6px 12px;
  border: 1px solid var(--wsm-line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .05);
  font-size: .86rem;
  font-weight: 600;
  letter-spacing: .05em;
  transition: opacity .3s var(--ease), background-color .3s var(--ease), border-color .3s var(--ease);
}
.wsm-word.is-hinted .wsm-word__first { color: var(--wsm-accent); text-decoration: underline; text-underline-offset: 3px; }
.wsm-word.is-found {
  border-color: var(--wc);
  background: rgba(255, 255, 255, .02);
  color: var(--wsm-sub);
  text-decoration: line-through;
  text-decoration-color: var(--wc);
  text-decoration-thickness: 2px;
  animation: wsm-pop .35s var(--ease);
}
.wsm-word.is-found::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--wc);
  vertical-align: 1px;
}
.wsm-word.is-revealed { opacity: .5; text-decoration: line-through; }
@keyframes wsm-pop { 50% { transform: scale(1.08); } }

.wsm-side__par {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--wsm-line);
  color: var(--wsm-sub);
  font-size: .82rem;
}
.wsm-side__par strong { color: var(--wsm-text); }
.wsm-side__par .wsm-star { font-size: .8rem; letter-spacing: 1px; }

.wsm-toast {
  position: absolute;
  left: 50%;
  top: 70px;
  z-index: 4;
  margin: 0;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: rgba(20, 6, 10, .92);
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  transform: translateX(-50%);
  pointer-events: none;
  animation: wsm-fade .2s var(--ease);
}
.wsm-toast[hidden] { display: none; }

/* Pause overlay hides the grid */
.wsm-play.is-paused .wsm-board { filter: blur(16px); pointer-events: none; user-select: none; }
.wsm-play.is-done .wsm-gridwrap { cursor: default; }
.wsm-paused {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 16px;
}
.wsm-paused[hidden] { display: none; }
.wsm-paused { place-items: start center; padding-top: 90px; }
.wsm-paused__card {
  max-width: 400px;
  padding: 28px;
  border: 1px solid var(--wsm-line);
  border-radius: var(--radius-md);
  background: rgba(28, 10, 16, .96);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
  text-align: center;
}
.wsm-paused__title { margin: 0 0 6px; font-size: 1.6rem; }
.wsm-paused__card p { margin: 0 0 20px; color: var(--wsm-sub); font-size: .9rem; }
.wsm-paused__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ==========================================================================
   Screen 3: results
   ========================================================================== */
.wsm-result { max-width: 640px; margin: 0 auto; padding: 10px 0; text-align: center; }
.wsm-result__stars { display: flex; justify-content: center; gap: 10px; margin-bottom: 8px; }
.wsm-star--big { font-size: clamp(3rem, 9vw, 4.25rem); opacity: 0; animation: wsm-star-in .5s var(--ease) forwards; }
@keyframes wsm-star-in {
  from { opacity: 0; transform: scale(.3) rotate(-30deg); }
  to   { opacity: 1; transform: none; }
}
.wsm-result__title { margin: 0 0 6px; font-size: clamp(1.8rem, 4vw, 2.5rem); }
.wsm-result__new {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  background: var(--wsm-accent);
  color: var(--night);
  font-size: .8rem;
  font-weight: 700;
}
.wsm-result__new[hidden] { display: none; }
.wsm-result__text { margin: 0 auto 24px; max-width: 460px; color: var(--wsm-sub); }
.wsm-result__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 26px; }
.wsm-result__stats div { padding: 14px 8px; border: 1px solid var(--wsm-line); border-radius: var(--radius-sm); background: var(--wsm-card); }
.wsm-result__stats dt { color: var(--wsm-sub); font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.wsm-result__stats dd { margin: 2px 0 0; font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.wsm-result__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.wsm-result__actions [hidden] { display: none; }

/* ==========================================================================
   How-to-play section (site theme)
   ========================================================================== */
.wsm-guide { margin: 0 0 56px; }
.wsm-guide .section-head__title { margin-bottom: 22px; }
.wsm-guide__item {
  height: 100%;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.wsm-guide__item h3 { margin: 12px 0 6px; font-size: 1.05rem; }
.wsm-guide__item p { margin: 0; color: var(--sub); font-size: .9rem; }
.wsm-guide__num {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand);
  color: var(--onbrand);
  font-weight: 700;
}
.wsm-guide__back { margin: 24px 0 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 991.98px) {
  .wsm-board { grid-template-columns: 1fr; gap: 18px; }
  .wsm-gridwrap { max-width: 600px; margin: 0 auto; }
}

@media (max-width: 767.98px) {
  .wsm { padding: 24px 20px; min-height: 0; }
  .wsm-daily-row { grid-template-columns: 1fr; }
  .wsm-result__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wsm-hud__stats { margin-left: 0; }
  .wsm-hud__actions { margin-left: auto; }
}

@media (max-width: 575.98px) {
  .wsm { margin-left: -4px; margin-right: -4px; padding: 20px 12px; border-radius: var(--radius-md); }
  .wsm-home__head { flex-direction: column; gap: 16px; }
  .wsm-logo { width: 70px; }
  .wsm-logo__board { height: 52px; }
  .wsm::before { width: 380px; bottom: 30px; }
  .wsm-toolbar { flex-direction: column; align-items: stretch; }
  .wsm-toolbar__actions .wsm-ghost { flex: 1; }
  .wsm-stages { grid-template-columns: 1fr; }
  .wsm-hud { gap: 10px 12px; margin-bottom: 12px; }
  .wsm-hud__info { width: 100%; }
  .wsm-hud__stats { gap: 16px; }
  .wsm-tool { padding: 8px 12px 8px 10px; }
  .wsm-tool__text { display: none; }
  .wsm-svg, .wsm-grid { inset: 5px; width: calc(100% - 10px); height: calc(100% - 10px); }
  .wsm-cell { font-size: calc((100cqw - 10px) / var(--n, 10) * .54); }
  .wsm-gridwrap { border-radius: var(--radius-sm); }
  .wsm-side { padding: 14px; }
  .wsm-word { padding: 5px 10px; font-size: .8rem; }
  .wsm-daily { padding: 14px; gap: 12px; }
  .wsm-daily__go { display: none; }
  .wsm-paused__actions .btn-pill, .wsm-paused__actions .wsm-ghost { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .wsm-logo__clap, .wsm-hint-ring, .wsm-found-line, .wsm-word.is-found, .wsm-screen { animation: none; }
  .wsm-star--big { opacity: 1; animation: none; }
  .wsm-cell { transition: none; }
}
