/* =============================================
   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;
  display: flex;
  flex-direction: column;
}

#app {
  width: 100%; flex: 1;
  min-height: 0;
  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-x: hidden;
  overflow-y: auto;
}
.screen.active { display: flex; align-items: center; justify-content: center; flex-direction: column; }

.hidden { display: none !important; }

/* 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);
}
.btn-skip-turn {
  margin-left: 8px;
  padding: 2px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  background: rgba(255, 80, 80, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(255, 80, 80, 0.3);
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  transition: background 0.2s, color 0.2s;
}
.btn-skip-turn:hover {
  background: rgba(255, 80, 80, 0.3);
  color: #fff;
}

/* Leave game button */
.btn-leave-game {
  background: rgba(255, 60, 60, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(255, 60, 60, 0.3);
  font-size: 14px;
  font-weight: 700;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 8px;
  transition: background 0.2s;
}
.btn-leave-game:hover {
  background: rgba(255, 60, 60, 0.4);
  color: #fff;
}

/* Danger button */
.btn-danger {
  background: rgba(255, 60, 60, 0.2) !important;
  color: #ff6b6b !important;
  border: 1px solid rgba(255, 60, 60, 0.4) !important;
}
.btn-danger:hover {
  background: rgba(255, 60, 60, 0.4) !important;
  color: #fff !important;
}

/* 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; }
}

/* =============================================
   GLOBAL TOP BAR (Auth + Notifications)
   ============================================= */
.global-top-bar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 900;
  padding: 8px 14px;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}
.global-top-bar.hidden { display: none; }
.auth-area {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}
.auth-area .btn { padding: 6px 14px; font-size: 10px; }
.auth-user-pic-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.auth-user-pic {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid #00b4ff;
  cursor: pointer;
  object-fit: cover;

}
.inbox-btn {
  position: relative;
  background: none;
  border: 1px solid #333;
  color: #aaa;
  font-size: 18px;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
}
.inbox-btn:hover { border-color: #00b4ff; color: #00b4ff; }
.inbox-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #ff2040;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', sans-serif;
}
.inbox-badge.hidden { display: none; }

