:root {
  color-scheme: dark;
  --bg-color: #0b1120;
  --card-bg: rgba(30, 41, 59, 0.65);
  --card-border: rgba(255, 255, 255, 0.12);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --maze-floor: #ede8df;
  --maze-visited: #d6cfbf;
  --wall-color: #475569;
  --empty-tile-bg: #091122;

  /* Ambient fluid orbs (Standard Default) */
  --liquid-orb-1: rgba(56, 189, 248, 0.22);
  --liquid-orb-2: rgba(99, 102, 241, 0.20);
  --liquid-orb-3: rgba(34, 197, 94, 0.14);
}

.tile,
.tut-tile,
.palette-btn,
.palette-preview span,
.maze-cell,
.rule-bulb,
.light {
  forced-color-adjust: none;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 1.5rem 1rem;
  font-family: system-ui, -apple-system, sans-serif;
  color: #f8fafc;
  min-height: 100vh;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;

  background-color: #030712;
  background-image: 
    radial-gradient(1px 1px at 25px 35px, rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(1px 1px at 75px 120px, rgba(147, 197, 253, 0.3), transparent),
    radial-gradient(1.5px 1.5px at 160px 80px, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1px 1px at 240px 190px, rgba(147, 197, 253, 0.25), transparent),
    radial-gradient(circle at 80% 20%, #0c1a3a 0%, #081126 35%, #050b18 70%, #02040a 100%);
  background-size: 320px 320px, 320px 320px, 320px 320px, 320px 320px, 100% 100%;
}

@keyframes cosmicFloat {
  0% {
    background-position: 0% 10%;
    filter: hue-rotate(0deg);
  }
  50% {
    background-position: 80% 90%;
    filter: hue-rotate(10deg);
  }
  100% {
    background-position: 20% 70%;
    filter: hue-rotate(-8deg);
  }
}

.liquid-glass-bg {
  position: fixed;
  inset: -40%;
  background: 
    radial-gradient(circle at 30% 35%, var(--liquid-orb-1) 0%, transparent 45%),
    radial-gradient(circle at 75% 65%, var(--liquid-orb-2) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, var(--liquid-orb-3) 0%, transparent 40%);
  filter: blur(80px);
  animation: liquidDrift 20s ease-in-out infinite alternate;
  z-index: -1;
  pointer-events: none;
  transition: all 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes liquidDrift {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  50% { transform: translate(-4%, 3%) rotate(7deg) scale(1.06); }
  100% { transform: translate(5%, -4%) rotate(-6deg) scale(1); }
}

.splash-container {
  position: fixed;
  inset: 0;
  background-color: #0b1120;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.splash-container.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
  max-width: 440px;
}

.splash-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.splash-title {
  margin: 0;
  font-size: 2.2rem;
  letter-spacing: 0.35rem;
  color: #f8fafc;
}

.splash-definition {
  margin-top: 1.25rem;
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.6;
  min-height: 3.2em;
  font-family: monospace, system-ui, sans-serif;
  letter-spacing: 0.02rem;
  text-align: left;
  display: inline-block;
  max-width: 360px;
  position: relative;
}

.typewriter-char {
  visibility: hidden;
}

.typewriter-char.revealed {
  visibility: visible;
}

.typewriter-cursor {
  display: inline-block;
  color: #38bdf8;
  font-weight: 700;
  animation: blinkCursor 0.75s step-start infinite;
  margin-left: 1px;
  vertical-align: baseline;
  position: absolute;
}

@keyframes blinkCursor {
  50% { opacity: 0; }
}

.splash-skip-hint {
  margin-top: 2rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  color: #475569;
  font-weight: 600;
  animation: pulseSkip 2s ease-in-out infinite;
}

@keyframes pulseSkip {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.9; }
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 1.5rem 1rem;

  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 40%, transparent 100%),
    rgba(11, 17, 32, 0.45);

  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);

  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  box-shadow: 
    0 20px 45px -10px rgba(0, 0, 0, 0.65), 
    inset 0 1px 0 rgba(255, 255, 255, 0.12);

  max-width: 440px;
  width: 94%;
  position: relative;
  box-sizing: border-box;
  transition: background-color 2.5s cubic-bezier(0.25, 1, 0.5, 1), 
              border-color 2.5s cubic-bezier(0.25, 1, 0.5, 1), 
              box-shadow 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.top-nav {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

.nav-left, .nav-right {
  display: flex;
  gap: 0.5rem;
}

.icon-btn,
.nav-left button,
.nav-right button {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid #334155;
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 700;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
  box-sizing: border-box !important;
}

.icon-btn:hover {
  color: var(--text-main);
  border-color: #475569;
  background-color: #0f172a;
}

#nav-account-btn.has-avatar {
  border-radius: 50% !important;
  padding: 2px !important;
  border-color: #38bdf8 !important;
  overflow: hidden !important;
}

.nav-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
}

header {
  text-align: center;
}

