:root {
  --bg-deep: #0a0e17;
  --bg-card: #121a2b;
  --bg-elevated: #1a2438;
  --border: rgba(255, 255, 255, 0.08);
  --text: #eef2ff;
  --text-muted: #8b95a8;
  --text-secondary: #c5cede;
  --surface: #1a2438;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --gold: #fbbf24;
  --gold-dim: rgba(251, 191, 36, 0.15);
  --win: #34d399;
  --lose: #f87171;
  --draw: #94a3b8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --font: 'Outfit', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(251, 191, 36, 0.08), transparent);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding-bottom: 88px;
}

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 14, 23, 0.85);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-icon {
  font-size: 1.5rem;
}

.brand-name {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.wallet {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}

.wallet-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.wallet-amount {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--gold);
}

/* Main content */
#screen-container {
  flex: 1;
  padding: 1.25rem;
}

.screen {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.screen-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Game cards grid */
.game-grid {
  display: grid;
  gap: 0.85rem;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
}

.game-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 24px var(--accent-glow);
}

.game-card:active {
  transform: translateY(0);
}

.game-card-icon {
  font-size: 2rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.game-card-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.game-card-info p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.game-card-tag {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--gold-dim);
  color: var(--gold);
  flex-shrink: 0;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.5rem;
  text-align: center;
}

.stat-value {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.15rem;
  display: block;
}

.stat-value.win { color: var(--win); }
.stat-value.lose { color: var(--lose); }

.stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}

/* Bet setup */
.bet-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.bet-panel h3 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.form-select {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.4;
  color-scheme: dark;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-select option {
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 500;
}

.bet-amount-display {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  margin-bottom: 1rem;
}

.bet-slider {
  width: 100%;
  accent-color: var(--accent);
  margin-bottom: 0.75rem;
}

.bet-quick-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.bet-quick-btns button {
  flex: 1;
  min-width: calc(50% - 0.25rem);
  padding: 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.bet-quick-btns button:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  width: 100%;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #818cf8);
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 28px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.15);
  color: var(--lose);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1rem;
}

/* Match screen */
.match-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.vs-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
  margin-bottom: 0.75rem;
}

.player-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.player-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border: 2px solid var(--border);
}

.player-chip.you .player-avatar {
  border-color: var(--accent);
}

