/* style.css - Premium, Modern iOS Wordle App Styling */

:root {
  /* Colors */
  --bg-app: #0A0F24;
  --bg-gradient: linear-gradient(180deg, #131A35 0%, #0A0F24 50%, #030612 100%);
  --bg-card: rgba(22, 28, 45, 0.7);
  --bg-card-glass: rgba(26, 34, 57, 0.6);
  --border-glass: rgba(255, 255, 255, 0.1);
  --accent-gold: #FBBF24;
  --accent-gold-light: #FDE047;
  
  /* Tile States (Official NYT Wordle Dark Mode Colors) */
  --color-correct: #538d4e;     /* NYT Dark Mode Green */
  --color-present: #b59f3b;     /* NYT Dark Mode Yellow */
  --color-absent: #3a3a3c;      /* NYT Dark Mode Dark Gray */
  --color-empty: transparent;   /* Transparent empty background */
  --color-border-empty: #3a3a3c; /* Empty Tile Border */
  --color-border-active: #565758; /* Populated Active Tile Border */
  
  /* Interactive States */
  --kb-key-bg: #4B5563;         /* Medium Gray for tactile look */
  --kb-key-text: #F9FAFB;
  --kb-key-active: #6B7280;
  --text-main: #F9FAFB;
  --text-muted: #9CA3AF;
  
  /* Grids & Sizing */
  --col-count: 5;
  --iphone-width: 420px;
  --iphone-height: 880px;
  --iphone-radius: 44px;
}

/* Global Reset & Preferences */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #030712;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Main Responsive Game Container */
.game-container {
  width: 100%;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile browsers */
  background: var(--bg-gradient);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  max-width: 480px; /* Elegant centered layout on desktop */
  margin: 0 auto;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  border-left: 1px solid var(--border-glass);
  border-right: 1px solid var(--border-glass);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) 0;
}

@media (max-width: 480px) {
  .game-container {
    max-width: 100%;
    height: 100vh;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }
}

/* Screen Management */
.game-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  z-index: 5;
}

.game-screen.active {
  display: flex;
}

/* Background floating bubbles to make the UI feel alive */
.game-screen::before, .game-screen::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0) 70%);
  pointer-events: none;
  z-index: 1;
}

.game-screen::before {
  width: 260px;
  height: 260px;
  top: -60px;
  right: -80px;
  animation: float-slow-1 14s ease-in-out infinite alternate;
}

.game-screen::after {
  width: 220px;
  height: 220px;
  bottom: -40px;
  left: -60px;
  animation: float-slow-2 18s ease-in-out infinite alternate;
}

@keyframes float-slow-1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-25px, 35px) scale(1.1); }
}

@keyframes float-slow-2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(35px, -25px) scale(1.05); }
}

/* Splash Screen view */
#screenSplash {
  justify-content: center;
  align-items: center;
  background-image: url('splash-bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 40px;
  z-index: 2;
}