h1 {
  margin: 0;
  letter-spacing: 0.25rem;
  font-size: clamp(1.8rem, 7vw, 2.2rem);
}

.motto {
  margin: 0.2rem 0 0 0;
  color: #38bdf8;
  font-size: clamp(0.75rem, 3vw, 0.85rem);
  font-weight: 500;
  letter-spacing: 0.05rem;
  transition: color 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.subtitle {
  margin: 0.35rem 0 0 0;
  color: var(--text-muted);
  font-size: clamp(0.72rem, 2.8vw, 0.8rem);
  min-height: 2.2em;
  line-height: 1.25;
}

.color-legend {
  font-size: 0.72rem;
  color: #94a3b8;
  background-color: rgba(15, 23, 42, 0.75);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #334155;
  font-weight: 500;
  letter-spacing: 0.02rem;
  text-align: center;
  transition: background-color 2.5s cubic-bezier(0.25, 1, 0.5, 1), border-color 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.stats-bar {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 1rem;
  background-color: rgba(15, 23, 42, 0.75);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background-color 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: #38bdf8;
  transition: color 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  background-color: #334155;
  color: #cbd5e1;
  font-weight: 600;
}

.badge.final-mode {
  background-color: #f59e0b;
  color: #0f172a;
}

.badge.won-mode {
  background-color: #10b981;
  color: #042f2e;
}

.play-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0.25rem 0;
  width: 100%;
}

.platform-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.palette-bar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  background-color: rgba(15, 23, 42, 0.75);
  padding: 8px 14px;
  border-radius: 16px;
  border: 2px solid #334155;
  min-height: 56px;
  box-sizing: border-box;
  transition: background-color 2.5s cubic-bezier(0.25, 1, 0.5, 1), border-color 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.tut-palette-bar {
  margin: 6px auto 2px auto !important;
  padding: 6px 12px !important;
  min-height: 48px !important;
}

.palette-btn {
  display: block;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  aspect-ratio: 1 / 1 !important;
  flex: 0 0 38px !important;
  padding: 0;
  border-radius: 9px;
  cursor: pointer;
  border: 2px solid transparent;
  position: relative;
  touch-action: manipulation;
  box-sizing: border-box;
  transform: scale(1);
  transform-origin: center center;
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.2s ease, 
              box-shadow 0.2s ease, 
              opacity 0.2s ease;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35),
              inset 0 -2px 0 rgba(0, 0, 0, 0.25),
              0 3px 5px rgba(0, 0, 0, 0.3);
}

.palette-btn span.color-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.palette-bar.has-active .palette-btn {
  transform: scale(0.85);
  opacity: 0.7;
}

.palette-bar.has-active .palette-btn.active {
  transform: scale(1.22);
  opacity: 1;
  border-color: #ffffff !important;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5),
              inset 0 -2px 0 rgba(0, 0, 0, 0.3),
              0 0 12px rgba(255, 255, 255, 0.6);
}

