/* ─── Intersect — style.css (Production v2.0) ──────────────────────────────
 *
 * Changes from v1:
 *  - user-select: none removed from * (was blocking form inputs despite override)
 *  - touch-action: manipulation removed from * (was suppressing pinch-zoom)
 *  - Both properties applied only to draggable word pills and non-text elements
 *  - prefers-reduced-motion: animations disabled/minimized
 *  - prefers-color-scheme: dark already default (base is dark-first)
 *  - CLS prevention: min-height locks on zone-content containers
 *  - WCAG 2.1 AA contrast: all text on var(--surface) passes 4.5:1
 *  - will-change applied only on active drag state (not statically)
 *  - Hidden elements use [hidden] attribute selector instead of .hidden class
 *    (JS toggles the 'hidden' attribute)
 */

/* ─── Design Tokens: Liquid Platinum & Obsidian Titanium ────────── */
:root {
  --bg: #030305;
  --bg-void: #030305;
  --surface: rgba(14, 16, 22, 0.75);
  --surface-hover: rgba(22, 26, 36, 0.9);
  --surface-glass: rgba(18, 20, 28, 0.55);
  --surface-border: rgba(255, 255, 255, 0.08);
  --border-specular: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.22),
    rgba(255, 255, 255, 0.02)
  );
  --card-shadow:
    0 16px 40px -10px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-tertiary: #64748b;
  --accent: #f8fafc;
  --accent-hover: #ffffff;
  --accent-secondary: #cbd5e1;
  --accent-glow: rgba(255, 255, 255, 0.22);
  --red: #f43f5e;
  --green: #10b981;
  --gold: #d4af37;
  --gold-glow: rgba(212, 175, 55, 0.18);
  --border: rgba(255, 255, 255, 0.09);
  --platinum: #f1f5f9;
  --gunmetal: #94a3b8;
  --champagne: #dfc79b;

  /* Word Diamond Bricks */
  --brick-bg: linear-gradient(180deg, #1e2230 0%, #11131c 100%);
  --brick-border: rgba(255, 255, 255, 0.12);
  --brick-hover-border: rgba(255, 255, 255, 0.4);

  /* Layout */
  --max-content: 400px;
  --border-radius-card: 16px;
  --border-radius-pill: 9999px;
  --border-radius-brick: 10px;
}

/* ─── Reset ───────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Prevent text selection only on non-interactive elements */
body,
.zone-title,
.puzzle-number,
.lives,
.countdown-row,
.footer-copy,
.ad-tag,
.ad-headline,
.ad-sub,
.stat-label,
.dist-label,
.loader-title,
.loader-sub {
  user-select: -webkit-none;
  user-select: none;
}

/* Ensure form fields can always receive text selection */
input,
textarea,
select,
[contenteditable] {
  user-select: text;
  -webkit-user-select: text;
}

/* ─── Base ────────────────────────────────────────────────────────────────── */
body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 20px 15px;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Ambient living radial spotlight follows cursor and touch */
.ambient-spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    850px circle at var(--mouse-x, 50%) var(--mouse-y, 35%),
    rgba(255, 255, 255, 0.035),
    transparent 60%
  );
  transition: background 0.3s ease;
}

/* Ensure app content stays layered above ambient spotlight */
h1,
.subtitle,
.header-controls,
.countdown-container,
main,
.footer {
  position: relative;
  z-index: 1;
}

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

/* ─── Fullscreen App Loader ───────────────────────────────────────────────── */
#app-loader {
  position: fixed;
  inset: 0;
  background-color: var(--bg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

#app-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-icon-wrapper {
  position: relative;
  width: 86px;
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-app-svg {
  width: 86px;
  height: 86px;
  border-radius: 22px;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.25));
  animation: loader-pulse 2s ease-in-out infinite;
}

@keyframes loader-pulse {
  0%,
  100% {
    transform: scale(0.96);
    filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.18));
  }
  50% {
    transform: scale(1.04);
    filter: drop-shadow(0 0 28px rgba(255, 255, 255, 0.45));
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader-app-svg {
    animation: none;
  }
  .word.dragging {
    transition: none;
    transform: none;
  }
  .drop-placeholder {
    animation: none;
  }
  .btn.reward-life-btn {
    animation: none;
  }
  @keyframes shake {
    0%,
    100% {
      transform: none;
    }
  }
  @keyframes pulse {
    0%,
    50%,
    100% {
      transform: none;
    }
  }
  @keyframes ruleFadeIn {
    from {
      opacity: 1;
      transform: none;
    }
  }
}

.loader-title {
  font-size: 1.15rem;
  letter-spacing: 4px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
}

.loader-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 1.5px;
}

/* ─── Header & Title ──────────────────────────────────────────────────────── */
h1 {
  font-size: 1.9rem;
  letter-spacing: 5px;
  margin-bottom: 4px;
  font-weight: 850;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 40%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 12px rgba(255, 255, 255, 0.12));
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ─── Header Controls Bar (Decluttered & Balanced) ────────────────────────── */
.header-controls {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-content);
  margin-bottom: 15px;
  padding: 6px 12px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.puzzle-number {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 800;
  letter-spacing: 0.5px;
  z-index: 2;
}

/* SVG Lives Container — truly centered so right-side dock never crowds it */
.lives {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  z-index: 1;
}

