/* ==========================================================================
   WORD TRAP - TACTICAL DESIGN SYSTEM (WEB)
   Faithfully inspired by the Word Trap Mobile Design System
   Warm Sand Canvas • WordTrapCard Elevation • Tactile 3D Buttons
   Flame (#E25822) • Mint (#5EC2BA) • Peach (#F4A261) • Charcoal (#18181B)
   ========================================================================== */

:root {
  /* --- Canvas & Surface --- */
  --wt-bg-canvas: #FAF8F5;
  --wt-card-bg: #FFFFFF;
  --wt-card-bg-subtle: #F4F1EB;
  
  /* --- Text & Contrast --- */
  --wt-text-primary: #18181B;
  --wt-text-secondary: #52525B;
  --wt-text-muted: #A1A1AA;
  --wt-border: rgba(24, 24, 27, 0.08);
  --wt-border-hover: rgba(24, 24, 27, 0.16);

  /* --- Primary: Flame Orange --- */
  --wt-flame: #E25822;
  --wt-flame-hover: #CC4B19;
  --wt-flame-subtle: #FFF3EE;
  --wt-flame-border: rgba(226, 88, 34, 0.25);
  --wt-flame-shadow: rgba(226, 88, 34, 0.22);

  /* --- Mint / Teal (Rating Points, Victory, Paths) --- */
  --wt-mint-bg: #E6F7F5;
  --wt-mint-content: #116961;
  --wt-mint-accent: #5EC2BA;
  --wt-mint-shadow: rgba(94, 194, 186, 0.22);

  /* --- Peach / Gold (Coins, Wagers, Streaks) --- */
  --wt-peach-bg: #FFF3E8;
  --wt-peach-content: #B45309;
  --wt-peach-accent: #F4A261;
  --wt-peach-shadow: rgba(244, 162, 97, 0.24);

  /* --- Crimson / Trap Alert --- */
  --wt-crimson: #EF4444;
  --wt-crimson-bg: #FEF2F2;

  /* --- Charcoal / Dark Surfaces --- */
  --wt-charcoal: #18181B;
  --wt-charcoal-card: #222226;

  /* --- Typography --- */
  --font-sans: 'Nunito', ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Space Mono', monospace;
  --font-arabic: 'Tajawal', 'Nunito', ui-rounded, sans-serif;

  /* --- Tactile Card Geometry --- */
  --radius-card: 24px;
  --radius-card-sm: 18px;
  --radius-pill: 9999px;
  --radius-tile: 16px;

  /* --- Tactile Shadows & Depth --- */
  --shadow-tactile: 0 4px 0 rgba(24, 24, 27, 0.06), 0 10px 24px -4px rgba(24, 24, 27, 0.05);
  --shadow-tactile-hover: 0 6px 0 rgba(24, 24, 27, 0.08), 0 14px 30px -4px rgba(24, 24, 27, 0.08);
  --shadow-btn-tactile: 0 4px 0 #18181B;
  --shadow-btn-flame: 0 4px 0 #AF3C10;
  --shadow-btn-mint: 0 4px 0 #0C4B45;

  /* --- Container --- */
  --container-max: 1140px;

  /* --- Legacy Variable Aliases --- */
  --wt-pure-white: #FFFFFF;
  --wt-pure-black: #18181B;
  --border-width: 1.5px;
  --shadow-hard: 0 4px 0 rgba(24, 24, 27, 0.08), 0 10px 24px -4px rgba(24, 24, 27, 0.05);
  --shadow-hard-sm: 0 2px 0 rgba(24, 24, 27, 0.06);
  --wt-gray-50: #F8F9FA;
  --wt-gray-300: rgba(24, 24, 27, 0.1);
  --wt-gray-350: rgba(24, 24, 27, 0.12);
  --wt-gray-500: #71717A;
  --wt-gray-600: #52525B;
  --wt-gray-650: #4B5563;
  --wt-gray-700: #3F3F46;
  --wt-gray-800: #27272A;
  --wt-forest: #116961;
  --wt-forest-subtle: #E6F7F5;
}