/* Game inbox (in-game top bar) */
.game-inbox-area {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* =============================================
   AUTH MODALS
   ============================================= */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.auth-input {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  background: #0e0e14;
  border: 1px solid #333;
  color: #fff;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.auth-input:focus {
  border-color: #00b4ff;
  box-shadow: 0 0 8px rgba(0,180,255,0.2);
}
.auth-check {
  color: #888;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.auth-check input { accent-color: #00b4ff; }
.auth-error {
  color: #ff2040;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.auth-error.hidden { display: none; }
.auth-switch {
  color: #556;
  font-size: 12px;
  text-align: center;
  margin-top: 6px;
}
.auth-link {
  color: #00b4ff;
  cursor: pointer;
  font-weight: 600;
}
.auth-link:hover { text-decoration: underline; }
.auth-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 0;
}
.auth-status.available { color: #00ff88; }
.auth-status.taken { color: #ff2040; }
.auth-status.hidden { display: none; }

/* =============================================
   PROFILE SCREEN
   ============================================= */
.profile-wrap {
  width: 100%;
  max-width: 520px;
  padding: 16px;
  overflow-y: auto;
  max-height: 100%;
  -webkit-overflow-scrolling: touch;
}
.profile-header {
  text-align: center;
  margin-bottom: 16px;
}
.profile-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
}
.profile-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 3px solid #00b4ff;
  object-fit: cover;
  background: #1a1a22;
}
.profile-avatar-edit {
  position: absolute;
  bottom: 0; right: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #00b4ff;
  color: #000;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: 2px solid #08080e;
  font-weight: 700;
}
.profile-avatar-edit.hidden { display: none; }
.profile-username {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(16px, 4vw, 24px);
  color: #fff;
  letter-spacing: 2px;
}
.profile-bio {
  color: #889;
  font-size: 13px;
  margin-top: 4px;
  max-width: 350px;
  margin-left: auto;
  margin-right: auto;
}
.profile-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}
.profile-buttons .btn { font-size: 10px; padding: 8px 16px; }

.profile-stats {
  text-align: center;
  margin-bottom: 16px;
  color: #667;
  font-size: 12px;
}
.profile-stats .stat-row {
  display: inline-flex;
  gap: 16px;
  padding: 6px 12px;
  border: 1px solid #1a1a22;
  background: rgba(255,255,255,0.02);
}
.stat-val {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  color: #00b4ff;
  font-size: 14px;
}

.btn-premium {
  color: #ffcc00;
  border-color: #ffcc00;
  box-shadow: 0 0 8px rgba(255,204,0,0.2);
}
.btn-premium:active { background: linear-gradient(180deg, #ffcc00, #c49800); color: #000; }

.btn-admin {
  color: #ff2040;
  border-color: #ff2040;
}
.btn-admin.hidden { display: none; }
.btn-admin:active { background: linear-gradient(180deg, #ff2040, #b01030); color: #fff; }

.btn-invite {
  color: #00ff88;
  border-color: #00ff88;
}
.btn-invite.hidden { display: none; }

.lobby-top-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 4px;
}

/* =============================================
   FEED / POSTS
   ============================================= */
.profile-feed {
  border-top: 1px solid #1a1a22;
  padding-top: 12px;
}
.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.feed-header .section-title { margin-bottom: 0; }
.post-compose {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.post-compose.hidden { display: none; }
.post-textarea {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 500;
  background: #0e0e14;
  border: 1px solid #333;
  color: #ddd;
  padding: 10px;
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
  max-height: 200px;
  outline: none;
  width: 100%;
}
.post-textarea:focus { border-color: #00b4ff; }
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feed-post {
  border: 1px solid #1a1a22;
  background: rgba(255,255,255,0.02);
  padding: 10px;
}
.feed-post-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.feed-post-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #1a1a22;
  border: 1px solid #333;
}
.feed-post-user {
  font-weight: 700;
  color: #ccc;
  font-size: 12px;
  letter-spacing: 1px;
}
.feed-post-time {
  color: #445;
  font-size: 10px;
  margin-left: auto;
}
.feed-post-body {
  color: #bbc;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.feed-post-actions {
  margin-top: 6px;
  display: flex;
  gap: 8px;
}
.feed-post-actions button {
  background: none;
  border: none;
  color: #556;
  font-size: 10px;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
}
.feed-post-actions button:hover { color: #ff2040; }

/* =============================================
   MODAL EXTENSIONS
   ============================================= */
.cp-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cp-modal.hidden { display: none; }
.cp-modal-box {
  background: #0c0c14;
  border: 1px solid #1a1a28;
  padding: 20px;
  max-width: 420px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-wide {
  max-width: 520px;
}
.cp-modal-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  text-align: center;
  margin-bottom: 14px;
  letter-spacing: 2px;
}
.cp-modal-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}

/* Inbox tabs */
.inbox-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.inbox-tab {
  flex: 1;
  padding: 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  font-weight: 700;
  background: transparent;
  border: 1px solid #333;
  color: #888;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.15s;
}
.inbox-tab.active {
  border-color: #00b4ff;
  color: #00b4ff;
  background: rgba(0,180,255,0.08);
}
.inbox-content {
  min-height: 100px;
  max-height: 50vh;
  overflow-y: auto;
}

/* Notification items */
.notif-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid #111;
  font-size: 12px;
  color: #bbc;
}
.notif-item.unread {
  background: rgba(0,180,255,0.12);
  border-left: 3px solid #00b4ff;
}
.notif-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.notif-text { flex: 1; }
.notif-time { color: #445; font-size: 10px; white-space: nowrap; }
.notif-actions {
  display: flex;
  gap: 6px;
}
.notif-actions button {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  padding: 4px 10px;
  border: 1px solid;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}
.notif-accept { color: #00ff88; border-color: #00ff88; }
.notif-accept:hover { background: rgba(0,255,136,0.15); }
.notif-reject { color: #ff2040; border-color: #ff2040; }
.notif-reject:hover { background: rgba(255,32,64,0.15); }
.notif-join { color: #00b4ff; border-color: #00b4ff; }
.notif-join:hover { background: rgba(0,180,255,0.15); }
.notif-open { color: #ffcc00; border-color: #ffcc00; }
.notif-open:hover { background: rgba(255,204,0,0.15); }
.notif-status-accepted {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  font-weight: 700;
  color: #556;
  letter-spacing: 1px;
}

/* Friends */
.friends-search {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.friends-search .auth-input { flex: 1; }
.friend-search-result {
  padding: 10px;
  border: 1px solid #222;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.friend-search-result.hidden { display: none; }
.friends-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 40vh;
  overflow-y: auto;
}
.friend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid #1a1a22;
  background: rgba(255,255,255,0.02);
}
.friend-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #1a1a22;
  border: 1px solid #333;
}
.friend-name {
  flex: 1;
  color: #ccc;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1px;
}
.friend-actions {
  display: flex;
  gap: 6px;
}
.friend-actions button {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  padding: 4px 10px;
  border: 1px solid;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 1px;
}
.friend-msg-btn { color: #00b4ff; border-color: #00b4ff; }
.friend-remove-btn { color: #ff2040; border-color: #ff2040; }
.friend-add-btn {
  color: #fff;
  border-color: #00ff88;
  background: rgba(0,255,136,0.2);
  padding: 6px 18px !important;
  font-size: 11px !important;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.15s;
}
.friend-add-btn:hover {
  background: rgba(0,255,136,0.4);
  box-shadow: 0 0 12px rgba(0,255,136,0.3);
}
.friend-invite-btn { color: #7c7800; border-color: #7c7800; }
.friend-pending { color: #888; font-size: 11px; font-style: italic; }

/* Conversations / DMs */
.conversations-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 50vh;
  overflow-y: auto;
}
.convo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border: 1px solid #1a1a22;
  cursor: pointer;
  transition: background 0.15s;
}
.convo-item:hover { background: rgba(0,180,255,0.05); }
.convo-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #1a1a22;
  border: 1px solid #333;
}
.convo-info { flex: 1; }
.convo-name { color: #ccc; font-weight: 600; font-size: 13px; }
.convo-preview { color: #556; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.convo-time { color: #445; font-size: 10px; }
.convo-unread {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #00b4ff;
  flex-shrink: 0;
}

.dm-messages {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 45vh;
  overflow-y: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}
.dm-msg {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}
.dm-msg.sent {
  align-self: flex-end;
  background: rgba(0,180,255,0.15);
  color: #cde;
  border: 1px solid rgba(0,180,255,0.2);
}
.dm-msg.received {
  align-self: flex-start;
  background: rgba(255,255,255,0.04);
  color: #bbc;
  border: 1px solid #1a1a22;
}
.dm-msg-time {
  font-size: 9px;
  color: #445;
  margin-top: 2px;
}
.dm-input-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: flex-end;
}
.dm-textarea {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid #333;
  color: #eee;
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  outline: none;
  transition: border-color 0.15s;
}
.dm-textarea:focus {
  border-color: #00b4ff;
}
.dm-textarea::placeholder {
  color: #556;
}

/* Settings form */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* New message button */
.btn-new-message {
  width: 100%;
  margin-bottom: 12px;
  font-size: 11px !important;
  padding: 10px !important;
  letter-spacing: 2px;
}
.new-message-picker {
  margin-bottom: 12px;
  border: 1px solid #222;
  padding: 10px;
}
.new-message-picker.hidden { display: none; }
.cp-modal-subtitle {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  color: #888;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.settings-form-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #888;
  letter-spacing: 2px;
  margin-top: 6px;
}

/* Premium */
.premium-body { text-align: center; padding: 20px 0; }
.premium-coming {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 24px;
  color: #ffcc00;
  letter-spacing: 4px;
  filter: drop-shadow(0 0 8px rgba(255,204,0,0.3));
}

/* Admin */
.admin-content {
  max-height: 50vh;
  overflow-y: auto;
}
.admin-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-bottom: 1px solid #111;
  font-size: 12px;
}
.admin-user-name {
  flex: 1;
  color: #ccc;
  font-weight: 600;
}
.admin-user-email { color: #667; font-size: 11px; }
.admin-user-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 700;
}
.admin-badge-admin { background: #ff2040; color: #fff; }
.admin-actions button {
  font-size: 9px;
  padding: 3px 8px;
  border: 1px solid #ff2040;
  background: transparent;
  color: #ff2040;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  margin-left: 4px;
}

/* Report item */
.report-item {
  padding: 8px;
  border-bottom: 1px solid #111;
  font-size: 12px;
  color: #bbc;
}
.report-item .report-user { color: #ff6b6b; font-weight: 600; }
.report-item .report-reason { color: #889; font-style: italic; }

/* Crop */
.crop-container {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.crop-canvas {
  max-width: 300px;
  max-height: 300px;
  border: 2px solid #333;
  cursor: crosshair;
}

/* Member badge on player icon */
.player-card .member-badge {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #00b4ff;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #08080e;
  font-family: 'Orbitron', sans-serif;
}
.player-card .player-icon {
  position: relative;
}

/* Default avatar */
.default-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a22;
  color: #444;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
}

/* Report profile pic button on profile */
.profile-report-btn {
  background: none;
  border: none;
  color: #556;
  font-size: 10px;
  cursor: pointer;
  margin-top: 4px;
}
.profile-report-btn:hover { color: #ff2040; }

/* Success toast */
.toast.success {
  border-color: #00ff88;
  color: #00ff88;
}

/* reCAPTCHA container */
.g-recaptcha {
  display: flex;
  justify-content: center;
  margin: 6px 0;
}

/* Scrollbar styling for dark theme */
.profile-wrap::-webkit-scrollbar,
.inbox-content::-webkit-scrollbar,
.friends-list::-webkit-scrollbar,
.dm-messages::-webkit-scrollbar,
.admin-content::-webkit-scrollbar,
.conversations-list::-webkit-scrollbar,
.cp-modal-box::-webkit-scrollbar {
  width: 6px;
}
.profile-wrap::-webkit-scrollbar-track,
.cp-modal-box::-webkit-scrollbar-track {
  background: transparent;
}
.profile-wrap::-webkit-scrollbar-thumb,
.cp-modal-box::-webkit-scrollbar-thumb {
  background: #222;
  border-radius: 3px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 20px;
  color: #445;
  font-size: 12px;
  letter-spacing: 1px;
}

/* =============================================
   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; }
button.hidden { display: none !important; }

@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;
}

/* =============================================
   AD BOTTOM BAR (fixed — never touches screen layout)
   ============================================= */
#ad-bottom-bar {
  width: 100%;
  flex-shrink: 0;
  background: #07070d;
  text-align: center;
  display: none;
}
#ad-bottom-bar.visible {
  display: block;
  border-top: 1px solid #1a1a2a;
}
#ad-bottom-bar .ad-slot {
  display: none;
}
#ad-bottom-bar .ad-slot.active {
  display: block;
}
#ad-bottom-bar ins.adsbygoogle {
  display: block !important;
  width: 100%;
  max-width: 728px;
  min-height: 50px;
  margin: 0 auto;
}

/* =============================================
   PUBLIC ROOMS (Home Screen)
   ============================================= */
.public-rooms {
  margin-top: 24px;
  width: 100%;
  max-width: 420px;
}
.public-rooms-title {
  font-size: clamp(10px, 2.5vw, 14px);
  color: #667;
  margin-bottom: 10px;
}
.public-rooms-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.public-room-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border: 1px solid #1a1a28;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: all 0.15s;
}
.public-room-card:active {
  background: rgba(0,180,255,0.08);
  border-color: #00b4ff;
}
.pr-game-type {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 11px;
  color: #ff3c00;
  letter-spacing: 1px;
}
.pr-info {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pr-host {
  color: #aab;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
}
.pr-players {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: #00b4ff;
}

/* =============================================
   DRAWMAGINE GAME SCREEN
   ============================================= */
.dm-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #060610;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
}

/* Top bar */
.dm-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px;
  background: linear-gradient(180deg, #111118 0%, #0a0a12 100%);
  border-bottom: 1px solid #1a1a28;
  flex-shrink: 0;
  min-height: 36px;
}
.dm-round-info {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #667;
  letter-spacing: 2px;
}
.dm-modifier-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #ff3c00;
  letter-spacing: 1px;
  padding: 2px 8px;
  border: 1px solid rgba(255,60,0,0.3);
  background: rgba(255,60,0,0.08);
  animation: pulse 1.5s ease-in-out infinite;
}
.dm-modifier-label.hidden { display: none; }
.dm-timer {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 18px;
  color: #00b4ff;
  letter-spacing: 2px;
  min-width: 40px;
  text-align: center;
  transition: color 0.3s;
}
.dm-timer.dm-timer-low {
  color: #ff2040;
  animation: pulse 0.6s ease-in-out infinite;
}

/* Canvas area */
.dm-canvas-area {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #0a0a14;
}
#dm-canvas {
  display: block;
  background: #fff;
  touch-action: none;
  border: 1px solid #222;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* Prompt display (drawer only) */
.dm-prompt {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #ffcc00;
  letter-spacing: 2px;
  padding: 4px 16px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,204,0,0.3);
  z-index: 10;
  white-space: nowrap;
}
.dm-prompt.hidden { display: none; }

.dm-word-hint {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #556;
  letter-spacing: 4px;
  padding: 4px 16px;
  background: rgba(0,0,0,0.7);
  z-index: 10;
  white-space: nowrap;
}
.dm-word-hint.hidden { display: none; }

.dm-clear-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 9px;
  padding: 6px 12px;
  background: rgba(255,60,60,0.15);
  color: #ff6b6b;
  border: 1px solid rgba(255,60,60,0.3);
  cursor: pointer;
  z-index: 10;
  letter-spacing: 1px;
}
.dm-clear-btn:active {
  background: rgba(255,60,60,0.4);
  color: #fff;
}

.dm-pen-indicator {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 12px;
  height: 12px;
  background: #000;
  border: 2px solid #444;
  border-radius: 50%;
  z-index: 10;
  transition: all 0.3s;
}

/* Guess area */
.dm-guess-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: linear-gradient(180deg, #0a0a12 0%, #060610 100%);
  border-top: 1px solid #1a1a28;
  padding: 6px 12px;
}

/* Mobile keyboard open — compact everything so it all fits */
.dm-keyboard-open .dm-top-bar {
  min-height: 24px;
  padding: 2px 8px;
}
.dm-keyboard-open .dm-top-bar .dm-timer { font-size: 14px; }
.dm-keyboard-open .dm-top-bar .dm-round-info { font-size: 9px; }
.dm-keyboard-open .dm-guess-area {
  flex: 0 0 auto;
  padding: 2px 8px;
  max-height: none;
}
.dm-keyboard-open .dm-scoreboard { display: none !important; }
.dm-keyboard-open .dm-drawer-info { display: none; }
.dm-keyboard-open .dm-guess-list {
  max-height: 40px;
  flex: 0 0 auto;
  overflow: hidden;
}
.dm-keyboard-open .dm-guess-input-area { padding: 2px 0; }
.dm-keyboard-open .dm-guess-input { padding: 6px 10px; font-size: 12px; }
.dm-drawer-info {
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #556;
  letter-spacing: 2px;
  padding: 4px 0;
  flex-shrink: 0;
}
.dm-drawer-info span {
  color: #00b4ff;
}

/* Scoreboard */
.dm-scoreboard {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 4px 0;
  flex-shrink: 0;
}
.dm-scoreboard.hidden { display: none; }
.dm-score-entry {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  font-size: 11px;
  color: #aab;
}
.dm-score-entry.dm-score-drawer {
  background: rgba(0,180,255,0.08);
  border-radius: 3px;
}
.dm-score-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dm-score-name {
  font-weight: 600;
  max-width: 50px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dm-score-pts {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  color: #ffcc00;
  font-size: 11px;
}

/* Guess list */
.dm-guess-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 0;
}
.dm-guess-item {
  font-size: 13px;
  padding: 4px 8px;
  color: #bbc;
  border-left: 2px solid #1a1a28;
  transition: all 0.2s;
}
.dm-guess-item.dm-guess-correct {
  color: #00ff88;
  border-left-color: #00ff88;
  background: rgba(0,255,136,0.05);
  font-weight: 700;
}
.dm-guess-item.dm-guess-flash {
  animation: guessFlash 0.5s ease-out;
}
@keyframes guessFlash {
  0% { background: rgba(0,255,136,0.3); }
  100% { background: rgba(0,255,136,0.05); }
}
.dm-guess-user {
  font-weight: 700;
  color: #00b4ff;
  margin-right: 6px;
  font-size: 11px;
}
.dm-guess-text {
  color: #ccc;
}
.dm-guess-points {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  color: #ffcc00;
  font-size: 10px;
  margin-left: 6px;
}

/* Guess input */
.dm-guess-input-area {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  flex-shrink: 0;
}
.dm-guess-input {
  flex: 1;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 14px;
  background: #0e0e14;
  border: 2px solid #333;
  color: #fff;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 2px;
  caret-color: #00b4ff;
  transition: border-color 0.2s;
}
.dm-guess-input:focus {
  border-color: #00b4ff;
  box-shadow: 0 0 10px rgba(0,180,255,0.2);
}
.dm-guess-input::placeholder {
  color: #333;
  font-size: 11px;
}

/* Round banner overlay */
.dm-round-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;
  background: rgba(0,0,0,0.85);
  animation: dmBannerIn 2.5s ease-out forwards;
}
.dm-round-banner.hidden { display: none; }
.dm-round-banner-text {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(18px, 6vw, 36px);
  color: #fff;
  text-align: center;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(0,180,255,0.6);
  padding: 20px 40px;
  border-top: 2px solid #00b4ff;
  border-bottom: 2px solid #00b4ff;
  background: linear-gradient(180deg, rgba(0,180,255,0.15) 0%, rgba(0,60,200,0.1) 100%);
}
.dm-round-banner.dm-banner-drawer .dm-round-banner-text {
  color: #ffcc00;
  border-color: #ffcc00;
  text-shadow: 0 0 20px rgba(255,204,0,0.6);
  background: linear-gradient(180deg, rgba(255,204,0,0.35) 0%, rgba(200,150,0,0.25) 100%);
}
.dm-modifier-hint {
  display: block;
  font-size: clamp(10px, 3vw, 14px);
  font-weight: 600;
  color: #ff3c00;
  margin-top: 6px;
  letter-spacing: 2px;
}
@keyframes dmBannerIn {
  0% { opacity: 0; }
  15% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; pointer-events: none; }
}

/* Answer banner */
.dm-answer-banner {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 55;
  pointer-events: none;
  background: rgba(0,0,0,0.7);
  animation: dmBannerIn 3s ease-out forwards;
}
.dm-answer-banner.hidden { display: none; }
.dm-answer-text {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(16px, 5vw, 28px);
  color: #fff;
  text-align: center;
  letter-spacing: 3px;
  padding: 20px 40px;
}
.dm-answer-word {
  display: block;
  font-size: clamp(24px, 8vw, 48px);
  color: #00ff88;
  margin-top: 8px;
  letter-spacing: 6px;
  text-shadow: 0 0 20px rgba(0,255,136,0.6);
}

/* Leave Drawmagine modal */
.dm-leave-btn {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 10px;
  background: transparent;
  color: #667;
  border: 1px solid #333;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s;
}
.dm-leave-btn:active {
  background: #ff2040;
  border-color: #ff2040;
  color: #fff;
}

/* Visibility toggle buttons */
.btn-visibility {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 14px;
  background: transparent;
  border: 1px solid #333;
  color: #667;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s;
}
.btn-visibility.selected {
  background: linear-gradient(180deg, #00b4ff 0%, #0066cc 100%);
  color: #fff;
  border-color: #00b4ff;
  box-shadow: 0 0 10px rgba(0,180,255,0.4);
}

/* Drawmagine game over overlay */
.dm-gameover-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  background: rgba(6,6,16,0.95);
  flex-direction: column;
  gap: 16px;
}
.dm-gameover-overlay.hidden { display: none; }
.dm-gameover-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(20px, 6vw, 40px);
  color: #ffcc00;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(255,204,0,0.5);
}
.dm-gameover-scores {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: 80%;
  max-width: 300px;
}
.dm-go-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 8px 14px;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid #333;
}
.dm-go-entry:first-child {
  border-left-color: #ffcc00;
  background: rgba(255,204,0,0.06);
}
.dm-go-name {
  font-weight: 700;
  color: #ddd;
  font-size: 14px;
}
.dm-go-pts {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 16px;
  color: #ffcc00;
}
.dm-gameover-btn-wrap {
  margin-top: 16px;
}

