/* PokeDollar: English Learning Edition - Dynamic Styling System */
/* 100% Viewport, Zero Blue Void, Vibrant Pokemon Stadium Aesthetics */

:root {
  --bg-deep: #0B0F19;
  --bg-card: rgba(30, 41, 59, 0.75);
  --bg-card-hover: rgba(51, 65, 85, 0.85);
  --border-glass: rgba(255, 255, 255, 0.12);
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --pokedollar-gold: #FACC15;
  --primary-red: #EF4444;
  --kanto-green: #10B981;
  --johto-wood: #D97706;
  --hoenn-blue: #0284C7;
  --sinnoh-cyan: #06B6D4;
  --unova-purple: #8B5CF6;
  --kalos-pink: #EC4899;
  --alola-orange: #F97316;
  --galar-crimson: #E11D48;
  --paldea-yellow: #EAB308;
}

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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-deep);
  font-family: 'Fredoka', 'Outfit', sans-serif;
  color: var(--text-main);
}

/* Base App Screens */
.app-screen {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: none !important;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #1E1B4B 0%, #0F172A 70%, #020617 100%);
}

.app-screen.active {
  display: flex !important;
  z-index: 10;
}

/* ================================================= */
/* 1. SETUP / CHARACTER SELECTION SCREEN             */
/* ================================================= */
#setup-screen {
  overflow-y: auto;
  padding: 20px 24px;
}

.setup-header {
  text-align: center;
  margin-bottom: 20px;
}

.setup-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.pokeball-icon-mini {
  width: 36px;
  height: 36px;
  background: linear-gradient(to bottom, #EF4444 48%, #0F172A 48%, #0F172A 52%, #FFFFFF 52%);
  border-radius: 50%;
  border: 3px solid #0F172A;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.setup-logo h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, #FDE047 0%, #F59E0B 50%, #EF4444 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.setup-tagline {
  font-size: 1.05rem;
  color: #CBD5E1;
}

/* Player Count Selector */
.player-count-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.count-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.count-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.count-pill {
  background: rgba(30, 41, 59, 0.8);
  border: 2px solid var(--border-glass);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.count-pill:hover, .count-pill.active {
  background: #4F46E5;
  border-color: #818CF8;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
}

/* Player Slots Container */
.setup-slots-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.setup-slot-card {
  background: rgba(15, 23, 42, 0.7);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
}

.setup-slot-card.active-slot {
  border-color: #FACC15;
  border-style: solid;
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.4);
  transform: scale(1.02);
}

.setup-slot-card.has-pokemon {
  border-style: solid;
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(30, 41, 59, 0.85);
}

.slot-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.slot-badge {
  background: #6366F1;
  color: white;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
}

.trainer-name-input {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: white;
  padding: 4px 8px;
  font-size: 0.85rem;
  font-weight: 600;
  width: 100%;
}

.slot-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 110px;
}

.slot-avatar {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  transition: transform 0.2s ease;
}

.slot-avatar:hover {
  transform: scale(1.08);
}

.slot-pokename {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 4px;
}

.slot-type-badge {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 8px;
  margin-top: 2px;
}

.slot-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #94A3B8;
  font-size: 0.85rem;
  gap: 4px;
}