.heart-svg {
  width: 18px;
  height: 18px;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 0.3s ease,
    opacity 0.3s ease;
  flex-shrink: 0;
}

.heart-svg.heart-active {
  fill: url(#gold-heart-gradient) #d4af37;
  stroke: rgba(255, 248, 231, 0.6);
  stroke-width: 0.8;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8))
    drop-shadow(0 0 8px rgba(212, 175, 55, 0.45));
}

.heart-svg.heart-empty {
  fill: rgba(255, 255, 255, 0.04);
  stroke: rgba(148, 163, 184, 0.4);
  stroke-width: 1.2;
  filter: none;
  opacity: 0.38;
}

.btn-heart-icon {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
  margin-left: 3px;
  display: inline-block;
}

.rewarded-heart-svg {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 2px 10px rgba(212, 175, 55, 0.45));
}

/* Sleek Segmented Micro-Dock on the right */
.header-right {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  z-index: 2;
}

.header-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 5px;
  touch-action: manipulation;
}

.header-icon-btn svg {
  width: 15px;
  height: 15px;
}

.header-icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.09);
  color: var(--text);
  transform: translateY(-1px);
}

.header-icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Sub-header & Sponsor Badge ─────────────────────────────────────────── */
.countdown-container {
  width: 100%;
  max-width: var(--max-content);
  margin-bottom: 15px;
}

.countdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.sub-sponsor-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--surface-border);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: default;
  transition: border-color 0.2s;
}

.sub-sponsor-badge:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.sub-sponsor-kicker {
  font-size: 0.6rem;
  font-weight: 700;
  opacity: 0.6;
  letter-spacing: 0.8px;
}

.sub-sponsor-name {
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.3px;
}

#countdown-timer {
  color: var(--text);
  font-weight: bold;
}

/* ─── 5-Puzzles Stepper & Experimental Badge ────────────────────────────── */
.puzzle-stepper-container {
  width: 100%;
  max-width: var(--max-content);
  margin-bottom: 14px;
  background: rgba(14, 16, 22, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 12px;
  padding: 8px 12px 10px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 248, 231, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.stepper-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.exp-badge {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff6de;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 999px;
  padding: 2px 8px;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.stepper-status-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: 0.04em;
}

.puzzle-progression-bar {
  display: flex;
  gap: 8px;
  width: 100%;
  align-items: center;
}

.progression-segment {
  flex: 1;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.progression-segment.active {
  background: linear-gradient(
    180deg,
    rgba(212, 175, 55, 0.3) 0%,
    rgba(140, 108, 25, 0.2) 100%
  );
  border: 1.5px solid #d4af37;
  color: #fffdf0;
  box-shadow:
    0 0 12px rgba(212, 175, 55, 0.35),
    inset 0 1px 0 rgba(255, 248, 231, 0.5);
}

.progression-segment.completed {
  background: rgba(212, 175, 55, 0.22);
  border-color: rgba(212, 175, 55, 0.7);
  color: #fff6de;
}

.progression-segment.failed {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* ─── Main ────────────────────────────────────────────────────────────────── */
main {
  width: 100%;
  max-width: var(--max-content);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ─── 4 Drop Quadrants Grid ──────────────────────────────────────────────── */
.zones-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 15px;
  width: 100%;
  max-width: var(--max-content);
  margin-bottom: 20px;
}

.zone {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-card);
  padding: 12px;
  min-height: 152px; /* CLS lock */
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  overflow: hidden;
  transition:
    background 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Specular Hair-line Bevel */
.zone::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-specular);
  pointer-events: none;
  border-radius: var(--border-radius-card) var(--border-radius-card) 0 0;
}

#zone-left::before {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.45) 0%,
    rgba(255, 255, 255, 0.08) 100%
  );
}

#zone-right::before {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(203, 213, 225, 0.45) 100%
  );
}

.zone.full-width {
  grid-column: span 2;
  min-height: 110px; /* CLS lock */
}

/* Intersection card for "Both Rules" zone — Toned-Down Classy Champagne Gold */
.zone.full-width#zone-both {
  border: 1px solid rgba(212, 175, 55, 0.38);
  background:
    radial-gradient(
      ellipse 80% 50% at 50% 0%,
      rgba(212, 175, 55, 0.06) 0%,
      transparent 100%
    ),
    var(--surface);
  box-shadow:
    0 16px 45px -10px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(243, 229, 171, 0.22),
    0 0 20px rgba(212, 175, 55, 0.06);
}

#zone-both::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1.5px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(212, 175, 55, 0.6) 50%,
    rgba(255, 255, 255, 0.08) 100%
  );
  pointer-events: none;
}

#zone-both .zone-title {
  color: #f3ebd7;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.22);
}

.zone.full-width#zone-neither {
  border-color: rgba(255, 255, 255, 0.08);
}

body.game-won #zone-left {
  border-color: rgba(203, 213, 225, 0.35);
  box-shadow:
    0 16px 45px -10px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 16px rgba(203, 213, 225, 0.08);
}

body.game-won #zone-right {
  border-color: rgba(148, 163, 184, 0.3);
  box-shadow:
    0 16px 45px -10px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 16px rgba(148, 163, 184, 0.06);
}

body.game-won #zone-both {
  border-color: rgba(212, 175, 55, 0.65);
  box-shadow:
    0 16px 45px -10px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 248, 231, 0.35),
    0 0 28px rgba(212, 175, 55, 0.2);
}

