/* WORDRA — design tokens + screen styles */

/* ===== ITEMS HUD (gameplay) ===== */
.wg-items {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 16px 16px;
}
.wg-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  cursor: pointer;
  transition: transform 80ms ease, border-color 120ms ease, background 120ms ease;
  font-family: inherit;
  box-shadow: 0 2px 0 var(--shadow-cell);
}
.wg-item:not(.disabled):hover { border-color: var(--item-color); }
.wg-item:not(.disabled):active { transform: translateY(1px); box-shadow: 0 1px 0 var(--shadow-cell); }
.wg-item.disabled { opacity: 0.45; cursor: not-allowed; }
.wg-item-icon {
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 0 6px color-mix(in oklab, var(--item-color) 60%, transparent));
}
.wg-item-name {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  font-family: 'JetBrains Mono', monospace;
}
.wg-item-count {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 10px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--item-color);
  background: color-mix(in oklab, var(--item-color) 18%, transparent);
  border: 1px solid color-mix(in oklab, var(--item-color) 40%, transparent);
  border-radius: 999px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
}

.wg-item-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  pointer-events: none;
  z-index: 50;
  animation: wgItemFlash 1.1s ease-out forwards;
}
.wg-item-flash-icon { font-size: 36px; line-height: 1; }
.wg-item-flash-text {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  text-transform: uppercase;
}
@keyframes wgItemFlash {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.6); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  60% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(0.95); }
}

.wg-cell.hint {
  animation: wgHintPulse 1s ease-in-out infinite;
}
@keyframes wgHintPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--gold), 0 2px 0 var(--shadow-cell); }
  50% { box-shadow: 0 0 0 6px color-mix(in oklab, var(--gold) 35%, transparent), 0 2px 0 var(--shadow-cell); }
}

.wg-combo-mult.locked { color: var(--purple) !important; }
.wg-combo-fill.locked { animation: wgLockPulse 1.2s ease-in-out infinite; }
@keyframes wgLockPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* ===== HOME INVENTORY ===== */
.wh-inv {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 360px;
  box-shadow: 0 2px 0 var(--shadow-cell);
}
.wh-inv-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.wh-inv-head > span:first-child { color: var(--text); }
.wh-inv-hint { color: var(--text-3); text-transform: lowercase; letter-spacing: 0.04em; }
.wh-inv-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.wh-inv-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.wh-inv-icon { font-size: 22px; line-height: 1; }
.wh-inv-name {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  font-family: 'JetBrains Mono', monospace;
}
.wh-inv-count {
  font-size: 11px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--item-color);
}

/* ===== RESULT — items used + reward ===== */
.wr-items-used {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.wr-items-used-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-3);
}
.wr-items-used-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.wr-item-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: color-mix(in oklab, var(--item-color) 14%, transparent);
  border: 1px solid color-mix(in oklab, var(--item-color) 40%, transparent);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
}

.wr-reward {
  margin-top: 18px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px dashed var(--border-2);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 340px;
}
.wr-reward-head {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--text-3);
  margin-bottom: 10px;
}
.wr-reward-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.wr-reward-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: color-mix(in oklab, var(--item-color) 12%, transparent);
  border: 1px solid color-mix(in oklab, var(--item-color) 50%, transparent);
  border-radius: var(--r-md);
  animation: wrRewardPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.wr-reward-card.bonus { animation-delay: 0.2s; }
.wr-reward-icon { font-size: 26px; line-height: 1; }
.wr-reward-meta { display: flex; flex-direction: column; gap: 2px; }
.wr-reward-name {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
}
.wr-reward-plus {
  font-size: 13px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--item-color);
  display: flex;
  align-items: center;
  gap: 6px;
}
.wr-reward-bonus {
  font-size: 9px;
  background: var(--gold);
  color: #14141A;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.1em;
}
@keyframes wrRewardPop {
  0% { opacity: 0; transform: scale(0.6) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== existing tokens ===== */
:root {
  --purple: #7C5CFF;
  --purple-deep: #5A3FE5;
  --gold: #FFD84D;
  --orange: #FF8A3D;
  --success: #22C55E;
  --danger: #EF4444;

  /* LIGHT mode — default */
  --bg: #FAF9F6;
  --bg-2: #F2F0EA;
  --surface: #FFFFFF;
  --surface-2: #F5F3ED;
  --border: #E5E2D9;
  --border-2: #D6D3C8;

  --text: #14141A;
  --text-2: #4A4A55;
  --text-3: #8A8A95;

  --shadow-cell: #C8C5BA;
  --shadow-cta: #B5B1A4;
  --canvas-bg: #EFEDE5;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 28px;
}

[data-theme="dark"] {
  --bg: #0B0B0F;
  --bg-2: #0F0F16;
  --surface: #14141A;
  --surface-2: #1B1B24;
  --border: #22222A;
  --border-2: #2A2A36;

  --text: #FFFFFF;
  --text-2: #A1A1AA;
  --text-3: #6B6B78;

  --shadow-cell: #000000;
  --shadow-cta: #000000;
  --canvas-bg: #07070b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: 'Inter', -apple-system, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }

/* ================================================== */
/* SHELL — dark canvas backdrop                       */
/* ================================================== */
.dc-stage { background: var(--canvas-bg); }
body { background: var(--canvas-bg); transition: background 0.3s; }

/* Frame chrome around each artboard */
.frame {
  width: 100%;
  height: 100%;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}
.frame.mobile { border-radius: 36px; }
.frame.desktop { border-radius: 14px; }

/* mobile bezel */
.bezel-mobile {
  width: 390px;
  height: 844px;
  background: #1a1a22;
  border-radius: 48px;
  padding: 12px;
  position: relative;
  box-shadow: 0 30px 80px rgba(124, 92, 255, 0.15), inset 0 0 0 1px #2a2a36;
}
.bezel-mobile .frame { border-radius: 36px; }
.bezel-mobile::before {
  content: "";
  position: absolute;
  top: 22px; left: 50%;
  transform: translateX(-50%);
  width: 110px; height: 30px;
  background: #000;
  border-radius: 18px;
  z-index: 50;
}

/* desktop / web bezel — borderless browser plate */
.bezel-desktop {
  width: 1280px;
  height: 800px;
  background: var(--surface-2);
  border-radius: 14px;
  padding: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(124, 92, 255, 0.18), inset 0 0 0 1px var(--border-2);
}
.bezel-desktop .browser-bar {
  height: 36px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}
.bezel-desktop .browser-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); }
.bezel-desktop .browser-bar .browser-url {
  margin-left: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
}
.bezel-desktop .frame { height: calc(100% - 36px); border-radius: 0; }

/* status bar (mobile) */
.status-bar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px 0 32px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  position: relative;
  z-index: 10;
}
.status-bar svg { stroke: var(--text); fill: var(--text); }
.status-bar .icons { display: flex; gap: 6px; align-items: center; }

