/* ============================================================
   Numble Words — style.css  v3.0
   Enhanced design with calm colors and smooth animations
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Roboto+Mono:wght@400;500;700&display=swap');

/* ─── CSS VARIABLES ──────────────────────────────────────── */
:root {
  /* Dark theme (default) - Calm colors */
  --bg:          #0f1419;
  --bg2:         #16191e;
  --bg3:         #1c2028;
  --surface:     #23272f;
  --surface2:    #2a2f38;
  --border:      #2f3541;
  --border2:     #3a4048;

  /* Calm color palette */
  --correct:     #5b9a8b;  /* Soft teal */
  --present:     #c4a565;  /* Muted gold */
  --absent:      #3a3f4a;  /* Soft gray */
  --correct-kb:  #5b9a8b;
  --present-kb:  #c4a565;
  --absent-kb:   #6b7280;

  --accent:      #6b7280;
  --purple:      #6366f1;  /* Calm indigo */
  --green:       #5b9a8b;
  --yellow:      #c4a565;
  --blue:        #60a5fa;
  --red:         #f87171;

  --text:        #e8eaed;
  --text2:       #9ca3af;
  --text3:       #6b7280;

  --tile-border-empty:  #2f3541;
  --tile-border-filled: #6b7280;
  --tile-bg:            #16191e;

  --shadow:   0 4px 32px rgba(0,0,0,0.4);
  --shadow-sm:0 2px 8px rgba(0,0,0,0.2);
  --shadow-lg:0 8px 48px rgba(0,0,0,0.6);

  --font:    'Outfit', sans-serif;
  --mono:    'Roboto Mono', monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  --nav-w: 240px;
  --header-h: 60px;
  --kb-max: 520px;
  
  --transition-fast: 0.15s ease;
  --transition-med: 0.3s ease;
  --transition-slow: 0.5s ease;
}

[data-theme="light"] {
  --bg:          #f8f9fa;
  --bg2:         #f1f3f5;
  --bg3:         #e9ecef;
  --surface:     #ffffff;
  --surface2:    #f8f9fa;
  --border:      #dee2e6;
  --border2:     #ced4da;
  
  --correct:     #5b9a8b;
  --present:     #c4a565;
  --absent:      #adb5bd;
  --correct-kb:  #5b9a8b;
  --present-kb:  #c4a565;
  --absent-kb:   #dee2e6;
  
  --text:        #212529;
  --text2:       #6c757d;
  --text3:       #adb5bd;
  --tile-border-empty:  #dee2e6;
  --tile-border-filled: #6c757d;
  --tile-bg:            #ffffff;
  
  --shadow:   0 4px 32px rgba(0,0,0,0.08);
  --shadow-sm:0 2px 8px rgba(0,0,0,0.04);
  --shadow-lg:0 8px 48px rgba(0,0,0,0.12);
}

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

html { 
  font-size: 16px; 
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--transition-med), color var(--transition-med);
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ─── TOP HEADER ──────────────────────────────────────────── */
#top-header {
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(16px);
  transition: background var(--transition-med);
}

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

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--r-sm);
  transition: all var(--transition-fast);
}

.hamburger-btn:hover { 
  color: var(--text); 
  background: var(--surface); 
  transform: scale(1.05);
}

.hamburger-btn svg { display: block; }

.logo-wrap { 
  display: flex; 
  align-items: center; 
  gap: 0.65rem; 
  cursor: pointer; 
  transition: transform var(--transition-fast);
}

.logo-wrap:hover {
  transform: translateY(-1px);
}

.logo-icon {
  width: 36px; 
  height: 36px;
  background: linear-gradient(135deg, var(--purple) 0%, #818cf8 100%);
  border-radius: 8px;
  display: flex; 
  align-items: center; 
  justify-content: center;
  font-weight: 900; 
  font-size: 0.9rem; 
  color: #fff;
  font-family: var(--mono);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  transition: all var(--transition-fast);
}

.logo-icon:hover {
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transform: scale(1.05);
}

.logo-name {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--text);
  transition: color var(--transition-fast);
}

.logo-name span { 
  color: var(--purple); 
}

.header-right { 
  display: flex; 
  align-items: center; 
  gap: 0.35rem; 
}

.hdr-btn {
  background: none; 
  border: none;
  color: var(--text2); 
  cursor: pointer;
  width: 40px; 
  height: 40px;
  display: flex; 
  align-items: center; 
  justify-content: center;
  border-radius: var(--r-md);
  transition: all var(--transition-fast);
  position: relative;
}

.hdr-btn:hover { 
  color: var(--text); 
  background: var(--surface); 
  transform: translateY(-1px);
}

.hdr-btn:active {
  transform: translateY(0);
}

.hdr-btn svg { 
  pointer-events: none; 
  transition: transform var(--transition-fast);
}

.hdr-btn:hover svg {
  transform: scale(1.1);
}

/* ─── LAYOUT ──────────────────────────────────────────────── */
#layout {
  display: flex;
  flex: 1;
  position: relative;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* ─── SIDEBAR ─────────────────────────────────────────────── */
#sidebar {
  width: var(--nav-w);
  min-height: calc(100vh - var(--header-h));
  background: var(--bg);
  border-right: 1px solid var(--border);
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform var(--transition-med), opacity var(--transition-med);
}

#sidebar::-webkit-scrollbar {
  width: 6px;
}

#sidebar::-webkit-scrollbar-track {
  background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 10px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

#sidebar.mobile-open { 
  transform: translateX(0) !important; 
  opacity: 1 !important; 
}

.nav-section {
  padding: 1.2rem 1rem 0.5rem;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text3);
  padding: 0.5rem 0.85rem 0.35rem;
  transition: color var(--transition-fast);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text2);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: all var(--transition-fast);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: var(--purple);
  transform: scaleY(0);
  transition: transform var(--transition-fast);
}

.nav-item:hover { 
  background: var(--surface); 
  color: var(--text); 
  transform: translateX(2px);
}

.nav-item.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.nav-item.active::before {
  transform: scaleY(1);
}

.nav-item.active .nav-dot { 
  background: var(--green); 
  box-shadow: 0 0 8px var(--green);
}

.nav-dot {
  width: 7px; 
  height: 7px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
  margin-left: auto;
  transition: all var(--transition-med);
}

.nav-icon { 
  font-size: 1.1rem; 
  width: 1.5rem; 
  text-align: center; 
  flex-shrink: 0; 
}

.sidebar-footer {
  margin-top: auto;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text3);
  line-height: 1.7;
  transition: all var(--transition-med);
}

