/* ==============================
   도믿맨: 퇴근길 생존기 - Styles
   ============================== */

@import url('https://cdn.jsdelivr.net/npm/galmuri@latest/dist/galmuri.css');

:root {
  --bg-dark: #1a1a2e;
  --bg-mid: #16213e;
  --bg-card: #0f3460;
  --accent: #e94560;
  --accent-glow: #ff6b81;
  --text-primary: #eaeaea;
  --text-secondary: #a0a0b0;
  --green: #4ade80;
  --yellow: #facc15;
  --red: #ef4444;
  --orange: #fb923c;
  --purple: #a78bfa;
  --karma-gold: #fbbf24;
  --btn-bg: #233554;
  --btn-hover: #2a4a6b;
  --btn-active: #1a3550;
  --dialogue-bg: #0d1b2a;
  --radius: 8px;
  --font-pixel: 'Galmuri11', 'DungGeunMo', 'Courier New', monospace;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-pixel);
  background: var(--bg-dark);
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ---- Screens ---- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 1;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  z-index: 10;
}

/* ===== START SCREEN ===== */
.start-container {
  text-align: center;
  padding: 2rem 1.5rem;
  animation: fadeSlideUp 0.8s ease;
}

.title-art {
  margin-bottom: 2rem;
}

.title-emoji {
  font-size: 4rem;
  display: block;
  margin-bottom: 0.5rem;
  animation: bounce 2s ease-in-out infinite;
}

.game-title {
  font-size: 3rem;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(233, 69, 96, 0.5), 2px 2px 0 #000;
  letter-spacing: 0.15em;
  margin-bottom: 0.25rem;
}

.game-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  font-weight: normal;
  letter-spacing: 0.3em;
}

.game-desc {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.start-menu {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.best-score-display {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--karma-gold);
  min-height: 1.2em;
}

.credits {
  margin-top: 3rem;
  font-size: 0.65rem;
  color: #555;
}

/* ===== BUTTONS ===== */
.btn-pixel {
  font-family: var(--font-pixel);
  font-size: 1rem;
  padding: 0.8rem 2.5rem;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn-pixel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: -1;
}

.btn-pixel:hover,
.btn-pixel:active {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
}

.btn-pixel:hover::after,
.btn-pixel:active::after {
  opacity: 1;
}

.btn-pixel:active {
  transform: translateY(1px);
}

/* ===== GAME SCREEN ===== */
.game-container {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

/* Location bar */
.location-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--bg-mid);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.8rem;
}

.location-icon {
  font-size: 1.1rem;
}

.location-name {
  flex: 1;
  color: var(--text-primary);
}

.stage-counter {
  color: var(--text-secondary);
  font-size: 0.75rem;
  background: rgba(255,255,255,0.05);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}

/* Scene area */
.scene-area {
  position: relative;
  background: linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-dark) 100%);
  padding: 1rem;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scene-bg {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  animation: fadeIn 0.5s ease;
}

.npc-description {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
  animation: fadeIn 0.6s ease;
}

/* Stat bars */
.stat-bars {
  padding: 0.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--bg-dark);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-label {
  font-size: 0.7rem;
  width: 70px;
  white-space: nowrap;
  color: var(--text-secondary);
}

.stat-bar-bg {
  flex: 1;
  height: 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 5px;
  background: var(--green);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.6s ease;
  position: relative;
}

.stat-bar-fill.warning {
  background: var(--yellow);
}

.stat-bar-fill.danger {
  background: var(--red);
  animation: pulse-bar 1s ease-in-out infinite;
}

.karma-fill {
  background: var(--karma-gold) !important;
}

.stat-value {
  font-size: 0.7rem;
  width: 28px;
  text-align: right;
  color: var(--text-secondary);
}

.stat-change {
  position: absolute;
  right: 8px;
  top: -18px;
  font-size: 0.75rem;
  font-weight: bold;
  animation: statPopUp 1.2s ease forwards;
  pointer-events: none;
  z-index: 20;
}

.stat-change.positive { color: var(--green); }
.stat-change.negative { color: var(--red); }

/* Clue box */
.clue-box {
  margin: 0 1rem;
  padding: 0.5rem 0.75rem;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: var(--karma-gold);
  animation: fadeIn 0.4s ease;
}

.clue-box.hidden {
  display: none;
}

/* Dialogue box */
.dialogue-box {
  flex: 1;
  margin: 0.5rem 1rem;
  padding: 1rem;
  background: var(--dialogue-bg);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  overflow-y: auto;
  min-height: 80px;
  position: relative;
}