/* ================================================== */
/* HOME                                                */
/* ================================================== */
.wh-root {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center;
  position: relative;
  padding: 60px 28px 36px;
  overflow: hidden;
}
.frame.desktop .wh-root { padding: 80px 80px 60px; }

.wh-ambient {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse 60% 40% at 30% 20%, rgba(124, 92, 255, 0.35), transparent 60%),
    radial-gradient(ellipse 50% 30% at 80% 90%, rgba(255, 216, 77, 0.18), transparent 60%);
  filter: blur(40px);
  pointer-events: none;
}
.wh-grain {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(124,92,255,0.04) 1px, transparent 1px);
  background-size: 3px 3px;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.wh-lang {
  position: absolute;
  top: 60px; right: 24px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px;
  display: flex;
  gap: 2px;
  z-index: 5;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
}
.wh-lang span {
  padding: 4px 10px;
  border-radius: 999px;
  transition: all 0.18s;
}
.wh-lang span.on {
  background: var(--purple);
  color: white;
}

.wh-logo {
  margin-top: 80px;
  text-align: center;
  position: relative;
  z-index: 2;
}
.frame.desktop .wh-logo { margin-top: 60px; }
.wh-logo-tiles {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.wh-tile {
  width: 44px; height: 56px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: 0.5px;
  color: var(--text);
  box-shadow: 0 4px 0 var(--shadow-cell), inset 0 1px 0 rgba(255,255,255,0.06);
  animation: wh-tile-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.frame.desktop .wh-tile { width: 64px; height: 80px; font-size: 38px; }
.wh-tile.alt {
  background: linear-gradient(180deg, var(--purple), var(--purple-deep));
  border-color: var(--purple-deep);
  color: white;
  box-shadow: 0 4px 0 #2a1888, 0 0 24px rgba(124, 92, 255, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}
@keyframes wh-tile-in {
  from { opacity: 0; transform: translateY(-20px) rotate(-8deg); }
  to { opacity: 1; transform: translateY(0) rotate(0); }
}
.wh-tagline {
  margin-top: 18px;
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-3);
  letter-spacing: 0.06em;
}

.wh-stats {
  margin-top: auto;
  margin-bottom: 32px;
  width: 100%;
  max-width: 380px;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 8px;
  position: relative;
  z-index: 2;
}
.frame.desktop .wh-stats { max-width: 460px; padding: 22px 8px; }
.wh-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.wh-stat-num {
  font-size: 22px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
}
.frame.desktop .wh-stat-num { font-size: 26px; }
.wh-stat-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.1em;
}
.wh-stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

.wh-ctas {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 2;
}
.frame.desktop .wh-ctas { max-width: 460px; }
.wh-cta {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-radius: var(--r-lg);
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}
.wh-cta:hover { transform: translateY(-2px); }
.wh-cta:active { transform: translateY(0); }
.wh-cta.primary {
  background: linear-gradient(180deg, var(--purple), var(--purple-deep));
  color: white;
  box-shadow: 0 6px 0 #2a1888, 0 0 32px rgba(124, 92, 255, 0.35);
}
.wh-cta.primary:hover { box-shadow: 0 8px 0 #2a1888, 0 0 48px rgba(124, 92, 255, 0.55); }
.wh-cta.secondary {
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--text);
  box-shadow: 0 4px 0 var(--shadow-cta);
}
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.wh-cta.secondary .wh-cta-arrow {
  background: var(--gold);
  color: #1a1a22;
}
.wh-cta-label {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: block;
  line-height: 1;
}
.wh-cta-sub {
  display: block;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  opacity: 0.65;
  margin-top: 4px;
}

.wh-foot {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-3);
  letter-spacing: 0.08em;
  position: relative;
  z-index: 2;
}
.wh-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); }

/* ================================================== */
/* GAMEPLAY                                            */
/* ================================================== */
.wordra-gameplay {
  width: 100%; height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 48px 18px 24px;
  position: relative;
  overflow: hidden;
}
.frame.desktop .wordra-gameplay { padding: 32px 60px; flex-direction: row; gap: 60px; align-items: center; justify-content: center; }

/* TOP BAR */
.wg-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.frame.desktop .wg-topbar {
  position: absolute;
  top: 28px; left: 60px; right: 60px;
}
.wg-back {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.wg-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
}
.wg-timer.low {
  color: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
  animation: wg-pulse-red 0.6s ease-in-out infinite;
}
@keyframes wg-pulse-red {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.wg-score {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
}
.wg-score-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.1em;
}
.wg-score-num {
  font-size: 22px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* word preview bar */
.wg-wordbar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.frame.desktop .wg-wordbar { position: absolute; top: 100px; left: 0; right: 0; }
.wg-hint {
  font-size: 12px;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
}
.wg-preview {
  display: flex;
  gap: 4px;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border-2);
  padding: 8px 14px;
  border-radius: 999px;
  transition: all 0.15s;
}
.wg-preview.maybe { border-color: var(--purple); }
.wg-preview.valid {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}
.wg-prev-ch {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}
.wg-prev-tick {
  margin-left: 6px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  display: flex; align-items: center; justify-content: center;
}