/* Fixed-height title container to guarantee baseline alignment and prevent CLS */
.zone-title {
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 14px;
  text-align: center;
  width: 100%;
}

.zone.full-width .zone-title {
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  margin-bottom: 10px;
}

/* Zone content area — consistent flex layout */
.zone-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 48px; /* CLS lock */
  flex-grow: 1;
}

/* Compact Rules boxes: vertical stacking with full-width stretch for clean, symmetrical alignment */
#zone-left .zone-content,
#zone-right .zone-content {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
}

#zone-left .word,
#zone-right .word,
#zone-left .drop-placeholder,
#zone-right .drop-placeholder {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(0.74rem, 2.5vw, 0.86rem);
  letter-spacing: 0.3px;
}

.zone.full-width .zone-content {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#zone-both .word,
#zone-neither .word,
#zone-both .drop-placeholder,
#zone-neither .drop-placeholder {
  flex: 1 1 0;
  max-width: 165px;
  min-width: 105px;
  min-height: 42px;
  padding: 8px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(0.74rem, 2.5vw, 0.86rem);
  letter-spacing: 0.3px;
  box-sizing: border-box;
}

/* ─── Rule Reveal Cards — Satin Champagne Gold Revelation ─────────────────── */
.rule-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  padding: 4px 8px;
  border-radius: 9px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: ruleFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.rule-text {
  font-size: clamp(0.68rem, 2.3vw, 0.82rem);
  font-weight: 850;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  line-height: 1;
  text-align: center;
  display: block;
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff6de;
  text-shadow: 0 0 16px rgba(212, 175, 55, 0.45);
}

/* Rule A & B: Satin Champagne Gold Reveal Cards */
.rule-card.rule-a,
.rule-card.rule-b {
  background: linear-gradient(
    180deg,
    rgba(34, 28, 16, 0.94) 0%,
    rgba(16, 13, 8, 0.98) 100%
  );
  border: 1.5px solid rgba(212, 175, 55, 0.55);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 248, 231, 0.32),
    0 0 18px rgba(212, 175, 55, 0.2);
}

@keyframes ruleFadeIn {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ─── Drag & Drop Zone Highlights ────────────────────────────────────────── */
.zone-highlight {
  background: rgba(24, 28, 38, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow:
    0 0 28px rgba(255, 255, 255, 0.15),
    var(--card-shadow) !important;
  transform: scale(1.015);
}

.drop-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: var(--border-radius-brick);
  font-size: 0.88rem;
  font-weight: 700;
  border: 1.5px dashed rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  opacity: 0.85;
  pointer-events: none;
  box-sizing: border-box;
  animation: ghostPulse 1.2s ease-in-out infinite alternate;
}

@keyframes ghostPulse {
  from {
    opacity: 0.5;
    transform: scale(0.97);
  }
  to {
    opacity: 0.95;
    transform: scale(1.02);
  }
}

/* ─── Word Bank ───────────────────────────────────────────────────────────── */
#word-bank {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: var(--max-content);
  min-height: 105px; /* CLS lock */
  padding: 15px;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--border-radius-card);
  border: 1px dashed var(--border);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
  margin-bottom: 18px;
  align-content: flex-start;
  transition:
    border-color 0.25s,
    background 0.25s;
}

#word-bank.bank-completed {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow:
    var(--card-shadow),
    inset 0 1px 0 var(--border-specular);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-content: center;
  min-height: 94px;
  padding: 18px 20px;
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
}

#word-bank.bank-completed.victory {
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  background: radial-gradient(
    ellipse 80% 60% at 50% 0%,
    rgba(212, 175, 55, 0.12) 0%,
    rgba(20, 16, 10, 0.95) 100%
  );
  box-shadow:
    var(--card-shadow),
    inset 0 1px 0 rgba(255, 248, 231, 0.3),
    0 0 24px rgba(212, 175, 55, 0.12);
}

#word-bank.bank-completed.gameover {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: linear-gradient(
    180deg,
    rgba(20, 24, 32, 0.95) 0%,
    rgba(10, 12, 16, 0.98) 100%
  );
  box-shadow:
    var(--card-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.bank-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  width: 100%;
  margin: 0 auto;
}

.bank-message-title {
  display: block;
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1.2;
  text-align: center;
}