/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html,
body,
button,
input,
select,
textarea,
optgroup {
  font-family: var(--font-sans);
}

body {
  background-color: var(--wt-bg-canvas);
  color: var(--wt-text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(24, 24, 27, 0.04) 1px, transparent 0);
  background-size: 24px 24px;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==================== TYPOGRAPHY ==================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--wt-text-primary);
  line-height: 1.15;
}

p, span, a, li, blockquote, label, small, strong, em, div {
  font-family: inherit;
}

.font-mono {
  font-family: var(--font-mono);
}

.font-arabic {
  font-family: var(--font-arabic);
}

/* ==================== TACTILE CARDS (WordTrapCard) ==================== */
.wordtrap-card {
  background: var(--wt-card-bg);
  border-radius: var(--radius-card);
  border: 1.5px solid var(--wt-border);
  box-shadow: var(--shadow-tactile);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.wordtrap-card:hover {
  box-shadow: var(--shadow-tactile-hover);
}

/* ==================== TACTILE BUTTONS ==================== */
.btn-tactile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 16px;
  padding: 14px 24px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  user-select: none;
  white-space: nowrap;
}

.btn-tactile:active {
  transform: translateY(2px);
}

.btn-flame {
  background: var(--wt-flame);
  color: #FFFFFF;
  border: 1.5px solid #AF3C10;
  box-shadow: var(--shadow-btn-flame);
}

.btn-flame:hover {
  background: var(--wt-flame-hover);
}

.btn-flame:active {
  box-shadow: 0 2px 0 #AF3C10;
}

.btn-dark {
  background: var(--wt-charcoal);
  color: #FFFFFF;
  border: 1.5px solid #000000;
  box-shadow: var(--shadow-btn-tactile);
}

.btn-dark:hover {
  background: #27272A;
}

.btn-dark:active {
  box-shadow: 0 2px 0 #000000;
}

.btn-outline {
  background: #FFFFFF;
  color: var(--wt-text-primary);
  border: 1.5px solid var(--wt-border);
  box-shadow: 0 3px 0 rgba(24, 24, 27, 0.08);
}

.btn-outline:hover {
  border-color: var(--wt-border-hover);
  background: #FAF8F5;
}

.btn-outline:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(24, 24, 27, 0.08);
}

.btn-sm {
  padding: 10px 18px;
  font-size: 12px;
  border-radius: 12px;
}

/* ==================== BADGES & CHIPS ==================== */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge-flame {
  background: var(--wt-flame-subtle);
  color: var(--wt-flame);
  border: 1px solid var(--wt-flame-border);
}

.badge-mint {
  background: var(--wt-mint-bg);
  color: var(--wt-mint-content);
  border: 1px solid rgba(94, 194, 186, 0.3);
}

.badge-peach {
  background: var(--wt-peach-bg);
  color: var(--wt-peach-content);
  border: 1px solid rgba(244, 162, 97, 0.3);
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: currentColor;
  display: inline-block;
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

/* ==================== NAVBAR ==================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 245, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--wt-border);
  padding: 14px 0;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--wt-text-primary);
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--wt-charcoal);
  color: var(--wt-flame);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 24px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.2);
}

.brand-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--wt-flame);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--wt-text-secondary);
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--wt-text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Language Switcher */
.lang-selector {
  display: inline-flex;
  align-items: center;
  background: var(--wt-dark-surface, #27272A);
  border: 1.5px solid var(--wt-border);
  border-radius: 9999px;
  padding: 3px;
  gap: 2px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--wt-text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.lang-btn:hover {
  color: var(--wt-text-primary);
}

.lang-btn.active {
  background: var(--wt-flame);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(226, 88, 34, 0.45);
}


/* ==================== HERO SECTION ==================== */
.hero-section {
  padding: 60px 0 80px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-title {
  font-size: clamp(40px, 5.5vw, 64px);
  font-weight: 900;
  line-height: 1.05;
  margin: 20px 0 18px;
  letter-spacing: -0.03em;
}

.hero-title .highlight {
  color: var(--wt-flame);
  display: block;
}

.hero-lead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--wt-text-secondary);
  max-width: 500px;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 36px;
}

.hero-stat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.mini-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--wt-card-bg);
  border: 1.5px solid var(--wt-border);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 0 rgba(24, 24, 27, 0.04);
}

