:root {
  --bg-gradient: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #0f172a 60%, #030712 100%);
  --accent-cyan: #06b6d4;
  --accent-gold: #fbbf24;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* 3D Color Palettes */
  --btn-red-face: #ef4444;
  --btn-red-bevel: #b91c1c;
  --btn-red-shadow: #7f1d1d;

  --btn-blue-face: #3b82f6;
  --btn-blue-bevel: #1d4ed8;
  --btn-blue-shadow: #1e3a8a;

  --btn-yellow-face: #f59e0b;
  --btn-yellow-bevel: #b45309;
  --btn-yellow-shadow: #78350f;

  --btn-green-face: #10b981;
  --btn-green-bevel: #047857;
  --btn-green-shadow: #064e3b;
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  color: #f8fafc;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

#app-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 14px;
  position: relative;
}

/* Header */
.top-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  margin-bottom: 10px;
}

.brand-badge {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #f43f5e, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.player-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
}

.score-badge {
  background: #3b82f6;
  padding: 2px 10px;
  border-radius: 20px;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.screen.hidden {
  display: none !important;
}

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

.glass-card {
  background: rgba(30, 41, 59, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-align: center;
}

h1.hero-title {
  font-size: 1.9rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.hero-subtitle {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* Inputs */
.input-group {
  margin-bottom: 14px;
  text-align: left;
}

.input-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.tactile-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 1.15rem;
  font-weight: 800;
  border-radius: 14px;
  border: 2px solid #334155;
  background: #0f172a;
  color: #fff;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.tactile-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.avatar-option {
  font-size: 1.4rem;
  padding: 6px 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  cursor: pointer;
}

.avatar-option.selected {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.2);
  transform: scale(1.1);
}

/* Base 3D Button */
.btn-3d {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family);
  font-weight: 900;
  border: none;
  cursor: pointer;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.08s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.btn-3d-primary {
  width: 100%;
  padding: 16px 20px;
  font-size: 1.15rem;
  color: #ffffff;
  border-radius: 18px;
  background: linear-gradient(180deg, #ec4899 0%, #db2777 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 0 #9d174d, 0 12px 18px rgba(0, 0, 0, 0.45);
}

.btn-3d-primary:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 #9d174d, 0 4px 8px rgba(0, 0, 0, 0.35);
}

/* ========================================================
   3D SHAPED BUTTONS (TRIANGLE, DIAMOND, CIRCLE, SQUARE)
   The buttons ARE the 3D beveled shapes nearly filling the pad
   ======================================================== */
.answers-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  padding: 6px 0 12px 0;
  min-height: 0;
}

.btn-shaped {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
}

.shape-svg {
  width: 100%;
  height: 100%;
  max-width: 220px;
  max-height: 220px;
  display: block;
  transition: transform 0.08s cubic-bezier(0.4, 0, 0.2, 1), filter 0.08s ease;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
}

.btn-shaped:active .shape-svg,
.btn-shaped.pressed .shape-svg {
  transform: translateY(8px) scale(0.96);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35)) brightness(1.15);
}

.shape-label-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 16px;
  pointer-events: none;
  z-index: 5;
}

.shape-label-text {
  font-size: 1.15rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.85);
  line-height: 1.25;
  text-transform: uppercase;
  max-width: 85%;
  word-break: break-word;
}

/* Question Banner */
.question-hint-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 10px 14px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.question-num-tag {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

.phone-timer {
  font-size: 1.1rem;
  font-weight: 900;
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.15);
  padding: 2px 10px;
  border-radius: 10px;
}

/* CROWD VOTE BALLOT SCREEN (When Host triggers Crowd Vote) */
.ballot-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  flex: 1;
  overflow-y: auto;
}

.btn-ballot {
  background: rgba(30, 41, 59, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-ballot.voted {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.2);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.ballot-icon {
  font-size: 2.2rem;
}

.ballot-meta {
  flex: 1;
}

.ballot-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: #fff;
}

.ballot-tagline {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 2px;
}

/* Results Card */
.result-card {
  padding: 26px 20px;
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 16px 32px rgba(0,0,0,0.5);
}
.result-card.correct {
  background: linear-gradient(135deg, rgba(6, 95, 70, 0.85), rgba(4, 120, 87, 0.95));
  border: 2px solid #34d399;
}
.result-card.wrong {
  background: linear-gradient(135deg, rgba(153, 27, 27, 0.85), rgba(185, 28, 28, 0.95));
  border: 2px solid #f87171;
}
.result-badge { font-size: 3.5rem; margin-bottom: 6px; }
.result-points { font-size: 2.2rem; font-weight: 900; }
.rank-indicator {
  margin-top: 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 16px;
  border-radius: 20px;
  display: inline-block;
}

/* Reaction Bar */
.reaction-bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 8px;
}

.reaction-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}
.reaction-btn:active {
  transform: scale(1.4);
}

/* ========================================================
   GAME 5: 3 VERTICAL CLINICAL DOORS (MOBILE PHONE STACK)
   ======================================================== */
.doors-mobile-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  width: 100%;
  min-height: 0;
  justify-content: space-evenly;
}

.mobile-door-card {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 8px 12px;
  cursor: pointer;
  outline: none;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  text-align: left;
}

.mobile-door-card:active {
  transform: scale(0.98);
}

.mobile-door-card.selected {
  border-color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.mobile-door-card.selected .mdoor-select-badge {
  background: #fbbf24;
  color: #000;
  font-weight: 900;
}

.mdoor-perspective {
  width: 76px;
  height: 94px;
  perspective: 600px;
  position: relative;
  flex-shrink: 0;
  margin-right: 14px;
}

.mdoor-chamber {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: radial-gradient(circle at 50% 50%, #1e1b4b 0%, #090d16 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.mdoor-prize-icon {
  font-size: 1.8rem;
}

.mdoor-prize-info {
  display: none;
}

.mdoor-leaf {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid #334155;
  border-radius: 8px;
  transform-origin: left center;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6);
  z-index: 2;
}

.mdoor-leaf.opened {
  transform: rotateY(-105deg);
}

.mdoor-number {
  font-size: 0.65rem;
  font-weight: 900;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.mdoor-window {
  width: 42px;
  height: 32px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(15, 23, 42, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mdoor-cross {
  width: 14px;
  height: 14px;
  position: relative;
}
.mdoor-cross::before, .mdoor-cross::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.4);
}
.mdoor-cross::before { left: 6px; top: 0; width: 2px; height: 14px; }
.mdoor-cross::after { top: 6px; left: 0; width: 14px; height: 2px; }

.mdoor-sign {
  font-size: 0.52rem;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
}

.mdoor-handle {
  position: absolute;
  right: 5px;
  top: 52%;
  width: 4px;
  height: 14px;
  background: linear-gradient(180deg, #fef08a, #ca8a04);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.mdoor-kickplate {
  width: 90%;
  height: 6px;
  background: linear-gradient(180deg, #94a3b8, #475569);
  border-radius: 2px;
}

.mdoor-select-badge {
  font-size: 0.85rem;
  font-weight: 800;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 16px;
  border-radius: 12px;
  letter-spacing: 0.5px;
  flex: 1;
  text-align: center;
}