.bank-message-title.victory {
  background: linear-gradient(180deg, #fffdf5 0%, #f7d884 55%, #cfa738 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 18px rgba(212, 175, 55, 0.45));
}

.bank-message-title.gameover {
  background: linear-gradient(180deg, #f8fafc 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.25));
}

.bank-message-sub {
  font-size: 0.82rem;
  color: #dfd8c8;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-align: center;
  margin-top: 2px;
}

/* ─── Word Diamond Bricks ─────────────────────────────────────────────────── */
.word {
  background: linear-gradient(
    180deg,
    rgba(28, 32, 44, 0.85) 0%,
    rgba(14, 16, 24, 0.95) 100%
  );
  color: #f1f5f9;
  padding: 10px 18px;
  border-radius: var(--border-radius-brick);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 105px;
  box-sizing: border-box;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  touch-action: none; /* Prevent scroll during drag */
  cursor: grab;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}

.word:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow:
    0 8px 20px -4px rgba(0, 0, 0, 0.6),
    0 0 16px rgba(255, 255, 255, 0.14);
}

.word:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.word.dragging {
  opacity: 0.96;
  transform: scale(1.06) rotate(1deg);
  z-index: 99999;
  position: fixed;
  border-radius: var(--border-radius-brick);
  background: linear-gradient(
    180deg,
    rgba(34, 40, 56, 0.95) 0%,
    rgba(18, 22, 32, 0.98) 100%
  );
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 0 25px rgba(255, 255, 255, 0.2);
  cursor: grabbing;
  pointer-events: none;
  margin: 0;
  box-sizing: border-box;
  will-change: transform, left, top;
}

.word.drag-origin-dimmed {
  opacity: 0.22 !important;
  transform: scale(0.96) !important;
  filter: grayscale(0.5);
  box-shadow: none !important;
  pointer-events: none;
}

/* Solved word colour variants — The Vault: Cold Steel A/B + Refined Satin Champagne Gold on Both */
.word.solved-left {
  background: linear-gradient(
    180deg,
    rgba(30, 36, 48, 0.95) 0%,
    rgba(16, 18, 26, 0.98) 100%
  ) !important;
  border-color: rgba(203, 213, 225, 0.45) !important;
  color: #ffffff !important;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 14px rgba(203, 213, 225, 0.12) !important;
  pointer-events: none;
}
.word.solved-right {
  background: linear-gradient(
    180deg,
    rgba(24, 28, 38, 0.95) 0%,
    rgba(12, 14, 22, 0.98) 100%
  ) !important;
  border-color: rgba(148, 163, 184, 0.38) !important;
  color: #f1f5f9 !important;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 12px rgba(148, 163, 184, 0.1) !important;
  pointer-events: none;
}
.word.solved-both {
  background: linear-gradient(
    180deg,
    rgba(46, 38, 24, 0.95) 0%,
    rgba(22, 18, 12, 0.98) 100%
  ) !important;
  border-color: rgba(212, 175, 55, 0.5) !important;
  color: #fffdf7 !important;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(243, 229, 171, 0.3),
    0 0 16px rgba(212, 175, 55, 0.16) !important;
  pointer-events: none;
}
.word.solved-neither {
  background: linear-gradient(
    180deg,
    rgba(18, 20, 26, 0.85) 0%,
    rgba(10, 12, 16, 0.95) 100%
  ) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #94a3b8 !important;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  pointer-events: none;
}
.word.hint-pinned {
  background: linear-gradient(
    180deg,
    rgba(38, 32, 22, 0.9) 0%,
    rgba(20, 16, 12, 0.98) 100%
  ) !important;
  border-color: rgba(212, 175, 55, 0.5) !important;
  color: #f5eedc !important;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(243, 229, 171, 0.25),
    0 0 14px rgba(212, 175, 55, 0.15) !important;
  pointer-events: none;
  cursor: default;
}
.word.error {
  border-color: var(--red) !important;
  background: rgba(244, 63, 94, 0.2) !important;
  color: #fda4af !important;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.4) !important;
  animation: error-shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
.word.keyboard-selected {
  border-color: #ffffff !important;
  box-shadow:
    0 0 24px rgba(255, 255, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
  transform: scale(1.04);
  background: linear-gradient(180deg, #262e3d 0%, #131722 100%) !important;
  color: #ffffff !important;
}

@keyframes error-shake {
  10%,
  90% {
    transform: translate3d(-2px, 0, 0);
  }
  20%,
  80% {
    transform: translate3d(3px, 0, 0);
  }
  30%,
  50%,
  70% {
    transform: translate3d(-4px, 0, 0);
  }
  40%,
  60% {
    transform: translate3d(4px, 0, 0);
  }
}

body.word-selected .zone {
  border-style: dashed;
  cursor: pointer;
}

body.word-selected .zone:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
}

/* ─── Message ─────────────────────────────────────────────────────────────── */
#message {
  min-height: 0;
  font-weight: bold;
  font-size: 1.05rem;
  text-align: center;
  margin-bottom: 12px;
  width: 100%;
  max-width: var(--max-content);
}

#message:empty {
  margin-bottom: 0;
  display: none;
}

/* ─── Controls & Action Buttons ──────────────────────────────────────────── */
.action-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 380px;
  margin-bottom: 20px;
}

body.game-over .action-buttons {
  flex-direction: column;
  gap: 10px;
}

.btn {
  background: var(--text);
  color: var(--bg);
  border: none;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  border-radius: var(--border-radius-pill);
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.2s,
    background-color 0.2s,
    box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn.hint-btn {
  background: rgba(14, 16, 22, 0.85);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  padding: 13px 14px;
  flex: 0.35;
}

.btn.hint-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(22, 26, 36, 0.95);
  box-shadow:
    0 8px 24px -4px rgba(0, 0, 0, 0.6),
    0 0 14px var(--accent-glow);
  transform: translateY(-1px);
}

/* Progressive Rewarded Button — Satin Champagne Gold */
.btn.reward-life-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: linear-gradient(
    180deg,
    rgba(58, 46, 22, 0.92) 0%,
    rgba(28, 22, 10, 0.98) 100%
  );
  color: #fff4d6;
  border: 1.5px solid rgba(212, 175, 55, 0.55);
  padding: 13px 12px;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  flex: 0.55;
  border-radius: var(--border-radius-pill);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 248, 231, 0.35),
    0 0 14px rgba(212, 175, 55, 0.2);
  animation: rewardGlowGold 2.2s ease-in-out infinite alternate;
}