.splash-logo {
  height: 140px; /* Bigger logo */
  max-width: 280px;
  object-fit: contain;
  margin-bottom: 45px;
  filter: drop-shadow(0 8px 24px rgba(59, 130, 246, 0.45)); /* Glowing logo */
  animation: splash-pop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes splash-pop {
  0% { transform: scale(0) rotate(-10deg); opacity: 0; }
  70% { transform: scale(1.15) rotate(3deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.loader-area {
  width: 80%;
  max-width: 240px;
  margin-top: 10px;
}

.loader-track {
  width: 100%;
  height: 18px; /* Thicker loader track */
  background: rgba(15, 23, 42, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  overflow: hidden;
  padding: 2px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.loader-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 50%, #10b981 100%); /* Neon blue to green loading gradient */
  border-radius: 20px;
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.6);
  position: relative;
  transition: width 0.1s linear;
}

/* Shine overlay on loader */
.loader-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 20px;
}

.loader-text {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 12px;
  letter-spacing: 1.5px;
}

/* Menu/Setup Screen view */
#screenSetup {
  background-image:
    linear-gradient(180deg, rgba(7, 5, 26, 0.55) 0%, rgba(7, 5, 26, 0.85) 100%),
    url('splash-bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.menu-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  padding: 20px 20px 16px;
  overflow-y: auto;
  scrollbar-width: none;
}
.menu-content::-webkit-scrollbar { display: none; }

.menu-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 8px;
  padding-bottom: 4px;
}

.menu-logo {
  height: 90px;
  max-width: 200px;
  object-fit: contain;
  animation: logo-bob 2.5s ease-in-out infinite alternate;
}

@keyframes logo-bob {
  0%   { transform: translateY(0) scale(1); }
  100% { transform: translateY(-8px) scale(1.03); }
}

.menu-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 12px 0;
}

.menu-footer {
  width: 100%;
  padding-top: 8px;
}

/* Play game button style (Tactile neon-green with bounce and shine) */
.play-btn-huge {
  background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
  color: #ffffff;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 20px; /* Bigger font */
  letter-spacing: 1px;
  padding: 16px 20px;
  border-radius: 16px;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 6px 0 #047857; /* Tactile 3D green shadow only, no glow shadow */
  transition: transform 0.05s ease, box-shadow 0.05s ease;
  position: relative;
  overflow: hidden;
  animation: play-btn-pulse 2s infinite ease-in-out;
}

@keyframes play-btn-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}

.play-btn-huge::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.22) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-20deg);
  animation: button-shine 3s infinite;
}

@keyframes button-shine {
  0% { left: -100%; }
  30%, 100% { left: 100%; }
}

.play-btn-huge:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #047857;
  animation: none;
}

/* Compact header elements inside the game */
.logo-area-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.compact-title-text {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--text-main);
  line-height: 1;
}

/* Header UI */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px 6px 18px;
  border-bottom: 1px solid var(--border-glass);
  background-color: rgba(13, 21, 39, 0.5);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.app-logo {
  height: 56px;
  max-width: 160px;
  object-fit: contain;
  margin-top: -6px;
  margin-bottom: -6px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.category-badge {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
  border: 1.5px solid rgba(245, 158, 11, 0.3);
  padding: 2.5px 8px;
  border-radius: 20px;
  margin-top: 5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-btn:active {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(0.92);
}

/* Coin Display in Header */
.coin-display {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 4px 10px 4px 6px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--accent-gold-light);
  font-family: 'Outfit', sans-serif;
  cursor: default;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.coin-display.coin-pop {
  animation: coin-pop-anim 0.4s ease-out;
}

@keyframes coin-pop-anim {
  0% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(-3deg); filter: brightness(1.2); }
  100% { transform: scale(1); }
}

.coin-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.coin-icon {
  filter: drop-shadow(0 1.5px 2px rgba(245, 158, 11, 0.4));
  display: block;
}

.coin-icon.mini {
  filter: none;
}

/* Board Game Grid */
.board-container {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  overflow-y: auto;
}

.board {
  display: grid;
  grid-template-rows: repeat(var(--row-count, 6), 1fr);
  gap: 6px;
  width: 100%;
  max-width: 320px;
  aspect-ratio: auto;
  margin: 0 auto;
}

.board-row {
  display: grid;
  grid-template-columns: repeat(var(--col-count, 5), 1fr);
  gap: 6px;
}

.tile {
  aspect-ratio: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: clamp(18px, 6.5vw, 26px);
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 4px; /* Clean, slightly square/rounded corners like NYT Wordle */
  background-color: var(--color-empty);
  border: 2px solid var(--color-border-empty);
  color: var(--text-main);
  transition: border-color 0.1s ease, background-color 0.1s ease;
  position: relative;
  transform-style: preserve-3d;
  perspective: 1000px;
}

/* Animation triggers */
.tile.pop {
  animation: tile-pop 0.1s ease-out;
  border-color: var(--color-border-active) !important;
}

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

.tile.reveal {
  animation: tile-flip 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes tile-flip {
  0% {
    transform: rotateX(0deg);
  }
  45% {
    transform: rotateX(90deg);
    background-color: var(--color-empty);
    border-color: var(--color-border-active);
  }
  55% {
    transform: rotateX(90deg);
    background-color: var(--target-bg);
    border-color: var(--target-bg);
  }
  100% {
    transform: rotateX(0deg);
    background-color: var(--target-bg);
    border-color: var(--target-bg);
  }
}

/* Row Shake animation for invalid word */
.board-row.shake {
  animation: row-shake 0.4s ease-in-out;
}

@keyframes row-shake {
  0%, 100% { transform: translateX(0); }
  15%, 45%, 75% { transform: translateX(-6px); }
  30%, 60%, 90% { transform: translateX(6px); }
}

/* Power-Ups Shop styling */
.powerups-container {
  display: flex;
  gap: 10px;
  padding: 6px 16px;
  justify-content: center;
}

.powerup-card {
  flex: 1;
  background: var(--bg-card-glass);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.powerup-card:active:not(:disabled) {
  transform: scale(0.96);
  background: rgba(30, 41, 59, 0.8);
}

.powerup-card:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.powerup-info {
  display: flex;
  flex-direction: column;
}

.powerup-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.powerup-desc {
  font-size: 9.5px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.1;
}

.powerup-price {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-gold-light);
  font-family: 'Space Grotesk', sans-serif;
}

/* Keyboard Styling */
.keyboard-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 8px 24px 8px; /* Safe padding for bottom home indicator */
  background: rgba(13, 21, 39, 0.3);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-glass);
}

