:root {
  --bg-dark: #0a0e17;
  --card-bg: rgba(18, 24, 38, 0.88);
  --card-border: rgba(99, 102, 241, 0.22);
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-indigo: #6366f1;
  --v-color: #10b981;
  --v-glow: rgba(16, 185, 129, 0.4);
  --x-color: #f59e0b;
  --x-glow: rgba(245, 158, 11, 0.4);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --font-display: 'Chakra Petch', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Background animated stars / subtle grid */
.stars-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  background: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.15), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.12), transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.08), transparent 60%);
  z-index: 0;
}

/* Header */
.app-header {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 14, 23, 0.75);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-icon {
  width: 38px;
  height: 38px;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 182, 212, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.logo-icon svg {
  width: 24px;
  height: 24px;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #38bdf8, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.9rem;
}

.user-avatar {
  font-size: 1rem;
}

.user-name {
  font-weight: 600;
  color: #c7d2fe;
}

.logout-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  margin-left: 0.4rem;
  text-decoration: underline;
}

.logout-link:hover {
  color: #f87171;
}

/* Main Container */
.main-container {
  position: relative;
  z-index: 5;
  flex: 1;
  max-width: 1050px;
  width: 100%;
  margin: 1.5rem auto;
  padding: 0 1rem 2rem 1rem;
  display: flex;
  flex-direction: column;
}

/* Cards & Screens */
.screen-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  animation: fadeIn 0.3s ease-out;
}

.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Auth Screen */
.auth-header {
  text-align: center;
  margin-bottom: 1.8rem;
}

.glitch-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 3px;
  background: linear-gradient(135deg, #38bdf8, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.auth-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 480px;
  margin: 0 auto;
}

.tab-control {
  display: flex;
  max-width: 380px;
  margin: 0 auto 1.5rem auto;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tab-btn {
  flex: 1;
  padding: 0.6rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.tab-btn.active {
  background: rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.auth-form {
  max-width: 380px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.alert-box {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
}

.alert-box.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.alert-box.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

/* Buttons */
.primary-btn {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all 0.2s;
}

.primary-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-1px);
}

.glow-btn {
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.primary-btn:disabled, .primary-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-arrow {
  width: 18px;
  height: 18px;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.rules-summary {
  max-width: 540px;
  margin: 2.5rem auto 0 auto;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.rules-summary h4 {
  color: var(--text-primary);
  margin-bottom: 0.6rem;
  font-family: var(--font-display);
  letter-spacing: 1px;
}

.rules-summary ul {
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rules-summary code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: #38bdf8;
  font-family: monospace;
}

/* Visual Badges for V and X */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.badge-v {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.35));
  border: 1px solid var(--v-color);
  color: #34d399;
  box-shadow: 0 0 14px var(--v-glow);
}

.badge-x {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.35));
  border: 1px solid var(--x-color);
  color: #fbbf24;
  box-shadow: 0 0 14px var(--x-glow);
}

.badge-none {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--text-muted);
}

.badge-icon {
  font-size: 0.95rem;
}

.icon-v, .icon-x {
  width: 15px;
  height: 15px;
}

.badge-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

/* Lobby Screen */
.lobby-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .lobby-grid {
    grid-template-columns: 1fr;
  }
}

.lobby-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 1.5rem;
}

.stats-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.avatar-large {
  font-size: 2.2rem;
  background: rgba(99, 102, 241, 0.15);
  padding: 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.tag {
  display: inline-block;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.85rem 0.5rem;
  text-align: center;
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: #e0e7ff;
}

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

.match-modes-card h3, .leaderboard-card h3 {
  font-family: var(--font-display);
  letter-spacing: 1px;
  margin-bottom: 1.1rem;
  color: #e2e8f0;
}

.modes-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateX(4px);
}

.mode-icon {
  font-size: 1.6rem;
}

.mode-info strong {
  display: block;
  font-size: 0.95rem;
}

.mode-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.join-room-box {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.join-room-box input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.leaderboard-table {
  max-height: 220px;
  overflow-y: auto;
}

.table-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 1.5rem;
}

.leader-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
}

.leader-rank {
  font-family: var(--font-display);
  font-weight: 700;
  width: 25px;
  color: var(--accent-cyan);
}