/* Pokemon Roster Grid */
.setup-roster-section {
  max-width: 1200px;
  margin: 0 auto 30px auto;
  width: 100%;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.roster-pokemon-card {
  background: var(--bg-card);
  border: 2px solid var(--border-glass);
  border-radius: 14px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.roster-pokemon-card:hover:not(.is-taken) {
  transform: translateY(-4px) scale(1.04);
  border-color: #60A5FA;
  box-shadow: 0 8px 20px rgba(96, 165, 250, 0.3);
}

.roster-pokemon-card.is-selected {
  border-color: #FACC15;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.6);
  background: rgba(250, 204, 21, 0.15);
}

.roster-pokemon-card.is-taken {
  opacity: 0.45;
  filter: grayscale(0.7);
  cursor: not-allowed;
  border-color: rgba(239, 68, 68, 0.4);
}

.roster-avatar-wrap {
  position: relative;
}

.roster-avatar {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.taken-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: #EF4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.roster-name {
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 4px;
  text-align: center;
}

.roster-type {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Start Button Bar */
.setup-actions-bar {
  text-align: center;
  position: sticky;
  bottom: 12px;
  z-index: 100;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.btn-start-game {
  width: 100%;
  padding: 16px 24px;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: 30px;
  border: none;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-start-game:hover:not(.disabled) {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.7);
}

.btn-start-game.disabled {
  background: #475569;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.7;
}

/* ================================================= */
/* 2. MAIN GAME SCREEN (FULL SCREEN, NO VOID)        */
/* ================================================= */
#game-screen {
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Top Navigation Bar */
.game-top-bar {
  height: 60px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  flex-shrink: 0;
}

.top-left-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-title {
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, #FDE047 0%, #F59E0B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.75rem;
  background: rgba(99, 102, 241, 0.3);
  border: 1px solid #818CF8;
  color: #C7D2FE;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

/* Center Active Player Banner */
.top-center-status {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 41, 59, 0.7);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-glass);
}

.hud-avatar {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

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

.hud-name {
  font-size: 0.9rem;
  font-weight: 700;
}

.hud-balance {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--pokedollar-gold);
}

.cur-symbol {
  font-weight: 800;
  color: #FBBF24;
}

/* Top Right Buttons */
.top-right-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-top-action {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-top-action:hover {
  background: rgba(71, 85, 105, 0.8);
  transform: translateY(-1px);
}

.btn-cache-clean {
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
  border-color: #38BDF8;
  color: white;
}

/* ================================================= */
/* 3. DYNAMIC WORLD BOARD & ROUTE TRACK              */
/* ================================================= */
.game-world-container {
  flex: 1;
  position: relative;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 20px;
  /* Winding regional journey background */
  background: 
    radial-gradient(ellipse at top left, rgba(16, 185, 129, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at top right, rgba(2, 132, 199, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(234, 179, 8, 0.15) 0%, transparent 50%),
    #0B0F19;
}

/* Route Track: Organically flowing grid of 40 tiles */
.board-track-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  max-width: 1800px;
  margin: 0 auto;
  width: 100%;
}

.space-route-tile {
  background: var(--bg-card);
  border: 2px solid var(--border-glass);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(8px);
  cursor: pointer;
  min-height: 190px;
}

.space-route-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.space-route-tile.active-player-here {
  border-color: #FACC15;
  box-shadow: 0 0 24px rgba(250, 204, 21, 0.5);
  background: rgba(30, 41, 59, 0.95);
}

.tile-number {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #64748B;
}

.tile-region-tag {
  align-self: flex-end;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-left: 3px solid;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tile-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 8px 0;
  height: 64px;
}

.tile-artwork {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

.tile-emoji {
  position: absolute;
  bottom: 0;
  right: calc(50% - 32px);
  font-size: 1.1rem;
}

.tile-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.tile-vocab-chip {
  background: rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(129, 140, 248, 0.4);
  color: #E0E7FF;
  font-size: 0.75rem;
  border-radius: 8px;
  padding: 3px 6px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-bottom: 6px;
}

.tile-vocab-chip:hover {
  background: rgba(99, 102, 241, 0.5);
}

.tile-price-tag {
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  color: var(--pokedollar-gold);
  background: rgba(0, 0, 0, 0.3);
  padding: 3px 6px;
  border-radius: 6px;
}

.tile-price-tag.start-tag {
  color: #34D399;
}
.tile-price-tag.quiz-tag {
  color: #60A5FA;
}
.tile-price-tag.battle-tag {
  color: #F87171;
}

/* Owner Banner */
.tile-owner-flag {
  margin-top: 6px;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 4px;
}

.owner-mini-avatar {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* Players on Tile */
.tile-players-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
  flex-wrap: wrap;
}

.player-token-sprite {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
}

.player-token-sprite img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.token-p-num {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: #1E293B;
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Animated Hopping Physics */
.player-token-sprite.active-hopper {
  animation: hopBounce 0.4s cubic-bezier(0.28, 0.84, 0.42, 1) infinite alternate;
}

@keyframes hopBounce {
  0% {
    transform: translateY(0) scale(1, 1);
  }
  50% {
    transform: translateY(-16px) scale(0.9, 1.15);
  }
  100% {
    transform: translateY(-24px) scale(1.05, 0.95);
  }
}

/* ================================================= */
/* 4. FLOATING 3D DICE & INTERACTION DOCK           */
/* ================================================= */
.floating-dice-dock {
  position: fixed;
  bottom: 110px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 90;
}

.dice-pair-container {
  display: flex;
  gap: 14px;
}

.dice-cube {
  width: 54px;
  height: 54px;
  background: linear-gradient(145deg, #FFFFFF, #E2E8F0);
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5), inset 0 2px 3px rgba(255, 255, 255, 0.8);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 6px;
  position: relative;
  transition: transform 0.2s ease;
}

.dice-dot {
  width: 9px;
  height: 9px;
  background: #1E293B;
  border-radius: 50%;
  margin: auto;
  opacity: 0;
}

.dice-dot.active-dot {
  opacity: 1;
}

.dice-cube.shaking {
  animation: diceRollShake 0.55s ease-in-out infinite;
}

@keyframes diceRollShake {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-25deg) scale(1.15) translateY(-8px); }
  50% { transform: rotate(20deg) scale(1.1) translateY(4px); }
  75% { transform: rotate(-15deg) scale(1.15) translateY(-4px); }
  100% { transform: rotate(0deg) scale(1); }
}

.btn-roll-dice {
  padding: 14px 28px;
  font-size: 1.15rem;
  font-weight: 800;
  border-radius: 30px;
  border: none;
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 50%, #B91C1C 100%);
  color: white;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.6);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-roll-dice:hover:not([disabled]) {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 28px rgba(239, 68, 68, 0.8);
}

.btn-roll-dice[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ================================================= */
/* 5. BOTTOM PLAYER TRAY (DOCK)                     */
/* ================================================= */
.bottom-player-tray {
  height: 90px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  overflow-x: auto;
  flex-shrink: 0;
  z-index: 80;
}

.tray-player-card {
  min-width: 170px;
  background: rgba(30, 41, 59, 0.7);
  border: 2px solid;
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.tray-player-card.is-turn {
  background: rgba(51, 65, 85, 0.95);
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.4);
  transform: translateY(-4px);
}

.tray-avatar-wrap {
  position: relative;
}

.tray-avatar {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.tray-p-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 8px;
}

.tray-details {
  display: flex;
  flex-direction: column;
}

.tray-p-name {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.tray-pokename {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tray-balance {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--pokedollar-gold);
}

.tray-props-badge {
  font-size: 0.7rem;
  color: #A5B4FC;
}

/* ================================================= */
/* 6. MODALS & ACTION DIALOGS                        */
/* ================================================= */
.game-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.game-modal-overlay.active-modal {
  display: flex;
}

.modal-card {
  background: #1E293B;
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 24px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  animation: modalPopIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.modal-emoji {
  font-size: 1.6rem;
}

.city-preview-image {
  text-align: center;
  margin-bottom: 12px;
}

.city-preview-image img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
}

/* English Vocab Box */
.english-vocab-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #4F46E5;
  border-radius: 12px;
  padding: 12px;
}

.vocab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.vocab-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #A5B4FC;
  text-transform: uppercase;
}

.btn-audio-speak {
  background: #4F46E5;
  color: white;
  border: none;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-audio-speak:hover {
  background: #6366F1;
}

.vocab-word {
  font-size: 1.3rem;
  font-weight: 800;
  color: #FACC15;
  margin-bottom: 4px;
}

.vocab-def {
  font-size: 0.9rem;
  color: #E2E8F0;
  margin-bottom: 4px;
}

.vocab-example {
  font-size: 0.85rem;
  color: #94A3B8;
}

/* Pricing Summary */
.pricing-summary {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.price-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.btn-modal {
  flex: 1;
  padding: 12px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-buy {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
}

.btn-buy:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
}

.btn-pass {
  background: #475569;
  color: white;
}

.btn-pass:hover {
  background: #64748B;
}

/* Oak Quiz */
.oak-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.oak-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid #FACC15;
}

.quiz-question-box {
  background: rgba(15, 23, 42, 0.8);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.quiz-q {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.quiz-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-quiz-opt {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid var(--border-glass);
  color: white;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.btn-quiz-opt:hover {
  background: #4F46E5;
  border-color: #818CF8;
}

.opt-letter {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 800;
  margin-right: 6px;
}

/* Battle Arena */
.battle-matchup {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin: 16px 0;
}

.fighter-side {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fighter-avatar {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.fighter-name {
  font-weight: 700;
  margin-top: 6px;
}

.fighter-roll {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--pokedollar-gold);
  margin-top: 4px;
}

.vs-badge {
  font-size: 1.5rem;
  font-weight: 900;
  color: #EF4444;
}

/* Banknotes Grid */
.banknotes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.banknote-item {
  background: rgba(15, 23, 42, 0.8);
  border: 2px solid;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.banknote-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.banknote-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--pokedollar-gold);
}

.banknote-lesson {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 4px 0;
}

/* Toast */
.game-toast {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-glass);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: white;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.game-toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.game-toast.warning {
  border-color: #EF4444;
  color: #FCA5A5;
}

.game-toast.rent {
  border-color: #F59E0B;
  color: #FDE68A;
}

.game-toast.success {
  border-color: #10B981;
  color: #A7F3D0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .game-top-bar {
    height: 54px;
    padding: 0 10px;
  }
  .brand-title {
    font-size: 1.1rem;
  }
  .brand-badge {
    display: none;
  }
  .hud-name {
    font-size: 0.8rem;
  }
  .board-track-container {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
  .space-route-tile {
    min-height: 160px;
    padding: 8px;
  }
  .tile-artwork {
    width: 44px;
    height: 44px;
  }
  .floating-dice-dock {
    bottom: 95px;
    right: 14px;
  }
  .btn-roll-dice {
    padding: 10px 20px;
    font-size: 1rem;
  }
  .dice-cube {
    width: 44px;
    height: 44px;
  }
  .bottom-player-tray {
    height: 80px;
    padding: 0 10px;
  }
  .tray-player-card {
    min-width: 140px;
    padding: 6px 8px;
  }
}

/* ================================================= */
/* 7. PASS-THE-DEVICE TURN HANDOVER (ANTI-ACCIDENTAL TOUCH) */
/* ================================================= */
.turn-handover-card {
  text-align: center;
  align-items: center;
  max-width: 480px;
  background: radial-gradient(circle at 50% 20%, #1E1B4B 0%, #0F172A 100%);
  border: 3px solid rgba(255, 255, 255, 0.2);
  padding: 28px 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(99, 102, 241, 0.3);
}

.handover-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.25);
  border: 1px solid #818CF8;
  color: #C7D2FE;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.handover-avatar-wrap {
  position: relative;
  margin: 10px 0;
}

.handover-pokemon-avatar {
  width: 100px;
  height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6));
  animation: handoverFloat 1.8s ease-in-out infinite alternate;
}

@keyframes handoverFloat {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

.handover-p-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  color: white;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.handover-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.handover-pokename {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.handover-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  margin-bottom: 16px;
}

.handover-stat-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--pokedollar-gold);
}

.handover-security-notice {
  font-size: 0.8rem;
  color: #94A3B8;
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 12px;
  border-radius: 8px;
}

.handover-action-box {
  width: 100%;
}

.btn-handover-confirm {
  width: 100%;
  padding: 16px 20px;
  font-size: 1.15rem;
  font-weight: 800;
  border-radius: 30px;
  border: none;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-handover-confirm:hover:not(.locked) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.7);
}

.btn-handover-confirm.locked {
  background: #475569 !important;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.75;
}

/* Restart & Victory Modals */
.btn-restart-game {
  background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%) !important;
  border-color: #818CF8 !important;
  color: white !important;
}

.victory-card {
  text-align: center;
  align-items: center;
  max-width: 520px;
}

.victory-trophy {
  font-size: 3.5rem;
  animation: hopBounce 0.6s ease infinite alternate;
}

.victory-title {
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, #FDE047 0%, #F59E0B 50%, #EF4444 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.victory-reason {
  font-size: 0.95rem;
  color: #CBD5E1;
  margin-bottom: 12px;
}

.victory-champion-box {
  background: rgba(15, 23, 42, 0.8);
  border: 3px solid;
  border-radius: 16px;
  padding: 16px;
  width: 100%;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.victory-avatar {
  width: 90px;
  height: 90px;
  object-fit: contain;
}

.victory-winner-name {
  font-size: 1.4rem;
  font-weight: 800;
}

.victory-cash {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--pokedollar-gold);
  margin-top: 6px;
}

.leaderboard-section {
  width: 100%;
  text-align: left;
}

.leaderboard-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 8px 12px;
}

.leaderboard-item.is-first {
  border-color: #FACC15;
  background: rgba(250, 204, 21, 0.15);
}

.rank-badge {
  font-size: 1.2rem;
}

.rank-avatar {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.rank-name {
  font-size: 0.9rem;
  font-weight: 700;
  flex: 1;
}

.rank-worth {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--pokedollar-gold);
}