/* Visibility row in lobby */
.visibility-select {
  margin-bottom: 10px;
}

/* dm-timer-update for Drawmagine */
.dm-timer-update {
  animation: dmTimerPop 0.3s ease;
}
@keyframes dmTimerPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* =============================================
   WHACK-WORDS
   ============================================= */

.ww-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Top Bar */
.ww-top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: rgba(0,0,0,0.6);
  border-bottom: 1px solid #222;
  flex-shrink: 0;
  z-index: 10;
}

.ww-title-display {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: clamp(11px, 2.5vw, 16px);
  color: #ff3c00;
  letter-spacing: 2px;
  white-space: nowrap;
}

.ww-story-title-display {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: clamp(10px, 2vw, 14px);
  color: #8090a0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.ww-progress {
  margin-left: auto;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(9px, 2vw, 13px);
  color: #00ff88;
  letter-spacing: 1px;
  white-space: nowrap;
}

/* Work Area */
.ww-work-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
  padding: 16px;
  padding-top: 12vh;
  overflow-y: auto;
}

/* Word Job */
.ww-word-job {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 420px;
  width: 100%;
}

.ww-job-label {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: clamp(14px, 3.5vw, 22px);
  color: #fff;
  text-align: center;
  letter-spacing: 2px;
}

.ww-job-label span {
  color: #ffcc00;
}