.leader-name {
  flex: 1;
  font-weight: 600;
}

.leader-score {
  font-family: var(--font-display);
  color: #a78bfa;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  background: #111827;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 16px;
  padding: 2.2rem;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  animation: modalPop 0.25s ease-out;
}

@keyframes modalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.pulse-radar {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.5rem auto;
  border-radius: 50%;
  border: 3px solid var(--accent-cyan);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
  animation: pulseRadar 1.5s infinite;
}

@keyframes pulseRadar {
  0% { transform: scale(0.85); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0.5; }
}

.cancel-btn {
  margin-top: 1.5rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
}

/* Secret Selection Screen */
.card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.room-pill {
  display: inline-block;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 4px 12px;
  border-radius: 20px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 1px;
  margin-bottom: 0.8rem;
}

.card-header h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.secret-selector {
  max-width: 380px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Digit Slots */
.digit-display, .guess-display {
  display: flex;
  gap: 0.8rem;
}

.digit-slot, .guess-slot {
  width: 62px;
  height: 72px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: #e0e7ff;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: all 0.2s;
}

.digit-slot.active, .guess-slot.active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.validation-msg {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Keypad */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  width: 100%;
}

.key-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.9rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}

.key-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.04);
}

.key-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.key-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  border-color: transparent;
}

.action-key {
  font-size: 0.95rem;
  font-family: var(--font-body);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.submit-key {
  font-size: 1rem;
  background: linear-gradient(135deg, #059669, #10b981);
  color: white;
  border-color: #34d399;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.35);
}

.submit-key:hover:not(:disabled) {
  background: linear-gradient(135deg, #047857, #059669);
}

.wait-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 1.2rem;
  border-radius: 12px;
  margin-top: 1.5rem;
  color: #c7d2fe;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Battle Arena */
.arena-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.2rem;
}

.player-tag {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.opponent .avatar-circle {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.4);
}

.name-box span {
  display: block;
}

.secret-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.secret-hint strong {
  color: #38bdf8;
  font-family: var(--font-display);
  letter-spacing: 2px;
}

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

.room-badge {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.turn-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 0.3rem;
}

.turn-banner.your-turn {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--v-color);
  color: #34d399;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.35);
}

.turn-banner.opp-turn {
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid #f43f5e;
  color: #fb7185;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulseDot 1s infinite alternate;
}

@keyframes pulseDot {
  from { opacity: 0.3; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.3); }
}

/* Feedback Legend */
.feedback-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 0.75rem 1.2rem;
  margin-bottom: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.legend-item.note {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Dual History Boards */
.arena-boards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .arena-boards {
    grid-template-columns: 1fr;
  }
}

.board-column {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.1rem;
}

.board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.board-header h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.5px;
}

.board-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.history-table-container {
  max-height: 240px;
  overflow-y: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.history-table th {
  text-align: left;
  padding: 0.5rem 0.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.history-table td {
  padding: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.guess-digits {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #f1f5f9;
}

.empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
  font-size: 0.85rem;
}

/* Guess Input Section in Arena */
.guess-input-section {
  max-width: 380px;
  margin: 0 auto 1.2rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}

.arena-keypad .key-btn {
  padding: 0.75rem;
  font-size: 1.25rem;
}

/* Quick Emojis & Footer */
.arena-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.quick-emojis {
  display: flex;
  gap: 0.5rem;
}

.emoji-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 1.2rem;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  transition: transform 0.15s;
}

.emoji-btn:hover {
  transform: scale(1.15);
}

.chat-bubble {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
  font-size: 0.88rem;
  color: #e0e7ff;
  animation: fadeIn 0.2s;
}

.leave-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
}

.leave-btn:hover {
  color: #f87171;
}

/* Victory / Game Over Modal */
.result-icon {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  animation: bounce 0.8s ease infinite alternate;
}

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

#gameOverTitle {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 0.3rem;
}

#gameOverSubtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.secrets-reveal-box {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}

.reveal-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
}

.reveal-item .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.code-box {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 3px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 12px;
  border-radius: 8px;
}

.code-box.highlight {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--v-color);
  color: #34d399;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.rematch-status-msg {
  font-size: 0.85rem;
  color: var(--accent-cyan);
  margin-top: 0.8rem;
}