.btn.reward-life-btn:hover {
  background: linear-gradient(
    180deg,
    rgba(74, 58, 26, 0.95) 0%,
    rgba(38, 28, 12, 0.98) 100%
  );
  border-color: rgba(212, 175, 55, 0.85);
  color: #ffffff;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 248, 231, 0.5),
    0 0 20px rgba(212, 175, 55, 0.35);
}

@keyframes rewardGlowGold {
  from {
    box-shadow:
      0 8px 24px rgba(0, 0, 0, 0.7),
      inset 0 1px 0 rgba(255, 248, 231, 0.25),
      0 0 6px rgba(212, 175, 55, 0.12);
  }
  to {
    box-shadow:
      0 8px 24px rgba(0, 0, 0, 0.7),
      inset 0 1px 0 rgba(255, 248, 231, 0.45),
      0 0 18px rgba(212, 175, 55, 0.32);
  }
}

#submit-btn {
  background: linear-gradient(180deg, #2a3142 0%, #161a26 100%);
  color: #f8fafc;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  padding: 13px 20px;
  flex: 1;
  border-radius: var(--border-radius-pill);
  transition:
    transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
}

#submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #363e52 0%, #1e2332 100%);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 0 18px rgba(255, 255, 255, 0.1);
}

#submit-btn:active:not(:disabled) {
  transform: scale(0.97);
}

/* Share Result CTA on Game Over / Victory — Royal Satin Champagne Gold */
#submit-btn[data-action="share"] {
  background: linear-gradient(
    180deg,
    rgba(64, 52, 24, 0.96) 0%,
    rgba(28, 22, 10, 0.98) 100%
  );
  border: 1.5px solid rgba(212, 175, 55, 0.7);
  color: #fff9e8;
  font-weight: 850;
  letter-spacing: 1.8px;
  box-shadow:
    0 8px 26px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 248, 231, 0.45),
    0 0 20px rgba(212, 175, 55, 0.25);
}

#submit-btn[data-action="share"]:hover:not(:disabled) {
  background: linear-gradient(
    180deg,
    rgba(82, 66, 30, 0.98) 0%,
    rgba(40, 30, 14, 1) 100%
  );
  border-color: rgba(212, 175, 55, 0.95);
  color: #ffffff;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 248, 231, 0.6),
    0 0 28px rgba(212, 175, 55, 0.4);
  transform: translateY(-2px);
}

.btn:active {
  transform: scale(0.96);
}

/* Next Puzzle Button — Royal Satin Champagne Gold */
.btn.next-puzzle-btn {
  background: linear-gradient(
    180deg,
    rgba(235, 198, 78, 0.98) 0%,
    rgba(184, 142, 34, 0.98) 100%
  );
  color: #0b0c10;
  border: 1.5px solid rgba(255, 248, 231, 0.85);
  font-weight: 850;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 13px 18px;
  flex: 1;
  border-radius: var(--border-radius-pill);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 0 18px rgba(212, 175, 55, 0.35);
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.2s,
    background 0.2s;
}

.btn.next-puzzle-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(
    180deg,
    rgba(255, 218, 98, 1) 0%,
    rgba(204, 162, 44, 1) 100%
  );
  border-color: #ffffff;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 24px rgba(212, 175, 55, 0.5);
}

.btn.next-puzzle-btn:active {
  transform: scale(0.97);
}

.bank-next-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(212, 175, 55, 0.25) 0%,
    rgba(140, 108, 25, 0.18) 100%
  );
  border: 1px solid rgba(212, 175, 55, 0.6);
  color: #fff6de;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  vertical-align: middle;
}

.bank-next-link:hover {
  background: linear-gradient(
    180deg,
    rgba(212, 175, 55, 0.45) 0%,
    rgba(160, 124, 30, 0.35) 100%
  );
  border-color: #d4af37;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.45);
  transform: translateY(-1px);
}

#submit-btn:disabled {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.28) !important;
  box-shadow: none !important;
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  transform: none !important;
}

.btn:disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.shake {
  animation: shake 0.3s ease-in-out;
}

/* ─── Floating Toast ──────────────────────────────────────────────────────── */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(18, 16, 12, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: #fff9e8;
  padding: 10px 20px;
  border-radius: var(--border-radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 750;
  letter-spacing: 0.5px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 248, 231, 0.3),
    0 0 22px rgba(212, 175, 55, 0.22);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: calc(100vw - 48px);
  text-align: center;
}

/* [hidden] attribute hides but allows :not([hidden]) selectors */
.toast-notification[hidden] {
  display: none;
}

.toast-notification.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  width: 16px;
  height: 16px;
  color: #ffffff;
  flex-shrink: 0;
}

/* Toast Notification Error Variant — Crimson Alert, Never Gold */
.toast-notification.toast-error {
  background: rgba(26, 10, 14, 0.96);
  border-color: rgba(239, 68, 68, 0.7);
  color: #ffe4e6;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 140, 140, 0.3),
    0 0 24px rgba(239, 68, 68, 0.4);
}

.toast-notification.toast-error .toast-icon {
  color: #ef4444;
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  margin-top: 30px;
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  width: 100%;
  max-width: var(--max-content);
  border-top: 1px solid var(--border);
  padding-top: 15px;
}