.player-name {
  font-size: 0.75rem;
  font-weight: 600;
  max-width: 5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vs-text {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pot-display {
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--gold);
  font-weight: 600;
}

/* Matchmaking */
.matchmaking {
  text-align: center;
  padding: 3rem 1rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.matchmaking p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.matchmaking .opponent-found {
  color: var(--win);
  font-weight: 600;
  animation: pulse 0.5s ease;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Game arena */
.arena {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.arena-prompt {
  font-size: 1.05rem;
  font-weight: 600;
}

.arena-timer {
  font-family: var(--mono);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
}

.choice-grid {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: center;
}

.choice-btn {
  width: 4.5rem;
  height: 4.5rem;
  border: 2px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 2rem;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.choice-btn:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

.choice-btn.selected {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.2);
  box-shadow: 0 0 20px var(--accent-glow);
}

.choice-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.reveal-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  width: 100%;
}

.reveal-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.reveal-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.reveal-value {
  font-size: 3rem;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.reveal-vs {
  font-weight: 800;
  color: var(--text-muted);
  font-size: 1.25rem;
}

/* Result overlay */
.result-banner {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1.25rem;
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.result-banner.win {
  background: rgba(52, 211, 153, 0.15);
  color: var(--win);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.result-banner.lose {
  background: rgba(248, 113, 113, 0.15);
  color: var(--lose);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.result-banner.draw {
  background: rgba(148, 163, 184, 0.15);
  color: var(--draw);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.result-payout {
  font-family: var(--mono);
  font-size: 0.9rem;
  margin-top: 0.35rem;
  opacity: 0.85;
}

/* Golf round complete */
.golf-complete {
  padding: 0.5rem 0 1rem;
  animation: fadeIn 0.45s ease;
}

.golf-complete-header {
  text-align: center;
  margin-bottom: 1rem;
}

.golf-complete-icon {
  font-size: 2.25rem;
  display: block;
  margin-bottom: 0.35rem;
}

.golf-complete-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
}

.golf-complete-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.golf-complete-total {
  margin-bottom: 1rem;
}

.golf-scorecard-wrap {
  overflow-x: auto;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.golf-scorecard {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.golf-scorecard th,
.golf-scorecard td {
  padding: 0.55rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.golf-scorecard th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.15);
}

.golf-scorecard tbody tr:last-child td {
  border-bottom: none;
}

.golf-scorecard tfoot td {
  font-weight: 700;
  border-bottom: none;
  border-top: 1px solid var(--border);
  background: rgba(251, 191, 36, 0.06);
}

.golf-scorecard-diff {
  font-family: var(--mono);
  font-weight: 600;
}

.golf-scorecard-diff.under { color: var(--win); }
.golf-scorecard-diff.even { color: var(--draw); }
.golf-scorecard-diff.over { color: var(--lose); }

.golf-complete-actions {
  margin-top: 0.5rem;
}

.golf-hud-turn {
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--gold);
  margin: 0.35rem 0 0.15rem;
}

.golf-scorecard-mp th:nth-child(4),
.golf-scorecard-mp th:nth-child(5),
.golf-scorecard-mp td:nth-child(4),
.golf-scorecard-mp td:nth-child(5) {
  text-align: center;
}

/* History */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.history-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.history-details {
  flex: 1;
  min-width: 0;
}

.history-details h4 {
  font-size: 0.9rem;
  font-weight: 600;
}

.history-details p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.history-result {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.history-result.win { color: var(--win); }
.history-result.lose { color: var(--lose); }
.history-result.draw { color: var(--draw); }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

/* Profile */
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.profile-avatar {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 0.75rem;
  border: 3px solid var(--border);
}

.profile-name {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.profile-rank {
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  text-align: center;
}

.profile-stat {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.profile-stat .stat-value {
  font-size: 1.25rem;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: rgba(10, 14, 23, 0.98);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
  padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom));
  z-index: 9999;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.65rem 0.5rem;
  min-height: 56px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  position: relative;
  z-index: 1;
}

.nav-btn .nav-icon,
.nav-btn .nav-label {
  pointer-events: none;
}

.nav-btn .nav-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.bottom-nav.hidden {
  display: none !important;
}

.nav-btn.active {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

.nav-btn:hover:not(.active) {
  color: var(--text);
}

/* Toast */
.toast-container {
  position: fixed;
  top: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: calc(100% - 2rem);
  max-width: 420px;
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-8px); }
}

/* Reaction game */
.reaction-target {
  width: 100%;
  max-width: 280px;
  height: 120px;
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
  user-select: none;
}

.reaction-target.waiting {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--lose);
}

.reaction-target.ready {
  background: rgba(52, 211, 153, 0.2);
  border-color: var(--win);
  color: var(--win);
  animation: pulse 0.6s ease infinite;
}

.reaction-target.too-soon {
  background: rgba(248, 113, 113, 0.2);
  border-color: var(--lose);
  color: var(--lose);
}

.number-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

.number-input-row input {
  width: 5rem;
  padding: 0.65rem;
  font-family: var(--mono);
  font-size: 1.5rem;
  text-align: center;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.number-input-row input:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-input-row input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  font-family: var(--font);
  font-size: 1rem;
  text-align: left;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.auth-input-row input:focus {
  outline: none;
  border-color: var(--accent);
}

.hidden { display: none !important; }

/* Pool */
.pool-canvas-wrap {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 0 0 4px #5c3a1a;
}

#pool-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.pool-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}

.pool-hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 4.5rem;
}

.pool-timer-wrap {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pool-timer-wrap.hidden {
  visibility: hidden;
}

.pool-timer-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(#3d9fe6 360deg, rgba(255, 255, 255, 0.1) 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
}

.pool-timer-num {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}

.pool-timer-urgent .pool-timer-num {
  color: #ef4444;
  animation: pool-timer-pulse 0.6s ease-in-out infinite alternate;
}

@keyframes pool-timer-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.12); }
}

.pool-hud-score {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--gold);
}

.pool-hud-turn {
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.68rem;
}

.pool-hint {
  font-size: 0.82rem !important;
  margin-bottom: 0.65rem !important;
}

.pool-controls {
  margin-top: 0.75rem;
  margin-bottom: 0;
  width: 100%;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}

.pool-foul {
  color: var(--lose);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.5rem;
  text-align: center;
}

.pool-table {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 2 / 1;
  background: linear-gradient(145deg, #1a5c3a, #0d3d24);
  border: 4px solid #5c3a1a;
  border-radius: 8px;
  position: relative;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4);
  margin: 0 auto;
}

.pool-pocket {
  position: absolute;
  width: 14%;
  aspect-ratio: 1;
  background: #111;
  border-radius: 50%;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
}

.pool-pocket.tl { top: -3%; left: -2%; }
.pool-pocket.tr { top: -3%; right: -2%; }
.pool-pocket.bl { bottom: -3%; left: -2%; }
.pool-pocket.br { bottom: -3%; right: -2%; }
.pool-pocket.mid { top: 50%; right: -3%; transform: translateY(-50%); }

.pool-ball {
  position: absolute;
  font-size: 1.1rem;
  transition: transform 0.6s ease, opacity 0.4s;
}

.pool-ball.cue { bottom: 20%; left: 15%; }
.pool-ball.potted { opacity: 0; transform: scale(0); }

.aim-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.75rem;
}

.aim-btn {
  padding: 0.5rem 1rem;
  border: 2px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  transition: border-color 0.15s, background 0.15s;
}

.aim-btn.selected {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.2);
}

.aim-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Darts */
.dart-canvas-wrap {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, #1a1210 0%, #0a0605 100%);
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.5),
    inset 0 0 0 2px rgba(251, 191, 36, 0.15),
    inset 0 0 24px rgba(0, 0, 0, 0.35);
}