/* ─── MAIN AREA ───────────────────────────────────────────── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
  width: 100%;
}

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem 3rem;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

/* ─── PAGE WRAPPERS ───────────────────────────────────────── */
.page { 
  width: 100%; 
  max-width: 640px; 
  animation: fadeUp 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
}

.page-narrow { max-width: 520px; }
.page-wide { max-width: 740px; }

@keyframes fadeUp {
  from { 
    opacity: 0; 
    transform: translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* ─── HOME PAGE ───────────────────────────────────────────── */
.home-hero {
  text-align: center;
  padding: 2.5rem 0 2rem;
}

.home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 1rem;
  animation: slideDown 0.6s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow-dot { 
  width: 7px; 
  height: 7px; 
  border-radius: 50%; 
  background: var(--green); 
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}

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

.home-title {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 1rem;
  animation: fadeUp 0.6s ease 0.1s both;
}

.home-title .t-purple { 
  color: var(--purple); 
  background: linear-gradient(135deg, var(--purple) 0%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-sub {
  font-size: 1rem;
  color: var(--text2);
  max-width: 420px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
  animation: fadeUp 0.6s ease 0.2s both;
}

/* ─── DAILY STRIP ──────────────────────────────────────────── */
.daily-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
  animation: fadeUp 0.6s ease 0.3s both;
}

.daily-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-med);
  position: relative;
  overflow: hidden;
}

.daily-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--purple), #818cf8);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-med);
}

.daily-tile:hover::before {
  transform: scaleX(1);
}

.daily-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--border2);
}

.dt-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 0.75rem;
}

.dt-label {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.dt-sub {
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.dt-arrow {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--purple);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.daily-tile:hover .dt-arrow {
  gap: 0.75rem;
  color: #818cf8;
}

/* ─── MODE TABS ───────────────────────────────────────────── */
.mode-tabs {
  display: flex;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 5px;
  margin-bottom: 1.5rem;
  gap: 5px;
  animation: fadeUp 0.6s ease 0.4s both;
}

.mode-tab {
  flex: 1;
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--text2);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--transition-med);
  position: relative;
}

.mode-tab:hover {
  color: var(--text);
  background: var(--surface);
}

.mode-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ─── CONFIG CARD ──────────────────────────────────────────── */
.config-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.6s ease 0.5s both;
}

.config-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.config-row:last-child {
  margin-bottom: 0;
}

.config-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  padding: 0.6rem 1.2rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 50px;
  text-align: center;
}

.pill:hover {
  background: var(--surface2);
  border-color: var(--border2);
  color: var(--text);
  transform: translateY(-2px);
}

.pill.active {
  background: var(--purple);
  border-color: var(--purple);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ─── BUTTONS ──────────────────────────────────────────────── */
.btn-play {
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--purple) 0%, #818cf8 100%);
  color: white;
  border: none;
  border-radius: var(--r-lg);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-med);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
  animation: fadeUp 0.6s ease 0.6s both;
  position: relative;
  overflow: hidden;
}

.btn-play::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn-play:hover::before {
  left: 100%;
}

.btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.btn-play:active {
  transform: translateY(0);
}

.home-cta {
  margin-bottom: 2.5rem;
}

/* ─── MULTIPLAYER SECTION ──────────────────────────────────── */
.mp-section {
  margin-top: 2rem;
  animation: fadeUp 0.6s ease 0.7s both;
}

.section-heading {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.mp-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.mp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  cursor: pointer;
  transition: all var(--transition-med);
  text-align: center;
}

.mp-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--purple);
}

.mp-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.mp-card h4 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.mp-card p {
  font-size: 0.9rem;
  color: var(--text2);
  line-height: 1.5;
}

/* ─── GAME PAGE ───────────────────────────────────────────── */
.game-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.game-back-btn {
  padding: 0.6rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.game-back-btn:hover {
  background: var(--surface2);
  transform: translateX(-2px);
}

.game-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.gbadge {
  padding: 0.4rem 0.9rem;
  border-radius: var(--r-md);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.gbadge-word {
  background: rgba(91, 154, 139, 0.15);
  color: var(--correct);
  border: 1px solid rgba(91, 154, 139, 0.3);
}

.gbadge-num {
  background: rgba(196, 165, 101, 0.15);
  color: var(--present);
  border: 1px solid rgba(196, 165, 101, 0.3);
}

.gbadge-daily {
  background: rgba(99, 102, 241, 0.15);
  color: var(--purple);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.gbadge-room {
  background: rgba(96, 165, 250, 0.15);
  color: var(--blue);
  border: 1px solid rgba(96, 165, 250, 0.3);
  font-family: var(--mono);
}

.game-chances {
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
}

/* ─── COLOR LEGEND ─────────────────────────────────────────── */
.color-legend {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.4s ease;
}

.legend-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  text-align: center;
}

.legend-items {
  display: flex;
  justify-content: space-around;
  gap: 1rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.legend-tile {
  width: 50px;
  height: 50px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
  animation: flipIn 0.6s ease;
}

@keyframes flipIn {
  from {
    transform: rotateX(-90deg);
    opacity: 0;
  }
  to {
    transform: rotateX(0);
    opacity: 1;
  }
}

.legend-tile.correct { background: var(--correct); }
.legend-tile.present { background: var(--present); }
.legend-tile.absent { background: var(--absent); }

.legend-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text2);
  text-align: center;
}

/* ─── GRID ─────────────────────────────────────────────────── */
.grid-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 1rem auto;
  max-width: 380px;
}

.grid-row {
  display: grid;
  gap: 5px;
}

.tile {
  aspect-ratio: 1;
  border: 2px solid var(--tile-border-empty);
  background: var(--tile-bg);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 900;
  font-family: var(--mono);
  color: var(--text);
  text-transform: uppercase;
  transition: all 0.2s ease;
  user-select: none;
}

.tile[data-state="tbd"] {
  border-color: var(--tile-border-filled);
  animation: pop 0.15s ease;
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.tile[data-state="correct"] {
  background: var(--correct);
  border-color: var(--correct);
  color: white;
}

.tile[data-state="present"] {
  background: var(--present);
  border-color: var(--present);
  color: white;
}

.tile[data-state="absent"] {
  background: var(--absent);
  border-color: var(--absent);
  color: var(--text2);
}

.tile.flipping {
  animation: flip 0.6s ease;
}

@keyframes flip {
  0% { transform: rotateX(0); }
  50% { transform: rotateX(-90deg); }
  100% { transform: rotateX(0); }
}

.tile.shaking {
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ─── GUESS INFO ──────────────────────────────────────────── */
.guess-info {
  text-align: center;
  padding: 1rem;
  min-height: 60px;
  animation: fadeUp 0.4s ease;
}

.gi-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text3);
  margin-bottom: 0.5rem;
}