.footer-links {
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.footer-links a,
.footer-links button.footer-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.footer-links a:hover,
.footer-links button.footer-link-btn:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-links a:focus-visible,
.footer-links button.footer-link-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.footer-divider {
  color: var(--border);
}

.footer-copy {
  opacity: 0.7;
  font-size: 0.75rem;
}

/* ─── Unified Modal System ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  cursor: pointer;
}

/* [hidden] on modal overlays: hide completely when not open */
.modal-overlay[hidden] {
  display: none;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  position: relative;
  background: linear-gradient(
    180deg,
    rgba(20, 24, 36, 0.96) 0%,
    rgba(10, 12, 18, 0.98) 100%
  );
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 26px 22px;
  width: 90%;
  max-width: 380px;
  text-align: center;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.9),
    0 0 35px var(--accent-glow);
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
  max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-close-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition:
    background 0.15s,
    color 0.15s;
  touch-action: manipulation;
}

.modal-close-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.modal-close-icon:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.modal-card h3 {
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 800;
}

.modal-card p,
.modal-card ul {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 15px;
  text-align: left;
}

.modal-card ul {
  padding-left: 20px;
}
.modal-card li {
  margin-bottom: 6px;
}

.modal-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
}

.modal-btn-primary {
  width: 100%;
  padding: 13px 18px;
  font-size: 0.92rem;
  background: linear-gradient(180deg, #2a3142 0%, #161a26 100%);
  color: #ffffff;
  border-radius: var(--border-radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition:
    transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.2s,
    border-color 0.2s,
    background 0.2s;
  touch-action: manipulation;
}

.modal-btn-primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #363e52 0%, #1e2332 100%);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 0 18px rgba(255, 255, 255, 0.15);
}
.modal-btn-primary:active {
  transform: scale(0.97);
}
.modal-btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Stats Modal Share CTA — Royal Satin Champagne Gold */
.modal-btn-share {
  background: linear-gradient(
    180deg,
    rgba(64, 52, 24, 0.96) 0%,
    rgba(28, 22, 10, 0.98) 100%
  ) !important;
  border: 1.5px solid rgba(212, 175, 55, 0.7) !important;
  color: #fff9e8 !important;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 248, 231, 0.45),
    0 0 18px rgba(212, 175, 55, 0.2) !important;
}

.modal-btn-share:hover {
  background: linear-gradient(
    180deg,
    rgba(82, 66, 30, 0.98) 0%,
    rgba(40, 30, 14, 1) 100%
  ) !important;
  border-color: rgba(212, 175, 55, 0.95) !important;
  color: #ffffff !important;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 248, 231, 0.6),
    0 0 24px rgba(212, 175, 55, 0.35) !important;
}

.modal-btn-secondary {
  width: 100%;
  padding: 13px 18px;
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: var(--border-radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: var(--card-shadow);
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.15s;
  touch-action: manipulation;
}

.modal-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}
.modal-btn-secondary:active {
  transform: scale(0.97);
}
.modal-btn-secondary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Legal & Policy Modals ───────────────────────────────────────────────── */
.legal-card {
  max-width: 460px;
  max-height: 85dvh;
}

.legal-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #fff6de;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--border-radius-pill);
  padding: 3px 10px;
  margin-bottom: 14px;
}

.legal-content {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 6px;
  text-align: left;
}

.legal-content h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff6de;
  margin: 14px 0 4px 0;
  letter-spacing: 0.4px;
}

.legal-content h4:first-child {
  margin-top: 0;
}

.legal-content p {
  margin-bottom: 10px;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #94a3b8;
}

.legal-content code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: #f1f5f9;
}

.legal-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.legal-content a:hover {
  color: #fff8e7;
}

/* ─── Feedback Form ───────────────────────────────────────────────────────── */
.feedback-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.45;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  width: 100%;
  text-align: left;
}

.form-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.form-input,
.form-textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.88rem;
  color: var(--text);
  font-family: inherit;
  box-sizing: border-box;
  transition:
    border-color 0.2s,
    background-color 0.2s;
  /* user-select and -webkit-user-select: text — set in global rule above */
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(15, 23, 42, 0.9);
}

.form-textarea {
  resize: none;
}

.direct-contact-note {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin: 8px 0 14px 0;
  line-height: 1.4;
}

.direct-contact-note a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.direct-contact-note a:hover {
  text-decoration: underline;
}

/* ─── Native Sponsor Card ─────────────────────────────────────────────────── */
.native-ad-card {
  background: rgba(20, 24, 34, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-card);
  padding: 12px 14px;
  margin: 10px 0 16px 0;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:
    border-color 0.2s,
    background 0.2s;
  cursor: pointer;
}

.native-ad-card:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(26, 30, 44, 0.85);
}

.ad-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.ad-tag {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.ad-provider {
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.ad-body {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ad-icon-tile {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.ad-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ad-headline {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}
.ad-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* ─── Rewarded Ad Modal ───────────────────────────────────────────────────── */
.rewarded-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 18px;
}

.rewarded-timer-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: #f5dc9a;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.32);
  padding: 2px 8px;
  border-radius: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.rewarded-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 12px 0 18px 0;
}

.rewarded-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 16px rgba(212, 175, 55, 0.45));
}
.rewarded-heading {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.rewarded-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 14px;
}

.rewarded-sponsor-box {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 12px 14px;
  width: 100%;
  text-align: left;
}