.ww-word-input {
  width: 100%;
  max-width: 360px;
  padding: 14px 18px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  background: #111;
  border: 2px solid #333;
  border-radius: 8px;
  color: #fff;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 3px;
  transition: border-color 0.2s;
}

.ww-word-input:focus {
  border-color: #00b4ff;
}

/* Draw Job */
.ww-draw-job {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 600px;
  flex: 1;
  min-height: 0;
}

.ww-canvas-container {
  width: 100%;
  flex: 1;
  min-height: 160px;
  max-height: 50vh;
  aspect-ratio: 4/3;
  background: #fff;
  border-radius: 8px;
  border: 2px solid #333;
  overflow: hidden;
  touch-action: none;
}

.ww-canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

/* Draw Tools */
.ww-draw-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.ww-color-picker {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.ww-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}

.ww-color-swatch:hover {
  transform: scale(1.15);
}

.ww-color-swatch.selected {
  border-color: #00b4ff;
  transform: scale(1.2);
  box-shadow: 0 0 8px rgba(0,180,255,0.5);
}

.ww-pen-sizes {
  display: flex;
  gap: 4px;
  align-items: center;
}

.ww-pen-size-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  background: #1a1a1a;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}

.ww-pen-size-btn.selected {
  border-color: #00b4ff;
  background: #1a2a3a;
}