/* GRID */
.wg-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  position: relative;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.frame.desktop .wg-grid { width: 480px; height: 480px; max-width: none; }

.wg-cell {
  background: var(--surface);
  border: 1.5px solid var(--border-2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--text);
  position: relative;
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.18s, border-color 0.18s;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 3px 0 var(--shadow-cell), inset 0 1px 0 rgba(255,255,255,0.04);
}
.frame.desktop .wg-cell { font-size: 34px; border-radius: 18px; }
.wg-cell.sel {
  background: linear-gradient(180deg, var(--purple), var(--purple-deep));
  border-color: rgba(255,255,255,0.3);
  color: white;
  transform: scale(1.08);
  box-shadow: 0 4px 0 #2a1888, 0 0 28px rgba(124, 92, 255, 0.55);
  z-index: 2;
}
.wg-cell.valid {
  background: linear-gradient(180deg, var(--gold), #E5B82E);
  color: #1a1a22;
  box-shadow: 0 4px 0 #8a6e10, 0 0 32px rgba(255, 216, 77, 0.6);
  border-color: rgba(255,255,255,0.4);
}
.wg-cell.last { transform: scale(1.16); z-index: 3; }
.wg-letter { line-height: 1; pointer-events: none; }
.wg-order {
  position: absolute;
  top: 4px; right: 6px;
  font-size: 9px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0,0,0,0.4);
  padding: 1px 4px;
  border-radius: 4px;
  pointer-events: none;
}

.wg-line {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* particle burst */
.wg-particle {
  position: absolute;
  left: 50%; top: 50%;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  pointer-events: none;
  animation: wg-particle-fly 0.7s ease-out forwards;
  z-index: 4;
}
@keyframes wg-particle-fly {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% {
    transform: translate(calc(-50% + cos(var(--a)) * var(--d)), calc(-50% + sin(var(--a)) * var(--d))) scale(0);
    opacity: 0;
  }
}

/* floater +120 */
.wg-floater {
  position: absolute;
  font-size: 22px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 16px currentColor;
  animation: wg-floater 1s ease-out forwards;
  z-index: 5;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}
.wg-floater small { font-size: 14px; opacity: 0.8; }
@keyframes wg-floater {
  0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
  20% { transform: translate(-50%, -60%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -160%) scale(1); opacity: 0; }
}

/* combo bar */
.wg-combo {
  margin-top: 20px;
  flex-shrink: 0;
}
.frame.desktop .wg-combo {
  position: absolute;
  bottom: 28px; left: 60px; right: 60px;
}
.wg-combo-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.wg-combo-mult {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
}
.wg-combo-mult.hot { color: var(--orange); }
.wg-combo-mult.peak { color: var(--gold); text-shadow: 0 0 12px var(--gold); animation: wg-peak 0.4s ease-in-out infinite alternate; }
@keyframes wg-peak {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}
.wg-combo-x {
  font-size: 14px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.wg-combo-track {
  height: 8px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.wg-combo-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.08s linear, background 0.2s, box-shadow 0.2s;
}

/* feedback toast */
.wg-toast {
  position: absolute;
  top: 100px; left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
  z-index: 10;
  animation: wg-toast 0.9s ease-out forwards;
  pointer-events: none;
}
.wg-toast.bad { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid var(--danger); }
.wg-toast.dup { background: rgba(255, 216, 77, 0.12); color: var(--gold); border: 1px solid var(--gold); }
@keyframes wg-toast {
  0% { transform: translate(-50%, -10px); opacity: 0; }
  20% { transform: translate(-50%, 0); opacity: 1; }
  80% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, -10px); opacity: 0; }
}

/* recent words */
.wg-recent {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  flex-shrink: 0;
  min-height: 30px;
}
.frame.desktop .wg-recent { display: none; }
.wg-chip {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  background: rgba(124, 92, 255, 0.1);
  border: 1px solid rgba(124, 92, 255, 0.25);
  color: var(--purple);
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  animation: wg-chip-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes wg-chip-in {
  from { transform: translateY(-8px) scale(0.8); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* desktop side panel for recent words */
.frame.desktop .wordra-gameplay::after {
  content: "";
}
.wg-side {
  display: none;
}
.frame.desktop .wg-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 240px;
}

/* ================================================== */
/* RESULT                                              */
/* ================================================== */
.wr-root {
  width: 100%; height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 28px 32px;
  position: relative;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}
.frame.desktop .wr-root { padding: 80px 60px; }

.wr-ambient {
  position: absolute;
  inset: -10%;
  background: radial-gradient(ellipse 60% 40% at 50% 30%, rgba(255, 216, 77, 0.18), transparent 60%);
  filter: blur(40px);
  pointer-events: none;
}

.wr-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.wr-conf {
  position: absolute;
  width: 8px; height: 14px;
  top: -20px;
  animation: wr-fall 2.5s linear forwards;
}
@keyframes wr-fall {
  to { transform: translateY(120vh) rotate(540deg); }
}

.wr-close {
  position: absolute;
  top: 60px; right: 24px;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}

.wr-tag {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  position: relative;
  z-index: 2;
}
.wr-newbest {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--gold);
  background: rgba(255, 216, 77, 0.1);
  border: 1px solid rgba(255, 216, 77, 0.4);
  padding: 4px 12px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  text-shadow: 0 0 12px rgba(255, 216, 77, 0.6);
  animation: wr-pulse 1s ease-in-out infinite alternate;
  z-index: 2;
}
@keyframes wr-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.04); }
}
.wr-score {
  margin-top: 24px;
  text-align: center;
  z-index: 2;
}
.wr-score-num {
  font-size: 84px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.frame.desktop .wr-score-num { font-size: 120px; }
.wr-score-row {
  margin-top: 8px;
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-3);
  letter-spacing: 0.06em;
}
.wr-rank {
  background: var(--purple);
  color: white;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.wr-stats {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 380px;
  z-index: 2;
}
.wr-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  text-align: center;
}
.wr-stat-num {
  font-size: 22px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.wr-stat-lbl {
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.08em;
}

.wr-top {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(124, 92, 255, 0.1);
  border: 1px solid rgba(124, 92, 255, 0.3);
  padding: 8px 16px;
  border-radius: 999px;
  z-index: 2;
}
.wr-top-lbl {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--purple);
  font-family: 'JetBrains Mono', monospace;
}
.wr-top-word {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text);
}

