/* =============================================
   CHRIS PLAYGROUND — Mid-2000s Edgy
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@400;500;600;700&display=swap');

/* RESET & MOBILE LOCK */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  position: fixed;
  overscroll-behavior: none;
  overscroll-behavior-y: none;
  touch-action: manipulation;
  -webkit-overflow-scrolling: none;
}

body {
  background: #08080e;
  color: #d0d0d0;
  font-family: 'Rajdhani', 'Tahoma', 'Arial', sans-serif;
  font-weight: 500;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  width: 100%; height: 100%;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(0,100,255,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(255,60,0,0.04) 0%, transparent 60%),
    #08080e;
}

/* SCREENS */
.screen {
  display: none;
  width: 100%; height: 100%;
  position: absolute; top: 0; left: 0;
  overflow: hidden;
}
.screen.active { display: flex; align-items: center; justify-content: center; flex-direction: column; }

/* TYPOGRAPHY */
.title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(18px, 5vw, 42px);
  color: #fff;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: 4px;
  background: linear-gradient(180deg, #ffffff 0%, #6ec6ff 40%, #0080ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(0,128,255,0.4));
}

.subtitle {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  color: #8090a0;
  font-size: clamp(12px, 3vw, 18px);
  text-align: center;
  margin-bottom: 30px;
  letter-spacing: 6px;
  text-transform: uppercase;
}

.section-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: clamp(12px, 3vw, 20px);
  color: #fff;
  margin-bottom: 16px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.hint {
  color: #556;
  font-size: 12px;
  margin: 6px 0 14px;
  text-align: center;
  letter-spacing: 1px;
}