.gi-content {
  font-size: 0.95rem;
  color: var(--text2);
  line-height: 1.6;
}

/* ─── KEYBOARD ────────────────────────────────────────────── */
.keyboard-wrap {
  max-width: var(--kb-max);
  margin: 0 auto;
  width: 100%;
}

.kb-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 8px;
}

.kb-key {
  min-width: 43px;
  height: 58px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.kb-key:hover {
  background: var(--surface2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.kb-key:active {
  transform: translateY(0);
}

.kb-key.wide {
  min-width: 65px;
  font-size: 0.75rem;
}

.kb-key[data-state="correct"] {
  background: var(--correct-kb);
  border-color: var(--correct-kb);
  color: white;
}

.kb-key[data-state="present"] {
  background: var(--present-kb);
  border-color: var(--present-kb);
  color: white;
}

.kb-key[data-state="absent"] {
  background: var(--absent-kb);
  border-color: var(--absent-kb);
  color: var(--text2);
  opacity: 0.55;
  text-decoration: line-through;
  text-decoration-color: rgba(255,255,255,0.4);
}

/* ─── NUMBER KEYBOARD ──────────────────────────────────────── */
.numkb-wrap {
  max-width: 360px;
  margin: 0 auto;
  width: 100%;
}

.numkb-btn {
  background: var(--purple);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: var(--r-lg);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: all var(--transition-med);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.numkb-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
}

.numkb-btn:active {
  transform: translateY(0);
}

/* ─── NUMBER INPUT MODAL ───────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 90%;
  animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.number-modal {
  padding: 0;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg3);
  color: var(--text);
}

.number-display {
  padding: 2rem 1.75rem;
  text-align: center;
  font-size: 2.5rem;
  font-weight: 900;
  font-family: var(--mono);
  color: var(--text);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
  letter-spacing: 8px;
}

.number-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 1.5rem 1.75rem;
}

.num-btn {
  aspect-ratio: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.num-btn:hover {
  background: var(--surface);
  transform: scale(1.05);
  box-shadow: var(--shadow-sm);
}

.num-btn:active {
  transform: scale(0.95);
}

.num-btn-clear {
  background: rgba(248, 113, 113, 0.15);
  color: var(--red);
  border-color: rgba(248, 113, 113, 0.3);
}

.num-btn-clear:hover {
  background: rgba(248, 113, 113, 0.25);
}

.num-btn-back {
  background: rgba(107, 114, 128, 0.15);
  color: var(--text2);
  border-color: var(--border);
  font-size: 1.2rem;
}

.btn-submit-number {
  margin: 0 1.75rem 1.75rem;
  width: calc(100% - 3.5rem);
  padding: 1rem;
  background: linear-gradient(135deg, var(--purple) 0%, #818cf8 100%);
  color: white;
  border: none;
  border-radius: var(--r-lg);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-med);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-submit-number:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
}

.btn-submit-number:active {
  transform: translateY(0);
}

.btn-submit-number:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ─── ROOM LIVE STATUS ─────────────────────────────────────── */
.room-live {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.4s ease;
}

.room-player {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition-med);
}

.room-player.rp-you {
  border-color: var(--purple);
  background: rgba(99, 102, 241, 0.05);
}

.rp-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.rp-stat {
  font-size: 0.8rem;
  color: var(--text2);
  font-family: var(--mono);
}

.rp-timer {
  font-size: 1.5rem;
  font-weight: 900;
  font-family: var(--mono);
  color: var(--purple);
  margin-top: 0.25rem;
}

/* ─── PROGRESS BAR ─────────────────────────────────────────── */
.progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--bg3);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), #818cf8);
  border-radius: 10px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* ─── TOAST ────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 1rem 1.5rem;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  backdrop-filter: blur(12px);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ─── CONFETTI ─────────────────────────────────────────────── */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  display: none;
}

/* ─── MOBILE OVERLAY ───────────────────────────────────────── */
#mob-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 199;
  backdrop-filter: blur(4px);
}

#mob-overlay.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --nav-w: 280px;
  }

  .hamburger-btn {
    display: block;
  }

  #sidebar {
    position: fixed;
    z-index: 201;
    transform: translateX(-100%);
    opacity: 0;
  }

  #app {
    padding: 1.5rem 1rem 2rem;
  }

  .page {
    max-width: 100%;
  }

  .home-hero {
    padding: 1.5rem 0 1rem;
  }

  .daily-strip {
    grid-template-columns: 1fr;
  }

  .mp-cards {
    grid-template-columns: 1fr;
  }

  .room-live {
    flex-direction: column;
  }

  .kb-key {
    min-width: 28px;
    height: 50px;
    font-size: 0.8rem;
  }

  .kb-key.wide {
    min-width: 50px;
    font-size: 0.65rem;
  }

  .tile {
    font-size: 1.3rem;
  }

  .number-display {
    font-size: 2rem;
    letter-spacing: 4px;
  }

  .num-btn {
    font-size: 1.2rem;
  }
  
  .modal-content {
    width: 95%;
    max-width: 95%;
    margin: 1rem;
  }
  
  .pill-group {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .logo-name {
    font-size: 1.1rem;
  }

  .home-title {
    font-size: 2rem;
  }

  .modal-content {
    width: 95%;
  }

  .number-pad {
    gap: 8px;
    padding: 1.25rem;
  }
}

/* ─── ROOM MODALS ──────────────────────────────────────────── */
.room-modal {
  max-width: 480px;
  width: 90%;
}

.modal-body {
  padding: 1.5rem 1.75rem;
  max-height: 60vh;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg3);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--purple);
  background: var(--surface);
}

.form-input::placeholder {
  color: var(--text3);
}

.code-input {
  text-transform: uppercase;
  font-family: var(--mono);
  letter-spacing: 4px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.choice-btn {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  text-align: left;
  width: 100%;
}

.choice-btn:hover {
  border-color: var(--purple);
  background: var(--surface2);
  transform: translateY(-2px);
}

.choice-btn.active {
  border-color: var(--purple);
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.choice-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.choice-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.choice-desc {
  font-size: 0.85rem;
  color: var(--text2);
  line-height: 1.4;
}

.slider-container {
  position: relative;
  padding: 1.5rem 0;
}

.difficulty-slider {
  width: 100%;
  height: 6px;
  background: var(--bg3);
  border-radius: 10px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.difficulty-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: var(--purple);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
  transition: all var(--transition-fast);
}

.difficulty-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.6);
}

