/* CineAHO Premium 2048 Game Stylesheet */

/* Core Variables & Tokens */
:root {
  --hue-purple: 270;
  --hue-blue: 210;
  --hue-green: 145;
  --hue-gold: 45;
  --hue-red: 350;
  --hue-cyan: 190;

  /* Theme Core - Dark Glassmorphism */
  --bg-color: #040712;
  --bg-grid: rgba(255, 255, 255, 0.015);
  
  --panel-bg: rgba(10, 16, 32, 0.6);
  --panel-border: rgba(255, 255, 255, 0.05);
  --panel-hover-border: rgba(59, 130, 246, 0.25);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #475569;
  
  /* Gradation Accents */
  --grad-purple: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
  --grad-blue: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --grad-cyan: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  --grad-green: linear-gradient(135deg, #10b981 0%, #047857 100%);
  --grad-gold: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  --grad-red: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);

  --neon-glow: 0 0 30px rgba(59, 130, 246, 0.2);
  --font-main: 'Noto Sans KR', 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 12px 40px 0 rgba(0, 0, 0, 0.6);
  
  --highlight-color: #3b82f6;
  --accent-purple: #a855f7;

  /* 2048 Custom Variables (Default) */
  --board-size: 4;
  --tile-size: 80px;
  --tile-gap: 10px;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Grid Background */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -2;
  pointer-events: none;
}

/* Ambient Glow Orbs */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(150px);
  z-index: -3;
  pointer-events: none;
  opacity: 0.18;
}

.bg-glow-purple {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #7e22ce 0%, transparent 70%);
  top: -100px;
  left: 5%;
}

.bg-glow-blue {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #1d4ed8 0%, transparent 70%);
  top: 35%;
  right: 5%;
}

/* Header */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  margin: 1rem 1.5rem 0 1.5rem;
  border-radius: 50px;
  transition: var(--transition-smooth);
}

.glass-header {
  background: rgba(10, 16, 32, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.logo-circle {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-text {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.95rem;
}

.logo-text span {
  color: var(--text-muted);
  font-weight: 400;
}

.header-nav {
  flex-grow: 1;
  margin: 0 2rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.header-nav::-webkit-scrollbar {
  display: none;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 1.25rem;
  white-space: nowrap;
}

.nav-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  padding: 0.5rem 0.25rem;
  position: relative;
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--text-main);
}

.nav-list a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #3b82f6;
  border-radius: 2px;
}

.btn-back-dashboard {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  padding: 0.5rem 1.2rem;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-back-dashboard:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #3b82f6;
  transform: translateX(-2px);
}

/* Common Glass Panels */
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: var(--panel-hover-border);
}

/* 2048 Game Container */
.game-container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.game-header-section {
  text-align: center;
}

.main-title {
  font-size: 2.1rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  letter-spacing: -0.5px;
}

.main-title span {
  background: linear-gradient(135deg, #3b82f6 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.main-title i {
  color: #3b82f6;
  margin-right: 0.5rem;
}

.subtitle-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto 1.25rem auto;
  line-height: 1.6;
}

.tag-badges {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.25rem 0.75rem;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.badge-tag {
  background: rgba(59, 130, 246, 0.05);
  border-color: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
}

/* Control Config Bar */
.game-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.5rem;
}

.control-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.select-wrapper {
  position: relative;
}