.mini-stat-pill .icon {
  font-size: 15px;
}

/* ==================== PHONE SIMULATOR (WordTrap Arena) ==================== */
.phone-mockup-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.phone-mockup {
  width: 100%;
  max-width: 380px;
  background: var(--wt-card-bg);
  border: 4px solid var(--wt-charcoal);
  border-radius: 42px;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.15), 0 6px 0 #18181B;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

/* Phone Notch */
.phone-notch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--wt-text-muted);
}

.notch-pill {
  width: 80px;
  height: 16px;
  background: var(--wt-charcoal);
  border-radius: var(--radius-pill);
}

/* Arena Header inside Phone */
.arena-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 4px 10px;
  border-bottom: 1px solid var(--wt-border);
  margin-bottom: 14px;
}

.arena-mode-tag {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--wt-flame);
  text-transform: uppercase;
}

/* Dual Scoreboard */
.arena-scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.player-score-card {
  background: var(--wt-card-bg-subtle);
  border: 1.5px solid var(--wt-border);
  border-radius: var(--radius-card-sm);
  padding: 8px 10px;
  text-align: center;
  transition: all 0.2s ease;
}

.player-score-card.active-turn {
  background: #FFFFFF;
  border-color: var(--wt-flame);
  box-shadow: 0 0 0 3px var(--wt-flame-subtle), 0 3px 0 rgba(226, 88, 34, 0.2);
}

.player-score-card .player-name {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--wt-text-secondary);
  text-transform: uppercase;
}

.player-score-card .player-score {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
  color: var(--wt-text-primary);
}

.player-score-card .turn-status {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--wt-flame);
  text-transform: uppercase;
}

/* Blitz Timer Circle */
.timer-pill {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--wt-charcoal);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.timer-seconds {
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
}

.timer-unit {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.06em;
  opacity: 0.7;
}

/* Word Stage */
.arena-word-stage {
  background: #FAF8F5;
  border: 1.5px solid var(--wt-border);
  border-radius: var(--radius-card-sm);
  padding: 24px 12px 18px;
  text-align: center;
  position: relative;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  overflow: hidden;
}

.word-tile-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
  direction: ltr !important;
}

.letter-tile {
  width: 44px;
  height: 52px;
  background: #FFFFFF;
  border: 2px solid var(--wt-charcoal);
  border-radius: 12px;
  box-shadow: 0 4px 0 #18181B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: var(--wt-text-primary);
  animation: tile-drop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.letter-tile.trapped-letter {
  background: var(--wt-crimson);
  color: #FFFFFF;
  border-color: #991B1B;
  box-shadow: 0 4px 0 #991B1B;
  animation: tile-shake 0.4s ease;
}

@keyframes tile-drop {
  0% { transform: translateY(-16px) scale(0.85); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes tile-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* Trie Branch Pill */
.trie-branch-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  border: 1px solid var(--wt-border);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 0 rgba(24, 24, 27, 0.04);
}

.trie-branch-chip .branch-num {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  color: var(--wt-flame);
}

/* Trap Sprung Overlay */
.trap-overlay {
  position: absolute;
  inset: 0;
  background: rgba(239, 68, 68, 0.96);
  color: #FFFFFF;
  border-radius: var(--radius-card-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  transform: scale(0.95);
  z-index: 10;
}

.trap-overlay.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.trap-headline {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.trap-subline {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
  text-align: center;
  margin-bottom: 12px;
}

.btn-trap-again {
  background: #FFFFFF;
  color: var(--wt-crimson);
  border: none;
  font-size: 11px;
  font-weight: 900;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,0.15);
}

/* Arena Match Status Display (Clean Spectator Bar) */
.arena-match-status {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 4px;
}

.match-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--wt-card-bg-subtle);
  border: 1.5px solid var(--wt-border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--wt-text-secondary);
}

.match-status-pill .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--wt-flame);
  animation: pulse-dot 1.5s infinite;
}