.difficulty-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: var(--purple);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
  transition: all var(--transition-fast);
}

.difficulty-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.6);
}

.slider-value {
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--purple);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: var(--r-md);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--mono);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-modal-action {
  width: calc(100% - 3.5rem);
  margin: 0 1.75rem 1.75rem;
  padding: 1rem;
  background: linear-gradient(135deg, var(--purple) 0%, #818cf8 100%);
  color: white;
  border: none;
  border-radius: var(--r-lg);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-med);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-modal-action:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
}

.btn-modal-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── ROOM LOBBY ──────────────────────────────────────────── */
.room-code-display {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg3);
  border-radius: var(--r-lg);
  margin-bottom: 1.5rem;
}

.room-code-label {
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.room-code {
  font-size: 2.5rem;
  font-weight: 900;
  font-family: var(--mono);
  color: var(--purple);
  letter-spacing: 8px;
  margin-bottom: 1rem;
}

.btn-copy-code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.6rem 1.2rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-copy-code:hover {
  background: var(--surface2);
  border-color: var(--purple);
  transform: translateY(-2px);
}

.lobby-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.lobby-info-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.lobby-info-item:not(:last-child) {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 0.5rem;
}

.info-icon {
  font-size: 1.3rem;
  width: 2rem;
  text-align: center;
}

.info-text {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.players-waiting {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.player-slot {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  transition: all var(--transition-fast);
}

.player-slot.filled {
  border-color: var(--purple);
  background: rgba(99, 102, 241, 0.05);
}

.player-icon {
  font-size: 1.5rem;
  width: 2rem;
  text-align: center;
}

.player-name {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.player-status {
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--r-sm);
  font-weight: 600;
}

.player-status.ready {
  background: rgba(91, 154, 139, 0.2);
  color: var(--correct);
}

.player-status.waiting {
  background: rgba(196, 165, 101, 0.2);
  color: var(--present);
}

/* ─── ADDITIONAL UTILITY CLASSES ───────────────────────────── */
.text-center { text-align: center; }
.text-muted { color: var(--text2); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ══════════════════════════════════════════════════════════════
   v5.0 NEW STYLES — Solo Setup, Rules Popup, Digit Circles,
   Compact Home, Reveal Button, MP Result Modal
   ══════════════════════════════════════════════════════════════ */

/* ─── SOLO SECTION ────────────────────────────────────────── */
.solo-section {
  margin-bottom: 2rem;
  animation: fadeUp 0.6s ease 0.4s both;
}

.solo-row {
  display: flex;
  gap: 1rem;
}

.solo-mode-btn {
  flex: 1;
  padding: 1.1rem 1.5rem;
  border-radius: var(--r-lg);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-med);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.solo-mode-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.solo-mode-btn:hover::before { opacity: 1; }

.solo-word {
  background: linear-gradient(135deg, #5b9a8b 0%, #4a8070 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(91,154,139,0.35);
}

.solo-word:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(91,154,139,0.45);
}

.solo-num {
  background: linear-gradient(135deg, #c4a565 0%, #a88b4a 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(196,165,101,0.35);
}

.solo-num:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(196,165,101,0.45);
}

/* ─── MULTIPLAYER INLINE CARDS ────────────────────────────── */
.mp-row {
  display: flex;
  gap: 1rem;
}

.mp-card-inline {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all var(--transition-med);
}

.mp-card-inline:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--purple);
}

.mp-icon-inline {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.mp-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mp-card-text strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.mp-card-text span {
  font-size: 0.78rem;
  color: var(--text3);
}

/* ─── SOLO SETUP MODAL ────────────────────────────────────── */
.solo-setup-modal {
  padding: 0;
  overflow: hidden;
  max-width: 480px;
}

.setup-section {
  margin-bottom: 1.5rem;
}

.setup-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.85rem;
}

/* ─── DIGIT CIRCLE PICKER ─────────────────────────────────── */
.digit-picker,
.mp-digit-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.digit-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--mono);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.digit-circle:hover {
  border-color: var(--purple);
  color: var(--text);
  transform: scale(1.1);
  background: var(--surface);
}

.digit-circle.active {
  background: var(--purple);
  border-color: var(--purple);
  color: white;
  box-shadow: 0 4px 12px rgba(99,102,241,0.4);
  transform: scale(1.1);
}

/* ─── CHANCES PICKER ──────────────────────────────────────── */
.chances-picker {
  display: flex;
  gap: 0.75rem;
}

.chance-btn {
  flex: 1;
  padding: 0.85rem;
  border-radius: var(--r-md);
  border: 2px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--mono);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.chance-btn:hover {
  border-color: var(--purple);
  color: var(--text);
  transform: translateY(-2px);
}

.chance-btn.active {
  background: var(--purple);
  border-color: var(--purple);
  color: white;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

/* ─── RULES MODAL ─────────────────────────────────────────── */
.rules-modal {
  max-width: 420px;
  padding: 0;
  overflow: hidden;
}

.rules-body {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.rule-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg3);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
}

.rule-tile {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  font-family: var(--mono);
  color: white;
  flex-shrink: 0;
  animation: flipIn 0.6s ease;
}

.rule-tile.correct { background: var(--correct); box-shadow: 0 4px 12px rgba(91,154,139,0.4); }
.rule-tile.present { background: var(--present); box-shadow: 0 4px 12px rgba(196,165,101,0.4); }
.rule-tile.absent  { background: #555; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }

.rule-text {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
}

.rule-text strong {
  font-size: 1rem;
  font-weight: 700;
}

.rule-text span {
  color: var(--text2);
  font-size: 0.85rem;
}

.btn-understood {
  background: linear-gradient(135deg, var(--correct) 0%, #4a8070 100%);
  box-shadow: 0 4px 12px rgba(91,154,139,0.35);
}

.btn-understood:hover:not(:disabled) {
  box-shadow: 0 6px 18px rgba(91,154,139,0.5);
}

/* ─── REVEAL BUTTON ───────────────────────────────────────── */
.reveal-btn-wrap {
  display: flex;
  justify-content: center;
  margin: -0.5rem 0;
}

.btn-reveal {
  padding: 0.7rem 1.8rem;
  background: transparent;
  border: 2px solid var(--red);
  border-radius: var(--r-lg);
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.5px;
}

.btn-reveal:hover {
  background: rgba(248,113,113,0.12);
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(248,113,113,0.25);
}

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

/* ─── MULTIPLAYER RESULT MODAL ────────────────────────────── */
.mp-result-modal {
  max-width: 380px;
  padding: 2rem 1.75rem;
  text-align: center;
}

.mp-result-emoji {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bounce 0.6s ease;
}

.mp-result-modal h2 {
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.mp-result-modal p {
  font-size: 0.95rem;
  color: var(--text2);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.mp-result-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.mp-result-buttons .btn-modal-action {
  width: 100%;
  margin: 0;
}

.btn-danger {
  background: linear-gradient(135deg, var(--red) 0%, #dc2626 100%) !important;
  box-shadow: 0 4px 12px rgba(248,113,113,0.3) !important;
}

.btn-danger:hover:not(:disabled) {
  box-shadow: 0 6px 18px rgba(248,113,113,0.5) !important;
}

.btn-outline {
  background: transparent !important;
  border: 2px solid var(--purple) !important;
  color: var(--purple) !important;
  box-shadow: none !important;
}

.btn-outline:hover:not(:disabled) {
  background: rgba(99,102,241,0.1) !important;
  transform: translateY(-2px);
}

/* ─── PULSE DOT (waiting) ─────────────────────────────────── */
.pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--purple);
  margin: 1rem auto 0;
  animation: pulse 1.5s infinite;
}

/* ─── BOUNCE ANIMATION ────────────────────────────────────── */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-20px); }
  60% { transform: translateY(-8px); }
}

/* ─── SECTION CARD ────────────────────────────────────────── */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.75rem;
}