.dropdown-select {
  appearance: none;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.55rem 2.2rem 0.55rem 1rem;
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.dropdown-select:focus {
  border-color: #3b82f6;
  box-shadow: var(--neon-glow);
}

.select-wrapper::after {
  content: '▼';
  font-size: 0.6rem;
  color: var(--text-muted);
  position: absolute;
  right: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(59, 130, 246, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: #3b82f6;
  color: #fff;
}

.btn-secondary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-hint {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.btn-hint:hover {
  background: rgba(168, 85, 247, 0.16);
  border-color: #a855f7;
  color: #fff;
}

.btn-autoplay {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: #fff;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.btn-autoplay:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(16, 185, 129, 0.35);
}

.btn-autoplay.active {
  background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
  box-shadow: 0 4px 10px rgba(244, 63, 94, 0.25);
}

.control-right {
  display: flex;
  gap: 0.5rem;
}

.btn-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-icon-circle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #3b82f6;
  color: #fff;
}

.btn-icon-circle.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: #3b82f6;
  color: #60a5fa;
}

/* Settings Sliders Panel */
.settings-panel {
  padding: 1.25rem 1.5rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.setting-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.setting-label-row label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.setting-item input[type="range"] {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  accent-color: #3b82f6;
}

.setting-toggle-wrapper {
  justify-content: center;
  align-items: flex-start;
}

/* Switch Toggle Styling */
.toggle-switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
  user-select: none;
}

.toggle-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.toggle-switch-container input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  transition: .3s;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: .3s;
}

.toggle-switch-container input:checked + .toggle-slider {
  background-color: #3b82f6;
}

.toggle-switch-container input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

/* Seed & Replay Control Bar */
.seed-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.5rem;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.seed-input-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 350px;
}

.seed-input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.seed-input-group input {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-smooth);
}

.seed-input-group input:focus {
  border-color: #3b82f6;
  box-shadow: var(--neon-glow);
}

.seed-actions-group {
  display: flex;
  gap: 0.5rem;
}

/* Game Workspace Layout */
.game-workspace {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Game Sidebar Panel */
.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Stat box items */
.stat-card-box {
  padding: 1.25rem;
}

.stat-rows-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.stat-card-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 0.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.stat-val-large {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}

/* Stat details row block */
.stat-details-box {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.stat-row span {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stat-row strong {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
}

/* AI Analysis Panel Box */
.ai-panel-box {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.ai-box-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #a855f7;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 0.4rem;
}

.ai-recommendation {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.ai-recommendation span {
  color: #a855f7;
  padding: 0.15rem 0.5rem;
  background: rgba(168, 85, 247, 0.15);
  border-radius: 4px;
  font-family: var(--font-display);
}

.ai-recommendation span.arrow-dir {
  font-size: 1.1rem;
}

.ai-scores-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.ai-scores-list div {
  display: flex;
  justify-content: space-between;
}

/* Main Grid Board Panel */
.board-panel {
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 480px;
}

.grid-board-wrapper {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.grid-board {
  display: grid;
  grid-template-columns: repeat(var(--board-size), var(--tile-size));
  grid-template-rows: repeat(var(--board-size), var(--tile-size));
  gap: var(--tile-gap);
  padding: var(--tile-gap);
  background: rgba(10, 15, 30, 0.8);
  border-radius: 12px;
  position: relative;
}

/* Grid Empty Background Slots */
.grid-cell {
  width: var(--tile-size);
  height: var(--tile-size);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.4);
}

/* Active Floating Tile Item */
.tile-item {
  position: absolute;
  width: var(--tile-size);
  height: var(--tile-size);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  user-select: none;
  transition: left 100ms cubic-bezier(0.25, 1, 0.5, 1), top 100ms cubic-bezier(0.25, 1, 0.5, 1), transform 100ms cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 10;
}

/* Default Neon Color Grades for Tiles */
.tile-2 {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.4);
  color: #38bdf8;
  box-shadow: 0 0 15px rgba(14, 165, 233, 0.15);
  font-size: 1.8rem;
}

.tile-4 {
  background: rgba(30, 58, 138, 0.4);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
  font-size: 1.8rem;
}

.tile-8 {
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.4);
  color: #fb923c;
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.15);
  font-size: 1.8rem;
}

.tile-16 {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
  font-size: 1.8rem;
}

.tile-32 {
  background: rgba(236, 72, 153, 0.12);
  border: 1px solid rgba(236, 72, 153, 0.4);
  color: #f472b6;
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.15);
  font-size: 1.8rem;
}

.tile-64 {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
  font-size: 1.8rem;
}

.tile-128 {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.45);
  color: #facc15;
  box-shadow: 0 0 18px rgba(234, 179, 8, 0.22);
  font-size: 1.55rem;
}