.dialogue-text {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.dialogue-text .cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  animation: blink 0.6s step-end infinite;
  vertical-align: text-bottom;
}

/* Choices */
.choices-area {
  padding: 0.5rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.btn-choice {
  font-family: var(--font-pixel);
  font-size: 0.82rem;
  padding: 0.7rem 0.8rem;
  background: var(--btn-bg);
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}

.btn-choice:hover {
  background: var(--btn-hover);
  border-color: var(--accent);
  transform: translateX(4px);
}

.btn-choice:active {
  background: var(--btn-active);
  transform: translateX(2px);
}

.btn-choice.hidden {
  display: none;
}

.btn-choice::before {
  content: attr(data-num);
  margin-right: 0.5rem;
  color: var(--accent);
  font-weight: bold;
}

.btn-choice.animate-in {
  animation: choiceSlideIn 0.3s ease forwards;
  opacity: 0;
}

.btn-choice:nth-child(1).animate-in { animation-delay: 0.05s; }
.btn-choice:nth-child(2).animate-in { animation-delay: 0.1s; }
.btn-choice:nth-child(3).animate-in { animation-delay: 0.15s; }
.btn-choice:nth-child(4).animate-in { animation-delay: 0.2s; }

/* Result overlay */
.result-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 27, 42, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: fadeIn 0.3s ease;
}

.result-overlay.hidden {
  display: none;
}

.result-content {
  text-align: center;
  padding: 2rem 1.5rem;
  max-width: 360px;
}