.wr-words {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  max-width: 380px;
  z-index: 2;
}
.wr-word {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: lowercase;
}
.wr-word.more {
  background: transparent;
  color: var(--text-3);
  border-style: dashed;
}

.wr-cta-row {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 380px;
  z-index: 2;
}
.wr-cta {
  flex: 1;
  height: 52px;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.18s;
}
.wr-cta:hover { transform: translateY(-2px); }
.wr-cta.primary {
  background: linear-gradient(180deg, var(--purple), var(--purple-deep));
  color: white;
  box-shadow: 0 4px 0 #2a1888, 0 0 24px rgba(124, 92, 255, 0.4);
}
.wr-cta.secondary {
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--text);
  box-shadow: 0 4px 0 var(--shadow-cta);
}

/* ================================================== */
/* DAILY                                               */
/* ================================================== */
.wd-root {
  width: 100%; height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 60px 24px 32px;
  position: relative;
  overflow: hidden;
}
.frame.desktop .wd-root { padding: 60px 80px; }

.wd-ambient {
  position: absolute;
  inset: -10%;
  background: radial-gradient(ellipse 50% 30% at 70% 10%, rgba(124, 92, 255, 0.2), transparent 60%);
  filter: blur(40px);
  pointer-events: none;
}

.wd-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  z-index: 2;
}
.wd-back {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.wd-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text);
}
.wd-spacer { width: 36px; }

.wd-card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  padding: 22px;
  position: relative;
  overflow: hidden;
  z-index: 2;
}
.wd-card::before {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(255, 216, 77, 0.2), transparent 70%);
}
.wd-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
}
.wd-no {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.04em;
  font-family: 'Inter', sans-serif;
  color: var(--text);
}
.wd-date {
  margin-top: 4px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-3);
}
.wd-badge {
  background: rgba(255, 216, 77, 0.15);
  color: var(--gold);
  border: 1px solid rgba(255, 216, 77, 0.4);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-family: 'JetBrains Mono', monospace;
}

.wd-myscore {
  margin-top: 22px;
  text-align: center;
}
.wd-myscore-num {
  font-size: 56px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(255, 216, 77, 0.4);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.wd-myscore-lbl {
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
}

.wd-empty {
  margin-top: 22px;
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
  padding: 0 12px;
}

.wd-play {
  margin-top: 22px;
  width: 100%;
  height: 52px;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--purple), var(--purple-deep));
  color: white;
  border: none;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 4px 0 #2a1888, 0 0 24px rgba(124, 92, 255, 0.35);
  transition: transform 0.18s;
}
.wd-play:hover:not(:disabled) { transform: translateY(-2px); }
.wd-play:disabled {
  background: var(--surface-2);
  box-shadow: 0 4px 0 var(--shadow-cta);
  color: var(--text-3);
  cursor: default;
}

.wd-lb {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
  z-index: 2;
}
.wd-lb-head {
  display: flex;
  justify-content: space-between;
  padding: 0 6px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-3);
}
.wd-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  padding: 10px 6px;
  font-size: 13px;
  border-radius: 8px;
}
.wd-row.you {
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.3);
}
.wd-rank {
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-3);
  font-size: 12px;
}
.wd-name {
  font-weight: 600;
  color: var(--text);
}
.wd-row.you .wd-name { color: var(--purple); }
.wd-pts {
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ================================================== */
/* DESIGN CANVAS HEADER                                */
/* ================================================== */
.dc-section { background: transparent !important; }
.dc-artboard {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* annotation card next to design */
.note-card {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.5;
  font-family: 'JetBrains Mono', monospace;
  max-width: 260px;
}
.note-card b { color: var(--text); font-weight: 700; }


/* ============================================================
   PAUSE OVERLAY
============================================================ */
.wp-root {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.wp-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: wp-fade-in 200ms ease-out;
}
.wp-card {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.6), 0 0 0 1px var(--border);
  animation: wp-pop 280ms cubic-bezier(.34,1.6,.64,1);
}
.wp-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--purple) 15%, transparent);
  color: var(--purple);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.wp-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}
.wp-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.wp-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: color-mix(in oklab, var(--bg) 60%, transparent);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 120ms;
  font-family: inherit;
}
.wp-toggle:hover { border-color: var(--purple); }
.wp-toggle.on { background: color-mix(in oklab, var(--purple) 12%, var(--surface)); border-color: var(--purple); }
.wp-toggle-icon { font-size: 20px; }
.wp-toggle-label { font-size: 11px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.08em; }
.wp-toggle-state { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700; color: var(--text-2); letter-spacing: 0.1em; }
.wp-toggle.on .wp-toggle-state { color: var(--purple); }
.wp-actions { display: flex; flex-direction: column; gap: 8px; }
.wp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 80ms, filter 120ms;
  border: 1px solid transparent;
}
.wp-btn:active { transform: translateY(1px); }
.wp-btn.primary { background: var(--purple); color: white; box-shadow: 0 6px 20px -8px var(--purple); }
.wp-btn.primary:hover { filter: brightness(1.08); }
.wp-btn.secondary { background: color-mix(in oklab, var(--bg) 60%, transparent); color: var(--text); border-color: var(--border); }
.wp-btn.ghost { background: transparent; color: var(--text-2); }
@keyframes wp-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wp-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   ONBOARDING
============================================================ */
.wo-root {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 60px 24px 32px;
  background: var(--bg);
  gap: 24px;
}
.wo-skip {
  position: absolute;
  top: 56px;
  right: 24px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-2);
  cursor: pointer;
}
.wo-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wo-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  width: 280px;
  aspect-ratio: 1;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}