.palette-btn.empty-swatch {
  background-color: var(--empty-tile-bg) !important;
  border: 2px solid #475569 !important;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.9),
              inset 0 -1px 2px rgba(255, 255, 255, 0.1),
              0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

.grid-board-dynamic {
  display: grid;
  gap: 8px;
  justify-content: center;
  align-content: center;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

.grid-board-dynamic .tile {
  width: 100%;
  aspect-ratio: 1 / 1;
  min-width: 0;
  min-height: 0;
}

/* 1. Flush Edge Tile Reflections (No inset gap) */
.tile {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  transition: transform 0.1s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  user-select: none;
  touch-action: manipulation;
  box-shadow: inset 0 3.5px 0 rgba(255, 255, 255, 0.45),
              inset 0 -3.5px 0 rgba(0, 0, 0, 0.35),
              0 4px 6px -1px rgba(0, 0, 0, 0.4),
              0 2px 4px -2px rgba(0, 0, 0, 0.4);
}

.tile:active {
  transform: translateY(2px) scale(0.98);
}

.tile.empty-tile,
.tut-tile.empty-tile {
  background-color: var(--empty-tile-bg) !important;
  border: 2px solid #475569 !important;
  box-shadow: inset 0 6px 14px rgba(0, 0, 0, 0.92),
              inset 0 1px 3px rgba(255, 255, 255, 0.08),
              0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

.tile.empty-tile:hover,
.tut-tile.empty-tile:hover {
  border-color: #64748b !important;
}

.tile.modified {
  box-shadow: inset 0 3.5px 0 rgba(255, 255, 255, 0.6),
              inset 0 -3.5px 0 rgba(0, 0, 0, 0.35),
              0 0 0 2.5px #ffffff,
              0 0 14px rgba(255, 255, 255, 0.8) !important;
}

.number-strip {
  display: flex;
  gap: clamp(3px, 1.2vw, 6px);
  justify-content: center;
  width: 100%;
  padding: 8px 4px;
  background-color: rgba(15, 23, 42, 0.75);
  border-radius: 12px;
  border: 1px solid #334155;
  transition: background-color 2.5s cubic-bezier(0.25, 1, 0.5, 1), border-color 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.num-box {
  width: clamp(28px, 8.8vw, 38px);
  height: clamp(44px, 12vw, 52px);
  background-color: #1e293b;
  border: 2px solid #334155;
  border-radius: 8px;
  color: #38bdf8;
  font-size: clamp(1.1rem, 4.5vw, 1.4rem);
  font-weight: 800;
  text-align: center;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
  padding: 0;
}

.num-box:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
  background-color: #0f172a;
}

.num-box.filled {
  border-color: #475569;
  color: #f8fafc;
}

.num-tip {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

.maze-wrapper {
  position: relative;
  width: 260px;
  height: 260px;
  background-color: var(--maze-floor);
  border: 4px solid var(--wall-color);
  border-radius: 12px;
  overflow: hidden;
  box-sizing: content-box;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2), 0 8px 16px rgba(0, 0, 0, 0.35);
  transition: border-color 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.maze-grid-5x5 {
  display: grid;
  grid-template-columns: repeat(5, 52px);
  grid-template-rows: repeat(5, 52px);
  width: 100%;
  height: 100%;
}

.maze-cell {
  width: 52px;
  height: 52px;
  background-color: var(--maze-floor);
  border: 1px solid rgba(71, 85, 105, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: filter 0.15s ease, background-color 0.15s ease;
  touch-action: manipulation;
}

.maze-cell:hover {
  filter: brightness(0.95);
}

.maze-cell.visited-step {
  background-color: var(--maze-visited) !important;
}

.maze-cell.start-cell::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 2.5px solid #38bdf8;
  box-shadow: 0 0 4px rgba(56, 189, 248, 0.7);
  box-sizing: border-box;
  pointer-events: none;
}

.maze-cell.end-cell {
  background-color: #ffffff !important;
  background-image: 
    linear-gradient(45deg, #0f172a 25%, transparent 25%), 
    linear-gradient(-45deg, #0f172a 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #0f172a 75%), 
    linear-gradient(-45deg, transparent 75%, #0f172a 75%) !important;
  background-size: 16px 16px !important;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0 !important;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 0 rgba(0, 0, 0, 0.4) !important;
}

.maze-cell.end-cell::after {
  content: none !important;
}

.maze-cell[style*="background-color"] {
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4),
              inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

#maze-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.maze-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 260px;
  padding: 0 4px;
}

.maze-steps-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: #38bdf8;
  transition: color 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.btn-micro {
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  background-color: #334155;
  color: #cbd5e1;
  border-radius: 6px;
  flex: none;
  width: auto;
  touch-action: manipulation;
}

.btn-micro:hover {
  background-color: #475569;
}

.scribble-container {
  width: 100%;
  max-width: 360px;
  margin: 0.2rem auto 0 auto;
  box-sizing: border-box;
}

.scribble-textarea {
  width: 100%;
  background-color: rgba(15, 23, 42, 0.75);
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 0.5rem 0.75rem;
  min-height: 48px;
  max-height: 7.2em;
  overflow-y: auto;
  resize: none;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, background-color 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.scribble-textarea:focus {
  border-color: #38bdf8;
}

.scribble-textarea::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.color-num {
  font-weight: 900;
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.tile .color-num {
  font-size: clamp(1.6rem, 6vw, 2.2rem);
}

.palette-btn .color-num {
  font-size: 0.95rem;
}

body.show-numbers .color-num {
  opacity: 0.3;
}

.controls-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  width: 100%;
  max-width: 360px;
  margin: 1rem auto 0 auto;
  box-sizing: border-box;
}

.button-group {
  width: 100%;
  margin: 0 auto;
}

.button-group.grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  width: 100%;
  justify-content: center;
  align-content: center;
}

.button-group.single-row {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.button-group.single-row button {
  width: 100% !important;
  min-width: 0 !important;
  padding: 0.75rem 0.2rem !important;
  font-size: 0.75rem !important;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button {
  min-height: 44px;
  background-color: #6366f1;
  color: white;
  border: none;
  padding: 0.75rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.1s ease;
  touch-action: manipulation;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 4px rgba(0, 0, 0, 0.3);
}

button:hover {
  background-color: #4f46e5;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background-color: #334155;
  color: #e2e8f0;
}

.btn-secondary:hover {
  background-color: #475569;
}

.btn-danger-red {
  background-color: #FFA8A8 !important;
  color: #1e293b !important;
  font-weight: 700;
}

.btn-danger-red:hover {
  background-color: #ff9191 !important;
}

.btn-warning-yellow {
  background-color: #eab308 !important;
  color: #0f172a !important;
  font-weight: 700;
}

.btn-warning-yellow:hover {
  background-color: #ca8a04 !important;
}

.btn-ready-green,
.btn-bonus {
  background-color: #10b981 !important;
  color: #ffffff !important;
  font-weight: 700;
}

.btn-ready-green:hover,
.btn-bonus:hover {
  background-color: #059669 !important;
}

.btn-submit-green {
  background-color: #22c55e !important;
  color: #0f172a !important;
  font-weight: 700 !important;
}

.btn-submit-green:hover {
  background-color: #16a34a !important;
}

.btn-share-blue {
  background-color: #1e3a8a !important;
  color: #f8fafc !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  padding: 0.75rem 1rem !important;
  border: 1px solid #2563eb !important;
  box-shadow: 0 4px 10px rgba(30, 58, 138, 0.4) !important;
}

.btn-share-blue:hover {
  background-color: #1d4ed8 !important;
}

.share-socials-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.social-share-btn {
  background-color: #0f172a;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 0.72rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  min-height: 32px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.social-share-btn:hover {
  background-color: #1e293b;
  border-color: #38bdf8;
  color: #ffffff;
}

.share-toast {
  text-align: center;
  color: #4ade80;
  font-size: 0.75rem;
  font-weight: 700;
  margin: 0.2rem 0 0 0;
  animation: fadeInHint 0.2s ease;
}

.rule-lights {
  display: flex;
  gap: 1.1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 0.25rem;
  margin-bottom: 0.2rem;
}

.light-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.light-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

/* 2. Glowing Axiom Lights with Ambient Radiant Auras */
.light {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: #1e293b;
  border: 2px solid #475569;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.light.pass {
  background-color: #22c55e;
  border-color: #4ade80;
  box-shadow: 0 0 8px #22c55e,
              0 0 18px rgba(34, 197, 94, 0.75),
              0 0 32px rgba(34, 197, 94, 0.35);
}

.light.fail {
  background-color: #ef4444;
  border-color: #f87171;
  box-shadow: 0 0 8px #ef4444,
              0 0 18px rgba(239, 68, 68, 0.75),
              0 0 32px rgba(239, 68, 68, 0.35);
}

@keyframes shakeError {
  0% { transform: translateX(0); }
  15% { transform: translateX(-6px); }
  30% { transform: translateX(6px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
  90% { transform: translateX(2px); }
  100% { transform: translateX(0); }
}

.outcome {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  width: 100% !important;
  max-width: 100% !important;
  align-self: stretch !important;
  box-sizing: border-box !important;
  white-space: pre-line;
  text-wrap: balance;
  line-height: 1.35;
}

.outcome.success {
  background-color: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid #22c55e;
}

.outcome.failure {
  display: block !important;
  background-color: rgba(239, 68, 68, 0.25) !important;
  color: #fca5a5 !important;
  border: 1px solid #ef4444 !important;
  margin-top: 0.5rem !important;
  font-weight: 700 !important;
  box-sizing: border-box;
  animation: shakeError 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.post-game {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-top: 1px solid #334155;
  padding-top: 1.1rem;
  transition: border-color 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.performance-summary, .revealed-rules-section, .bonus-section {
  background-color: rgba(15, 23, 42, 0.75);
  padding: 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

h3 {
  margin: 0 0 0.25rem 0;
  font-size: 0.95rem;
  color: #f8fafc;
}

.hint-text {
  margin: 0 0 0.65rem 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.perf-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0.75rem 0;
}

.perf-card {
  background-color: #1e293b;
  padding: 0.65rem 0.2rem;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: background-color 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.perf-val {
  font-size: 1rem;
  font-weight: 700;
  color: #38bdf8;
  transition: color 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.perf-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 3px;
}

.percentile-banner {
  background: linear-gradient(90deg, #1e293b, #334155);
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 0.5rem;
  font-size: 0.8rem;
  text-align: center;
  color: #facc15;
  font-weight: 600;
  white-space: pre-line;
}

.rule-vote-card {
  background-color: #1e293b;
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid #334155;
  transition: border-color 0.2s ease, background-color 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.rule-vote-card.unrevealed {
  cursor: pointer;
  background-color: #152033;
  border: 1px dashed #475569;
  touch-action: manipulation;
}

.unrevealed-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
}

.unrevealed-badge {
  font-size: 0.7rem;
  background-color: #0f172a;
  padding: 2px 6px;
  border-radius: 4px;
  color: #38bdf8;
  border: 1px solid #334155;
}

.rule-desc {
  font-size: 0.8rem;
  color: #cbd5e1;
}

.vote-actions {
  display: flex;
  gap: 0.5rem;
}

.vote-btn {
  padding: 0.45rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
  min-height: 38px;
}

.vote-btn.active-yes {
  background-color: #22c55e !important;
  color: #0f172a !important;
}

.vote-btn.active-no {
  background-color: #ef4444 !important;
  color: #ffffff !important;
}

.custom-guess-area {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.custom-guess-input {
  background-color: #0f172a;
  border: 1px solid #475569;
  color: #f8fafc;
  padding: 0.55rem 0.6rem;
  font-size: 0.85rem;
  border-radius: 4px;
  font-family: inherit;
  outline: none;
}

.custom-guess-input:focus {
  border-color: #38bdf8;
}

.submit-guess-btn {
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  background-color: #0284c7;
  color: white;
  border-radius: 4px;
  align-self: flex-end;
  min-height: 36px;
}

.saved-alt-rule {
  font-size: 0.75rem;
  color: #94a3b8;
  font-style: italic;
  background-color: rgba(15, 23, 42, 0.6);
  padding: 4px 6px;
  border-radius: 4px;
}

.vote-stats {
  font-size: 0.75rem;
  color: #38bdf8;
  font-weight: 600;
}

.solutions-tracker {
  font-size: 0.9rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 0.25rem;
}

.bonus-msg {
  font-size: 0.75rem;
  margin: 0.5rem 0 0 0;
  min-height: 1.2em;
  font-weight: 600;
  white-space: pre-line;
  text-wrap: balance;
  line-height: 1.35;
}

.bonus-msg.pass { color: #4ade80; }
.bonus-msg.fail { 
  display: block !important;
  color: #f87171 !important; 
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  margin-top: 0.5rem !important;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(11, 17, 32, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem 0.75rem;
  box-sizing: border-box;
} 

.modal-card {
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 40%, transparent 100%),
    rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);

  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  padding: 1.25rem;
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.75), 
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: background-color 2.5s cubic-bezier(0.25, 1, 0.5, 1), border-color 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.modal-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0.25rem;
  width: auto;
  min-height: unset;
  line-height: 1;
  touch-action: manipulation;
}

.modal-close-btn:hover {
  color: var(--text-main);
  background: none;
}

.modal-prose {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #cbd5e1;
  margin: 0;
}

.modal-prose a {
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.tutorial-tabs {
  display: flex;
  gap: 4px;
  background-color: rgba(15, 23, 42, 0.75);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #334155;
}

.tut-tab {
  flex: 1;
  padding: 0.5rem 0.2rem;
  font-size: 0.72rem;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  min-height: unset;
}

.tut-tab.active {
  background-color: #38bdf8;
  color: #0f172a;
  font-weight: 700;
}

.one-page-guide {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: left;
}

.guide-bullets {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.guide-bullets li {
  margin-bottom: 0.4rem;
}

.calendar-modal {
  max-width: 380px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.5rem;
}

.cal-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #38bdf8;
}

.cal-nav-btn {
  background-color: rgba(15, 23, 42, 0.75);
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  flex: 0 0 auto;
  min-height: 38px;
}

.cal-nav-btn:hover {
  background-color: #334155;
}

.cal-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.calendar-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  justify-items: center;
}

.cal-day-cell {
  width: clamp(30px, 9vw, 36px);
  height: clamp(30px, 9vw, 36px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #cbd5e1;
  background-color: transparent;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.2s ease;
  user-select: none;
  touch-action: manipulation;
}

.cal-day-cell.empty {
  cursor: default;
}

.cal-day-cell.future, .cal-day-cell.disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.cal-day-cell.unplayed:not(.future):not(.disabled) {
  border-color: #334155;
  background-color: #0f172a;
}

.cal-day-cell.attempted {
  background-color: #64748b;
  color: #0f172a;
}

.cal-day-cell.completed {
  background-color: #22c55e;
  color: #042f2e;
}

.cal-day-cell.active-level {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
}

.calendar-legend {
  display: flex;
  justify-content: space-around;
  background-color: rgba(15, 23, 42, 0.75);
  padding: 0.6rem;
  border-radius: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.cal-leg-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot-sample {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-sample.unplayed {
  background-color: #0f172a;
  border: 1px solid #334155;
}

.dot-sample.attempted {
  background-color: #64748b;
}

.dot-sample.completed {
  background-color: #22c55e;
}

.slideshow-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 180px;
  justify-content: space-between;
}

.slide {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.slide.active {
  display: flex;
}

.slide-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #38bdf8;
  font-weight: 700;
}

.slide-text {
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.45;
  margin: 0.25rem 0 0 0;
}

.carousel-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 1.25rem;
}

.carousel-btn {
  height: 42px;
  min-width: 44px;
  padding: 0 16px;
  border-radius: 20px;
  background-color: #334155;
  color: #f8fafc;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex: none;
}

.carousel-btn.confirm {
  background-color: #2563eb;
  color: #ffffff;
}

.slide-indicators {
  display: flex;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #475569;
  transition: background-color 0.2s;
}

.dot.active {
  background-color: #38bdf8;
}

.lifetime-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 0.25rem;
}

.lifetime-stat {
  background-color: rgba(15, 23, 42, 0.75);
  padding: 0.75rem 0.25rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.lifetime-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: #38bdf8;
}

.lifetime-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 3px;
  line-height: 1.1;
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  background-color: rgba(15, 23, 42, 0.75);
  color: #e2e8f0;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  min-height: 48px;
  transition: background-color 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.menu-item-btn:hover {
  background-color: #334155;
}

.settings-disclaimer {
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
  padding: 0.4rem 0.6rem;
  margin: 0.2rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-disclaimer a {
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.crimson-theme .settings-disclaimer a {
  color: #fb7185;
}

.contact-box {
  background-color: rgba(15, 23, 42, 0.75);
  padding: 0.85rem 1rem;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border: 1px solid #334155;
  transition: all 0.2s ease, background-color 2.5s cubic-bezier(0.25, 1, 0.5, 1);
  user-select: none;
}

.contact-box:hover {
  border-color: #38bdf8;
  background-color: #152033;
}

.email-text {
  color: #38bdf8;
  font-weight: 600;
  font-size: 0.95rem;
}

.copy-badge {
  font-size: 0.72rem;
  background-color: #1e293b;
  color: #cbd5e1;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #475569;
  font-weight: 600;
  transition: all 0.2s ease;
}

.copy-badge.copied {
  background-color: #22c55e;
  border-color: #16a34a;
  color: #042f2e;
}

.palette-option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.palette-choice-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.9rem;
  background-color: rgba(15, 23, 42, 0.75);
  border: 2px solid #334155;
  border-radius: 8px;
  color: #f8fafc;
  min-height: 46px;
}

.palette-choice-btn.active {
  border-color: #38bdf8;
  background-color: rgba(56, 189, 248, 0.1);
}

.palette-name {
  font-size: 0.82rem;
  font-weight: 600;
}

.palette-preview {
  display: flex;
  gap: 4px;
}

.palette-preview span {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: inline-block;
}

.settings-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(15, 23, 42, 0.75);
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid #334155;
  gap: 12px;
  transition: background-color 2.5s cubic-bezier(0.25, 1, 0.5, 1), border-color 2.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f8fafc;
}

.toggle-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #334155;
  transition: 0.3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #38bdf8;
}

body.crimson-theme #hard-theme-toggle:checked + .slider {
  background-color: #fb7185;
}

input:checked + .slider:before {
  transform: translateX(18px);
}

.hidden {
  display: none !important;
}

.interactive-tut-card {
  max-width: 420px;
  text-align: center;
}

.tut-header-badge {
  align-self: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #38bdf8;
  background: #0f172a;
  padding: 3px 12px;
  border-radius: 9999px;
  border: 1px solid #334155;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

.tutorial-text {
  font-size: 0.84rem;
  line-height: 1.5;
  margin: 0 auto;
  min-height: unset;
  height: auto;
  max-height: none;
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #334155;
  border-top: 3px solid #eeb814;
  text-align: center;
  text-align-last: center;
  text-wrap: balance;
  white-space: pre-line;
  width: 100%;
}

.tut-choice-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
  width: 100%;
}

.tut-choice-btn {
  background-color: #0f172a;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 0.78rem;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  line-height: 1.35;
  min-height: unset;
  transition: all 0.2s ease;
}

.tut-choice-btn:hover:not(:disabled) {
  background-color: #1e293b;
  border-color: #38bdf8;
  color: #ffffff;
}

.tut-choice-btn.disabled-option {
  opacity: 0.35 !important;
  pointer-events: none !important;
  border-style: dashed !important;
  color: #64748b !important;
}

.tutorial-grid-dynamic {
  display: grid;
  gap: 10px;
  justify-content: center;
  margin: 10px 0;
}

.tutorial-grid-dynamic.grid-2x2 {
  grid-template-columns: repeat(2, 68px);
  grid-template-rows: repeat(2, 68px);
}

.tutorial-grid-dynamic.grid-3x3 {
  grid-template-columns: repeat(3, 58px);
  grid-template-rows: repeat(3, 58px);
}

/* 1. Flush Edge Interactive Tutorial Tile Reflections */
.tut-tile {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  cursor: pointer;
  border: none;
  transition: transform 0.1s ease, background-color 0.2s ease;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.42),
              inset 0 -3px 0 rgba(0, 0, 0, 0.3),
              0 3px 5px rgba(0, 0, 0, 0.3);
}

.tut-tile:active {
  transform: scale(0.96);
}

.tut-tile.locked {
  cursor: not-allowed;
  opacity: 0.95;
}

.interactive-lights-row {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-top: 6px;
}

.button-group.tut-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.button-group.tut-actions button {
  flex: 1 1 45%;
}

/* =========================================================================
   EXPERT MODE (CRIMSON GLASS THEME)
   ========================================================================= */
body.crimson-theme {
  --bg-color: #1a080d;
  --card-bg: rgba(52, 24, 31, 0.7);
  --card-border: rgba(251, 113, 133, 0.2);
  --wall-color: #5c242e;
  --empty-tile-bg: #15090c;

  --liquid-orb-1: rgba(225, 29, 72, 0.26);
  --liquid-orb-2: rgba(159, 18, 57, 0.28);
  --liquid-orb-3: rgba(251, 113, 133, 0.15);

  /* Deep crimson-to-black obsidian cosmic gradient */
  background: radial-gradient(circle at 25% 25%, #2a0812 0%, #15050a 40%, #1f060e 75%, #080204 100%) !important;
}

@keyframes cosmicCrimsonFloat {
  0% {
    background-position: 0% 10%;
    filter: hue-rotate(0deg);
  }
  50% {
    background-position: 80% 90%;
    filter: hue-rotate(12deg);
  }
  100% {
    background-position: 20% 70%;
    filter: hue-rotate(-10deg);
  }
}

body.crimson-theme .game-container {
  box-shadow: 0 20px 45px rgba(225, 29, 72, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  border: 1px solid var(--card-border);
}

body.crimson-theme .motto {
  color: #fb7185;
}

body.crimson-theme .stat-value,
body.crimson-theme .perf-val,
body.crimson-theme .solutions-tracker,
body.crimson-theme .maze-steps-text {
  color: #fb7185;
}

body.crimson-theme .stats-bar,
body.crimson-theme .palette-bar,
body.crimson-theme .number-strip,
body.crimson-theme .performance-summary,
body.crimson-theme .bonus-section,
body.crimson-theme .revealed-rules-section,
body.crimson-theme .scribble-textarea,
body.crimson-theme .cal-nav-btn,
body.crimson-theme .menu-item-btn,
body.crimson-theme .contact-box,
body.crimson-theme .color-legend,
body.crimson-theme .settings-toggle-row {
  background-color: rgba(26, 11, 15, 0.8);
  border-color: #4c1d25;
}

body.crimson-theme .scribble-textarea:focus,
body.crimson-theme .num-box:focus {
  border-color: #fb7185;
  box-shadow: 0 0 8px rgba(251, 113, 133, 0.35);
}

body.crimson-theme .icon-btn {
  border-color: #4c1d25;
}

body.crimson-theme .icon-btn:hover {
  border-color: #5c242e;
  background-color: #241115;
}

body.crimson-theme .perf-card,
body.crimson-theme .rule-vote-card {
  background-color: #291218;
  border-color: #4c1d25;
}

body.crimson-theme .modal-card {
  background-color: rgba(49, 21, 28, 0.88);
  border-color: #5c242e;
}

body.crimson-theme button#test-btn {
  background-color: #e11d48;
}

body.crimson-theme button#test-btn:hover {
  background-color: #be123c;
}

.hard-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 32px;
}

.hard-counter-badge {
  font-size: 0.8rem;
  font-weight: 700;
  background-color: #0f172a;
  border: 1px solid #334155;
  color: #38bdf8;
  padding: 2px 8px;
  border-radius: 6px;
  line-height: 1;
}

body.crimson-theme .hard-counter-badge {
  background-color: #1a0b0f;
  border-color: #4c1d25;
  color: #fb7185;
}

.hard-level-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hard-select-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  background-color: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f8fafc;
  cursor: pointer;
  text-align: left;
}

body.crimson-theme .hard-select-btn {
  background-color: #1a0b0f;
  border-color: #4c1d25;
}

.hard-select-btn:hover {
  border-color: #fb7185;
}

.hard-btn-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.hard-hint-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: -0.25rem;
  margin-bottom: 0.25rem;
}

.btn-hint-trigger {
  background-color: transparent !important;
  color: #fb7185 !important;
  border: 1px dashed #fb7185 !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  padding: 0.4rem 1rem !important;
  min-height: 34px !important;
  border-radius: 20px !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-hint-trigger:hover {
  background-color: rgba(251, 113, 133, 0.12) !important;
}

.hard-hint-bubble {
  width: 100%;
  max-width: 340px;
  padding: 0.6rem 0.9rem;
  background-color: rgba(251, 113, 133, 0.1);
  border: 1px solid #fb7185;
  border-left: 4px solid #fb7185;
  border-radius: 8px;
  color: #ffe4e6;
  font-size: 0.82rem;
  text-align: left;
  line-height: 1.4;
  animation: fadeInHint 0.25s ease-out;
}

.hard-hint-label {
  font-weight: 700;
  color: #fb7185;
  margin-right: 0.35rem;
}

@keyframes fadeInHint {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.extra-modes-banner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 0.75rem;
}

.mode-entry-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.1rem;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.1s ease;
}

.mode-entry-btn:hover {
  filter: brightness(0.95);
}

.mode-entry-btn:active {
  transform: scale(0.99);
}

.btn-mode-number {
  background-color: #38bdf8;
  color: #0c4a6e;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

.btn-mode-path {
  background-color: #ede8df;
  color: #44403c;
  box-shadow: 0 4px 12px rgba(237, 232, 223, 0.2);
}

.btn-mode-expert {
  background-color: #9f1239;
  color: #ffe4e6;
  box-shadow: 0 4px 12px rgba(159, 18, 57, 0.3);
}

/* First-Time UI Spotlight Onboarding Walkthrough */
.spotlight-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.3s ease;
}

.spotlight-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.spotlight-cutout {
  position: absolute;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.78), 0 0 15px rgba(56, 189, 248, 0.8);
  border: 2px solid #38bdf8;
  pointer-events: none;
  transition: all 0.25s ease-out;
}

.spotlight-tooltip {
  position: absolute;
  background: #0f172a;
  border: 1px solid #38bdf8;
  border-radius: 10px;
  padding: 12px 16px;
  max-width: 260px;
  color: #f8fafc;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  z-index: 100000;
  pointer-events: none;
  transition: all 0.25s ease-out;
}

.spotlight-step-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  margin-bottom: 4px;
}

.spotlight-text {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #cbd5e1;
  margin: 0;
}

.spotlight-tap-hint {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 8px;
  display: block;
  text-align: right;
  font-style: italic;
}

/* Compact Menu Separators */
.menu-separator {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 4px 0;
}

.menu-separator::before,
.menu-separator::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-separator span {
  padding: 0 8px;
  font-size: 0.68rem;
  letter-spacing: 0.08rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
}

body.crimson-theme .menu-separator span {
  color: #9f1239;
}

body.crimson-theme .menu-separator::before,
body.crimson-theme .menu-separator::after {
  border-bottom-color: rgba(251, 113, 133, 0.15);
}

/* Inline Click-to-Copy Email Link in Credits */
.copy-inline-email {
  color: #38bdf8;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.copy-inline-email:hover {
  color: #7dd3fc;
}

body.crimson-theme .copy-inline-email {
  color: #fb7185;
}

/* Modal Theme Backgrounds */
/* Path Selection Modal (Warm Dull Beige Theme) */
#modal-path .modal-card {
  background-color: #d8cfc4 !important;
  border: 1px solid #b8ab9c !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.4) !important;
}

#modal-path .hard-title-wrap h3 {
  color: #2c251e !important;
}

#modal-path .modal-prose {
  color: #4a4035 !important;
}

#modal-path .hard-counter-badge {
  background-color: #c4b9ac !important;
  border: 1px solid #a89c8f !important;
  color: #2c251e !important;
}

#modal-path .modal-close-btn {
  color: #5c5043 !important;
}

#modal-path .modal-close-btn:hover {
  color: #1a1612 !important;
}

#modal-path .mode-level-tile {
  background-color: #c7bcaf !important;
  border: 2px solid #a39587 !important;
  color: #2c251e !important;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.15), 0 2px 5px rgba(0, 0, 0, 0.15) !important;
}

