/* ==========================================================================
   ❖ LUCKY HORSE v1.1 — 手機賓客端頂級婚禮奢華遙控專屬樣式 ❖
   以「婚禮主色調（深藍藏青、白紗、奶茶、湖水綠）」與「賓客穿搭建議（酒紅、灰藍、霧玫粉、薰衣草紫）」
   打造尊榮宴會級的行動端互動盛宴體驗。
   ========================================================================== */

:root {
  /* --- 婚禮主色調 Wedding Core Palette --- */
  --navy-dark: #132238;          /* 深藍色/藏青色 - 沉穩、優雅、經典 */
  --navy-card: rgba(26, 43, 76, 0.82); /* 藏青玻璃磨砂卡片 */
  --navy-light: #243b61;         /* 藏青高光 */
  
  --wedding-white: #FAF9F5;      /* 白紗 - 純淨、浪漫、永恆 */
  --off-white: #F3F0E6;          /* 柔和白紗 */
  
  --milktea: #D8C3A5;            /* 奶茶色 - 溫柔、柔和、質感 */
  --milktea-light: #EAE0CE;      /* 奶茶高光 */
  --milktea-dark: #B8A180;       /* 奶茶深邊 */
  
  --lake-green: #7AB8B1;         /* 湖水綠 - 點綴、進度條、計時器 */
  --lake-green-glow: rgba(122, 184, 177, 0.4);

  /* --- 隊伍專屬對抗色系 --- */
  /* 🔴 新郎陣營 Groom Team：酒紅色 Burgundy + 霧玫粉 Dusty Rose */
  --team-red-main: #88303C;
  --team-red-light: #C98CA7;
  --team-red-bg: linear-gradient(135deg, rgba(136, 48, 60, 0.4) 0%, rgba(26, 43, 76, 0.9) 100%);
  --team-red-border: #C98CA7;

  /* 🔵 新娘陣營 Bride Team：灰藍色 Slate Blue + 薰衣草紫 Lavender */
  --team-blue-main: #4A6B8A;
  --team-blue-light: #9B8AA4;
  --team-blue-bg: linear-gradient(135deg, rgba(74, 107, 138, 0.4) 0%, rgba(26, 43, 76, 0.9) 100%);
  --team-blue-border: #9B8AA4;

  /* --- 賓客穿搭建議進階色系 (選項 A/B/C/D) --- */
  --dusty-rose: #C98CA7;      /* 霧玫粉 - 選項 A */
  --lavender: #9B8AA4;        /* 薰衣草紫 - 選項 B */
  --sage-green: #8FAD91;      /* 鼠尾草綠 - 選項 C */
  --champagne: #DFD1BA;       /* 香檳色 - 選項 D & 勝利榮耀 */
  --terracotta: #B86B53;      /* 磚橘色 - 暈眩警告 */

  /* --- 質感陰影與玻璃光暈 --- */
  --glass-border: rgba(216, 195, 165, 0.35);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.55);
  --shadow-gold: 0 0 25px rgba(216, 195, 165, 0.3);
  --shadow-red: 0 0 25px rgba(201, 140, 167, 0.4);
  --shadow-blue: 0 0 25px rgba(155, 138, 164, 0.4);
}

.team-select-message {
  min-height: 20px;
  margin: 3px 0 5px;
  color: #315E58;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.team-choice-card.is-full {
  opacity: 0.62;
  border-color: #ef4444;
}

.team-choice-card.is-full .btn-select {
  background: #5f646b !important;
  cursor: not-allowed;
}

.team-choice-card.is-current-team {
  opacity: 1;
  outline: 3px solid #f4cc68;
  outline-offset: -3px;
}

.final-sprint-mobile {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  background: rgba(22, 26, 30, 0.96);
  color: #fffdf7;
  border-top: 10px solid #ef4444;
  border-bottom: 10px solid #f4cc68;
  font-family: 'Noto Sans TC', sans-serif;
  pointer-events: none;
}

.final-sprint-mobile.active {
  display: flex;
  animation: mobile-sprint-enter 0.25s ease-out both;
}

.final-sprint-mobile-label {
  color: #f4cc68;
  font-family: 'Noto Serif TC', serif;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 0;
}