.wo-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  transition: all 200ms;
}
.wo-cell.sel { background: color-mix(in oklab, var(--purple) 22%, var(--surface)); color: var(--purple); border-color: var(--purple); transform: scale(1.06); }
.wo-cell.valid { background: color-mix(in oklab, var(--gold) 28%, var(--surface)); color: var(--gold-deep, #B58800); border-color: var(--gold); animation: wo-pulse 400ms ease-out; }
.wo-order {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--purple);
  font-weight: 700;
}
.wo-finger {
  position: absolute;
  top: 12px;
  left: 12px;
  width: calc((100% - 24px - 24px) / 5);
  aspect-ratio: 1;
  pointer-events: none;
  transform: translate(calc(var(--gx) * (100% + 6px)), calc(var(--gy) * (100% + 6px)));
  transition: transform 600ms cubic-bezier(.5,1.4,.5,1);
}
.wo-finger::after {
  content: "";
  position: absolute;
  inset: 25%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklab, var(--purple) 70%, transparent) 0%, transparent 70%);
  border: 2px solid var(--purple);
  animation: wo-finger-pulse 800ms ease-out infinite;
}
.wo-popup {
  position: absolute;
  top: 30%;
  right: -24px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 28px;
  color: var(--gold);
  text-shadow: 0 0 20px color-mix(in oklab, var(--gold) 60%, transparent);
  animation: wo-popup 800ms ease-out;
}
.wo-popup small { font-size: 14px; opacity: 0.8; }
.wo-copy { display: flex; flex-direction: column; gap: 10px; }
.wo-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.wo-step-num { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 800; color: var(--purple); letter-spacing: 0.1em; }
.wo-step-text { font-size: 14px; font-weight: 600; color: var(--text); }
.wo-cta {
  height: 52px;
  background: var(--purple);
  color: white;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 24px -10px var(--purple);
}
@keyframes wo-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
@keyframes wo-finger-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
}
@keyframes wo-popup {
  0% { opacity: 0; transform: translateY(20px) scale(0.5); }
  30% { opacity: 1; transform: translateY(-10px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-40px) scale(1); }
}

/* ============================================================
   COUNTDOWN
============================================================ */
.wc-root {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.wc-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.wc-num {
  position: relative;
  font-family: 'JetBrains Mono', monospace;
  font-size: 200px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  text-shadow: 0 0 60px color-mix(in oklab, var(--purple) 80%, transparent);
  animation: wc-pop 700ms cubic-bezier(.34,1.6,.64,1);
}
.wc-num.go {
  font-size: 120px;
  color: var(--gold);
  text-shadow: 0 0 80px color-mix(in oklab, var(--gold) 90%, transparent);
}
.wc-sub {
  position: relative;
  margin-top: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--text-2);
  text-transform: uppercase;
}
@keyframes wc-pop {
  0% { opacity: 0; transform: scale(2); }
  20% { opacity: 1; transform: scale(0.95); }
  60% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.85); }
}

/* ============================================================
   SETTINGS
============================================================ */
.ws-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
  overflow-y: auto;
  padding-bottom: 32px;
}
.ws-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.ws-back, .wpr-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
}
.ws-title, .wpr-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--text);
}
.ws-spacer, .wpr-spacer { width: 36px; }
.ws-section { margin-top: 24px; padding: 0 20px; }
.ws-section-head {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--text-2);
  margin-bottom: 8px;
  padding: 0 4px;
}
.ws-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all 120ms;
}
.ws-row:hover { border-color: color-mix(in oklab, var(--purple) 50%, var(--border)); }
.ws-row-icon { font-size: 22px; width: 32px; text-align: center; }
.ws-row-meta { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ws-row-title { font-size: 14px; font-weight: 700; color: var(--text); }
.ws-row-sub { font-size: 11px; color: var(--text-2); }
.ws-row-toggle {
  position: relative;
  width: 36px;
  height: 22px;
  background: var(--border);
  border-radius: 999px;
  transition: background 200ms;
}
.ws-row-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 200ms cubic-bezier(.34,1.6,.64,1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.ws-row.on .ws-row-toggle { background: var(--purple); }
.ws-row.on .ws-row-knob { transform: translateX(14px); }
.ws-row-opts { display: flex; gap: 4px; padding: 3px; background: var(--bg); border-radius: 8px; border: 1px solid var(--border); }
.ws-row-opt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--text-2);
}
.ws-row-opt.sel { background: var(--purple); color: white; }
.ws-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-2);
}
.ws-meta-row span:last-child { color: var(--text); font-weight: 600; }
.ws-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  padding: 0 20px;
  font-size: 11px;
  color: var(--text-3, var(--text-2));
}
.ws-link { background: none; border: none; color: var(--text-2); cursor: pointer; font: inherit; padding: 4px; }
.ws-link:hover { color: var(--purple); }