.ww-pen-dot {
  background: #fff;
  border-radius: 50%;
}

.ww-draw-btns {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Waiting */
.ww-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 30px 20px;
}

.ww-waiting-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: clamp(12px, 3vw, 18px);
  color: #ffcc00;
  text-align: center;
  letter-spacing: 2px;
}

.ww-waiting-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.ww-waiting-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.05);
  padding: 8px 20px;
  border-radius: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #d0d0d0;
}

.ww-waiting-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===================== STORY TIME ===================== */

.ww-story-area {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.ww-story-drawing {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a12;
  min-height: 0;
  overflow: hidden;
  padding: 10px;
}

.ww-story-drawing img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  border: 2px solid #222;
}

.ww-story-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  overflow-y: auto;
  gap: 10px;
  background: rgba(0,0,0,0.4);
}

.ww-story-sentence {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(15px, 3.5vw, 22px);
  font-weight: 500;
  color: #d0d0d0;
  text-align: center;
  line-height: 1.5;
  max-width: 680px;
}

.ww-filled-word {
  color: #ffcc00;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0 3px;
}

.ww-page-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 16px;
  background: rgba(0,0,0,0.6);
  border-top: 1px solid #222;
  flex-shrink: 0;
}

#ww-page-num {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(10px, 2vw, 14px);
  color: #8090a0;
  letter-spacing: 2px;
}

#ww-next-page, #ww-end-story {
  margin-left: auto;
}

/* Leave button reuse */
#ww-leave-btn {
  /* Same style as existing btn-leave-game */
}

/* WHACK-WORDS settings panel in lobby */
#ww-settings {
  /* Same structure as pool/dm settings panels */
}