.tile-256 {
  background: rgba(234, 179, 8, 0.25);
  border: 2px solid rgba(234, 179, 8, 0.7);
  color: #fff;
  box-shadow: 0 0 25px rgba(234, 179, 8, 0.35);
  font-size: 1.55rem;
}

.tile-512 {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
  font-size: 1.55rem;
}

.tile-1024 {
  background: rgba(16, 185, 129, 0.28);
  border: 2px solid rgba(16, 185, 129, 0.75);
  color: #fff;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
  font-size: 1.35rem;
}

.tile-2048 {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.3) 0%, rgba(168, 85, 247, 0.3) 100%);
  border: 2px solid rgba(244, 114, 182, 0.85);
  color: #fff;
  box-shadow: 0 0 35px rgba(236, 72, 153, 0.5), inset 0 0 15px rgba(168, 85, 247, 0.3);
  font-weight: 900;
  text-shadow: 0 0 8px rgba(255,255,255,0.6);
  font-size: 1.35rem;
  animation: shine-glow 2s infinite alternate;
}

.tile-super {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(234, 179, 8, 0.3) 100%);
  border: 2px solid #fbbf24;
  color: #fff;
  box-shadow: 0 0 45px rgba(251, 191, 36, 0.6);
  font-weight: 900;
  text-shadow: 0 0 10px rgba(255,255,255,0.8);
  font-size: 1.15rem;
}

/* Animations */
.tile-new {
  animation: pop-spawn 180ms ease-out forwards;
}

.tile-merged {
  animation: pulse-merge 250ms cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  z-index: 12;
}

@keyframes pop-spawn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes pulse-merge {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.22);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shine-glow {
  0% {
    box-shadow: 0 0 25px rgba(236, 72, 153, 0.4);
  }
  100% {
    box-shadow: 0 0 45px rgba(168, 85, 247, 0.7);
  }
}

/* Board Overlays */
.board-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  text-align: center;
  animation: fadeIn 0.3s ease-out;
}

.overlay-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
}

.overlay-content h2 {
  font-size: 2.2rem;
  font-weight: 800;
  color: #f43f5e;
}