.keyboard-row {
  display: flex;
  justify-content: center;
  width: 100%;
  gap: 4px;
}

.kb-key {
  background-color: var(--kb-key-bg);
  color: var(--kb-key-text);
  border: none;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  font-weight: 800;
  height: 48px;
  flex-grow: 1;
  flex-basis: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 3px 0 #4b4b4d; /* 3D pop border shadow */
  transition: transform 0.05s ease, box-shadow 0.05s ease, background-color 0.1s ease;
  touch-action: manipulation;
}

.kb-key:active {
  background-color: var(--kb-key-active);
  transform: translateY(2px);
  box-shadow: 0 1px 0 #4b4b4d;
}

.kb-key.wide {
  flex-grow: 1.5;
  font-size: 11.5px;
  text-transform: uppercase;
}

/* Keyboard key states matched from game rules */
.kb-key.correct {
  background-color: var(--color-correct) !important;
  box-shadow: 0 3px 0 #3d6a3a !important;
}

.kb-key.correct:active {
  box-shadow: 0 1px 0 #3d6a3a !important;
}

.kb-key.present {
  background-color: var(--color-present) !important;
  box-shadow: 0 3px 0 #8e7a2b !important;
}

.kb-key.present:active {
  box-shadow: 0 1px 0 #8e7a2b !important;
}

.kb-key.absent {
  background-color: var(--color-absent) !important;
  box-shadow: 0 3px 0 #28282a !important;
  opacity: 0.75;
}

.kb-key.absent:active {
  box-shadow: 0 1px 0 #28282a !important;
}



/* MODALS - GENERAL */
.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(3, 7, 18, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-card {
  background: var(--bg-card-glass);
  border: 1px solid var(--border-glass);
  width: 100%;
  max-width: 360px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
}

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

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

.modal-header h2 {
  font-size: 19px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}

.close-modal-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 26px;
  cursor: pointer;
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  max-height: 480px;
}

.modal-footer {
  padding: 16px 22px 20px 22px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  gap: 10px;
}

/* SETTINGS MODAL SPECIALS */
.setting-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-group label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(147, 197, 253, 0.7);
  font-family: 'Outfit', sans-serif;
}