.final-sprint-mobile strong {
  color: #fffdf7;
  font-family: 'Outfit', sans-serif;
  font-size: 72px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.final-sprint-mobile.compact {
  inset: 66px 10px auto;
  height: 48px;
  padding: 0 16px;
  flex-direction: row;
  gap: 8px;
  border: 2px solid #f4cc68;
  border-radius: 8px;
  background: #243f3a;
  box-shadow: 0 6px 18px rgba(22, 26, 30, 0.3);
  animation: none;
}

.final-sprint-mobile.compact .final-sprint-mobile-label {
  font-size: 20px;
}

.final-sprint-mobile.compact strong {
  margin-left: auto;
  color: #f4cc68;
  font-size: 28px;
}

@keyframes mobile-sprint-enter {
  from { opacity: 0; transform: scale(1.06); }
  to { opacity: 1; transform: scale(1); }
}

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

body {
  background: 
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.18) 0%, transparent 65%),
    radial-gradient(circle at 0% 0%, rgba(0,0,0,0.06) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(0,0,0,0.06) 0%, transparent 40%),
    #85D4C7;
  color: #2A2A2A;
  font-family: 'Outfit', 'Noto Sans TC', 'Inter', sans-serif;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  user-select: none;
}

/* 婚禮浪漫金沙背景紋理 */
body::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image: radial-gradient(rgba(216, 195, 165, 0.07) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
  z-index: 0;
}

#mobile-app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  z-index: 1;
}

/* ==========================================================================
   頂部狀態列
   ========================================================================== */
#mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  z-index: 10;
}
.user-profile { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: bold; font-family: 'Noto Serif TC', serif; color: #2A2A2A; }
#header-avatar { font-size: 26px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.team-badge {
  font-size: 14px;
  font-family: 'Noto Serif TC', serif;
  font-weight: bold;
  padding: 5px 14px;
  border-radius: 20px;
  background: #315E58;
  color: #FFFDF5;
  border: 2px solid #F5D06B;
  box-shadow: 0 3px 10px rgba(32, 56, 59, 0.22);
  letter-spacing: 0;
}
.team-badge.red { background: var(--team-red-main); color: #fff; border-color: var(--team-red-light); box-shadow: 0 0 10px rgba(201, 140, 167, 0.5); }
.team-badge.blue { background: var(--team-blue-main); color: #fff; border-color: var(--team-blue-light); box-shadow: 0 0 10px rgba(155, 138, 164, 0.5); }
.team-badge.yellow { background: #d97706; color: #fff; border-color: #f59e0b; box-shadow: 0 0 10px rgba(245, 158, 11, 0.5); }
.team-badge.pink {
  background: #ec4899;
  color: #fff;
}
.team-badge.purple {
  background: #8b5cf6;
  color: #fff;
}

/* ==========================================================================
   畫面切換
   ========================================================================== */
.screen {
  display: none;
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}
.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card-box {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  padding: 35px 24px;
  width: 100%;
  max-width: 440px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1), inset 0 0 20px rgba(255, 255, 255, 0.5);
  color: #2A2A2A;
}

.ornament-line {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  color: var(--milktea);
  letter-spacing: 6px;
  margin-bottom: 8px;
  opacity: 0.9;
}

.card-box h1, .card-box h2 {
  font-family: 'Noto Serif TC', serif;
  font-weight: 900;
  color: #1a4f47;
  font-size: 26px;
  margin-bottom: 12px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sub-text {
  color: #4a5568;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* 登入表單與頭像選擇 */
.form-group { text-align: left; margin-bottom: 22px; }
.form-group label { display: block; font-family: 'Noto Serif TC', serif; font-size: 15px; font-weight: bold; margin-bottom: 10px; color: #1a4f47; letter-spacing: 1px; }
.form-group input {
  width: 100%;
  padding: 15px;
  font-size: 18px;
  font-family: 'Outfit', 'Noto Sans TC', sans-serif;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.7);
  color: #2A2A2A;
  outline: none;
  transition: all 0.2s;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}
.form-group input:focus { border-color: #7AB8B1; background: rgba(255, 255, 255, 0.9); box-shadow: 0 0 15px rgba(122, 184, 177, 0.3), inset 0 2px 5px rgba(0,0,0,0.05); }
.form-group input::placeholder { color: #A0AEC0; }

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.avatar-opt {
  font-size: 28px;
  padding: 10px 4px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.avatar-opt:active { transform: scale(0.92); }
.avatar-opt.selected {
  border-color: #7AB8B1;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 15px rgba(122, 184, 177, 0.4);
  transform: scale(1.08);
}

.btn-block {
  width: 100%;
  padding: 18px;
  font-size: 20px;
  font-family: 'Noto Serif TC', serif;
  font-weight: bold;
  color: var(--navy-dark);
  border: 1px solid var(--wedding-white);
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(216, 195, 165, 0.35);
  transition: all 0.2s;
  letter-spacing: 2px;
}
.btn-block:active { transform: scale(0.97); }
.btn-gradient {
  background: linear-gradient(135deg, var(--milktea) 0%, var(--champagne) 50%, var(--milktea-dark) 100%);
}

.error-msg { color: var(--terracotta); font-size: 15px; margin-top: 15px; min-height: 20px; font-weight: bold; font-family: 'Noto Serif TC', serif; }

/* ==========================================================================
   隊伍選擇卡片 (Team Choice Cards)
   ========================================================================== */
.team-select-box {
  max-width: 480px;
  padding: 16px 13px 14px;
}

#screen-team-select.active {
  align-items: stretch;
  justify-content: flex-start;
}

#screen-team-select .team-select-box {
  flex: 0 0 auto;
  margin: 0 auto;
}

#screen-team-select {
  padding: 12px;
}

#screen-team-select .card-box h2 {
  margin-bottom: 3px;
  font-size: 22px;
}

#screen-team-select .sub-text {
  margin-bottom: 0;
  font-size: 13px;
}

.team-choice-grid { display: flex; flex-direction: column; gap: 7px; width: 100%; }
.team-choice-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 104px;
  align-items: center;
  column-gap: 9px;
  min-height: 82px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(49, 94, 88, 0.2);
  border-left: 6px solid var(--team-accent, #315E58);
  border-radius: 8px;
  padding: 7px 8px 7px 5px;
  transition: border-color 0.18s ease, background 0.18s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(32, 56, 59, 0.1);
}
.team-choice-card:hover {
  background: #FFFFFF;
  border-color: var(--team-accent, #315E58);
}
.red-choice {
  --team-accent: #B54555;
}
.blue-choice {
  --team-accent: #5D84AC;
}
.yellow-choice {
  --team-accent: #D97706;
}
.pink-choice {
  --team-accent: #DB2777;
}
.purple-choice {
  --team-accent: #7C3AED;
}
.choice-card-header {
  display: contents;
  text-align: left;
}
.choice-dog-img {
  grid-column: 1;
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(32, 56, 59, 0.2));
}

.choice-title-wrap {
  grid-column: 2;
  min-width: 0;
}
.choice-title-wrap h3 {
  font-family: 'Noto Serif TC', serif;
  font-size: 17px;
  color: #20383B;
  margin-bottom: 2px;
  line-height: 1.25;
}
.choice-title-wrap h3 small {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  color: var(--milktea);
  letter-spacing: 1px;
  opacity: 0.9;
  font-weight: 600;
}
.choice-slogan {
  overflow: hidden;
  font-size: 11px;
  color: #5A6D6B;
  font-family: 'Outfit', 'Noto Sans TC', sans-serif;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice-card-footer {
  grid-column: 3;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.member-count-tag {
  font-size: 10px;
  color: #4B5E65;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.btn-select {
  width: 100%;
  min-height: 38px;
  padding: 6px 5px;
  font-size: 12px;
  font-family: 'Noto Serif TC', serif;
  font-weight: bold;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  color: #fff;
  letter-spacing: 0;
  line-height: 1.2;
  transition: filter 0.18s;
  box-shadow: 0 2px 6px rgba(32, 56, 59, 0.2);
  cursor: pointer;
}
.bg-red { background: linear-gradient(135deg, #88303C, #B54555); border-color: #C98CA7; }
.bg-blue { background: linear-gradient(135deg, #4A6B8A, #5D84AC); border-color: #9B8AA4; }
.bg-yellow { background: linear-gradient(135deg, #D97706, #F59E0B); border-color: #F5D06B; color: #1E293B; text-shadow: 0 1px 1px rgba(255,255,255,0.4); }
.bg-pink {
  background: linear-gradient(135deg, #ec4899, #f472b6);
  color: #fff;
}
.bg-purple {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
  color: #fff;
}

/* ==========================================================================
   狂點應援控制台 (SCREEN_RACING)
   ========================================================================== */
.race-control-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 100%;
  max-width: 440px;
  padding: 10px 0;
}
.team-indicator {
  width: 100%;
  padding: 15px;
  text-align: center;
  font-size: 18px;
  font-family: 'Noto Serif TC', serif;
  background: var(--navy-card);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  color: var(--wedding-white);
  letter-spacing: 1px;
}
.team-indicator strong { font-size: 22px; color: var(--milktea-light); }

.player-live-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 10px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(19,34,56,0.76);
  overflow: hidden;
}
.player-live-stats > div { min-width: 0; padding: 9px 6px; text-align: center; border-right: 1px solid var(--glass-border); }
.player-live-stats > div:last-child { border-right: 0; }
.player-live-stats span, .player-live-stats strong { display: block; }
.player-live-stats span { color: var(--milktea); font-size: 11px; font-weight: 800; }
.player-live-stats strong { margin-top: 3px; color: var(--wedding-white); font: 900 20px/1 'Outfit', sans-serif; }

.critical-progress { width: 100%; margin-top: 8px; color: var(--off-white); font-size: 12px; font-weight: 800; }
.critical-progress > span { display: flex; justify-content: space-between; }
.critical-progress i { height: 7px; display: block; margin-top: 5px; overflow: hidden; border-radius: 4px; background: rgba(255,255,255,0.18); }
.critical-progress b { width: 0; height: 100%; display: block; border-radius: inherit; background: var(--champagne); transition: width .15s ease; }

.tap-zone {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 20px 0;
}
.giant-tap-btn {
  width: 270px;
  height: 270px;
  border-radius: 50%;
  border: 8px solid var(--milktea);
  background: radial-gradient(circle at 50% 30%, #243b61 0%, #132238 70%, #0c1524 100%);
  color: var(--wedding-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7), inset 0 0 40px rgba(216, 195, 165, 0.35), 0 0 30px rgba(216, 195, 165, 0.3);
  transition: transform 0.05s, box-shadow 0.05s, border-color 0.1s;
}
.giant-tap-btn:active {
  transform: scale(0.92);
  border-color: var(--champagne);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8), inset 0 0 60px rgba(216, 195, 165, 0.7), 0 0 50px rgba(216, 195, 165, 0.6);
}
.tap-icon { font-size: 85px; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.6)); transition: transform 0.05s; }
.giant-tap-btn:active .tap-icon { transform: scale(1.1) rotate(-5deg); }
.giant-tap-btn.critical-hit { animation: criticalPulse .62s ease; }
@keyframes criticalPulse { 45% { transform: scale(1.08); border-color: #F5D06B; box-shadow: 0 0 60px rgba(245,208,107,.9); } }
.critical-hit-feedback { position: absolute; inset: 32% 0 auto; z-index: 5; display: grid; place-items: center; pointer-events: none; animation: criticalFloat .9s ease forwards; }
.critical-hit-feedback strong { color: #F5D06B; font: 900 34px/1 'Outfit', sans-serif; text-shadow: 0 3px 12px rgba(0,0,0,.8); }
.critical-hit-feedback span { margin-top: 7px; color: #fff; font-size: 19px; font-weight: 900; }
@keyframes criticalFloat { to { transform: translateY(-60px) scale(1.12); opacity: 0; } }
.tap-label { font-family: 'Noto Serif TC', serif; font-size: 24px; font-weight: 900; color: var(--milktea-light); margin-top: 12px; line-height: 1.3; letter-spacing: 2px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }

.tap-effect { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }

.race-footer { width: 100%; text-align: center; }
.stun-alert { background: var(--terracotta); color: #fff; padding: 14px; border-radius: 14px; font-size: 16px; font-weight: bold; font-family: 'Noto Serif TC', serif; margin-bottom: 12px; box-shadow: 0 4px 15px rgba(184, 107, 83, 0.5); animation: blink 0.5s infinite alternate; }
.tap-tip { font-size: 15px; color: var(--off-white); opacity: 0.8; letter-spacing: 1px; }

/* ==========================================================================
   答題分屏控制台 (SCREEN_QUIZ - 僅選項 A/B/C/D)
   ========================================================================== */
.quiz-ctrl-box { max-width: 440px; padding: 30px 20px; }
.quiz-top h2 { font-family: 'Noto Serif TC', serif; font-size: 26px; color: var(--milktea-light); letter-spacing: 1px; }
.quiz-instruction { font-size: 16px; color: var(--wedding-white); margin: 12px 0; font-weight: bold; letter-spacing: 1px; }
.quiz-mobile-timer { font-size: 22px; font-weight: bold; font-family: 'Outfit', sans-serif; color: var(--terracotta); margin-bottom: 22px; }

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}
.opt-btn {
  padding: 28px 12px;
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  background: rgba(19, 34, 56, 0.85);
  color: var(--wedding-white);
  font-size: 20px;
  font-weight: bold;
  font-family: 'Outfit', 'Noto Serif TC', sans-serif;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}
.opt-btn:active { transform: scale(0.94); }

/* 為四個選項分別賦予賓客穿搭建議色系（霧玫粉、薰衣草紫、鼠尾草綠、香檳金） */
.opt-btn[data-opt="A"] { border-color: var(--dusty-rose); }
.opt-btn[data-opt="A"] .opt-tag { color: var(--dusty-rose); }

.opt-btn[data-opt="B"] { border-color: var(--lavender); }
.opt-btn[data-opt="B"] .opt-tag { color: var(--lavender); }

.opt-btn[data-opt="C"] { border-color: var(--sage-green); }
.opt-btn[data-opt="C"] .opt-tag { color: var(--sage-green); }

.opt-btn[data-opt="D"] { border-color: var(--champagne); }
.opt-btn[data-opt="D"] .opt-tag { color: var(--champagne); }

.opt-btn.selected {
  border-color: var(--lake-green);
  background: linear-gradient(135deg, rgba(122, 184, 177, 0.3), rgba(19, 34, 56, 0.95));
  box-shadow: 0 0 20px rgba(122, 184, 177, 0.5);
  transform: scale(1.05);
}
.opt-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.opt-tag { font-size: 36px; font-weight: 900; font-family: 'Cinzel', 'Outfit', sans-serif; }
.opt-text { font-size: 16px; color: var(--off-white); font-weight: 500; }

.lock-msg {
  background: rgba(122, 184, 177, 0.25);
  border: 1px solid var(--lake-green);
  color: var(--wedding-white);
  padding: 14px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: bold;
  font-family: 'Noto Serif TC', serif;
  box-shadow: 0 0 15px rgba(122, 184, 177, 0.3);
}
.lock-msg strong, .lock-msg span { display: block; }
.lock-msg strong { font-size: 24px; }
.lock-msg span { margin-top: 6px; font-size: 14px; }
.lock-msg.is-correct { color: #173E34; background: #9BE3C4; border-color: #55B78D; animation: answerPop .42s ease; }
.lock-msg.is-wrong { color: #fff; background: rgba(184,107,83,.88); border-color: #E6A896; animation: answerPop .42s ease; }
@keyframes answerPop { 55% { transform: scale(1.04); } }

.mobile-pause-overlay { position: fixed; inset: 0; z-index: 9999; display: none; place-items: center; padding: 24px; color: #20383B; background: rgba(158,219,208,.95); backdrop-filter: blur(10px); }
.mobile-pause-overlay.active { display: grid; }
.mobile-pause-overlay > div { width: min(390px, 100%); padding: 34px 24px; text-align: center; border: 3px solid rgba(255,255,255,.75); border-radius: 8px; background: rgba(255,255,255,.3); }
.mobile-pause-overlay small, .mobile-pause-overlay strong, .mobile-pause-overlay span { display: block; }
.mobile-pause-overlay small { color: #315E58; font-weight: 900; }
.mobile-pause-overlay strong { margin-top: 14px; font-size: 34px; }
.mobile-pause-overlay span { margin-top: 12px; color: #315E58; font-weight: 800; }

.wait-box { padding: 45px 24px; }
.screen#screen-racing { min-height: 0; overflow: hidden; padding: 36px 20px 12px; }
#screen-racing .race-control-area { display: grid; grid-template-rows: 58px 64px 32px minmax(0, 1fr) 28px; gap: 6px; min-height: 0; padding: 0; }
#screen-racing .team-indicator { height: 100%; padding: 6px 10px; font-size: 16px; line-height: 1.3; border-radius: 8px; }
#screen-racing .team-indicator strong { font-size: 18px; }
#screen-racing .player-live-stats, #screen-racing .critical-progress { margin: 0; height: 100%; }
#screen-racing .player-live-stats strong { font-size: 17px; line-height: 1.2; }
#screen-racing #my-team-progress { font-size: 15px; }
#screen-racing .tap-zone { min-height: 0; height: 100%; margin: 0; }
#screen-racing .giant-tap-btn { width: auto; max-width: 100%; height: min(100%, 260px); aspect-ratio: 1; min-height: 0; }
#screen-racing .tap-icon { font-size: 56px; }
#screen-racing .tap-label { font-size: 18px; margin-top: 4px; letter-spacing: 0; }
#screen-racing .tap-tip { font-size: 12px; line-height: 1.3; margin: 0; letter-spacing: 0; }
.wait-icon { font-size: 65px; margin-bottom: 18px; animation: float-item 2s infinite ease-in-out; }

/* Keep the header aligned with the fixed stage overlays, including long names. */
body { height: 100dvh; }
#mobile-header { flex: 0 0 64px; height: 64px; min-height: 64px; padding: 8px 12px; gap: 8px; }
.user-profile { min-width: 0; gap: 6px; }
#header-avatar { flex: 0 0 auto; }
#header-nickname { min-width: 0; overflow-wrap: anywhere; font-size: 14px; line-height: 1.3; max-height: 37px; overflow: hidden; }
.team-badge { flex: 0 0 auto; max-width: 46%; padding: 6px 8px; font-size: 12px; }
.screen { min-height: 0; }
#screen-login.active, #screen-quiz.active { justify-content: flex-start; padding: 12px; }
#screen-login .card-box, .quiz-ctrl-box { margin: auto 0; flex-shrink: 0; padding: 18px 16px; }
#screen-login h1 { font-size: 22px; line-height: 1.3; margin-bottom: 8px; }
#screen-login .sub-text { font-size: 13px; margin-bottom: 12px; }
#screen-login .form-group { margin-bottom: 12px; }
#screen-login label { margin-bottom: 6px; letter-spacing: 0; }
#screen-login input { padding: 10px; min-height: 44px; }
.avatar-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.avatar-opt { min-width: 0; height: 44px; padding: 0; font-size: 25px; }
.avatar-opt.selected { transform: none; }
#btn-join { min-height: 44px; padding: 12px 6px; font-size: 16px; letter-spacing: 0; }
#login-error { margin: 6px 0 0; font-size: 13px; }
#login-error:empty { display: none; }
.quiz-top h2 { font-size: 22px; color: #183e38; }
.quiz-instruction { font-size: 14px; line-height: 1.4; color: #244f48; letter-spacing: 0; margin: 8px 0; }
.quiz-mobile-timer { font-size: 22px; color: #9a2424; margin-bottom: 12px; }
.options-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.opt-btn { min-width: 0; min-height: 108px; padding: 10px 8px; gap: 4px; }
.opt-tag { font-size: 28px; }
.opt-text { overflow-wrap: anywhere; font-size: 16px; line-height: 1.4; }
.lock-msg { padding: 8px; }
.lock-msg strong { font-size: 20px; }
.opt-btn:disabled { opacity: 1; background: #354b52; }
.opt-btn.selected { transform: none; background: #244f48; border: 3px solid #f5d06b; box-shadow: none; }
@media (max-height: 600px) {
  #screen-login.active, #screen-quiz.active { padding: 8px; }
  #screen-login .card-box, .quiz-ctrl-box { padding: 12px; }
  #screen-login h1 { font-size: 20px; }
  #screen-login .sub-text { margin-bottom: 8px; }
  #screen-login .form-group { margin-bottom: 8px; }
  .quiz-top h2 { font-size: 20px; }
}