/* ============================================================
   PROFILE / STATS
============================================================ */
.wpr-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
  overflow-y: auto;
  padding-bottom: 32px;
}
.wpr-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.wpr-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
}
.wpr-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 24px 16px;
  text-align: center;
}
.wpr-avatar {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--purple) 0%, color-mix(in oklab, var(--purple) 60%, var(--gold)) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 900;
  color: white;
  box-shadow: 0 12px 32px -10px var(--purple);
  margin-bottom: 10px;
}
.wpr-name { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.wpr-rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 240px;
}
.wpr-rank-tier {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--gold);
}
.wpr-rank-progress {
  position: relative;
  width: 100%;
  height: 6px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.wpr-rank-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--gold));
  border-radius: 999px;
}
.wpr-rank-meta { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-2); }
.wpr-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 16px 20px;
}
.wpr-stat {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wpr-stat.hero {
  grid-column: span 2;
  background: linear-gradient(135deg, color-mix(in oklab, var(--purple) 18%, var(--surface)), var(--surface));
  border-color: color-mix(in oklab, var(--purple) 40%, var(--border));
}
.wpr-stat-num { font-family: 'JetBrains Mono', monospace; font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.wpr-stat.hero .wpr-stat-num { font-size: 40px; color: var(--purple); }
.wpr-stat.streak .wpr-stat-num { color: #FF7A29; }
.wpr-stat-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-2);
  margin-top: 4px;
}
.wpr-trend {
  margin: 0 20px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.wpr-trend-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.wpr-trend-head span:first-child {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-2);
}
.wpr-trend-up {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 800;
  color: #22C55E;
}
.wpr-row-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 16px 20px;
}
.wpr-row-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.wpr-row-stat-lbl { font-size: 11px; color: var(--text-2); font-weight: 600; }
.wpr-row-stat-val { font-size: 16px; font-weight: 800; color: var(--text); }
.wpr-row-stat-val.mono { font-family: 'JetBrains Mono', monospace; letter-spacing: 0.05em; }
.wpr-achievements { padding: 8px 20px; }
.wpr-ach-head {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--text-2);
  margin-bottom: 10px;
  padding: 0 4px;
}
.wpr-ach-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.wpr-ach {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  opacity: 0.4;
  text-align: center;
}
.wpr-ach.on { opacity: 1; border-color: color-mix(in oklab, var(--gold) 40%, var(--border)); background: color-mix(in oklab, var(--gold) 10%, var(--surface)); }
.wpr-ach-icon { font-size: 22px; filter: grayscale(1); }
.wpr-ach.on .wpr-ach-icon { filter: none; }
.wpr-ach-name { font-size: 10px; font-weight: 700; color: var(--text-2); }
.wpr-ach.on .wpr-ach-name { color: var(--text); }

/* ============================================================
   LOADING
============================================================ */
.wl-root {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: var(--bg);
  padding: 40px 24px;
  gap: 24px;
}
.wl-logo-tiles {
  display: flex;
  gap: 6px;
}
.wl-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  animation: wl-bob 1.2s ease-in-out infinite;
}
.wl-bar {
  position: relative;
  width: 220px;
  height: 6px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.wl-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--gold));
  border-radius: 999px;
  transition: width 300ms;
  position: relative;
  overflow: hidden;
}
.wl-bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: wl-shimmer 1.4s linear infinite;
}
.wl-pct { font-family: 'JetBrains Mono', monospace; font-weight: 800; font-size: 14px; color: var(--text); letter-spacing: 0.1em; }
.wl-tip { font-size: 12px; color: var(--text-2); text-align: center; max-width: 220px; line-height: 1.5; }
@keyframes wl-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes wl-shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* ============================================================
   LANG PICKER
============================================================ */
.wlp-root {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: var(--bg);
  padding: 48px 24px;
  gap: 16px;
}
.wlp-logo {
  font-weight: 900;
  font-size: 36px;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, var(--purple), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wlp-sub { font-size: 13px; color: var(--text-2); margin-bottom: 20px; }
.wlp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}
.wlp-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
  transition: all 120ms;
}
.wlp-card:hover { border-color: var(--purple); transform: translateY(-2px); }
.wlp-flag { font-size: 36px; }
.wlp-name { font-size: 15px; font-weight: 800; color: var(--text); }
.wlp-meta { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700; color: var(--text-2); letter-spacing: 0.15em; }
.wlp-foot { margin-top: 24px; font-size: 11px; color: var(--text-2); }

/* ============================================================
   EMPTY STATE
============================================================ */
.we-root {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: var(--bg);
  padding: 40px 24px;
  gap: 12px;
  text-align: center;
}
.we-icon { font-size: 56px; filter: grayscale(0.3); margin-bottom: 8px; }
.we-title { font-size: 20px; font-weight: 800; color: var(--text); }
.we-sub { font-size: 13px; color: var(--text-2); max-width: 240px; line-height: 1.5; }
.we-cta {
  margin-top: 12px;
  height: 48px;
  padding: 0 24px;
  background: var(--purple);
  color: white;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 20px -10px var(--purple);
}

/* ============================================================
   SHARE CARD
============================================================ */
.ws-card-canvas {
  border-radius: 16px;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.5);
  border: 1px solid var(--border);
}


/* ============================================================
   ITEM ANIMATIONS — Candy Crush-style WOW effects
============================================================ */