.result-text {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.result-effects {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  font-size: 0.8rem;
}

.effect-item {
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
}

.effect-item.positive {
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.effect-item.negative {
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ===== END SCREEN ===== */
.end-container {
  text-align: center;
  padding: 2rem 1.5rem;
  animation: fadeSlideUp 0.6s ease;
  max-width: 400px;
  max-height: 100vh;
  overflow-y: auto;
}

.ending-emoji {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bounce 2s ease-in-out infinite;
}

.ending-title {
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  text-shadow: 0 0 15px rgba(233, 69, 96, 0.3);
}

.ending-message {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.final-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.8rem;
}

.final-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.final-stat-val {
  font-size: 1.3rem;
  font-weight: bold;
}

.final-stat-label {
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.final-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.score-value {
  font-size: 2.5rem;
  color: var(--karma-gold);
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.new-best {
  font-size: 0.9rem;
  color: var(--karma-gold);
  margin-bottom: 1.5rem;
  animation: pulse 1s ease-in-out infinite;
}

.new-best.hidden {
  display: none;
}

/* ===== AD CONTAINER ===== */
/* min-height prevents layout shift when AdSense fails to load */
.ad-container {
  margin: 1rem 0;
  min-height: 90px;
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

/* ===== SHARE CAPTURE AREA ===== */
.share-capture {
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-mid) 50%, #0f3460 100%);
  border: 1px solid rgba(233, 69, 96, 0.3);
  border-radius: 12px;
  padding: 1.5rem 1.5rem 1rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.share-capture::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-glow));
}

.share-capture-header {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-align: center;
}

.share-capture-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.share-hashtags {
  color: #555;
  font-size: 0.65rem;
}

/* ===== SHARE BUTTONS ===== */
.share-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  margin-top: 0.5rem;
}

.btn-share {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  padding: 0.55rem 0.9rem;
  background: var(--btn-bg);
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-share:hover {
  background: var(--btn-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(233, 69, 96, 0.2);
}

.btn-share:active {
  transform: translateY(1px);
  background: var(--btn-active);
}

.btn-native-share {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-native-share:hover {
  background: var(--accent-glow);
  border-color: var(--accent-glow);
}

.btn-native-share.hidden {
  display: none;
}

.share-toast {
  font-size: 0.75rem;
  color: var(--green);
  margin-bottom: 1rem;
  padding: 0.4rem 0.8rem;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: var(--radius);
  display: inline-block;
  animation: fadeIn 0.3s ease;
}

.share-toast.hidden {
  display: none;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes pulse-bar {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes choiceSlideIn {
  from { opacity: 0; transform: translateX(-15px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes statPopUp {
  0% { opacity: 1; transform: translateY(0); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-20px); }
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.shake {
  animation: shakeX 0.4s ease;
}

/* ===== AUTH AREA ===== */
.auth-area {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.auth-logged-out {
  text-align: center;
}

.auth-prompt {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.auth-buttons {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-login {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  color: #fff;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.btn-login:active {
  transform: translateY(1px);
}

.btn-login-google {
  background: #4285f4;
  border-color: #4285f4;
}

.btn-login-google:hover {
  background: #3367d6;
}

.btn-login-github {
  background: #24292e;
  border-color: #444;
}

.btn-login-github:hover {
  background: #333;
}

.btn-login-kakao {
  background: #fee500;
  border-color: #fee500;
  color: #3c1e1e;
}

.btn-login-kakao:hover {
  background: #fdd800;
}

.auth-logged-in {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-logged-in.hidden {
  display: none;
}

.auth-logged-out.hidden {
  display: none;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  object-fit: cover;
}

.user-avatar.hidden {
  display: none;
}

.user-name {
  font-size: 0.8rem;
  color: var(--text-primary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-small {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  padding: 0.3rem 0.6rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-small:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ===== LEADERBOARD SCREEN ===== */
.leaderboard-container {
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
  animation: fadeSlideUp 0.5s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 100vh;
  overflow-y: auto;
}

.leaderboard-title {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 0.8rem;
  text-shadow: 0 0 15px rgba(233, 69, 96, 0.3);
}

/* Leaderboard Tabs */
.leaderboard-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0.6rem;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  overflow: hidden;
}

.lb-tab {
  flex: 1;
  padding: 0.5rem 0.8rem;
  font-family: var(--font);
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.lb-tab:hover {
  background: rgba(255, 255, 255, 0.06);
}

.lb-tab-active {
  color: var(--accent);
  background: rgba(233, 69, 96, 0.12);
  font-weight: bold;
}

/* Leaderboard Week Info */
.leaderboard-week-info {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 0.6rem;
  opacity: 0.8;
}

.leaderboard-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1.5rem;
  min-height: 100px;
}

.leaderboard-loading,
.leaderboard-empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 2rem 0;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius);
  transition: background 0.2s ease;
}

.leaderboard-row:hover {
  background: rgba(255,255,255,0.06);
}

.leaderboard-row-me {
  background: rgba(233, 69, 96, 0.08);
  border-color: rgba(233, 69, 96, 0.25);
}

.leaderboard-row-me:hover {
  background: rgba(233, 69, 96, 0.12);
}

.lb-rank {
  width: 24px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: bold;
  flex-shrink: 0;
}

.lb-rank.rank-1 {
  color: var(--karma-gold);
  font-size: 1rem;
}

.lb-rank.rank-2 {
  color: #c0c0c0;
  font-size: 0.95rem;
}

.lb-rank.rank-3 {
  color: #cd7f32;
  font-size: 0.9rem;
}

.lb-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.lb-avatar-placeholder {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.lb-name {
  flex: 1;
  font-size: 0.78rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-ending {
  font-size: 0.9rem;
  flex-shrink: 0;
}

.lb-score {
  font-size: 0.8rem;
  color: var(--karma-gold);
  font-weight: bold;
  min-width: 40px;
  text-align: right;
  flex-shrink: 0;
}

/* ===== SECONDARY BUTTON ===== */
.btn-secondary {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 0.6rem 2rem;
}

.btn-secondary::after {
  background: var(--text-secondary);
}

.btn-secondary:hover,
.btn-secondary:active {
  color: var(--bg-dark);
  border-color: var(--text-secondary);
}

/* ===== MUTE BUTTON ===== */
.btn-mute {
  position: fixed;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 1000;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  background: rgba(22, 33, 62, 0.85);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
  padding: 0;
  line-height: 1;
}

.btn-mute:hover {
  background: rgba(35, 53, 84, 0.95);
  border-color: var(--accent);
}

.btn-mute:active {
  transform: scale(0.92);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .game-title { font-size: 2.5rem; }
  .game-subtitle { font-size: 1rem; }
  .scene-area { min-height: 100px; }
  .scene-bg { font-size: 2.5rem; }
  .dialogue-box { min-height: 60px; }
  .btn-choice { font-size: 0.78rem; padding: 0.6rem 0.7rem; }
}

@media (min-width: 481px) {
  .game-container {
    max-height: 100vh;
  }
}

/* ===== DAILY CHALLENGE ===== */
.start-buttons-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-daily {
  border-color: var(--karma-gold);
  color: var(--karma-gold);
  font-size: 1rem;
  padding: 0.8rem 2rem;
}

.btn-daily::after {
  background: var(--karma-gold);
}

.btn-daily:hover,
.btn-daily:active {
  color: var(--bg-dark);
  border-color: var(--karma-gold);
}

.daily-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  min-height: 1.4em;
}

.daily-info.hidden {
  display: none;
}

.daily-streak-badge {
  font-size: 0.75rem;
  color: var(--karma-gold);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

.daily-streak-badge.hidden {
  display: none;
}

.daily-done-badge {
  font-size: 0.75rem;
  color: var(--green);
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.25);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

.daily-done-badge.hidden {
  display: none;
}

.daily-label {
  text-align: center;
  font-size: 0.7rem;
  color: var(--bg-dark);
  background: var(--karma-gold);
  padding: 0.2rem 0;
  letter-spacing: 0.15em;
  font-weight: bold;
}

.daily-label.hidden {
  display: none;
}

/* ===== DAILY COMPLETION OVERLAY ===== */
.daily-complete-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.3s ease;
}

.daily-complete-overlay.hidden {
  display: none;
}

.daily-complete-card {
  background: var(--bg-mid);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  max-width: 320px;
  width: 90%;
  animation: fadeSlideUp 0.4s ease;
}

.daily-complete-title {
  font-size: 1.3rem;
  color: var(--karma-gold);
  margin-bottom: 1rem;
  text-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
}

.daily-complete-percentile {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.daily-complete-score {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.daily-complete-streak {
  font-size: 0.85rem;
  color: var(--karma-gold);
  margin-bottom: 1.5rem;
}

/* ===== TUTORIAL OVERLAY ===== */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-overlay.hidden {
  display: none;
}

.tutorial-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

.tutorial-card {
  position: relative;
  background: var(--bg-mid);
  border: 1px solid rgba(233, 69, 96, 0.3);
  border-radius: 12px;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  max-width: 340px;
  width: 90%;
  animation: fadeSlideUp 0.5s ease;
}

.tutorial-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-glow));
  border-radius: 12px 12px 0 0;
}

.tutorial-slide {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tutorial-slide.hidden {
  display: none;
}

.tutorial-illustration {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.tutorial-stat-demo {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 1.1rem;
}

.tutorial-text {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.tutorial-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.5rem 0 1rem;
}

.tutorial-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.3s ease, transform 0.3s ease;
}

.tutorial-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

.tutorial-btn {
  min-width: 120px;
}

/* ===== GALLERY SCREEN ===== */
.gallery-container {
  width: 100%;
  max-width: 440px;
  padding: 1.5rem;
  animation: fadeSlideUp 0.5s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 100vh;
  overflow-y: auto;
}

.gallery-title {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
  text-shadow: 0 0 15px rgba(233, 69, 96, 0.3);
}

.gallery-progress {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  width: 100%;
  margin-bottom: 1.5rem;
}

.gallery-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 1rem 0.7rem;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.gallery-card-unlocked {
  border-color: rgba(233, 69, 96, 0.2);
  background: rgba(233, 69, 96, 0.04);
}

.gallery-card-unlocked:hover {
  transform: translateY(-2px);
  border-color: rgba(233, 69, 96, 0.4);
}

.gallery-card-locked {
  border-color: rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.015);
  opacity: 0.55;
}

.gallery-card-emoji {
  font-size: 2rem;
  margin-bottom: 0.2rem;
}

.gallery-card-locked-emoji {
  filter: grayscale(1);
  opacity: 0.5;
}

.gallery-card-title {
  font-size: 0.8rem;
  color: var(--text-primary);
  font-weight: bold;
}

.gallery-card-locked .gallery-card-title {
  color: var(--text-secondary);
}

.gallery-card-desc {
  font-size: 0.65rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.gallery-card-locked .gallery-card-desc {
  font-style: italic;
  color: #555;
}

/* ===== ENDING UNLOCK TOAST ===== */
.ending-unlock-toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  background: rgba(233, 69, 96, 0.95);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 20px rgba(233, 69, 96, 0.4);
  animation: fadeSlideDown 0.4s ease;
  white-space: nowrap;
}

.ending-unlock-toast.hidden {
  display: none;
}

.unlock-icon {
  font-size: 1.1rem;
}

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== SUB BUTTONS ROW ===== */
.start-buttons-row-sub {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .gallery-card {
    min-height: 120px;
    padding: 0.7rem 0.5rem;
  }
  .gallery-card-emoji {
    font-size: 1.6rem;
  }
}

/* ===== TOSS DONATION BUTTON ===== */
.btn-toss {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  padding: 0.4rem 1rem;
  margin: 0.6rem auto 0.2rem;
  background: transparent;
  color: #0064FF;
  border: 1px solid rgba(0, 100, 255, 0.3);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  opacity: 0.75;
}

.btn-toss:hover {
  background: rgba(0, 100, 255, 0.08);
  border-color: #0064FF;
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 100, 255, 0.15);
}

.btn-toss:active {
  transform: translateY(1px);
  opacity: 1;
}

/* ===== STREAK REWARD POPUP ===== */
.streak-reward-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 250;
  animation: fadeIn 0.3s ease;
}

.streak-reward-overlay.hidden {
  display: none;
}

.streak-reward-card {
  background: var(--bg-mid);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  max-width: 300px;
  width: 85%;
  animation: fadeSlideUp 0.5s ease;
}

.streak-reward-emoji {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  animation: bounce 2s ease-in-out infinite;
}

.streak-reward-title {
  font-size: 1.1rem;
  color: var(--karma-gold);
  margin-bottom: 0.75rem;
  text-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
}

.streak-reward-name {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding: 0.5rem 1rem;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--radius);
  display: inline-block;
}

/* ===== ENDING-SPECIFIC SHARE CARD COLORS ===== */
.share-capture.ending-victory {
  border-color: rgba(74, 222, 128, 0.4);
}
.share-capture.ending-victory::before {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.share-capture.ending-bad_mental {
  border-color: rgba(167, 139, 250, 0.4);
}
.share-capture.ending-bad_mental::before {
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.share-capture.ending-bad_social {
  border-color: rgba(156, 163, 175, 0.4);
}
.share-capture.ending-bad_social::before {
  background: linear-gradient(90deg, #6b7280, #9ca3af);
}

.share-capture.ending-cold {
  border-color: rgba(125, 211, 252, 0.4);
}
.share-capture.ending-cold::before {
  background: linear-gradient(90deg, #0ea5e9, #7dd3fc);
}

.share-capture.ending-perfect {
  border-color: rgba(251, 191, 36, 0.5);
}
.share-capture.ending-perfect::before {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.share-capture.ending-reverse_master {
  border-color: rgba(239, 68, 68, 0.4);
}
.share-capture.ending-reverse_master::before {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

.share-capture.ending-ghost {
  border-color: rgba(255, 255, 255, 0.15);
}
.share-capture.ending-ghost::before {
  background: linear-gradient(90deg, rgba(255,255,255,0.4), rgba(255,255,255,0.15));
}

.share-capture.ending-social_butterfly {
  border-color: rgba(244, 114, 182, 0.4);
}
.share-capture.ending-social_butterfly::before {
  background: linear-gradient(90deg, #ec4899, #f472b6);
}

/* Share capture tagline */
.share-capture-tagline {
  font-size: 0.68rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}

/* ===== AD REWARD BUTTON (in result overlay) ===== */
.btn-ad-reward {
  display: block;
  width: 100%;
  margin-bottom: 0.6rem;
  border-color: var(--green);
  color: var(--green);
  font-size: 0.85rem;
  padding: 0.65rem 1.5rem;
  animation: fadeSlideUp 0.4s ease;
}

.btn-ad-reward::after {
  background: var(--green);
}

.btn-ad-reward:hover,
.btn-ad-reward:active {
  color: var(--bg-dark);
  border-color: var(--green);
}

/* ===== AD REWARD MODAL ===== */
.ad-reward-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-reward-modal.hidden {
  display: none;
}

.ad-reward-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
}

.ad-reward-card {
  position: relative;
  background: var(--bg-mid);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 12px;
  padding: 1.8rem 1.5rem 1.5rem;
  text-align: center;
  max-width: 340px;
  width: 90%;
  animation: fadeSlideUp 0.4s ease;
}

.ad-reward-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), #86efac);
  border-radius: 12px 12px 0 0;
}

.ad-reward-title {
  font-size: 1.2rem;
  color: var(--green);
  margin-bottom: 0.6rem;
  text-shadow: 0 0 15px rgba(74, 222, 128, 0.3);
}

.ad-reward-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.ad-reward-timer {
  font-size: 0.9rem;
  color: var(--karma-gold);
  margin-bottom: 1rem;
  padding: 0.4rem 0.8rem;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--radius);
  display: inline-block;
}

/* Reward ad progress bar */
.ad-reward-progress-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.ad-reward-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--karma-gold), #fde68a);
  border-radius: 4px;
  transition: width 0.3s linear;
}

.ad-reward-ad-container {
  margin: 0.8rem 0 1.2rem;
  min-height: 100px;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.ad-reward-claim-btn {
  width: 100%;
  margin-bottom: 0.5rem;
}

.ad-reward-claim-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.ad-reward-claim-btn.active {
  animation: claimPulse 1.2s ease-in-out infinite;
}

@keyframes claimPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  50% { box-shadow: 0 0 12px 4px rgba(74, 222, 128, 0.3); }
}

.ad-reward-close-btn {
  width: 100%;
  font-size: 0.8rem;
  padding: 0.5rem 1.5rem;
}