/* ─── STATS GRID ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.stat-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 900;
  font-family: var(--mono);
  color: var(--purple);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text2);
  margin-top: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── SETTINGS ROW ────────────────────────────────────────── */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child { border-bottom: none; }

.setting-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.setting-desc {
  font-size: 0.85rem;
  color: var(--text2);
}

.toggle-switch {
  width: 52px;
  height: 28px;
  border-radius: 14px;
  background: var(--bg3);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-med);
  position: relative;
  flex-shrink: 0;
}

.toggle-switch.active {
  background: var(--purple);
  border-color: var(--purple);
}

.toggle-knob {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform var(--transition-med);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch.active .toggle-knob {
  transform: translateX(24px);
}

/* ─── RESPONSIVE FOR NEW ELEMENTS ─────────────────────────── */
@media (max-width: 768px) {
  .solo-row,
  .mp-row {
    flex-direction: column;
  }

  .digit-circle {
    width: 38px;
    height: 38px;
    font-size: 0.82rem;
  }

  .chances-picker {
    gap: 0.5rem;
  }

  .mp-result-modal {
    padding: 1.5rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .solo-row,
  .mp-row {
    gap: 0.75rem;
  }

  .digit-circle {
    width: 34px;
    height: 34px;
    font-size: 0.78rem;
  }
}

/* ══════════════════════════════════════════════════════════════
   v6.0 NEW STYLES
   ══════════════════════════════════════════════════════════════ */

/* ─── TOPBAR RIGHT ────────────────────────────────────────── */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ─── REVEAL BUTTON — small, top-right ───────────────────── */
.btn-reveal-small {
  padding: 0.4rem 0.85rem;
  background: transparent;
  border: 1.5px solid var(--red);
  border-radius: var(--r-md);
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.btn-reveal-small:hover {
  background: rgba(248,113,113,0.1);
}

/* ─── HINT BUTTON — small, top-right ─────────────────────── */
.btn-hint-small {
  padding: 0.4rem 0.85rem;
  background: transparent;
  border: 1.5px solid var(--present);
  border-radius: var(--r-md);
  color: var(--present);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.btn-hint-small:hover {
  background: rgba(196,165,101,0.1);
}

/* ─── REVEAL CONFIRM MODAL ────────────────────────────────── */
.reveal-confirm-modal {
  max-width: 380px;
  padding: 0;
  overflow: hidden;
}

/* ─── RESULT CARD — uniform buttons ──────────────────────── */
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2rem 1.75rem;
  text-align: center;
  margin-top: 1.5rem;
  animation: fadeUp 0.4s ease;
}
.result-emoji { font-size: 3rem; margin-bottom: 0.75rem; }
.result-title { font-size: 1.5rem; font-weight: 900; margin-bottom: 0.5rem; color: var(--text); }
.result-sub { font-size: 0.9rem; color: var(--text2); margin-bottom: 0.5rem; }
.result-answer {
  font-size: 2rem; font-weight: 900; color: var(--purple);
  font-family: var(--mono); margin: 0.75rem 0 1.5rem;
  letter-spacing: 4px;
}
.result-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.result-btn {
  padding: 0.75rem 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.result-btn:hover { background: var(--bg3); transform: translateY(-1px); }
.result-btn-primary {
  background: linear-gradient(135deg, var(--purple) 0%, #818cf8 100%);
  border-color: var(--purple);
  color: white;
  grid-column: 1 / -1;
}
.result-btn-primary:hover { box-shadow: 0 4px 16px rgba(99,102,241,0.35); transform: translateY(-2px); }
.result-btn-danger {
  background: rgba(248,113,113,0.12);
  border-color: rgba(248,113,113,0.4);
  color: var(--red);
}
.result-btn-danger:hover { background: rgba(248,113,113,0.2); }

/* ─── INFO ROW (streak / hints / achievements) ────────────── */
.info-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.info-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
}
.info-chip.clickable { cursor: pointer; transition: all var(--transition-fast); }
.info-chip.clickable:hover { border-color: var(--purple); color: var(--text); }

/* ─── PRO BANNER ──────────────────────────────────────────── */
.pro-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: var(--r-md);
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--purple);
}
.pro-banner button {
  background: none;
  border: 1px solid var(--purple);
  border-radius: var(--r-sm);
  color: var(--purple);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}

/* ─── SOLO SECTION ────────────────────────────────────────── */
.solo-section { margin-bottom: 1.75rem; animation: fadeUp 0.6s ease 0.4s both; }
.section-heading { font-size: 1rem; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 0.85rem; }
.solo-row { display: flex; gap: 0.75rem; }
.solo-mode-btn {
  flex: 1; padding: 0.95rem 1rem;
  border-radius: var(--r-lg); font-size: 0.92rem; font-weight: 700;
  cursor: pointer; transition: all var(--transition-med);
  border: 2px solid transparent;
}
.solo-word { background: linear-gradient(135deg,#5b9a8b,#4a8070); color:white; box-shadow:0 4px 14px rgba(91,154,139,0.3); }
.solo-word:hover { transform:translateY(-2px); box-shadow:0 6px 20px rgba(91,154,139,0.4); }
.solo-num { background: linear-gradient(135deg,#c4a565,#a88b4a); color:white; box-shadow:0 4px 14px rgba(196,165,101,0.3); }
.solo-num:hover { transform:translateY(-2px); box-shadow:0 6px 20px rgba(196,165,101,0.4); }
.solo-pro { background: linear-gradient(135deg,var(--purple),#818cf8); color:white; box-shadow:0 4px 14px rgba(99,102,241,0.3); }
.solo-pro:hover { transform:translateY(-2px); box-shadow:0 6px 20px rgba(99,102,241,0.4); }

/* ─── MULTIPLAYER ROW ─────────────────────────────────────── */
.mp-section { margin-bottom: 1.75rem; animation: fadeUp 0.6s ease 0.5s both; }
.mp-row { display: flex; gap: 0.75rem; }
.mp-card-inline {
  flex:1; display:flex; align-items:center; gap:0.75rem;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r-lg); padding:0.95rem 1rem; cursor:pointer;
  transition:all var(--transition-med);
}
.mp-card-inline:hover { transform:translateY(-2px); box-shadow:var(--shadow); border-color:var(--purple); }
.mp-icon-inline { font-size:1.6rem; flex-shrink:0; }
.mp-card-text { display:flex; flex-direction:column; gap:0.15rem; }
.mp-card-text strong { font-size:0.9rem; font-weight:700; color:var(--text); }
.mp-card-text span { font-size:0.75rem; color:var(--text3); }

/* ─── HOME FOOTER LINKS ───────────────────────────────────── */
.home-footer-links {
  display: flex; gap: 1.25rem; flex-wrap: wrap;
  padding: 1.5rem 0 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  animation: fadeUp 0.6s ease 0.6s both;
}
.home-footer-links a {
  font-size: 0.8rem; color: var(--text3); cursor: pointer;
  transition: color var(--transition-fast); text-decoration: none;
}
.home-footer-links a:hover { color: var(--text); }

/* ─── SOLO SETUP MODAL ────────────────────────────────────── */
.solo-setup-modal { padding:0; overflow:hidden; max-width:460px; }
.setup-section { margin-bottom:1.5rem; }
.setup-label { font-size:0.85rem; font-weight:600; color:var(--text); margin-bottom:0.75rem; }
.digit-picker, .mp-digit-picker { display:flex; flex-wrap:wrap; gap:7px; }
.digit-circle {
  width:42px; height:42px; border-radius:50%;
  border:2px solid var(--border); background:var(--bg3);
  color:var(--text2); font-size:0.88rem; font-weight:700;
  font-family:var(--mono); cursor:pointer;
  transition:all var(--transition-fast);
  display:flex; align-items:center; justify-content:center;
}
.digit-circle:hover { border-color:var(--purple); color:var(--text); transform:scale(1.08); }
.digit-circle.active { background:var(--purple); border-color:var(--purple); color:white; box-shadow:0 4px 12px rgba(99,102,241,0.4); transform:scale(1.08); }
.chances-picker { display:flex; gap:0.65rem; }
.chance-btn {
  flex:1; padding:0.8rem; border-radius:var(--r-md);
  border:2px solid var(--border); background:var(--bg3);
  color:var(--text2); font-size:1.05rem; font-weight:700;
  font-family:var(--mono); cursor:pointer; transition:all var(--transition-fast);
}
.chance-btn:hover { border-color:var(--purple); color:var(--text); }
.chance-btn.active { background:var(--purple); border-color:var(--purple); color:white; box-shadow:0 4px 12px rgba(99,102,241,0.3); }
.repeat-toggle-btn {
  padding:0.45rem 1rem; border-radius:var(--r-md);
  border:2px solid var(--border); background:var(--bg3);
  color:var(--text2); font-size:0.85rem; font-weight:700;
  cursor:pointer; transition:all var(--transition-fast);
}
.repeat-toggle-btn.active { background:var(--purple); border-color:var(--purple); color:white; }

/* ─── RULES MODAL ─────────────────────────────────────────── */
.rules-modal { max-width:400px; padding:0; overflow:hidden; }
.rules-body { padding:1.25rem 1.75rem; display:flex; flex-direction:column; gap:1rem; }
.rule-item { display:flex; align-items:center; gap:1rem; padding:0.85rem; background:var(--bg3); border-radius:var(--r-lg); border:1px solid var(--border); }
.rule-tile { width:48px; height:48px; border-radius:var(--r-md); display:flex; align-items:center; justify-content:center; font-size:1.3rem; font-weight:900; font-family:var(--mono); color:white; flex-shrink:0; }
.rule-tile.correct { background:var(--correct); }
.rule-tile.present { background:var(--present); }
.rule-tile.absent { background:#555; }
.rule-text { font-size:0.88rem; color:var(--text); line-height:1.5; }
.rule-text strong { font-size:0.95rem; font-weight:700; }
.rule-text span { color:var(--text2); font-size:0.82rem; }
.btn-understood { background:linear-gradient(135deg,var(--correct),#4a8070) !important; }

/* ─── MP RESULT MODAL ─────────────────────────────────────── */
.mp-result-modal { max-width:360px; padding:2rem 1.75rem; text-align:center; }
.mp-result-emoji { font-size:3.5rem; margin-bottom:0.75rem; }
.mp-result-modal h2 { font-size:1.5rem; font-weight:900; margin-bottom:0.5rem; }
.mp-result-modal p { font-size:0.9rem; color:var(--text2); margin-bottom:1.5rem; }
.mp-result-buttons { display:flex; flex-direction:column; gap:0.65rem; }
.mp-result-buttons .result-btn { width:100%; }

/* ─── ACHIEVEMENTS ────────────────────────────────────────── */
.ach-grid { display:flex; flex-direction:column; gap:0.75rem; margin-top:0.5rem; }
.ach-item {
  display:flex; align-items:center; gap:1rem;
  padding:1rem 1.25rem; background:var(--bg3);
  border:1px solid var(--border); border-radius:var(--r-lg);
  position:relative;
}
.ach-item:not(.ach-locked) { border-color:rgba(99,102,241,0.3); background:rgba(99,102,241,0.05); }
.ach-locked { opacity:0.5; }
.ach-icon { font-size:1.8rem; width:2.5rem; text-align:center; flex-shrink:0; }
.ach-text { display:flex; flex-direction:column; gap:0.2rem; }
.ach-text strong { font-size:0.95rem; font-weight:700; color:var(--text); }
.ach-text span { font-size:0.8rem; color:var(--text2); }
.ach-lock { position:absolute; right:1rem; font-size:1rem; }

/* ─── BLOG ────────────────────────────────────────────────── */
.blog-grid { display:flex; flex-direction:column; gap:1rem; }
.blog-card {
  background:var(--bg3); border:1px solid var(--border);
  border-radius:var(--r-lg); padding:1.25rem 1.5rem;
  cursor:pointer; transition:all var(--transition-med);
}
.blog-card:hover { border-color:var(--purple); transform:translateX(4px); }
.blog-tag { font-size:0.7rem; font-weight:700; letter-spacing:1.5px; text-transform:uppercase; color:var(--purple); margin-bottom:0.5rem; }
.blog-title { font-size:1rem; font-weight:700; color:var(--text); margin-bottom:0.5rem; line-height:1.4; }
.blog-preview { font-size:0.85rem; color:var(--text2); line-height:1.6; margin-bottom:0.75rem; }
.blog-meta { font-size:0.75rem; color:var(--text3); }
.blog-back-btn { background:none; border:1px solid var(--border); border-radius:var(--r-md); padding:0.5rem 1rem; color:var(--text2); font-size:0.85rem; font-weight:600; cursor:pointer; margin-bottom:1.5rem; transition:all var(--transition-fast); }
.blog-back-btn:hover { color:var(--text); border-color:var(--border2); }
.blog-post-header { margin-bottom:1.5rem; padding-bottom:1.25rem; border-bottom:1px solid var(--border); }
.blog-post-title { font-size:1.5rem; font-weight:900; line-height:1.3; margin:0.75rem 0 0.5rem; }
.blog-post-content { line-height:1.8; color:var(--text); }
.blog-post-content p { margin-bottom:1rem; }
.blog-post-content h3 { font-size:1.1rem; font-weight:700; margin:1.5rem 0 0.75rem; color:var(--text); }
.blog-post-content ul { margin:0.5rem 0 1rem 1.25rem; }
.blog-post-content li { margin-bottom:0.5rem; }
.blog-cta { margin-top:1.5rem; padding-top:1.25rem; border-top:1px solid var(--border); text-align:center; }
.blog-cta p { color:var(--text2); margin-bottom:1rem; }

/* ─── SECTION CARD ────────────────────────────────────────── */
.section-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); padding:1.75rem; }
.section-card h2 { font-size:1.3rem; font-weight:800; margin-bottom:1rem; }

/* ─── STATS GRID ──────────────────────────────────────────── */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(90px,1fr)); gap:0.75rem; }
.stat-card { background:var(--bg3); border:1px solid var(--border); border-radius:var(--r-lg); padding:1.1rem; text-align:center; }
.stat-value { font-size:1.8rem; font-weight:900; font-family:var(--mono); color:var(--purple); }
.stat-label { font-size:0.72rem; font-weight:600; color:var(--text2); margin-top:0.3rem; text-transform:uppercase; letter-spacing:0.5px; }

/* ─── SETTINGS ────────────────────────────────────────────── */
.setting-row { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1.1rem 0; border-bottom:1px solid var(--border); }
.setting-row:last-child { border-bottom:none; }
.setting-label { font-size:0.95rem; font-weight:600; color:var(--text); margin-bottom:0.2rem; }
.setting-desc { font-size:0.8rem; color:var(--text2); }
.toggle-switch { width:50px; height:26px; border-radius:13px; background:var(--bg3); border:2px solid var(--border); cursor:pointer; transition:all var(--transition-med); position:relative; flex-shrink:0; }
.toggle-switch.active { background:var(--purple); border-color:var(--purple); }
.toggle-knob { width:18px; height:18px; border-radius:50%; background:white; position:absolute; top:2px; left:2px; transition:transform var(--transition-med); box-shadow:0 2px 4px rgba(0,0,0,0.2); }
.toggle-switch.active .toggle-knob { transform:translateX(24px); }

/* ─── PULSE DOT ───────────────────────────────────────────── */
.pulse-dot { width:10px; height:10px; border-radius:50%; background:var(--purple); margin:1rem auto 0; animation:pulse 1.5s infinite; }

/* ─── GBADGE PRO ──────────────────────────────────────────── */
.gbadge-pro { background:rgba(99,102,241,0.15); color:var(--purple); border:1px solid rgba(99,102,241,0.3); }

/* ─── KB NUM KEY ──────────────────────────────────────────── */
.kb-num { background:var(--bg3); border-color:var(--border2); min-width:36px; font-family:var(--mono); }

/* ─── BOUNCE ──────────────────────────────────────────────── */
@keyframes bounce {
  0%,100%{transform:translateY(0);}
  30%{transform:translateY(-18px);}
  60%{transform:translateY(-6px);}
}

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media(max-width:768px){
  .solo-row,.mp-row{flex-direction:column;}
  .digit-circle{width:36px;height:36px;font-size:0.8rem;}
  .topbar-right{gap:0.35rem;}
  .result-btns{grid-template-columns:1fr 1fr;}
  .info-row{gap:0.45rem;}
  .info-chip{font-size:0.75rem;padding:0.4rem 0.7rem;}
}
@media(max-width:480px){
  .chances-picker{gap:0.4rem;}
  .digit-circle{width:32px;height:32px;font-size:0.75rem;}
  .result-btns{grid-template-columns:1fr;}
  .result-btn-primary{grid-column:unset;}
}

/* ══════════════════════════════════════════════════════════════
   v6.1 FIXES — mobile header, nav icons, result popup
   ══════════════════════════════════════════════════════════════ */

/* ─── HEADER MOBILE FIX — prevent overflow, clip icons ───── */
#top-header {
  padding: 0 0.85rem !important;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}

.header-left {
  flex-shrink: 0;
  min-width: 0;
  gap: 0.5rem !important;
}

.header-right {
  flex-shrink: 0;
  gap: 0.2rem !important;
  overflow: hidden;
}

.hdr-btn {
  width: 36px !important;
  height: 36px !important;
  flex-shrink: 0;
  padding: 0;
}

.logo-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

/* ─── NAV ICON SVG — consistent stroke style ─────────────── */
.nav-icon {
  width: 20px !important;
  height: 20px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text3);
  transition: color var(--transition-fast);
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  color: var(--text);
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* ─── RESULT POPUP MODAL ──────────────────────────────────── */
.result-popup-overlay {
  z-index: 500 !important;
  animation: fadeIn 0.2s ease;
}

.result-popup-card {
  max-width: 360px !important;
  width: 92% !important;
  padding: 2rem 1.5rem !important;
  text-align: center;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.rp-emoji {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.rp-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.rp-sub {
  font-size: 0.88rem;
  color: var(--text2);
  margin-bottom: 0.5rem;
}

.rp-answer {
  font-size: 1.8rem;
  font-weight: 900;
  font-family: var(--mono);
  color: var(--purple);
  letter-spacing: 6px;
  margin: 0.75rem 0 0.5rem;
}

.rp-grid {
  font-size: 1.1rem;
  line-height: 1.6;
  letter-spacing: 2px;
  margin: 0.5rem 0 1.25rem;
  background: none;
  border: none;
  font-family: var(--mono);
}

.rp-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  width: 100%;
}

.rp-btn {
  padding: 0.75rem 0.5rem;
  background: var(--surface2, var(--bg3));
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.rp-btn:hover {
  background: var(--bg3);
  transform: translateY(-1px);
}

.rp-btn-primary {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--purple) 0%, #818cf8 100%);
  border-color: var(--purple);
  color: white;
  font-size: 0.95rem;
  padding: 0.85rem;
}

.rp-btn-primary:hover {
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
  transform: translateY(-2px);
}

/* ─── MOBILE RESPONSIVE FIXES ─────────────────────────────── */
@media (max-width: 768px) {
  #top-header {
    padding: 0 0.75rem !important;
  }

  .header-right {
    gap: 0.15rem !important;
  }

  .hdr-btn {
    width: 34px !important;
    height: 34px !important;
  }

  .logo-icon {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.78rem !important;
  }

  .logo-name {
    font-size: 1.1rem !important;
    max-width: 100px;
  }

  .rp-btns {
    grid-template-columns: 1fr;
  }

  .rp-btn-primary {
    grid-column: unset;
  }

  /* Footer links on home — wrap cleanly */
  .home-footer-links {
    gap: 0.85rem !important;
    padding: 1.25rem 0 0.5rem !important;
  }

  .home-footer-links a {
    font-size: 0.78rem !important;
  }
}

@media (max-width: 380px) {
  .hdr-btn {
    width: 30px !important;
    height: 30px !important;
  }

  .logo-name {
    max-width: 85px;
    font-size: 1rem !important;
  }

  .logo-icon {
    width: 28px !important;
    height: 28px !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   v6.2 — Footer SVG icons, settings toggle, keyboard fix
   ══════════════════════════════════════════════════════════════ */

/* ─── HOME FOOTER LINKS — with SVG icons ─────────────────── */
.home-footer-links {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0 !important;
  padding: 1.25rem 0 0 !important;
  border-top: 1px solid var(--border) !important;
  margin-top: 1rem !important;
}

.footer-link {
  display: flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  padding: 0.5rem 0.85rem 0.5rem 0 !important;
  margin-right: 0.75rem !important;
  margin-bottom: 0.35rem !important;
  font-size: 0.8rem !important;
  color: var(--text3) !important;
  cursor: pointer !important;
  transition: color var(--transition-fast) !important;
  text-decoration: none !important;
  border: none !important;
  background: none !important;
  white-space: nowrap !important;
}

.footer-link:hover {
  color: var(--text) !important;
}

.footer-link svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.footer-link:hover svg {
  opacity: 1;
}

.home-footer-bottom {
  font-size: 0.72rem;
  color: var(--text3);
  padding: 0.5rem 0 1rem;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}

/* ─── KEYBOARD ABSENT — visible with strikethrough ────────── */
/* override any dark theme that hides absent keys too much */
[data-theme="dark"] .kb-key[data-state="absent"] {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.08) !important;
  color: rgba(255,255,255,0.4) !important;
  opacity: 1 !important;
  text-decoration: line-through !important;
  text-decoration-color: rgba(255,255,255,0.3) !important;
  text-decoration-thickness: 1.5px !important;
}

[data-theme="light"] .kb-key[data-state="absent"] {
  background: rgba(0,0,0,0.04) !important;
  border-color: rgba(0,0,0,0.1) !important;
  color: rgba(0,0,0,0.35) !important;
  opacity: 1 !important;
  text-decoration: line-through !important;
  text-decoration-color: rgba(0,0,0,0.25) !important;
  text-decoration-thickness: 1.5px !important;
}

/* Number pad absent digit indicator */
.num-btn[data-state="absent"] {
  opacity: 0.45;
  text-decoration: line-through;
  text-decoration-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.03) !important;
}

/* ─── MOBILE FOOTER FIX ───────────────────────────────────── */
@media (max-width: 480px) {
  .footer-link {
    font-size: 0.75rem !important;
    margin-right: 0.5rem !important;
  }
  .home-footer-links {
    gap: 0 !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   FINAL PRODUCTION STYLES — AdSense slots, email capture, PWA
   ══════════════════════════════════════════════════════════════ */

/* ─── ADSENSE PLACEHOLDER SLOTS ──────────────────────────── */
.ad-slot {
  width: 100%;
  background: transparent;
  border-radius: var(--r-md);
  overflow: hidden;
  /* Hidden until AdSense is activated */
  display: none;
}

/* Once AdSense is approved, change display:none to display:flex */
.ad-slot-leaderboard {
  min-height: 90px;
  justify-content: center;
  align-items: center;
  margin: 0.5rem 0;
}

.ad-slot-banner {
  min-height: 50px;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
}

/* ─── EMAIL CAPTURE ───────────────────────────────────────── */
.email-capture {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  animation: fadeUp 0.6s ease 0.7s both;
}

.email-capture-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.email-capture-sub {
  font-size: 0.78rem;
  color: var(--text2);
  margin-bottom: 0.85rem;
}

.email-capture-row {
  display: flex;
  gap: 0.6rem;
}

.email-capture-input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--transition-fast);
  min-width: 0;
}

.email-capture-input:focus {
  border-color: var(--purple);
}

.email-capture-input::placeholder {
  color: var(--text3);
}

.email-capture-btn {
  padding: 0.6rem 1.1rem;
  background: var(--purple);
  color: white;
  border: none;
  border-radius: var(--r-md);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.email-capture-btn:hover {
  background: #818cf8;
  transform: translateY(-1px);
}

/* ─── PWA INSTALL BANNER ──────────────────────────────────── */
.pwa-banner {
  display: none; /* shown via JS when installable */
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 300;
  width: calc(100% - 2rem);
  max-width: 420px;
  align-items: center;
  gap: 1rem;
}

.pwa-banner.visible { display: flex; }

.pwa-banner-text {
  flex: 1;
  font-size: 0.88rem;
  color: var(--text);
}

.pwa-banner-text strong {
  display: block;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.pwa-banner-text span {
  font-size: 0.78rem;
  color: var(--text2);
}

.pwa-install-btn {
  padding: 0.55rem 1.1rem;
  background: var(--purple);
  color: white;
  border: none;
  border-radius: var(--r-md);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.pwa-dismiss-btn {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  flex-shrink: 0;
}