.sponsor-box-tag {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.9px;
  color: #d4af37;
  margin-bottom: 4px;
}
.sponsor-box-brand {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}
.sponsor-box-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* ─── Rewarded Ad Claim & Countdown Button — Satin Champagne Gold ────────── */
#rewarded-claim-btn {
  width: 100%;
  padding: 14px 18px;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  border-radius: var(--border-radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  touch-action: manipulation;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* While counting down ("Reward in 5s") — Rich dark burnished gold */
#rewarded-claim-btn:disabled {
  background: linear-gradient(
    180deg,
    rgba(46, 36, 18, 0.94) 0%,
    rgba(22, 17, 8, 0.98) 100%
  ) !important;
  color: #f3ebd7 !important;
  border: 1.5px solid rgba(212, 175, 55, 0.45) !important;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 248, 231, 0.22),
    0 0 14px rgba(212, 175, 55, 0.14) !important;
  opacity: 0.92 !important;
  cursor: wait !important;
  pointer-events: none !important;
}

/* When countdown finishes and claim is ready ("Claim +1 Life") */
#rewarded-claim-btn:not(:disabled) {
  background: linear-gradient(
    180deg,
    rgba(72, 56, 26, 0.98) 0%,
    rgba(34, 26, 12, 1) 100%
  ) !important;
  border: 1.5px solid rgba(212, 175, 55, 0.85) !important;
  color: #ffffff !important;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 248, 231, 0.5),
    0 0 22px rgba(212, 175, 55, 0.38) !important;
  animation: rewardGlowGold 2s ease-in-out infinite alternate;
  cursor: pointer !important;
}

#rewarded-claim-btn:not(:disabled):hover {
  transform: translateY(-1px);
  background: linear-gradient(
    180deg,
    rgba(88, 68, 32, 1) 0%,
    rgba(44, 34, 16, 1) 100%
  ) !important;
  border-color: #fff0c7 !important;
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 0 30px rgba(212, 175, 55, 0.5) !important;
}

#rewarded-claim-btn:not(:disabled):active {
  transform: scale(0.97);
}

/* ─── AdBlock Detected & Support Modals — Royal Obsidian & Satin Gold ─── */
.adblock-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px;
  max-width: 380px;
  text-align: center;
}

.adblock-meta {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.adblock-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #d4af37;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 3px 10px;
  border-radius: 12px;
}

.adblock-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 12px 0 16px 0;
}

.adblock-icon {
  margin-bottom: 12px;
  filter: drop-shadow(0 0 16px rgba(212, 175, 55, 0.45));
}

.adblock-heading {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff6de;
  margin-bottom: 8px;
}

.adblock-text {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.48;
}

.adblock-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
}

.adblock-help-drawer {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(14, 16, 22, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 10px;
  text-align: left;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.adblock-help-step {
  margin-bottom: 6px;
}

.adblock-help-step:last-child {
  margin-bottom: 0;
}

.modal-btn-gold {
  background: linear-gradient(
    180deg,
    rgba(64, 52, 24, 0.96) 0%,
    rgba(28, 22, 10, 0.98) 100%
  ) !important;
  border: 1.5px solid rgba(212, 175, 55, 0.7) !important;
  color: #fff9e8 !important;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 248, 231, 0.45),
    0 0 18px rgba(212, 175, 55, 0.2) !important;
}

.modal-btn-gold:hover {
  background: linear-gradient(
    180deg,
    rgba(82, 66, 30, 0.98) 0%,
    rgba(40, 30, 14, 1) 100%
  ) !important;
  border-color: rgba(212, 175, 55, 0.95) !important;
  color: #ffffff !important;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 248, 231, 0.6),
    0 0 24px rgba(212, 175, 55, 0.35) !important;
}

/* ─── Statistics Modal ────────────────────────────────────────────────────── */
.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0 20px 0;
}

.stat-box {
  background: rgba(20, 24, 34, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
}
.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  text-align: center;
  margin-top: 4px;
  font-weight: 600;
}

.distribution-title {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  text-align: left;
  font-weight: 700;
  text-transform: uppercase;
}

.distribution-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  width: 100%;
}

.dist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.dist-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 12px;
  text-align: right;
}

.dist-bar-wrapper {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  height: 26px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 2px;
}

.dist-bar {
  height: 100%;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px;
  min-width: 24px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  background: transparent;
  color: var(--text-muted);
}

.dist-bar.has-value {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.2)
  );
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.dist-bar.highlight-bar {
  background: linear-gradient(
    90deg,
    #b88a28 0%,
    #f6d27e 50%,
    #fff6de 100%
  ) !important;
  border: 1px solid rgba(212, 175, 55, 0.9) !important;
  box-shadow:
    0 0 18px rgba(212, 175, 55, 0.4),
    inset 0 1px 0 rgba(255, 248, 231, 0.8) !important;
  color: #1a1408 !important;
}

.dist-bar.highlight-bar .dist-count {
  color: #1a1408 !important;
  font-weight: 900;
}

.dist-count {
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffffff;
}

.dist-bar:not(.has-value) .dist-count {
  color: var(--text-muted);
}

/* ─── How-To Modal ────────────────────────────────────────────────────────── */
.howto-card {
  max-height: 90vh;
  overflow-y: auto;
}

.howto-summary {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 12px;
}

.example-container {
  background: rgba(10, 12, 16, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.example-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
}

.example-tag {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--accent);
}