.flying-letter {
  position: absolute;
  width: 44px;
  height: 52px;
  background: var(--wt-flame);
  color: #FFFFFF;
  border: 2px solid #AF3C10;
  border-radius: 12px;
  box-shadow: 0 4px 0 #AF3C10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  pointer-events: none;
  z-index: 50;
  transition: all 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.letter-tile.new-letter {
  background: var(--wt-flame);
  color: #FFFFFF;
  border-color: #AF3C10;
  box-shadow: 0 4px 0 #AF3C10;
  animation: tile-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes tile-pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Phone External Dock */
.phone-dock {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.dock-pill-btn {
  background: var(--wt-card-bg);
  border: 1.5px solid var(--wt-border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 800;
  color: var(--wt-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 0 rgba(24, 24, 27, 0.04);
}

.dock-pill-btn:hover {
  background: #FFFFFF;
  border-color: var(--wt-border-hover);
  color: var(--wt-text-primary);
}

.dock-pill-btn.active {
  background: var(--wt-charcoal);
  color: #FFFFFF;
  border-color: #000000;
  box-shadow: 0 3px 0 #000000;
}

/* ==================== VISUAL TRAP PROGRESSION ==================== */
.section-visual-flow {
  padding: 70px 0;
}

.section-head-center {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 48px;
}

.section-title {
  font-size: clamp(28px, 4vw, 42px);
  margin: 12px 0 10px;
}

.section-subtitle {
  font-size: 16px;
  color: var(--wt-text-secondary);
}

/* 4-Step Interactive Flow Strip */
.trap-steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.step-flow-card {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.step-flow-card .step-badge {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--wt-text-muted);
  margin-bottom: 14px;
}

.step-flow-card .step-tiles-box {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  min-height: 52px;
  align-items: center;
  direction: ltr !important;
}

.step-flow-card .mini-tile {
  width: 36px;
  height: 44px;
  background: #FFFFFF;
  border: 1.5px solid var(--wt-charcoal);
  border-radius: 10px;
  box-shadow: 0 3px 0 #18181B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
}

.step-flow-card .mini-tile.new {
  background: var(--wt-flame);
  color: #FFFFFF;
  border-color: #AF3C10;
  box-shadow: 0 3px 0 #AF3C10;
}

.step-flow-card .mini-tile.trapped {
  background: var(--wt-crimson);
  color: #FFFFFF;
  border-color: #991B1B;
  box-shadow: 0 3px 0 #991B1B;
}

.step-flow-card .step-name {
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.step-flow-card .step-branches {
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  color: var(--wt-text-secondary);
}

.step-flow-card.is-trap {
  background: #FEF2F2;
  border-color: rgba(239, 68, 68, 0.3);
}

.step-flow-card.is-trap .step-name {
  color: var(--wt-crimson);
}

.step-flow-card.is-trap .step-branches {
  color: var(--wt-crimson);
  font-weight: 900;
}

/* ==================== BENTO FEATURES GRID ==================== */
.section-features-bento {
  padding: 60px 0 80px;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.bento-col-7 {
  grid-column: span 7;
}

.bento-col-5 {
  grid-column: span 5;
}

.bento-col-6 {
  grid-column: span 6;
}

.bento-col-12 {
  grid-column: span 12;
}

.bento-card {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.bento-head {
  margin-bottom: 24px;
}

.bento-title {
  font-size: 22px;
  font-weight: 900;
  margin: 10px 0 6px;
  letter-spacing: -0.02em;
}

.bento-desc {
  font-size: 14px;
  color: var(--wt-text-secondary);
  line-height: 1.45;
}

/* Visual Feature 1: Live Interactive Trie Branch Visualizer */
.trie-visualizer-box {
  background: var(--wt-bg-canvas);
  border: 1.5px solid var(--wt-border);
  border-radius: var(--radius-card-sm);
  padding: 20px;
}

.trie-input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.trie-current-word {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--wt-flame);
}

.trie-tree-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trie-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 800;
}

.trie-bar-letter {
  width: 28px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 800;
}

.trie-bar-track {
  flex: 1;
  height: 12px;
  background: rgba(24, 24, 27, 0.06);
  border-radius: 6px;
  overflow: hidden;
}

.trie-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.3s ease;
}

.trie-bar-fill.high { background: var(--wt-mint-accent); }
.trie-bar-fill.mid { background: var(--wt-peach-accent); }
.trie-bar-fill.dead { background: var(--wt-crimson); }

.trie-bar-count {
  width: 60px;
  text-align: right;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--wt-text-secondary);
}

/* Visual Feature 2: 3 Game Modes (Online, Friend, AI) */
.mode-items-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.mode-item-card {
  background: var(--wt-bg-canvas);
  border: 1.5px solid var(--wt-border);
  border-radius: var(--radius-card-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.mode-item-card:hover {
  border-color: rgba(255, 94, 0, 0.4);
  transform: translateY(-1px);
}

.mode-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mode-item-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.mode-icon-online {
  background: rgba(255, 94, 0, 0.12);
  border: 1px solid rgba(255, 94, 0, 0.3);
}

.mode-icon-friend {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.mode-icon-ai {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.mode-item-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mode-item-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 800;
  color: var(--wt-text-primary);
  letter-spacing: 0.02em;
}

.mode-item-tag {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}

.tag-hot {
  background: rgba(255, 94, 0, 0.15);
  color: var(--wt-flame);
  border: 1px solid rgba(255, 94, 0, 0.3);
}

.tag-chill {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.mode-item-sub {
  font-size: 11px;
  color: var(--wt-text-muted);
  font-weight: 600;
  margin-top: 2px;
  line-height: 1.3;
}

.mode-item-right {
  flex-shrink: 0;
  text-align: right;
}

.mode-cost-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: var(--wt-card-bg);
  border: 1px solid var(--wt-border);
  color: var(--wt-text-secondary);
  white-space: nowrap;
}

.bot-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--wt-card-bg-subtle);
  border: 1px solid var(--wt-border);
  border-radius: 14px;
  padding: 10px 14px;
}

.bot-icon {
  font-size: 18px;
}

.bot-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--wt-text-secondary);
}

/* Visual Feature 3: Hero Section Card 3D Duel Showcase */
.hero-showcase-card {
  padding: 36px;
  background: var(--wt-card-bg);
  display: flex;
  flex-direction: column;
}

.hero-showcase-header {
  margin-bottom: 24px;
}

.hero-showcase-img-container {
  width: 100%;
  border-radius: var(--radius-card-sm);
  overflow: hidden;
  position: relative;
  border: 1.5px solid var(--wt-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  background: #FDFBF7;
}

.hero-showcase-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-showcase-card:hover .hero-showcase-img {
  transform: scale(1.012);
}

/* ==================== MINIMAL CTA BANNER ==================== */
.section-cta {
  padding: 50px 0 80px;
}

.cta-tactile-card {
  background: var(--wt-charcoal);
  color: #FFFFFF;
  border-radius: 32px;
  padding: 50px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.25), 0 6px 0 #000000;
  border: 2px solid #000000;
  position: relative;
  overflow: hidden;
}

.cta-tactile-card::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(226, 88, 34, 0.28) 0%, transparent 70%);
  pointer-events: none;
}

.cta-left {
  max-width: 540px;
}

.cta-title {
  color: #FFFFFF;
  font-size: clamp(28px, 3.5vw, 42px);
  margin-bottom: 12px;
}

.cta-desc {
  font-size: 16px;
  color: #A1A1AA;
  line-height: 1.5;
  margin-bottom: 0;
}

.cta-right {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==================== FOOTER ==================== */
.site-footer {
  border-top: 1px solid var(--wt-border);
  padding: 40px 0;
  background: #FAF8F5;
  font-size: 13px;
  color: var(--wt-text-secondary);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.footer-link {
  color: var(--wt-text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--wt-text-primary);
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }

  .hero-content {
    align-items: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .bento-col-7, .bento-col-5, .bento-col-6, .bento-col-12 {
    grid-column: span 12;
  }

  .trap-steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cta-tactile-card {
    flex-direction: column;
    text-align: center;
    padding: 36px 24px;
  }
}

@media (max-width: 600px) {
  .nav-links {
    display: none;
  }

  .trap-steps-grid {
    grid-template-columns: 1fr;
  }

  .mobile-stats-replica-row {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 36px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ==========================================================================
   BUTTONS, BADGES & UTILITIES (COMPATIBILITY)
   ========================================================================== */

.bg-grid-pattern {
  background-color: var(--wt-bg-canvas);
  background-image: radial-gradient(circle at 1px 1px, rgba(24, 24, 27, 0.04) 1px, transparent 0);
  background-size: 24px 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 800;
  text-decoration: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  border: 1.5px solid transparent;
}

.btn:active {
  transform: translateY(2px);
}

.btn-primary, .btn-flame {
  background: var(--wt-flame);
  color: #FFFFFF;
  box-shadow: 0 4px 0 var(--shadow-btn-flame);
  border-color: var(--shadow-btn-flame);
}

.btn-primary:hover, .btn-flame:hover {
  background: var(--wt-flame-hover);
  color: #FFFFFF;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.btn-lg {
  padding: 16px 28px;
  font-size: 15px;
  letter-spacing: 0.05em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge-flame {
  background: var(--wt-flame-subtle);
  color: var(--wt-flame);
  border: 1px solid var(--wt-flame-border);
}

.badge-black {
  background: var(--wt-charcoal);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--wt-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--wt-text-muted);
  flex-wrap: wrap;
  gap: 16px;
}

.footer-legal-inline {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-legal-inline a {
  color: var(--wt-text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-legal-inline a:hover {
  color: var(--wt-flame);
}

/* ==========================================================================
   BLOG & ARTICLE READER STYLES
   ========================================================================== */

.blog-hero {
  padding: 60px 0 40px;
  background-color: var(--wt-bg-canvas);
  border-bottom: 1.5px solid var(--wt-border);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  margin-top: 36px;
}

.blog-card {
  background: var(--wt-card-bg);
  border: 1.5px solid var(--wt-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-tactile);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--wt-text-primary);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-tactile-hover);
  border-color: var(--wt-border-hover);
}

.blog-card-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  background: var(--wt-card-bg);
}

.blog-card-media {
  background: var(--wt-charcoal);
  color: #FFFFFF;
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  min-height: 240px;
  border-bottom: 1.5px solid var(--wt-border);
}

.blog-card-featured .blog-card-media {
  border-bottom: none;
  border-left: 1.5px solid var(--wt-border);
  min-height: auto;
}

.blog-media-pattern {
  font-family: var(--font-sans);
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 4px;
  opacity: 0.2;
  user-select: none;
  line-height: 1.1;
  overflow: hidden;
  color: #FFFFFF;
}

.blog-card-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--wt-text-muted);
}

.blog-tag {
  background: var(--wt-flame-subtle);
  color: var(--wt-flame);
  border: 1px solid var(--wt-flame-border);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.blog-card-title {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 12px;
  color: var(--wt-text-primary);
}

.blog-card-excerpt {
  font-size: 14px;
  color: var(--wt-text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
  flex: 1;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--wt-border);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.blog-read-more {
  color: var(--wt-flame);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Article Reader View */
.article-header-section {
  padding: 60px 0 40px;
  background-color: var(--wt-bg-canvas);
  border-bottom: 1.5px solid var(--wt-border);
}

.article-header-container {
  max-width: 820px;
  margin: 0 auto;
}

.article-badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.article-headline {
  font-size: 42px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--wt-text-primary);
}

.article-lead {
  font-size: 19px;
  line-height: 1.6;
  color: var(--wt-text-secondary);
  font-weight: 500;
  margin-bottom: 28px;
}

.article-byline {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--wt-border);
  font-size: 13px;
  font-weight: 700;
  color: var(--wt-text-secondary);
}

.article-avatar {
  width: 44px;
  height: 44px;
  background: var(--wt-flame);
  color: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--shadow-btn-flame);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
}

.article-body-section {
  padding: 60px 0 100px;
}

.article-content {
  max-width: 820px;
  margin: 0 auto;
}

.article-content h2 {
  font-size: 26px;
  font-weight: 900;
  margin: 44px 0 16px;
  line-height: 1.25;
  color: var(--wt-text-primary);
}

.article-content h3 {
  font-size: 20px;
  font-weight: 800;
  margin: 32px 0 12px;
  color: var(--wt-text-primary);
}

.article-content p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--wt-text-secondary);
  margin-bottom: 24px;
}

.article-content ul, .article-content ol {
  padding-left: 28px;
  margin-bottom: 28px;
}

.article-content li {
  font-size: 16px;
  line-height: 1.7;
  color: var(--wt-text-secondary);
  margin-bottom: 10px;
}

.article-content blockquote {
  background: var(--wt-flame-subtle);
  border-left: 4px solid var(--wt-flame);
  border-radius: 0 var(--radius-card-sm) var(--radius-card-sm) 0;
  padding: 24px 28px;
  margin: 36px 0;
  font-size: 18px;
  line-height: 1.6;
  font-weight: 600;
  color: var(--wt-text-primary);
}

.article-code-block {
  background: var(--wt-charcoal);
  color: #E4E4E7;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-card-sm);
  box-shadow: var(--shadow-tactile);
  padding: 24px;
  margin: 32px 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
}

.article-callout-box {
  background: var(--wt-card-bg);
  border: 1.5px solid var(--wt-border);
  border-radius: var(--radius-card-sm);
  box-shadow: var(--shadow-tactile);
  padding: 28px;
  margin: 36px 0;
}

.article-callout-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--wt-flame);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-share-cta {
  background: var(--wt-card-bg);
  border: 1.5px solid var(--wt-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-tactile);
  padding: 44px;
  text-align: center;
  margin-top: 56px;
}