.board-win .overlay-content h2 {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.overlay-content p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.overlay-buttons {
  display: flex;
  gap: 0.75rem;
}

/* High Contrast Mode CSS Overrides */
html[data-contrast="true"] {
  --bg-color: #000000;
  --panel-bg: #111111;
  --panel-border: #ffffff;
  --panel-hover-border: #ffff00;
  --text-main: #ffffff;
  --text-muted: #dddddd;
  --text-dark: #888888;
}

html[data-contrast="true"] .tile-2 {
  background: #ffffff !important;
  color: #000000 !important;
  border: 3px solid #000000 !important;
  box-shadow: none !important;
}

html[data-contrast="true"] .tile-4 {
  background: #ffff00 !important;
  color: #000000 !important;
  border: 3px solid #000000 !important;
  box-shadow: none !important;
}

html[data-contrast="true"] .tile-8 {
  background: #0000ff !important;
  color: #ffffff !important;
  border: 3px solid #ffffff !important;
  box-shadow: none !important;
}

html[data-contrast="true"] .tile-16 {
  background: #ff0000 !important;
  color: #ffffff !important;
  border: 3px solid #ffffff !important;
  box-shadow: none !important;
}

html[data-contrast="true"] .tile-32 {
  background: #00ff00 !important;
  color: #000000 !important;
  border: 3px solid #000000 !important;
  box-shadow: none !important;
}

html[data-contrast="true"] .tile-64 {
  background: #ff00ff !important;
  color: #ffffff !important;
  border: 3px solid #ffffff !important;
  box-shadow: none !important;
}

html[data-contrast="true"] .tile-128 {
  background: #00ffff !important;
  color: #000000 !important;
  border: 3px solid #000000 !important;
  box-shadow: none !important;
}

html[data-contrast="true"] .tile-256 {
  background: #ffffff !important;
  color: #ff0000 !important;
  border: 3px solid #ff0000 !important;
  box-shadow: none !important;
}

html[data-contrast="true"] .tile-512 {
  background: #000000 !important;
  color: #ffffff !important;
  border: 3px solid #ffffff !important;
  box-shadow: none !important;
}

html[data-contrast="true"] .tile-1024 {
  background: #dddddd !important;
  color: #000000 !important;
  border: 3px solid #000000 !important;
  box-shadow: none !important;
}

html[data-contrast="true"] .tile-2048 {
  background: #ff00ff !important;
  color: #ffff00 !important;
  border: 4px double #ffff00 !important;
  box-shadow: none !important;
  animation: none !important;
}

html[data-contrast="true"] .tile-super {
  background: #ff0000 !important;
  color: #ffff00 !important;
  border: 4px double #ffff00 !important;
  box-shadow: none !important;
}

/* Explanation Accordion Table of Contents (TOC) styling matching portal style */
.explanation-board-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.explanation-board-section .board-header {
  border-bottom: 2px solid #3b82f6;
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.explanation-board-section .board-header i {
  font-size: 1.25rem;
  color: #3b82f6;
}

.explanation-board-section .board-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.explanation-board-section .board-header span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.explanation-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.explanation-index-list {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 16px;
  overflow: hidden;
}

.explanation-index-list ul {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.explanation-index-list li {
  padding: 0.7rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition-smooth);
}

.explanation-index-list li:last-child {
  border-bottom: none;
}

.explanation-index-list li:hover {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
  padding-left: 1.25rem;
}

.explanation-index-list li.active {
  background: rgba(59, 130, 246, 0.1);
  color: #fff;
  border-left: 4px solid #3b82f6;
  padding-left: 1.25rem;
}

.index-num {
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.08);
  font-weight: 700;
}

.explanation-index-list li.active .index-num {
  color: #3b82f6;
}

.explanation-display-box {
  min-height: 380px;
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
  border-left: 4px solid #93c5fd; /* Soft Blue accent */
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.45) 0%, rgba(15, 23, 42, 0.6) 100%);
}

.display-content-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

.display-top-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(59, 130, 246, 0.12);
  padding: 0.25rem 0.8rem;
  border-radius: 30px;
  width: fit-content;
}

.display-top-badge i {
  font-size: 0.8rem;
  color: #60a5fa;
}

.display-top-badge span {
  font-size: 0.72rem;
  font-weight: 700;
  color: #93c5fd;
}

.explanation-display-box h3 {
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.display-text-body {
  font-size: 0.92rem;
  color: #e2e8f0;
  line-height: 1.7;
}

.display-text-body p {
  margin-bottom: 1rem;
}

.display-text-body ul, .display-text-body ol {
  margin-left: 1.25rem;
  margin-bottom: 1rem;
}

.display-text-body li {
  margin-bottom: 0.45rem;
}

.display-text-body strong {
  color: #60a5fa;
}

.fade-out {
  opacity: 0;
}

/* Floating Navigator */
.floating-navigator {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
}

.floating-buttons-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-float {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(10, 16, 32, 0.8);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
}

.btn-float:hover {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
  transform: translateY(-2px);
}

/* Responsive queries */
@media (max-width: 850px) {
  .game-workspace {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .game-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  
  .ai-panel-box {
    grid-column: span 2;
  }

  .explanation-layout {
    grid-template-columns: 1fr;
  }

  .explanation-index-list ul {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .explanation-index-list li {
    flex: 1 1 180px;
  }
}

@media (max-width: 600px) {
  .main-header {
    margin: 0.5rem;
    padding: 0.5rem 1.1rem;
  }
  
  .logo-text {
    display: none;
  }
  
  .main-title {
    font-size: 1.7rem;
  }
  
  .game-control-bar {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  
  .control-left {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .control-right {
    justify-content: center;
  }
  
  .game-sidebar {
    grid-template-columns: 1fr;
  }
  
  .ai-panel-box {
    grid-column: auto;
  }
}