#dart-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.dart-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}

.dart-hud-score {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--gold);
}

.dart-hud-turn {
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.65rem;
  text-align: center;
}

.dart-hint {
  font-size: 0.82rem !important;
  margin-bottom: 0.5rem !important;
}

.dart-board {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, #f87171 8%, #1a2438 8%, #1a2438 25%, #34d399 25%, #34d399 45%, #6366f1 45%, #6366f1 70%, #fbbf24 70%);
  border: 4px solid #5c3a1a;
  margin: 0 auto;
  position: relative;
  box-shadow: var(--shadow);
}

.dart-board::after {
  content: '🎯';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.dart-meter-wrap {
  width: 100%;
  max-width: 280px;
  height: 28px;
  background: var(--bg-elevated);
  border-radius: 999px;
  border: 2px solid var(--border);
  position: relative;
  overflow: hidden;
  margin: 0.75rem auto;
}

.dart-meter-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(52, 211, 153, 0.35);
  border-left: 1px solid var(--win);
  border-right: 1px solid var(--win);
}

.dart-meter-cursor {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 4px;
  background: var(--gold);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--gold);
  transition: left 0.05s linear;
}

.dart-throw-info {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Mini golf */
.golf-canvas-wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), 0 0 0 3px #3d6e30, 0 0 0 5px #2a4d20;
}

#golf-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.golf-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}

.golf-hud-score {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--gold);
}

.golf-hud-hole {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.golf-hole-name {
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.golf-hint {
  font-size: 0.82rem !important;
  margin-bottom: 0.5rem !important;
}

.golf-strokes {
  text-align: center;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.golf-target {
  text-align: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.golf-hole {
  width: 100%;
  max-width: 280px;
  height: 80px;
  background: linear-gradient(90deg, #1a5c3a 0%, #228b52 60%, #0d3d24 100%);
  border-radius: var(--radius-sm);
  position: relative;
  margin: 0 auto;
  border: 2px solid #5c3a1a;
}

.golf-ball {
  position: absolute;
  left: 8%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  transition: left 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.golf-flag {
  position: absolute;
  right: 8%;
  top: 30%;
  font-size: 1.5rem;
}

.golf-power-bar {
  width: 100%;
  max-width: 320px;
  height: 24px;
  background: var(--bg-elevated);
  border-radius: 999px;
  border: 2px solid var(--border);
  margin: 0.75rem auto 0;
  overflow: hidden;
}

.golf-power-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--win), var(--gold));
  border-radius: 999px;
  transition: none;
}

/* Basketball */
.basket-court {
  width: 100%;
  max-width: 260px;
  height: 140px;
  background: linear-gradient(180deg, #7c2d12 0%, #9a3412 100%);
  border-radius: var(--radius-sm);
  border: 2px solid #431407;
  position: relative;
  margin: 0 auto;
}

.basket-hoop {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
}

.basket-timing-bar {
  width: 100%;
  max-width: 260px;
  height: 32px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  position: relative;
  margin: 0.75rem auto 0;
  overflow: hidden;
}

.basket-sweet-spot {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(52, 211, 153, 0.4);
  border-left: 2px solid var(--win);
  border-right: 2px solid var(--win);
}

.basket-marker {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 6px;
  background: var(--gold);
  border-radius: 3px;
  box-shadow: 0 0 10px var(--gold);
}

.score-compare {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.score-box {
  text-align: center;
}

.score-box .score-num {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
}

.score-box .score-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

@media (min-width: 481px) {
  #app {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}