/* ---- ITEM BUTTON: ripple when fired ---- */
.wg-item.firing {
  transform: scale(0.94);
  border-color: var(--item-color) !important;
  background: color-mix(in oklab, var(--item-color) 18%, var(--surface));
  animation: wg-item-fire 480ms cubic-bezier(.34,1.6,.64,1);
}
.wg-item.firing .wg-item-icon {
  animation: wg-item-icon-pop 600ms cubic-bezier(.34,1.6,.64,1);
  filter: drop-shadow(0 0 12px var(--item-color));
}
.wg-item-ripple {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 2px solid var(--item-color);
  pointer-events: none;
  animation: wg-item-ripple 700ms ease-out forwards;
}
@keyframes wg-item-fire {
  0% { transform: scale(1); }
  20% { transform: scale(0.92); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes wg-item-icon-pop {
  0% { transform: scale(1) rotate(0); }
  30% { transform: scale(1.6) rotate(-12deg); }
  60% { transform: scale(1.2) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes wg-item-ripple {
  0% { opacity: 1; transform: scale(1); border-width: 3px; }
  100% { opacity: 0; transform: scale(2.4); border-width: 1px; }
}

/* ---- BIG BANNER FLASH ---- */
.wg-item-flash {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 60;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px 18px 22px;
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--surface) 92%, transparent) 0%,
    color-mix(in oklab, var(--surface) 80%, transparent) 100%);
  border: 2px solid var(--purple);
  border-radius: 24px;
  box-shadow:
    0 0 0 6px color-mix(in oklab, var(--purple) 20%, transparent),
    0 30px 80px -20px rgba(0,0,0,0.6),
    inset 0 0 20px color-mix(in oklab, var(--purple) 30%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: wg-banner 1100ms cubic-bezier(.34,1.6,.64,1);
}
.wg-item-flash.flash-shuffle { border-color: #22D3EE; box-shadow: 0 0 0 6px rgba(34,211,238,0.2), 0 30px 80px -20px rgba(0,0,0,0.6); }
.wg-item-flash.flash-time    { border-color: #22C55E; box-shadow: 0 0 0 6px rgba(34,197,94,0.2), 0 30px 80px -20px rgba(0,0,0,0.6); }
.wg-item-flash.flash-hint    { border-color: #FFD84D; box-shadow: 0 0 0 6px rgba(255,216,77,0.25), 0 30px 80px -20px rgba(0,0,0,0.6); }
.wg-item-flash.flash-lock    { border-color: #FF8A3D; box-shadow: 0 0 0 6px rgba(255,138,61,0.25), 0 30px 80px -20px rgba(0,0,0,0.6); }
.wg-item-flash-icon {
  font-size: 38px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
  animation: wg-flash-icon 1100ms cubic-bezier(.34,1.6,.64,1);
}
.wg-item-flash-text {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.wg-item-flash-rays {
  position: absolute;
  inset: -40%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg, rgba(255,255,255,0.18) 8deg, transparent 16deg,
    transparent 60deg, rgba(255,255,255,0.18) 68deg, transparent 76deg,
    transparent 120deg, rgba(255,255,255,0.18) 128deg, transparent 136deg,
    transparent 180deg, rgba(255,255,255,0.18) 188deg, transparent 196deg,
    transparent 240deg, rgba(255,255,255,0.18) 248deg, transparent 256deg,
    transparent 300deg, rgba(255,255,255,0.18) 308deg, transparent 316deg
  );
  z-index: -1;
  border-radius: 50%;
  filter: blur(2px);
  animation: wg-rays-spin 1100ms linear;
}
@keyframes wg-banner {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(-8deg); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.18) rotate(2deg); }
  40% { transform: translate(-50%, -50%) scale(0.96) rotate(-1deg); }
  60% { transform: translate(-50%, -50%) scale(1.04) rotate(0deg); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.92) translateY(-40px); }
}
@keyframes wg-flash-icon {
  0% { transform: scale(0) rotate(-180deg); }
  30% { transform: scale(1.4) rotate(20deg); }
  50% { transform: scale(1) rotate(-8deg); }
  70% { transform: scale(1.1) rotate(0deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes wg-rays-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(180deg); }
}

/* ---- SHUFFLE: cells spin out & drop in ---- */
.wg-cell.fx-shuffle-out {
  animation: wg-cell-shuffle-out 350ms cubic-bezier(.6,-0.2,.7,0) forwards;
}
.wg-cell.fx-shuffle-in {
  animation: wg-cell-shuffle-in 500ms cubic-bezier(.34,1.6,.64,1) backwards;
}
@keyframes wg-cell-shuffle-out {
  0% { transform: scale(1) rotate(0); opacity: 1; }
  100% { transform: scale(0) rotate(720deg) translateY(-30px); opacity: 0; filter: blur(4px); }
}
@keyframes wg-cell-shuffle-in {
  0% { transform: scale(0) rotate(-720deg) translateY(40px); opacity: 0; filter: blur(4px); }
  60% { transform: scale(1.15) rotate(20deg) translateY(0); opacity: 1; filter: blur(0); }
  80% { transform: scale(0.95) rotate(-4deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.wg-vortex {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.wg-vortex-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid #22D3EE;
  opacity: 0;
}
.wg-vortex.out .r1 { width: 60%; aspect-ratio: 1; animation: wg-vortex-out 350ms ease-out; }
.wg-vortex.out .r2 { width: 80%; aspect-ratio: 1; animation: wg-vortex-out 350ms ease-out 80ms; }
.wg-vortex.out .r3 { width: 100%; aspect-ratio: 1; animation: wg-vortex-out 350ms ease-out 160ms; }
.wg-vortex.in .r1 { width: 100%; aspect-ratio: 1; animation: wg-vortex-in 500ms ease-out; }
.wg-vortex.in .r2 { width: 80%; aspect-ratio: 1; animation: wg-vortex-in 500ms ease-out 80ms; }
.wg-vortex.in .r3 { width: 60%; aspect-ratio: 1; animation: wg-vortex-in 500ms ease-out 160ms; }
@keyframes wg-vortex-out {
  0% { opacity: 0.8; transform: scale(0.4) rotate(0); border-width: 4px; }
  100% { opacity: 0; transform: scale(1.2) rotate(360deg); border-width: 1px; }
}
@keyframes wg-vortex-in {
  0% { opacity: 0; transform: scale(1.4) rotate(0); border-width: 1px; }
  60% { opacity: 0.8; transform: scale(0.8) rotate(-180deg); border-width: 3px; }
  100% { opacity: 0; transform: scale(0.6) rotate(-360deg); border-width: 1px; }
}

/* ---- TIME +10s: golden ring expanding from timer ---- */
.wg-timer.bonus {
  animation: wg-timer-bonus 700ms cubic-bezier(.34,1.6,.64,1);
  position: relative;
}
.wg-timer.bonus::after {
  content: "+10";
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 900;
  font-size: 18px;
  color: #22C55E;
  text-shadow: 0 0 12px rgba(34,197,94,0.8);
  animation: wg-time-plus 1000ms ease-out forwards;
  pointer-events: none;
  white-space: nowrap;
}
@keyframes wg-timer-bonus {
  0% { transform: scale(1); color: var(--text); }
  30% { transform: scale(1.4); color: #22C55E; text-shadow: 0 0 24px rgba(34,197,94,0.9); }
  60% { transform: scale(1); color: #22C55E; }
  100% { transform: scale(1); color: var(--text); text-shadow: none; }
}
@keyframes wg-time-plus {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.4); }
  20% { opacity: 1; transform: translateX(-50%) translateY(-4px) scale(1.3); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-40px) scale(1); }
}
.wg-time-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.wg-time-ring {
  position: absolute;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 4px solid #22C55E;
  opacity: 0;
  animation: wg-time-ring-anim 800ms ease-out;
}
.wg-time-ring.delay { animation-delay: 120ms; border-color: #FFD84D; border-width: 3px; }
.wg-time-clock {
  position: absolute;
  font-size: 64px;
  filter: drop-shadow(0 0 24px #22C55E);
  animation: wg-time-clock-anim 800ms cubic-bezier(.34,1.6,.64,1);
}
@keyframes wg-time-ring-anim {
  0% { opacity: 0; transform: scale(0.2); border-width: 8px; }
  40% { opacity: 0.9; }
  100% { opacity: 0; transform: scale(2.2); border-width: 1px; }
}
@keyframes wg-time-clock-anim {
  0% { opacity: 0; transform: scale(0) rotate(-180deg); }
  30% { opacity: 1; transform: scale(1.3) rotate(20deg); }
  60% { opacity: 1; transform: scale(0.95) rotate(-8deg); }
  80% { opacity: 0.6; transform: scale(1) rotate(0); }
  100% { opacity: 0; transform: scale(1.2) rotate(0); }
}

/* ---- HINT: spotlight beam onto target cell ---- */
.wg-cell.fx-hint-target {
  animation: wg-hint-target-pop 600ms cubic-bezier(.34,1.6,.64,1);
  z-index: 4;
}
@keyframes wg-hint-target-pop {
  0% { transform: scale(1); }
  30% { transform: scale(1.25); box-shadow: 0 0 0 6px rgba(255,216,77,0.4), 0 0 24px rgba(255,216,77,0.8); }
  60% { transform: scale(0.96); }
  100% { transform: scale(1); }
}
.wg-hint-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
  border-radius: inherit;
}
.wg-hint-spotlight {
  position: absolute;
  /* grid is 5x5 with 12px padding + 6px gap (matches default board) */
  --gap: 6px;
  --pad: 12px;
  width: calc((100% - 2 * var(--pad) - 4 * var(--gap)) / 5);
  aspect-ratio: 1;
  top: var(--pad);
  left: var(--pad);
  transform: translate(
    calc(var(--gx) * (100% + var(--gap))),
    calc(var(--gy) * (100% + var(--gap)))
  );
}
.wg-hint-spotlight::before {
  content: "";
  position: absolute;
  inset: -200%;
  background: radial-gradient(circle at center, rgba(255,216,77,0.55) 0%, rgba(255,216,77,0.15) 25%, transparent 55%);
  animation: wg-hint-spot 600ms ease-out;
}
.wg-hint-spotlight::after {
  content: "💡";
  position: absolute;
  top: -32px;
  left: 50%;
  font-size: 22px;
  transform: translateX(-50%);
  filter: drop-shadow(0 0 12px #FFD84D);
  animation: wg-hint-bulb 600ms cubic-bezier(.34,1.6,.64,1);
}
@keyframes wg-hint-spot {
  0% { opacity: 0; transform: scale(0.4); }
  40% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.4); }
}
@keyframes wg-hint-bulb {
  0% { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(0.4); }
  40% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.3); }
  100% { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.9); }
}

/* ---- LOCK: flame ignition ring ---- */
.wg-lock-ignite {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  z-index: 4;
}
.wg-lock-flame {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 3px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              conic-gradient(from 0deg, #FF8A3D, #FFD84D, #FF8A3D, #EF4444, #FF8A3D, #FFD84D, #FF8A3D) border-box;
  -webkit-mask: linear-gradient(white, white) content-box, linear-gradient(white, white);
  -webkit-mask-composite: xor;
  mask: linear-gradient(white, white) content-box, linear-gradient(white, white);
  mask-composite: exclude;
  animation: wg-lock-spin 800ms linear;
  filter: drop-shadow(0 0 20px #FF8A3D);
}
@keyframes wg-lock-spin {
  0% { opacity: 0; transform: rotate(0); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: rotate(720deg); }
}

/* combo bar lock chains */
.wg-combo.lock-chains {
  position: relative;
}
.wg-combo.lock-chains::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: repeating-linear-gradient(
    45deg,
    rgba(255,138,61,0.6) 0 4px,
    transparent 4px 12px
  );
  z-index: -1;
  animation: wg-chain-shift 1.2s linear infinite;
  border-radius: 12px;
}
.wg-lock-chain-fx {
  position: absolute;
  top: -8px; left: 0; right: 0; bottom: -8px;
  pointer-events: none;
}
.wg-lock-spark {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #FFD84D;
  border-radius: 50%;
  box-shadow: 0 0 8px #FF8A3D;
  animation: wg-lock-spark-anim 1.4s ease-out infinite;
}
.wg-lock-spark.s1 { left: 10%; top: 50%; animation-delay: 0s; }
.wg-lock-spark.s2 { left: 50%; top: 50%; animation-delay: 0.4s; }
.wg-lock-spark.s3 { left: 90%; top: 50%; animation-delay: 0.8s; }
@keyframes wg-chain-shift {
  from { background-position: 0 0; }
  to { background-position: 24px 0; }
}
@keyframes wg-lock-spark-anim {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-30px) scale(0); opacity: 0; }
}

/* ---- ITEM SPARKS — radial particles emitted on use ---- */
.wg-item-spark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  background: var(--c);
  border-radius: 50%;
  pointer-events: none;
  z-index: 6;
  box-shadow: 0 0 12px var(--c), 0 0 4px white;
  animation: wg-spark-fly 900ms cubic-bezier(.2,.6,.4,1) forwards;
}
@keyframes wg-spark-fly {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.4);
  }
  100% {
    opacity: 0;
    transform:
      translate(-50%, -50%)
      translate(calc(cos(var(--a)) * var(--d)), calc(sin(var(--a)) * var(--d)))
      scale(0.2);
  }
}

/* ensure grid clips nothing important and keeps overlays inside */
.wg-grid {
  position: relative;
}