#modal-path .mode-level-tile:hover {
  background-color: #beb1a3 !important;
  border-color: #8c7e70 !important;
}

#modal-path .mode-level-tile.completed {
  background-color: #8f8272 !important;
  border-color: #5a4f42 !important;
  color: #fdfbf7 !important;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), 0 0 12px rgba(115, 102, 88, 0.4) !important;
}

#modal-path .return-daily-btn {
  background-color: #c4b9ac !important;
  border: 1px dashed #9c8f82 !important;
  color: #3d342a !important;
}

#modal-path .return-daily-btn:hover {
  background-color: #b5a899 !important;
  border-color: #7d7063 !important;
  color: #1a1612 !important;
}

#modal-hard .modal-card {
  background-color: rgba(52, 24, 31, 0.94) !important;
  border-color: rgba(251, 113, 133, 0.35) !important;
  box-shadow: 0 20px 45px rgba(159, 18, 57, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

/* 5-Column Level Selection Grid */
.mode-level-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  width: 100%;
  margin: 0.5rem 0;
  box-sizing: border-box;
}

.mode-level-tile {
  aspect-ratio: 1 / 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, "SF Mono", "Roboto Mono", "Fira Code", monospace;
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  border-radius: 12px;
  cursor: pointer;
  border: 2px solid #475569;
  background-color: rgba(15, 23, 42, 0.8);
  color: #f8fafc;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), inset 0 -2px 0 rgba(0, 0, 0, 0.3), 0 3px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  padding: 0;
  min-height: unset;
}

.mode-level-tile:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: #94a3b8;
}

.mode-level-tile:active {
  transform: translateY(1px) scale(0.97);
}

/* Completed Levels: Darker body + Golden Aura Glow */
.mode-level-tile.completed {
  background-color: #080d1a !important;
  border-color: #eab308 !important;
  color: #fef08a !important;
  box-shadow: inset 0 2px 0 rgba(254, 240, 138, 0.35),
              inset 0 -2px 0 rgba(0, 0, 0, 0.5),
              0 0 12px rgba(234, 179, 8, 0.65),
              0 0 24px rgba(234, 179, 8, 0.28) !important;
}

/* Return to Daily Puzzle Button */
.return-daily-btn {
  width: 100%;
  margin-top: 0.6rem;
  border: 1px dashed #475569;
  background-color: rgba(15, 23, 42, 0.6);
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.return-daily-btn:hover {
  background-color: #1e293b;
  border-color: #94a3b8;
  color: #ffffff;
}

.site-footer {
  width: 100%;
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.5;
  user-select: none;
  pointer-events: none;
  letter-spacing: 0.02rem;
}