@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-card-featured {
    grid-template-columns: 1fr;
  }

  .blog-card-featured .blog-card-media {
    border-left: none;
    border-bottom: 1.5px solid var(--wt-border);
  }

  .article-headline {
    font-size: 30px;
  }

  .article-lead {
    font-size: 17px;
  }
}

/* ==================== RTL & ARABIC TYPOGRAPHY ==================== */
html[dir="rtl"],
body.is-arabic {
  font-family: var(--font-arabic);
  direction: rtl;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] .hero-title,
html[dir="rtl"] .section-title,
html[dir="rtl"] .bento-title,
html[dir="rtl"] .cta-title,
html[dir="rtl"] .brand-title,
html[dir="rtl"] .brand-subtitle,
html[dir="rtl"] .hero-lead,
html[dir="rtl"] .bento-desc,
html[dir="rtl"] .section-subtitle,
html[dir="rtl"] .step-name,
html[dir="rtl"] .step-branches,
html[dir="rtl"] .badge-pill,
html[dir="rtl"] .btn-tactile,
html[dir="rtl"] .nav-link {
  font-family: var(--font-arabic);
  letter-spacing: 0 !important;
}

html[dir="rtl"] .hero-title {
  line-height: 1.25;
}

html[dir="rtl"] .hero-content {
  text-align: right;
  align-items: flex-start;
}

html[dir="rtl"] .brand-icon {
  margin-right: 0;
  margin-left: 12px;
}

html[dir="rtl"] .cta-left {
  text-align: right;
}

html[dir="rtl"] .trie-input-header {
  flex-direction: row-reverse;
}

html[dir="rtl"] .bot-status-row {
  justify-content: flex-start;
}

html[dir="rtl"] .mode-item-right {
  text-align: left;
}

html[dir="rtl"] .footer-inner {
  flex-direction: row-reverse;
}

html[dir="rtl"] .footer-links {
  padding: 0;
}

/* Ensure game word demo animations and progression steps never reverse Latin letters in RTL mode */
html[dir="rtl"] .word-tile-row,
html[dir="rtl"] #arenaWordDisplay,
html[dir="rtl"] .step-tiles-box,
html[dir="rtl"] .step-flow-card .step-tiles-box,
html[dir="rtl"] .trie-bar-row {
  direction: ltr !important;
}