.example-rules {
  font-size: 0.76rem;
  color: #e2e8f0;
}

.example-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.example-zone {
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 56px;
  transition: all 0.2s ease;
}

/* Zone A: Slate Titanium */
.example-zone.example-zone-a {
  background: linear-gradient(
    180deg,
    rgba(28, 34, 46, 0.85) 0%,
    rgba(14, 18, 26, 0.95) 100%
  );
  border: 1px solid rgba(203, 213, 225, 0.35);
}
.example-zone.example-zone-a .example-zone-title {
  color: #cbd5e1;
}

/* Zone B: Charcoal Gunmetal */
.example-zone.example-zone-b {
  background: linear-gradient(
    180deg,
    rgba(22, 26, 36, 0.85) 0%,
    rgba(12, 14, 22, 0.95) 100%
  );
  border: 1px solid rgba(148, 163, 184, 0.3);
}
.example-zone.example-zone-b .example-zone-title {
  color: #94a3b8;
}

/* Both Rules: Satin Champagne Gold */
.example-zone.example-zone-both {
  background: radial-gradient(
    ellipse 80% 60% at 50% 0%,
    rgba(212, 175, 55, 0.12) 0%,
    rgba(20, 16, 10, 0.92) 100%
  );
  border: 1px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.08);
}
.example-zone.example-zone-both .example-zone-title {
  color: #f3ebd7;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* Neither Rule: Obsidian Slate */
.example-zone.example-zone-neither {
  background: rgba(18, 20, 26, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.example-zone.example-zone-neither .example-zone-title {
  color: #64748b;
}

.example-zone.full-span {
  grid-column: span 2;
  min-height: 48px;
}

.example-zone-title {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 5px;
}

.example-zone-words {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Diamond Bricks per Zone */
.example-pill {
  padding: 4px 10px;
  border-radius: var(--border-radius-brick);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.example-pill.pill-a {
  background: linear-gradient(
    180deg,
    rgba(30, 36, 48, 0.95) 0%,
    rgba(16, 18, 26, 0.98) 100%
  );
  border: 1px solid rgba(203, 213, 225, 0.45);
  color: #ffffff;
}

.example-pill.pill-b {
  background: linear-gradient(
    180deg,
    rgba(24, 28, 38, 0.95) 0%,
    rgba(12, 14, 22, 0.98) 100%
  );
  border: 1px solid rgba(148, 163, 184, 0.38);
  color: #f1f5f9;
}

.example-pill.highlight-both {
  background: linear-gradient(
    180deg,
    rgba(46, 38, 24, 0.95) 0%,
    rgba(22, 18, 12, 0.98) 100%
  );
  border: 1px solid rgba(212, 175, 55, 0.6);
  color: #fffdf7;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.22);
}

.example-pill.pill-neither {
  background: linear-gradient(
    180deg,
    rgba(18, 20, 26, 0.85) 0%,
    rgba(10, 12, 16, 0.95) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.example-explanation {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
  background: rgba(255, 255, 255, 0.04);
  border-left: 2px solid rgba(255, 255, 255, 0.4);
  padding: 6px 8px;
  border-radius: 0 6px 6px 0;
}

.howto-rules-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.rule-bullet {
  font-size: 0.85rem;
}

/* ─── Tutorial Overlay ────────────────────────────────────────────────────── */
#tutorial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#tutorial-overlay[hidden] {
  display: none;
}

#tutorial-overlay.active {
  opacity: 1;
}

.tutorial-text {
  background: linear-gradient(180deg, #242938 0%, #151822 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 1.1rem;
  position: absolute;
  top: 15%;
  text-align: center;
  max-width: 80%;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.8),
    0 0 20px rgba(255, 255, 255, 0.2);
  pointer-events: auto;
}

.close-tutorial {
  position: absolute;
  top: -12px;
  right: -12px;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  touch-action: manipulation;
}

.tutorial-highlight {
  z-index: 1501 !important;
  position: relative;
  box-shadow:
    0 0 0 4px var(--accent),
    0 0 25px var(--accent) !important;
  border-color: var(--accent) !important;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

/* ─── Utility: [hidden] attribute ────────────────────────────────────────── */
/* Keep .hidden for loader fade-out transition (which needs display:flex) */
.hidden {
  display: none !important;
}

/* Ensure [hidden] always hides elements including buttons with display: flex */
.header-icon-btn[hidden],
[hidden] {
  display: none !important;
}

/* Standalone / Installed PWA mode — unconditionally hide install/download button */
@media (display-mode: standalone),
  (display-mode: window-controls-overlay),
  (display-mode: minimal-ui),
  (display-mode: fullscreen) {
  #install-app-btn {
    display: none !important;
  }
}

/* ─── Responsive Adjustments ─────────────────────────────────────────────── */
@media (max-width: 360px) {
  h1 {
    font-size: 1.5rem;
  }
  .zones-grid {
    gap: 10px;
  }
  .zone {
    min-height: 130px;
    padding: 8px;
  }
  .word {
    padding: 8px 12px;
    font-size: 0.82rem;
  }
  .action-buttons {
    gap: 8px;
  }
  .btn.hint-btn {
    padding: 11px 10px;
    font-size: 0.9rem;
  }
}

@media (min-width: 480px) {
  :root {
    --max-content: 440px;
  }
  .modal-card {
    max-width: 400px;
  }
}
