* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(160deg, #1b1f2a, #0d1117);
  color: #e6e6e6;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  /* 화면(.screen)이 위, 푸터가 아래로 쌓이는 세로 배치.
     가로 flex로 두면 넓은 화면에서 푸터가 게임 옆에 나란히 붙어버린다. */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hidden { display: none !important; }

.screen {
  width: 100%;
  max-width: 1280px;
  padding: 32px;
  text-align: center;
  margin: auto; /* 남는 공간이 있을 때만 세로 중앙, 넘치면 정상 스크롤 */
  flex-shrink: 0;
}

h1 { font-size: 2.2rem; margin-bottom: 8px; }
.subtitle { color: #9aa4b2; margin-bottom: 28px; }

.lang-select {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.lang-btn {
  padding: 12px 28px;
  border-radius: 10px;
  border: 2px solid #3a4152;
  background: #1b2130;
  color: #e6e6e6;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s;
}
.lang-btn:hover { border-color: #5b8cff; }
.lang-btn.selected {
  border-color: #5b8cff;
  background: #223052;
  box-shadow: 0 0 0 2px rgba(91,140,255,0.35);
}

.primary-btn {
  padding: 14px 36px;
  font-size: 1.1rem;
  border-radius: 10px;
  border: none;
  background: #5b8cff;
  color: white;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}
.primary-btn:hover:not(:disabled) { background: #4172e0; transform: translateY(-1px); }
.primary-btn:disabled { background: #3a4152; cursor: not-allowed; opacity: 0.6; }

.arcade-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1220px;
  margin: 0 auto;
  padding: 14px 20px;
  background: #000;
  border: 2px solid #333;
  border-radius: 6px;
  font-family: "Press Start 2P", monospace;
}
.hud-block { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.hud-block-life { align-items: center; flex: 1; padding: 0 24px; }
.hud-label { font-size: 0.8rem; color: #cfd6e2; letter-spacing: 1px; }
.hud-value { font-size: 1.3rem; color: #fff; }

.life-bar {
  width: 100%;
  max-width: 300px;
  height: 20px;
  border: 2px solid #fff;
  display: flex;
  padding: 2px;
  gap: 2px;
}
.life-bar-fill {
  height: 100%;
  width: 100%;
  background: #e8342a;
  transition: width 0.25s linear, background 0.25s linear;
}

.sub-hud {
  display: flex;
  justify-content: center;
  gap: 24px;
  max-width: 1220px;
  margin: 10px auto 18px;
  font-size: 1rem;
  color: #9aa4b2;
  flex-wrap: wrap;
}
.sub-hud span span { color: #fff; font-weight: 700; }

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.18) 0px,
    rgba(0,0,0,0.18) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
  z-index: 999;
}

.game-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1220px;
  margin: 0 auto;
}

.typing-side {
  background: #161b26;
  border-radius: 14px;
  padding: 24px;
  border: 1px solid #262d3d;
}

.timer-bar-wrap {
  height: 8px;
  background: #262d3d;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}
.timer-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #5b8cff, #7ee787);
  transition: width 0.08s linear, background 0.3s;
}
.timer-bar.warning { background: linear-gradient(90deg, #ff9f43, #ffcc66); }
.timer-bar.danger { background: linear-gradient(90deg, #ff4d4d, #ff8080); }

.sentence-display {
  font-size: 1.9rem;
  line-height: 1.8;
  min-height: 120px;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
  word-break: keep-all;
}
.sentence-display .char-correct { color: #7ee787; }
.sentence-display .char-wrong { color: #ff4d4d; background: rgba(255,77,77,0.18); border-radius: 3px; }
.sentence-display .char-pending { color: #6b7280; }

/* 지금 쳐야 할 글자 한 개만 미리 파란색으로 표시 */
.sentence-display .char-current {
  color: #5b8cff;
}

.typing-input {
  width: 100%;
  padding: 18px 20px;
  font-size: 1.4rem;
  border-radius: 10px;
  border: 2px solid #2c3346;
  background: #0e131c;
  color: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.typing-input:focus { border-color: #5b8cff; }
.typing-input.shake {
  animation: shake 0.25s;
  border-color: #ff4d4d;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.time-row {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  font-family: "Press Start 2P", monospace;
}
.time-label { font-size: 0.75rem; color: #9aa4b2; }
.time-value { font-size: 1.2rem; color: #ffb454; }

.zombie-side {
  background: #161b26;
  border-radius: 14px;
  padding: 24px;
  border: 1px solid #262d3d;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.corridor {
  position: relative;
  height: 320px;
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #1a1c1e 0%, #24262a 46%, #1a1c1e 52%, #100f10 100%);
  --proximity: 0;
}

.train-ceiling {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 34%;
  background: linear-gradient(180deg, #2b2d31 0%, #1b1c1f 100%);
  box-shadow: 0 6px 14px rgba(0,0,0,0.5);
}
.train-lights {
  position: absolute;
  top: 6%;
  left: 0; right: 0;
  height: 10px;
  background: repeating-linear-gradient(90deg,
    rgba(255,226,150,0.9) 0px, rgba(255,226,150,0.9) 26px,
    transparent 26px, transparent 92px);
  filter: blur(1px);
  opacity: 0.85;
}
.train-floor {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 30%;
  background: linear-gradient(0deg, #0c0d0f 0%, #202226 100%);
}
.train-floor::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg,
    rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 2px,
    transparent 2px, transparent 64px);
}
.corridor::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg,
    rgba(0,0,0,0.35) 0px, rgba(0,0,0,0.35) 10px,
    transparent 10px, transparent 96px);
  pointer-events: none;
}

.zombie {
  position: absolute;
  bottom: 9%;
  left: 8%;
  transform: translateX(-50%) scale(1);
  transition: left 0.4s ease-in;
}

/* 좀비 시트: 4프레임, 프레임당 333x508 (비율 0.656) */
.zombie-sprite {
  width: 144px;
  height: 220px;
  background-image: url("assets/zombie_walk_sheet.png");
  background-repeat: no-repeat;
  background-size: 576px 220px; /* 4 frames * 144px */
  filter: drop-shadow(0 5px 8px rgba(0,0,0,0.55));
  animation: zombieWalkCycle 0.72s steps(4) infinite;
}
@keyframes zombieWalkCycle {
  from { background-position-x: 0; }
  to   { background-position-x: -576px; }
}

.player-figure {
  position: absolute;
  bottom: 9%;
  right: 6%;
  width: 99px;
  height: 220px;
  animation: playerIdle 1.6s ease-in-out infinite;
  z-index: 4;
}
/* 주인공 시트: 7프레임, 프레임당 207x459 (비율 0.451) */
.player-sprite {
  width: 99px;
  height: 220px;
  background-image: url("assets/player_walk_sheet.png");
  background-repeat: no-repeat;
  background-size: 693px 220px; /* 7 frames * 99px */
  background-position: -297px 0; /* resting frame */
  filter: drop-shadow(0 5px 8px rgba(0,0,0,0.55));
}
.player-sprite.hurt {
  width: 176px;
  background-image: url("assets/player_hit.png");
  background-size: 176px 220px;
  background-position: 0 0;
}
@keyframes playerIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.zombie-shadow {
  position: absolute;
  left: 50%;
  bottom: -6%;
  width: 70%;
  height: 18%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0,0,0,0.55) 0%, transparent 75%);
  animation: shadowPulse 0.85s ease-in-out infinite;
}
@keyframes shadowPulse {
  0%, 100% { transform: translateX(-50%) scaleX(1); opacity: 0.6; }
  50% { transform: translateX(-50%) scaleX(0.8); opacity: 0.4; }
}

.zombie.hit .zombie-sprite {
  animation: zombieHit 0.25s, zombieShamble 0.85s ease-in-out infinite;
}
@keyframes zombieHit {
  0% { filter: brightness(2.2) drop-shadow(0 0 14px red); }
  100% { filter: drop-shadow(0 6px 10px rgba(0,0,0,0.6)); }
}
.zombie.dying {
  animation: zombieDie 0.35s forwards;
}
@keyframes zombieDie {
  to { opacity: 0; transform: translateX(-50%) scale(0.1) rotate(25deg); }
}

.hit-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 60%, rgba(255,0,0,0.55), transparent 70%);
  opacity: 0;
  pointer-events: none;
}
.hit-flash.flash {
  animation: hitFlash 0.3s ease-out;
}
@keyframes hitFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 60px 20px rgba(0,0,0,0.55),
    inset 0 0 calc(40px + var(--proximity) * 120px) calc(10px + var(--proximity) * 40px) rgba(200,0,0,calc(var(--proximity) * 0.65));
  transition: box-shadow 0.2s linear;
}

.corridor.shake {
  animation: corridorShake 0.25s;
}
@keyframes corridorShake {
  0%, 100% { transform: translate(0,0); }
  25% { transform: translate(-4px, 2px); }
  50% { transform: translate(4px, -2px); }
  75% { transform: translate(-3px, 1px); }
}

.zombie-hint {
  text-align: center;
  color: #7a8494;
  font-size: 0.85rem;
}

#levelclear-screen, #gameover-screen, #victory-screen {
  background: #161b26;
  border-radius: 16px;
  border: 1px solid #262d3d;
  padding: 48px 32px;
}
#gameover-screen h2 { color: #ff5c5c; }
#victory-screen h2 { color: #ffd166; }

/* ---- 최종 점수 크게 강조 ---- */
.final-score {
  margin: 18px auto 26px;
  padding: 22px 32px;
  max-width: 420px;
  border-radius: 16px;
  border: 2px solid rgba(255, 92, 92, 0.35);
  background: radial-gradient(
    ellipse at center,
    rgba(255, 92, 92, 0.16) 0%,
    rgba(255, 92, 92, 0.04) 70%
  );
}
.final-score-label {
  font-size: 0.85rem;
  letter-spacing: 3px;
  color: #9aa4b5;
  margin-bottom: 6px;
}
.final-score-value {
  font-family: "Press Start 2P", monospace;
  font-size: 3.6rem;
  line-height: 1.15;
  color: #ff8a8a;
  text-shadow: 0 0 12px rgba(255, 92, 92, 0.75), 0 4px 0 rgba(0, 0, 0, 0.45);
  animation: scorePop 0.55s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

/* 승리 화면은 붉은색 대신 금색 계열로 */
.final-score--win {
  border-color: rgba(255, 209, 102, 0.4);
  background: radial-gradient(
    ellipse at center,
    rgba(255, 209, 102, 0.18) 0%,
    rgba(255, 209, 102, 0.04) 70%
  );
}
.final-score--win .final-score-value {
  color: #ffd166;
  text-shadow: 0 0 14px rgba(255, 209, 102, 0.8), 0 4px 0 rgba(0, 0, 0, 0.45);
}

@keyframes scorePop {
  0% { transform: scale(0.3); opacity: 0; }
  70% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 520px) {
  .final-score { padding: 18px 20px; }
  .final-score-value { font-size: 2.4rem; }
}

/* ---- 문장 성공 이펙트 ---- */
.burst {
  position: absolute;
  bottom: 40%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 6;
}
.burst i {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6b0 0%, #ffcf4d 55%, rgba(255,180,60,0) 70%);
  animation: burstOut 0.6s ease-out forwards;
}
@keyframes burstOut {
  0%   { transform: translate(0,0) scale(0.4); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.1); opacity: 0; }
}

.praise {
  position: absolute;
  bottom: 52%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  animation: praiseFloat 0.9s ease-out forwards;
}
.praise-word {
  font-family: "Press Start 2P", monospace;
  font-size: 1rem;
  color: #ffe36e;
  text-shadow: 2px 2px 0 #a3560a, 0 0 12px rgba(255,210,90,0.7);
}
.praise-score {
  font-family: "Press Start 2P", monospace;
  font-size: 0.75rem;
  color: #9dffb0;
  text-shadow: 2px 2px 0 #14532d;
}
@keyframes praiseFloat {
  0%   { transform: translate(-50%, 10px) scale(0.6); opacity: 0; }
  25%  { transform: translate(-50%, -6px) scale(1.15); opacity: 1; }
  40%  { transform: translate(-50%, -10px) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -46px) scale(1); opacity: 0; }
}

/* ---- 시작 카운트다운 ---- */
.countdown {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 12, 0.55);
  pointer-events: none;
}
.countdown span {
  font-family: "Press Start 2P", monospace;
  font-size: 4rem;
  color: #ffe36e;
  text-shadow: 4px 4px 0 #a3560a, 0 0 24px rgba(255, 210, 90, 0.75);
  animation: countPop 0.9s ease-out;
}
.countdown span.go {
  color: #9dffb0;
  text-shadow: 4px 4px 0 #14532d, 0 0 24px rgba(120, 255, 160, 0.75);
}
.countdown span.long {
  font-size: 1.6rem;
  max-width: 90%;
  text-align: center;
  line-height: 1.6;
  color: #ff8ae2;
  text-shadow: 3px 3px 0 #7a1a5e, 0 0 20px rgba(255, 138, 226, 0.8);
  animation: countPopLong 1.8s ease-out;
}
@keyframes countPopLong {
  0%   { transform: scale(1.4); opacity: 0; }
  15%  { transform: scale(1); opacity: 1; }
  85%  { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0; }
}
@keyframes countPop {
  0%   { transform: scale(2.2); opacity: 0; }
  25%  { transform: scale(1); opacity: 1; }
  75%  { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.7); opacity: 0; }
}

/* ---- 칭찬 문구 등급별 색상 ---- */
.praise-word--good { color: #d8dee8; text-shadow: 2px 2px 0 #3a4152, 0 0 10px rgba(216,222,232,0.5); }
.praise-word--nice { color: #7ee787; text-shadow: 2px 2px 0 #14532d, 0 0 12px rgba(126,231,135,0.6); }
.praise-word--perfect { color: #ffe36e; text-shadow: 2px 2px 0 #a3560a, 0 0 12px rgba(255,210,90,0.7); }
.praise-word--combo { color: #ff8ae2; text-shadow: 2px 2px 0 #7a1a5e, 0 0 14px rgba(255,138,226,0.75); }
.praise-word--clean { color: #7ef2ff; text-shadow: 2px 2px 0 #075464, 0 0 16px rgba(126,242,255,0.85); }

/* ---- 구글 로그인 / 프로필 ---- */
.auth-box {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  min-height: 60px;
  align-items: center;
}
.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid #3a4152;
  background: #fff;
  color: #1f1f1f;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
}
.google-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.google-g {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4285f4, #34a853 50%, #fbbc05 75%, #ea4335);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
}
.auth-hint { color: #7a8494; font-size: 0.8rem; margin-top: 8px; }

.auth-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #161b26;
  border: 1px solid #262d3d;
  border-radius: 30px;
  padding: 6px 14px 6px 6px;
}
.auth-avatar { width: 32px; height: 32px; border-radius: 50%; }
.auth-name { font-size: 0.9rem; color: #fff; }
.auth-country { font-size: 1.1rem; }
.text-btn {
  background: none;
  border: none;
  color: #9aa4b2;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.text-btn:hover { color: #fff; }

/* ---- 랭킹 ---- */
.leaderboard {
  max-width: 420px;
  margin: 28px auto 0;
  background: #161b26;
  border: 1px solid #262d3d;
  border-radius: 14px;
  padding: 16px 20px;
  text-align: left;
}
.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.leaderboard-title { font-weight: 700; color: #fff; }
.leaderboard-tabs { display: flex; gap: 6px; }
.lb-tab {
  background: #1b2130;
  border: 1px solid #3a4152;
  color: #9aa4b2;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
}
.lb-tab.selected { background: #223052; color: #fff; border-color: #5b8cff; }
.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}
.leaderboard-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #d8dee8;
  padding: 4px 0;
}
.leaderboard-list li .lb-rank { width: 20px; color: #7a8494; font-weight: 700; }
.leaderboard-list li .lb-avatar { width: 22px; height: 22px; border-radius: 50%; }
.leaderboard-list li .lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-list li .lb-score { color: #ffe36e; font-weight: 700; }
.lb-empty { color: #7a8494; font-size: 0.85rem; text-align: center; }

/* ---- 국가 선택 모달 ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal-box {
  background: #161b26;
  border: 1px solid #262d3d;
  border-radius: 16px;
  padding: 28px;
  width: 90%;
  max-width: 360px;
  text-align: center;
}
.modal-box h3 { margin: 0 0 8px; color: #fff; }
.modal-hint { color: #9aa4b2; font-size: 0.85rem; margin-bottom: 18px; }
.country-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 2px solid #2c3346;
  background: #0e131c;
  color: #fff;
  font-size: 1rem;
  margin-bottom: 16px;
}

/* ---- 애드센스 광고 슬롯 ---- */
.ad-slot {
  max-width: 1220px;
  margin: 16px auto 0;
  min-height: 90px;
  border: 1px dashed #3a4152;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4a5266;
  font-size: 0.75rem;
  letter-spacing: 2px;
}
.ad-placeholder-label {
  font-family: "Press Start 2P", monospace;
}

/* ---- 종료 화면 액션 버튼 그룹 ---- */
.end-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 4px;
}
.secondary-btn {
  padding: 14px 28px;
  font-size: 1.1rem;
  border-radius: 10px;
  border: 2px solid #3a4152;
  background: transparent;
  color: #d8dee8;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.secondary-btn:hover { border-color: #5b8cff; color: #fff; }

/* ---- 게임 화면 하단 링크 (소개/약관/문의) ---- */
.game-footer {
  flex-shrink: 0;
  width: 100%;
  max-width: 1220px;
  margin: 32px auto 0;
  padding: 20px 16px 28px;
  border-top: 1px solid #262d3d;
  text-align: center;
  font-size: 0.85rem;
}
.game-footer a {
  color: #7a8494;
  text-decoration: none;
  margin: 0 12px;
  transition: color 0.15s;
}
.game-footer a:hover { color: #5b8cff; }
.game-footer-copy {
  margin-top: 10px;
  color: #4b5563;
  font-size: 0.8rem;
}

/* ---- 첫 화면 전체 배경 (지하철 내부) ---- */
/* 첫 화면일 때만 깔리고, 게임이 시작되면 화면과 함께 사라진다 */
#start-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("assets/train_bg.png?v=2") center center / cover no-repeat;
  z-index: -2;
}
/* 글자 가독성을 위한 어둡게 덮는 층 */
#start-screen::after {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 13, 20, 0.55) 0%,
    rgba(10, 13, 20, 0.68) 45%,
    rgba(10, 13, 20, 0.88) 100%
  );
  z-index: -1;
}

/* 배경 위에서도 제목과 패널이 또렷하게 보이도록 보강 */
#start-screen h1 {
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.9);
}
#start-screen .subtitle {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}
#start-screen .leaderboard,
#start-screen .auth-box {
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* ================================================================
   첫 화면 헤드라인 / 로그인 카드 / 시작 버튼
   ================================================================ */

/* ---- 타이틀 크게 ---- */
#start-screen h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}
#start-screen .subtitle {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: #b8c2d0;
  margin-bottom: 34px;
}

/* ---- 구글 로그인을 감싸는 빈티지 카드 ---- */
/* 지하철 벽에 붙은 낡은 안내문 느낌: 누렇게 바랜 종이 + 테이프 + 얼룩 */
#start-screen .auth-box {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  margin-bottom: 34px;
}
.auth-guest {
  position: relative;
  padding: 24px 32px 20px;
  border-radius: 3px;
  border: 1px solid rgba(126, 102, 62, 0.38);
  /* 오래 묵어 어두워진 종이 톤 (배경이 어두운 지하철이라 밝은 종이는 너무 튄다) */
  background: linear-gradient(180deg, #2b2519 0%, #231e15 55%, #191510 100%);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.65),
    inset 0 0 46px rgba(0, 0, 0, 0.5);
  transform: rotate(-1.2deg);
}
/* 빛바랜 얼룩 (어두운 바탕이라 밝은 쪽으로 얹는다) */
.auth-guest::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 3px;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 12% 18%, rgba(196, 158, 96, 0.14), transparent 55%),
    radial-gradient(ellipse at 88% 84%, rgba(176, 140, 84, 0.12), transparent 58%);
}
/* 위쪽에 붙인 테이프 */
.auth-guest::after {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(-2.5deg);
  width: 92px;
  height: 24px;
  background: rgba(206, 194, 162, 0.22);
  border-left: 1px dashed rgba(255, 255, 255, 0.22);
  border-right: 1px dashed rgba(255, 255, 255, 0.22);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
/* 카드 위에서는 버튼과 안내문을 종이 톤에 맞춘다 */
.auth-guest .google-btn {
  position: relative;
  z-index: 1;
  padding: 12px 24px;
  font-size: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.auth-guest .auth-hint {
  position: relative;
  z-index: 1;
  color: #b9c1cd;
  font-size: 0.82rem;
  margin-top: 12px;
  margin-bottom: 0;
}

/* ---- 시작하기 버튼: 언어 버튼과 어울리게 키우고 색 입히기 ---- */
#start-btn {
  min-width: 240px;
  padding: 16px 44px;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 12px;
  /* 게임의 시그니처 색(타이머 바와 동일한 파랑→초록) */
  background: linear-gradient(135deg, #5b8cff 0%, #4fc3f7 45%, #7ee787 100%);
  color: #0d1b12;
  box-shadow:
    0 8px 22px rgba(91, 140, 255, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}
#start-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #6d99ff 0%, #63cdf9 45%, #92ee9a 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(91, 140, 255, 0.45);
}
#start-btn:disabled {
  background: #2c3346;
  color: #6b7280;
  box-shadow: none;
}

/* ================================================================
   타이틀 번개 효과
   7초 주기로 두 번 번쩍인다. 제목이 번쩍이는 순간 배경(::after 어둠막)도
   함께 옅어져서, 창밖에서 번개가 친 것처럼 객차 전체가 잠깐 밝아진다.
   ================================================================ */
#start-screen h1 {
  animation: titleLightning 7s infinite;
}

@keyframes titleLightning {
  /* 평상시 */
  0%, 5%, 14%, 43%, 100% {
    color: #fff;
    text-shadow: 0 3px 14px rgba(0, 0, 0, 0.9);
  }
  /* 1차 섬광 — 짧게 두 번 끊어 친다 */
  6% {
    color: #ffffff;
    text-shadow:
      0 0 10px #fff,
      0 0 26px #9fd4ff,
      0 0 52px #4fa8ff,
      0 0 90px rgba(79, 168, 255, 0.7);
  }
  8% {
    color: #cfe4ff;
    text-shadow: 0 3px 14px rgba(0, 0, 0, 0.9);
  }
  10% {
    color: #ffffff;
    text-shadow:
      0 0 14px #fff,
      0 0 34px #bfe3ff,
      0 0 68px #5bb4ff,
      0 0 120px rgba(91, 180, 255, 0.75);
  }
  /* 2차 섬광 — 조금 약하게 */
  45% {
    color: #ffffff;
    text-shadow:
      0 0 10px #fff,
      0 0 28px #a9d9ff,
      0 0 58px #4fa8ff;
  }
}

/* 번개가 칠 때 객차 안이 잠깐 밝아지는 연출 */
#start-screen::after {
  animation: coachFlash 7s infinite;
}
@keyframes coachFlash {
  0%, 5%, 14%, 43%, 100% { opacity: 1; }
  6%  { opacity: 0.55; }
  8%  { opacity: 0.95; }
  10% { opacity: 0.45; }
  45% { opacity: 0.7; }
}

/* 화면 깜빡임에 민감한 사용자를 위해 애니메이션을 끈다 */
@media (prefers-reduced-motion: reduce) {
  #start-screen h1,
  #start-screen::after {
    animation: none;
  }
}

/* ---- 음소거 버튼 ---- */
.mute-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #3a4152;
  background: rgba(22, 27, 38, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #e6e6e6;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s, background 0.15s;
}
.mute-btn:hover {
  border-color: #5b8cff;
  transform: translateY(-1px);
}
.mute-btn.muted {
  color: #7a8494;
  border-color: #2c3346;
}