/* Segmented button controllers */
.segmented-control {
  display: flex;
  background-color: rgba(13, 20, 44, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
}

.segmented-control button {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 0;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.segmented-control button:hover {
  color: #ffffff;
}

.segmented-control button.active {
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 2px 0 #1e3a8a;
}

/* Category grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.category-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.category-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.category-card .cat-icon {
  font-size: 22px;
}

.category-card .cat-name {
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.2px;
  font-family: 'Outfit', sans-serif;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
}

.category-card.active {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.15);
}

.category-card.active .cat-name {
  color: #93c5fd;
}

/* Category description box */
.category-explanation-box {
  font-size: 11.5px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 400;
  font-style: italic;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  padding-top: 4px;
  min-height: 18px;
  transition: opacity 0.2s ease;
}

/* Buttons */
.primary-btn {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #D97706 100%);
  color: #030712;
  border: none;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.5px;
  padding: 12px 20px;
  border-radius: 12px;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.primary-btn:active {
  transform: scale(0.97);
  filter: brightness(0.9);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 10px;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-btn:active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* STATS MODAL SPECIFICS */
.stats-summary {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.stat-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
  text-align: center;
}

.stat-chart-container h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  letter-spacing: 0.2px;
}

.guess-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chart-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
}

.chart-num {
  font-family: 'Space Grotesk', sans-serif;
  width: 10px;
}

.chart-bar-container {
  flex-grow: 1;
  background-color: rgba(3, 7, 18, 0.4);
  border-radius: 4px;
  height: 20px;
  overflow: hidden;
}

.chart-bar {
  background-color: var(--kb-key-bg);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  color: #fff;
  border-radius: 4px;
  min-width: 18px;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.chart-bar.highlight {
  background: linear-gradient(90deg, #10B981 0%, #059669 100%);
}

/* GAME OVER MODAL SPECIFICS */
.result-card {
  max-width: 320px;
}

.text-center {
  text-align: center;
}

.result-badge {
  font-size: 48px;
  margin-bottom: 10px;
  animation: bounce-badge 1.2s ease infinite alternate;
}

@keyframes bounce-badge {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

.result-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 4px;
}

.result-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.revealed-word-box {
  background: rgba(3, 7, 18, 0.5);
  border: 1px dashed var(--border-glass);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.word-lbl {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.word-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent-gold-light);
}

.rewards-summary {
  background-color: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 22px;
}

.reward-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
}

.reward-val-coins {
  color: #34D399;
  font-family: 'Space Grotesk', sans-serif;
}

.primary-btn.pulse {
  animation: btn-pulse 1.8s infinite;
}

@keyframes btn-pulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* TOAST NOTIFICATIONS */
.toast-container {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  width: calc(100% - 40px);
  max-width: 300px;
  pointer-events: none;
}

.toast {
  background-color: rgba(17, 24, 39, 0.9);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  animation: toast-in-out 2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes toast-in-out {
  0% { transform: translateY(-10px) scale(0.9); opacity: 0; }
  10% { transform: translateY(0) scale(1); opacity: 1; }
  90% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-10px) scale(0.9); opacity: 0; }
}

/* CONFETTI CANVAS */
.confetti-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99;
}

/* Toggle Switch & Settings Custom Controls */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  transition: .3s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: .3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #2563eb;
}

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

/* Settings Slider */
.settings-slider {
  width: 100%;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.1);
  height: 6px;
  border-radius: 5px;
  outline: none;
  -webkit-appearance: none;
}

.settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
  border: 2px solid white;
}

.setting-row {
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-glass);
}

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

.setting-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-label {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text-main);
}

.setting-value {
  font-size: 13px;
  font-weight: 700;
  color: #3b82f6;
}

.setting-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.setting-row-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-glass);
}

.setting-text-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 75%;
}

.menu-btn-huge {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 18px;
  border-radius: 12px;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.05s ease, box-shadow 0.05s ease;
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.menu-btn-huge:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