/* EDGE GLOW EFFECT */
.glitch {
  position: relative;
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100%;
  background: linear-gradient(180deg, #ffffff 0%, #6ec6ff 40%, #0080ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.glitch::before {
  opacity: 0.5;
  animation: edgeShift1 3s ease-in-out infinite;
  filter: blur(2px);
}
.glitch::after {
  opacity: 0.3;
  animation: edgeShift2 3s ease-in-out infinite;
  filter: blur(4px);
}

@keyframes edgeShift1 {
  0%, 100% { transform: translate(0); }
  25% { transform: translate(-1px, 1px); }
  75% { transform: translate(1px, -1px); }
}
@keyframes edgeShift2 {
  0%, 100% { transform: translate(0); }
  25% { transform: translate(1px, -1px); }
  75% { transform: translate(-1px, 1px); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* BUTTONS */
.btn {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: clamp(10px, 2.2vw, 14px);
  padding: 12px 28px;
  border: 2px solid;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.15s ease;
  background: transparent;
  outline: none;
  touch-action: manipulation;
  position: relative;
}

.btn-primary {
  color: #00b4ff;
  border-color: #00b4ff;
  box-shadow: 0 0 8px rgba(0,180,255,0.25), inset 0 0 8px rgba(0,180,255,0.08);
}
.btn-primary:active {
  background: linear-gradient(180deg, #00b4ff 0%, #0070c0 100%);
  color: #000;
  box-shadow: 0 0 20px rgba(0,180,255,0.5);
}

.btn-secondary {
  color: #c0c0c0;
  border-color: #666;
  box-shadow: 0 0 6px rgba(192,192,192,0.15);
}
.btn-secondary:active {
  background: linear-gradient(180deg, #ccc 0%, #888 100%);
  color: #000;
}

.btn-small {
  font-size: 10px;
  padding: 8px 16px;
  color: #ffcc00;
  border-color: #ffcc00;
  letter-spacing: 1px;
}
.btn-small:active {
  background: linear-gradient(180deg, #ffcc00 0%, #c49800 100%);
  color: #000;
}

.btn-large {
  font-size: clamp(12px, 2.8vw, 18px);
  padding: 16px 36px;
  margin-top: 16px;
}

.btn:disabled {
  opacity: 0.25;
  cursor: default;
}

.btn-game {
  color: #ff3c00;
  border-color: #ff3c00;
  margin: 4px;
}
.btn-game.selected {
  background: linear-gradient(180deg, #ff3c00 0%, #c02000 100%);
  color: #fff;
  box-shadow: 0 0 16px rgba(255,60,0,0.5);
}

/* INPUTS */
input[type="text"] {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  background: #0e0e14;
  border: 2px solid #333;
  color: #fff;
  padding: 12px 16px;
  font-size: clamp(13px, 3vw, 20px);
  outline: none;
  text-transform: uppercase;
  text-align: center;
  caret-color: #00b4ff;
  letter-spacing: 2px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus {
  border-color: #00b4ff;
  box-shadow: 0 0 12px rgba(0,180,255,0.3);
}
input[type="text"]::placeholder {
  color: #333;
}

.input-code {
  width: 140px;
  letter-spacing: 10px;
  font-size: clamp(18px, 5vw, 28px);
}

.input-username {
  width: 300px;
  max-width: 85vw;
  letter-spacing: 4px;
}

/* HOME */
.home-wrap {
  text-align: center;
  padding: 20px;
}
.home-buttons {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.join-row {
  display: flex; gap: 12px; align-items: center;
}
.divider {
  color: #333;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  margin: 4px 0;
  letter-spacing: 4px;
}

/* CENTER BOX */
.center-box {
  text-align: center;
  padding: 20px;
  display: flex; flex-direction: column; align-items: center;
}

/* ICON GRID */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(4, 56px);
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}
.icon-option {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 3px solid #1a1a22;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  outline: 3px solid transparent;
}
.icon-option:active { transform: scale(0.92); }
.icon-option.selected {
  outline-color: #00b4ff;
  box-shadow: 0 0 16px rgba(0,180,255,0.5);
  transform: scale(1.12);
}
.icon-option.locked {
  opacity: 0.3;
  pointer-events: none;
  position: relative;
}
.icon-option.locked::after {
  content: '✕';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  color: #fff;
  text-shadow: 0 0 4px #000;
}

/* LOBBY */
.lobby-wrap {
  text-align: center;
  padding: 16px;
  width: 100%;
  max-width: 520px;
}

.code-display {
  color: #00b4ff;
  letter-spacing: 8px;
  font-size: clamp(18px, 5vw, 32px);
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  filter: drop-shadow(0 0 6px rgba(0,180,255,0.3));
}

.player-list {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #1a1a22;
  background: rgba(255,255,255,0.02);
  min-height: 80px;
}

.player-card {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 10px;
  border: 1px solid #222;
  background: rgba(255,255,255,0.02);
  min-width: 72px;
}
.player-card .player-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2px solid #111;
}
.player-card .player-icon.no-icon {
  background: #1a1a22;
  border-color: #333;
}
.player-card .player-name {
  font-size: 11px;
  font-weight: 600;
  color: #aaa;
  word-break: break-all;
  letter-spacing: 1px;
}
.player-card.disconnected {
  opacity: 0.35;
}
.player-card.host .player-name::after {
  content: ' ★';
  color: #ffcc00;
}

.host-controls {
  margin-top: 12px;
}
.game-select {
  margin-bottom: 10px;
}

/* SETTINGS PANEL */
.settings-panel {
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid #1a1a2e;
  background: rgba(255,255,255,0.02);
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.settings-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #888;
  letter-spacing: 2px;
  white-space: nowrap;
}
.settings-btns {
  display: flex;
  gap: 6px;
}
.btn-setting {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 14px;
  border: 2px solid #333;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.15s;
}
.btn-setting:hover {
  border-color: #00b4ff;
  color: #00b4ff;
}
.btn-setting.selected {
  background: linear-gradient(180deg, #00b4ff 0%, #0077cc 100%);
  border-color: #00b4ff;
  color: #fff;
  box-shadow: 0 0 10px rgba(0,180,255,0.4);
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%; transform: translateX(-50%);
  padding: 10px 24px;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  z-index: 999;
  border: 1px solid #00b4ff;
  background: rgba(8,8,14,0.95);
  color: #00b4ff;
  letter-spacing: 1px;
  backdrop-filter: blur(6px);
}
.toast.error {
  border-color: #ff2040;
  color: #ff2040;
}
.toast.hidden { display: none; }

/* =============================================
   GAME SCREEN
   ============================================= */

.game-wrap {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #060610;
}

/* Top bar */
.game-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 14px;
  background: linear-gradient(180deg, #111118 0%, #0a0a12 100%);
  border-bottom: 1px solid #1a1a28;
  flex-shrink: 0;
  min-height: 28px;
  width: 100%;
}
.turn-info {
  font-size: clamp(10px, 2.2vw, 13px);
  color: #667;
  font-weight: 600;
  letter-spacing: 1px;
}
.turn-player {
  color: #00b4ff;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: clamp(10px, 2.2vw, 14px);
}

/* Leaderboard in top bar */
.leaderboard-panel {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  max-width: 60%;
  justify-content: flex-end;
}
.lb-entry {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: #aab;
}
.lb-entry.lb-active {
  background: rgba(0, 180, 255, 0.15);
}
.lb-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.lb-name {
  font-weight: 600;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-count {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  color: #FFD700;
  font-size: 12px;
}

/* Mobile: hide names, just show dot + count */
@media (max-width: 500px) {
  .leaderboard-panel { gap: 4px; }
  .lb-entry { padding: 1px 3px; gap: 3px; }
  .lb-name { display: none; }
  .lb-dot { width: 8px; height: 8px; }
  .lb-count { font-size: 10px; }
}
.money-info { display: none; }

/* Main game area */
.game-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 0;
  width: 100%;
}

/* Pool table canvas */
.table-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow: visible;
}

#pool-canvas {
  display: block;
  touch-action: none;
  image-rendering: auto;
}

/* Power bar */
.power-bar-container {
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px;
  flex-shrink: 0;
  height: 100%;
  justify-content: center;
}
.power-bar-container.hidden { display: none; }

.power-label {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 8px;
  color: #ff3c00;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.power-bar {
  width: 28px;
  flex: 1;
  max-height: 220px;
  background: #0a0a12;
  border: 1px solid #222;
  position: relative;
  border-radius: 3px;
  overflow: hidden;
  touch-action: none;
}

.power-fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, #ff2040, #ff6600, #ffcc00, #00ff88);
  height: 0%;
  transition: none;
}

.power-handle {
  position: absolute;
  left: -4px; right: -4px;
  height: 6px;
  background: #fff;
  border: 1px solid #000;
  bottom: 0%;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 0 6px rgba(255,255,255,0.4);
}

.btn-shoot {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 9px;
  padding: 10px 6px;
  margin-top: 8px;
  color: #ff3c00;
  border: 2px solid #ff3c00;
  background: transparent;
  width: 100%;
  letter-spacing: 1px;
  cursor: pointer;
}
.btn-shoot:active {
  background: linear-gradient(180deg, #ff3c00, #c02000);
  color: #fff;
  box-shadow: 0 0 12px rgba(255,60,0,0.5);
}

/* Bottom game controls */
.game-bottom {
  padding: 2px 12px;
  background: linear-gradient(180deg, #0a0a12 0%, #060610 100%);
  border-top: 1px solid #1a1a28;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
  min-height: 32px;
  flex-wrap: wrap;
  width: 100%;
}

.card-area { display: flex; align-items: center; gap: 8px; }
.card-area.hidden { display: none; }

.card-list {
  display: flex; gap: 5px;
}
.card-btn {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 9px;
  padding: 7px 10px;
  background: rgba(255,60,0,0.08);
  border: 1px solid #ff3c00;
  color: #ff3c00;
  cursor: pointer;
  touch-action: manipulation;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.15s;
}
.card-btn:active {
  background: #ff3c00;
  color: #fff;
  box-shadow: 0 0 10px rgba(255,60,0,0.4);
}

.btn-buy {
  color: #ffcc00;
  border-color: #ffcc00;
  background: rgba(255,204,0,0.06);
}
.btn-buy:active {
  background: #ffcc00;
  color: #000;
}

.card-instruction {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 10px;
  color: #ff3c00;
  text-align: center;
  letter-spacing: 1px;
  animation: pulse 1.2s ease-in-out infinite;
}
.card-instruction.hidden { display: none; }

.active-card-display {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 10px;
  color: #ff2040;
  letter-spacing: 1px;
  animation: pulse 1s ease-in-out infinite;
}
.active-card-display.hidden { display: none; }

/* RESULTS */
.final-leaderboard {
  width: 100%;
  max-width: 420px;
  margin: 16px auto;
  padding: 0 16px;
}
.final-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 4px;
  border: 1px solid #1a1a22;
  background: rgba(255,255,255,0.02);
  font-size: 13px;
}
.final-entry:first-child {
  border-color: #ffcc00;
  background: rgba(255,204,0,0.05);
}
.final-entry:nth-child(2) {
  border-color: #aaa;
  background: rgba(192,192,192,0.03);
}
.final-entry:nth-child(3) {
  border-color: #a0522d;
}
.final-rank {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 16px;
  color: #ffcc00;
  min-width: 34px;
}
.final-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid #222;
}
.final-name {
  flex: 1;
  color: #ccc;
  font-weight: 600;
  letter-spacing: 1px;
}
.final-score {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  color: #00ff88;
  font-size: 16px;
}
.final-money {
  color: #ffcc00;
  font-size: 11px;
  font-weight: 700;
}

/* DESKTOP */
@media (min-width: 800px) {
  .icon-grid {
    grid-template-columns: repeat(4, 64px);
    gap: 14px;
  }
  .icon-option { width: 64px; height: 64px; }
}

/* Small phone tweaks */
@media (max-height: 600px) {
  .game-top-bar { padding: 3px 8px; min-height: 28px; }
  .game-bottom { padding: 3px 6px; min-height: 36px; }
  .power-bar-container { width: 50px; padding: 4px 2px; }
}

/* =============================================
   TURN BANNER OVERLAY
   ============================================= */
.turn-banner {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  pointer-events: none;
  animation: turnBannerIn 1.6s ease-out forwards;
}
.turn-banner.hidden { display: none; }

.turn-banner-text {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(24px, 8vw, 52px);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 6px;
  text-align: center;
  padding: 16px 40px;
  background: linear-gradient(180deg, rgba(0,180,255,0.2) 0%, rgba(0,80,200,0.15) 100%);
  border-top: 2px solid #00b4ff;
  border-bottom: 2px solid #00b4ff;
  text-shadow: 0 0 20px rgba(0,180,255,0.6), 0 0 40px rgba(0,180,255,0.3);
  backdrop-filter: blur(4px);
  width: 100%;
}

.turn-banner.is-my-turn .turn-banner-text {
  color: #ffcc00;
  border-color: #ffcc00;
  background: linear-gradient(180deg, rgba(255,204,0,0.2) 0%, rgba(200,150,0,0.12) 100%);
  text-shadow: 0 0 20px rgba(255,204,0,0.6), 0 0 40px rgba(255,204,0,0.3);
}

@keyframes turnBannerIn {
  0% { opacity: 0; transform: scale(1.3); }
  15% { opacity: 1; transform: scale(1); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.95); }
}

/* =============================================
   CARD BOUGHT OVERLAY
   ============================================= */
.card-bought-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  pointer-events: none;
  animation: cardOverlayAnim 2s ease-out forwards;
}
.card-bought-overlay.hidden { display: none; }

.card-bought-inner {
  text-align: center;
  padding: 20px 50px;
  background: radial-gradient(ellipse at center, rgba(255,60,0,0.25) 0%, rgba(0,0,0,0.6) 70%);
  border: 2px solid #ff3c00;
  box-shadow: 0 0 40px rgba(255,60,0,0.4), 0 0 80px rgba(255,60,0,0.15), inset 0 0 30px rgba(255,60,0,0.1);
}

.card-bought-label {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: clamp(10px, 3vw, 16px);
  color: #aaa;
  letter-spacing: 6px;
  margin-bottom: 8px;
}

.card-bought-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(28px, 10vw, 60px);
  color: #ff3c00;
  text-transform: uppercase;
  letter-spacing: 8px;
  text-shadow: 0 0 20px rgba(255,60,0,0.8), 0 0 50px rgba(255,60,0,0.4);
  animation: cardNamePulse 0.4s ease-in-out 3;
}

@keyframes cardOverlayAnim {
  0% { opacity: 0; transform: scale(2); }
  10% { opacity: 1; transform: scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes cardNamePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Turn indicator — top bar glow when it's your turn */
.game-top-bar.my-turn {
  background: linear-gradient(180deg, rgba(255,204,0,0.15) 0%, #0a0a12 100%);
  border-bottom-color: #ffcc00;
  box-shadow: 0 2px 12px rgba(255,204,0,0.2);
}
.game-top-bar.my-turn .turn-player {
  color: #ffcc00;
  animation: pulse 1.2s ease-in-out infinite;
}

/* =============================================
   CARD BUTTON REDESIGN (emoji + name)
   ============================================= */
.card-btn {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 9px;
  padding: 7px 10px;
  background: rgba(255,60,0,0.08);
  border: 1px solid #ff3c00;
  color: #ff3c00;
  cursor: pointer;
  touch-action: manipulation;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.card-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.card-btn:not(:disabled):active {
  background: #ff3c00;
  color: #fff;
  box-shadow: 0 0 10px rgba(255,60,0,0.4);
}
.card-btn-emoji { font-size: 14px; }

/* =============================================
   CP MODAL (shared base)
   ============================================= */
.cp-modal {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  animation: modalBgIn 0.2s ease-out;
}
.cp-modal.hidden { display: none; }
.cp-modal.modal-enter { animation: modalBgIn 0.2s ease-out; }
.cp-modal.modal-exit { animation: modalBgOut 0.25s ease-in forwards; }

@keyframes modalBgIn  { from { opacity:0 } to { opacity:1 } }
@keyframes modalBgOut { from { opacity:1 } to { opacity:0 } }

.cp-modal-box {
  background: linear-gradient(160deg, #0e0e1a 0%, #12121e 100%);
  border: 2px solid #00b4ff;
  box-shadow: 0 0 40px rgba(0,180,255,0.25), 0 0 80px rgba(0,180,255,0.08);
  padding: 24px 32px;
  min-width: min(320px, 90vw);
  max-width: min(460px, 94vw);
  text-align: center;
  animation: modalBoxIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.cp-modal.modal-exit .cp-modal-box { animation: modalBoxOut 0.2s ease-in forwards; }

@keyframes modalBoxIn  { from { transform: scale(0.75); opacity:0 } to { transform: scale(1); opacity:1 } }
@keyframes modalBoxOut { from { transform: scale(1); opacity:1 } to { transform: scale(0.85); opacity:0 } }

.cp-modal-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(16px, 5vw, 26px);
  color: #fff;
  letter-spacing: 4px;
  margin-bottom: 16px;
  text-shadow: 0 0 12px rgba(0,180,255,0.5);
}

.cp-modal-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* =============================================
   CARD DRAW MODAL
   ============================================= */
.draw-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
}
.draw-result.hidden { display: none; }
.draw-result.draw-card-animate {
  animation: drawCardPop 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes drawCardPop {
  0% { transform: scale(0.4) rotate(-10deg); opacity:0; }
  60% { transform: scale(1.1) rotate(2deg); opacity:1; }
  100% { transform: scale(1) rotate(0deg); opacity:1; }
}

.draw-card-icon {
  font-size: clamp(40px, 12vw, 64px);
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(0,180,255,0.5));
}
.draw-card-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(18px, 5vw, 28px);
  color: #00b4ff;
  letter-spacing: 3px;
  text-shadow: 0 0 10px rgba(0,180,255,0.5);
}
.draw-card-desc {
  font-size: clamp(11px, 2.5vw, 14px);
  color: #8899aa;
  line-height: 1.5;
  max-width: 300px;
}

.draw-no-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.draw-no-card.hidden { display: none; }
.draw-no-card-icon { font-size: 48px; opacity: 0.4; }
.draw-no-card-text {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #556;
  letter-spacing: 3px;
}

.draw-discard-wrap { margin-top: 12px; }
.draw-discard-wrap.hidden { display: none; }
.draw-discard-label {
  font-size: 10px;
  color: #ff9900;
  letter-spacing: 2px;
  font-family: 'Orbitron', sans-serif;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.draw-discard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.discard-btn {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 10px;
  padding: 9px 14px;
  background: rgba(255,100,0,0.07);
  border: 1px solid #ff6600;
  color: #ff6600;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}
.discard-btn:hover { background: rgba(255,100,0,0.18); }
.discard-btn-new { border-color: #aaa; color: #aaa; background: rgba(255,255,255,0.04); }
.discard-btn-new:hover { background: rgba(255,255,255,0.10); }
.discard-emoji { font-size: 18px; }

/* =============================================
   CARD CONFIRM MODAL
   ============================================= */
.confirm-card-desc {
  font-size: clamp(12px, 2.8vw, 15px);
  color: #8899aa;
  line-height: 1.6;
  margin-top: 4px;
}
