/* Running From Responsibilities — Pixel site UI */

:root {
  --navy: #0c1445;
  --navy-mid: #141e52;
  --navy-panel: #101840;
  --pink: #ff1493;
  --pink-dark: #c4106e;
  --yellow: #ffd700;
  --green: #00c853;
  --green-dark: #009624;
  --purple: #7b2cbf;
  --purple-dark: #5a189a;
  --blue: #2196f3;
  --cyan: #4ecdc4;
  --text: #f0f0ff;
  --site-header-offset: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  overflow-x: hidden;
  overflow-y: auto;
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 18px;
  background: var(--navy);
  color: var(--text);
  touch-action: manipulation;
  user-select: none;
}
body.playing { overflow: hidden; }

#game-container { position: fixed; inset: 0; z-index: 0; }
#game-container canvas { display: block; width: 100%; height: 100%; }

/* ── Site header ── */
#site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px;
  background: var(--navy-mid);
  border-bottom: 4px solid #000;
  box-shadow: 0 4px 0 rgba(0,0,0,0.4);
  min-height: 56px;
}
.header-left { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-lives { display: flex; gap: 5px; }

.site-nav-menu {
  display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; flex: 1;
}
.nav-link {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem; color: #8899cc; text-decoration: none;
  letter-spacing: 0.04em; padding: 4px 2px;
  transition: color 0.15s;
}
.nav-link:hover, .nav-link.active { color: var(--yellow); }

#header-play-btn { flex-shrink: 0; }
#header-home-btn { flex-shrink: 0; font-size: 0.45rem; padding: 8px 12px; }

.header-game-stats {
  display: flex; align-items: center; justify-content: flex-end;
  flex: 1; gap: 10px; padding: 0 4px;
  font-family: 'Press Start 2P', monospace; font-size: 0.45rem;
}
.header-stat-group { display: flex; align-items: center; gap: 10px; }
.header-stat .stat-label { font-size: 0.32rem; opacity: 0.85; margin-left: 2px; }
#site-header.in-game .header-score-wrap { display: flex !important; }
.header-score-wrap.hidden { display: none !important; }
.header-game-stats.hidden { display: none !important; }
#site-header.in-game .site-nav-menu { display: none; }
#site-header.in-game #header-play-btn { display: none; }
#site-header.in-game .btn-audio { display: inline-flex; }
#site-header:not(.in-game) .btn-audio { display: inline-flex; }
#site-header:not(.in-game) .header-game-stats { display: none !important; }

@media (max-width: 820px) {
  #site-header:not(.in-game) {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-areas:
      ". audio play"
      "nav nav nav";
    align-items: center;
    gap: 6px 8px;
    padding: 8px 10px 6px;
  }
  #site-header:not(.in-game) .header-left { display: none; }
  #site-header:not(.in-game) .site-nav-menu {
    grid-area: nav;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    overflow-x: auto;
    padding: 6px 2px 2px;
    border-top: 2px solid rgba(0, 0, 0, 0.35);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #site-header:not(.in-game) .site-nav-menu::-webkit-scrollbar { display: none; }
  #site-header:not(.in-game) .nav-link {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.36rem;
    padding: 6px 2px;
  }
  #site-header:not(.in-game) #audio-mute-btn { grid-area: audio; }
  #site-header:not(.in-game) #header-play-btn {
    grid-area: play;
    font-size: 0.42rem;
    padding: 8px 10px;
  }
  #site-header.in-game {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
  }
  #site-header.in-game .header-game-stats {
    flex: 1 1 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.38rem;
  }
}

.header-level { color: var(--cyan); }
.header-phase {
  background: var(--yellow); color: #111; padding: 3px 8px;
  border: 2px solid #000; font-size: 0.4rem;
}
.header-phase.boss { background: var(--pink); color: #fff; }
.header-stat {
  display: flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.45); padding: 4px 10px;
  border: 2px solid var(--yellow); color: var(--yellow);
}

/* Pixel buttons */
.btn-pink, .btn-green, .btn-purple, .btn-blue, .btn-header, .btn-audio, .char-btn {
  font-family: 'Press Start 2P', monospace;
  cursor: pointer; border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s;
  pointer-events: auto; color: #fff;
}
.btn-pink, .btn-header { background: var(--pink); font-size: 0.55rem; padding: 10px 16px; }
.btn-audio {
  background: #2c3e50; font-size: 0.85rem; padding: 8px 12px; line-height: 1;
  min-width: 44px; display: inline-flex; justify-content: center; align-items: center;
}
.btn-green { background: var(--green); color: #111; font-size: 0.55rem; padding: 12px 20px; }
.btn-purple { background: var(--purple); font-size: 0.55rem; padding: 12px 20px; }
.btn-blue { background: var(--blue); font-size: 0.55rem; padding: 12px 20px; }
.btn-lg { font-size: 0.6rem; padding: 14px 22px; }
.btn-wide { width: 100%; margin-top: 12px; padding: 14px; font-size: 0.5rem; }
.btn-pink:hover, .btn-green:hover, .btn-purple:hover, .btn-blue:hover, .btn-header:hover, .btn-audio:hover, .char-btn:hover {
  transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000;
}

.pixel-heart {
  width: 22px; height: 20px; image-rendering: pixelated;
  background: #e74c3c;
  clip-path: polygon(50% 18%, 62% 6%, 78% 6%, 88% 18%, 88% 34%, 50% 72%, 12% 34%, 12% 18%, 22% 6%, 38% 6%);
  border: none; box-shadow: 1px 1px 0 #922b21;
}
.pixel-heart.empty { background: #444; box-shadow: none; opacity: 0.8; }

.stat-ico, .feature-ico {
  width: 20px; height: 20px; display: inline-block; flex-shrink: 0;
  background-size: contain; background-repeat: no-repeat; image-rendering: pixelated;
}
.stat-ico.trophy, .feature-ico.trophy {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect fill='%23ffd700' x='4' y='2' width='8' height='6'/%3E%3Crect fill='%23b8860b' x='6' y='8' width='4' height='2'/%3E%3Crect fill='%23ffd700' x='5' y='10' width='6' height='3'/%3E%3C/svg%3E");
}
.stat-ico.coin {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle fill='%23ffd700' cx='8' cy='8' r='7'/%3E%3Ctext x='8' y='11' text-anchor='middle' font-size='8' fill='%23fff'%3E%24%3C/text%3E%3C/svg%3E");
}
.feature-ico.bolt { background: var(--yellow); clip-path: polygon(50% 0%, 65% 40%, 100% 45%, 70% 60%, 80% 100%, 50% 75%, 20% 100%, 30% 60%, 0% 45%, 35% 40%); }
.feature-ico.potion { background: var(--pink); border-radius: 4px 4px 8px 8px; border: 2px solid #000; }
.feature-ico.star { background: var(--yellow); clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.feature-ico.skull { background: #ccc; border-radius: 50% 50% 40% 40%; border: 2px solid #000; }

/* ── Home / landing ── */
#home-screen {
  position: relative; z-index: 20;
  padding-top: var(--site-header-offset); min-height: 100vh;
  background: var(--navy);
}
#home-screen.hidden { display: none; }

/* ── Coin launch banner ── */
.coin-launch-banner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto 6px;
  padding: 0 16px;
  overflow: hidden;
  scroll-margin-top: calc(var(--site-header-offset) + 8px);
}
.coin-banner-bg {
  position: absolute;
  inset: 8px 16px 0;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 215, 0, 0.08) 0 12px,
      rgba(255, 20, 147, 0.08) 12px 24px
    );
  border-radius: 2px;
  pointer-events: none;
  animation: coin-bg-shift 4s linear infinite;
}
@keyframes coin-bg-shift {
  from { background-position: 0 0; }
  to { background-position: 48px 0; }
}
.coin-banner-inner {
  position: relative;
  background: linear-gradient(135deg, #1a0a3a 0%, var(--navy-panel) 35%, #0f2850 100%);
  border: 4px solid #000;
  box-shadow: 6px 6px 0 #000, inset 0 0 0 3px var(--yellow);
  padding: 18px 20px 16px;
  animation: coin-banner-pop 0.6s ease-out;
}
@keyframes coin-banner-pop {
  0% { transform: scale(0.98); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}
.coin-banner-badge {
  display: inline-block;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.38rem, 1.8vw, 0.48rem);
  color: #111;
  background: var(--yellow);
  border: 3px solid #000;
  box-shadow: 3px 3px 0 #000;
  padding: 8px 12px;
  margin-bottom: 14px;
  letter-spacing: 0.06em;
  animation: coin-badge-pulse 1.4s ease-in-out infinite;
}
@keyframes coin-badge-pulse {
  0%, 100% { transform: scale(1); box-shadow: 3px 3px 0 #000; }
  50% { transform: scale(1.03); box-shadow: 4px 4px 0 #000, 0 0 12px rgba(255, 215, 0, 0.55); }
}
.coin-banner-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.coin-banner-coin {
  flex-shrink: 0;
  width: clamp(52px, 10vw, 72px);
  height: clamp(52px, 10vw, 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1rem, 3vw, 1.4rem);
  color: #111;
  background: radial-gradient(circle at 35% 30%, #fff6a8, var(--yellow) 45%, #b8860b 100%);
  border: 4px solid #000;
  border-radius: 50%;
  box-shadow: 4px 4px 0 #000;
}
.coin-spin { animation: coin-spin-bob 2.2s ease-in-out infinite; }
.coin-spin-delay { animation-delay: 0.6s; }
@keyframes coin-spin-bob {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-8px) rotate(8deg); }
}
.coin-banner-copy { flex: 1; min-width: 0; }
.coin-banner-kicker {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.32rem, 1.4vw, 0.4rem);
  color: var(--cyan);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.coin-banner-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.65rem, 2.8vw, 1rem);
  line-height: 1.45;
  color: #fff;
  margin-bottom: 10px;
  text-shadow: 3px 3px 0 #000;
}
.coin-banner-ticker-name { color: var(--yellow); }
.coin-banner-live {
  color: var(--pink);
  animation: coin-live-blink 0.9s step-end infinite;
}
@keyframes coin-live-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.coin-banner-sub {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  line-height: 1.35;
  opacity: 0.92;
  max-width: 52ch;
}
.coin-banner-ticker-wrap {
  margin-top: 16px;
}
.coin-banner-ticker {
  overflow: hidden;
  background: rgba(0, 0, 0, 0.45);
  border: 3px solid #000;
  padding: 8px 0;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.06);
}
.coin-ticker-track {
  display: inline-block;
  white-space: nowrap;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.32rem, 1.2vw, 0.38rem);
  color: var(--yellow);
  padding-left: 100%;
  animation: coin-ticker-scroll 14s linear infinite;
}
@keyframes coin-ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
@media (max-width: 640px) {
  .coin-launch-banner { padding: 0 10px; margin-bottom: 4px; }
  .coin-banner-inner { padding: 14px 14px 12px; }
  .coin-banner-badge { font-size: 0.34rem; padding: 6px 10px; margin-bottom: 10px; }
  .coin-banner-kicker { font-size: 0.3rem; margin-bottom: 6px; }
  .coin-banner-title { font-size: 0.58rem; line-height: 1.55; margin-bottom: 8px; }
  .coin-banner-sub { font-size: 1.05rem; line-height: 1.3; }
  .coin-banner-ticker-wrap { margin-top: 12px; }
  .coin-ticker-track { font-size: 0.3rem; }
  .coin-banner-row { flex-direction: column; text-align: center; }
  .coin-banner-coin { display: none; }
  .coin-banner-sub { max-width: none; }
  .nickname-strip { padding: 6px 12px; gap: 8px 12px; }
  .nickname-input { min-width: min(280px, 88vw); font-size: 1.2rem; }
  .hero-section { padding: 0 10px 20px; }
  .hero-panel { padding: 16px; }
  .hero-tagline { font-size: 1.05rem; }
  .hero-buttons { flex-direction: column; }
  .hero-buttons .btn-lg { width: 100%; text-align: center; justify-content: center; }
  .feature-strip { padding: 10px 12px; gap: 8px 12px; }
  .feature-item { font-size: 0.34rem; }
  .home-grid { padding: 0 10px 20px; gap: 12px; }
  #site-footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 14px 12px;
    font-size: 0.85rem;
  }
}

.nickname-strip {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 12px 18px; padding: 8px 20px; max-width: 960px; margin: 0 auto;
}
.nickname-label {
  font-family: 'Press Start 2P', monospace; font-size: 0.45rem; color: var(--yellow);
  letter-spacing: 0.04em;
}
.nickname-input {
  font-family: 'VT323', monospace; font-size: 1.4rem; padding: 8px 14px;
  min-width: min(300px, 72vw); background: rgba(0,0,0,0.5); color: var(--cyan);
  border: 3px solid #000; box-shadow: 3px 3px 0 #000;
}
.nickname-input::placeholder { color: rgba(255,255,255,0.35); }
.nickname-input:focus { outline: 2px solid var(--cyan); outline-offset: 2px; }

.hero-section {
  position: relative;
  padding: 0 16px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-banner {
  width: 100%;
  border: 4px solid #000;
  box-shadow: 6px 6px 0 #000;
  overflow: hidden;
  background: #1a6fbf;
}

.hero-banner-img {
  width: 100%;
  height: auto;
  display: block;
  max-height: min(52vh, 480px);
  object-fit: cover;
  object-position: center center;
  image-rendering: auto;
}

.hero-content {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
  padding: 0 4px;
}
@media (max-width: 768px) { .hero-content { grid-template-columns: 1fr; } }

.hero-panel {
  background: var(--navy-panel); border: 4px solid #000;
  box-shadow: 6px 6px 0 #000; padding: 20px;
}
.panel-title {
  font-family: 'Press Start 2P', monospace; font-size: 0.55rem;
  color: var(--yellow); margin-bottom: 12px;
}
.hero-panel-right p { line-height: 1.5; font-size: 1.1rem; opacity: 0.92; }
.panel-heart { color: var(--pink); font-size: 1.4rem; margin-top: 8px; display: block; }

.game-logo {
  font-family: 'Press Start 2P', monospace; line-height: 1.6;
  margin-bottom: 14px;
}
.logo-running { display: block; font-size: 0.75rem; color: #fff; }
.logo-from { display: block; font-size: 0.65rem; color: var(--cyan); }
.logo-resp { display: block; font-size: 0.55rem; color: var(--yellow); }
.hero-tagline { font-size: 1.15rem; line-height: 1.45; margin-bottom: 16px; margin-top: 0; opacity: 0.95; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 10px; }

.feature-strip {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px;
  background: var(--navy-mid); border-top: 4px solid #000; border-bottom: 4px solid #000;
  padding: 14px 16px; margin: 8px 0 20px;
}
.feature-item {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Press Start 2P', monospace; font-size: 0.38rem;
  color: var(--text); letter-spacing: 0.02em;
}

.home-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  max-width: 1100px; margin: 0 auto; padding: 0 16px 24px;
}
@media (max-width: 900px) { .home-grid { grid-template-columns: 1fr; } }

.home-panel {
  background: var(--navy-panel); border: 4px solid #000;
  box-shadow: 6px 6px 0 #000; padding: 0 0 16px; overflow: hidden;
}
.panel-head {
  font-family: 'Press Start 2P', monospace; font-size: 0.48rem;
  padding: 12px 14px; text-align: center; color: #fff;
  border-bottom: 4px solid #000;
}
.panel-pink .panel-head, .panel-head-pink { background: var(--pink); }
.panel-yellow .panel-head, .panel-head-yellow { background: var(--yellow); color: #111; }
.panel-purple .panel-head { background: var(--purple); }

.avoider-cards {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  padding: 12px;
}
@media (max-width: 600px) { .avoider-cards { grid-template-columns: repeat(3, 1fr); } }
.avoider-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: 'Press Start 2P', monospace; font-size: 0.32rem;
  text-align: center; padding: 8px 4px;
  background: rgba(255,255,255,0.06); border: 2px solid rgba(255,255,255,0.15);
}
.avoider-sprite {
  width: 32px; height: 40px; border: 2px solid #000;
  image-rendering: pixelated;
}
.avoider-sprite.hippie { background: linear-gradient(180deg,#ffd4a8 30%,#27ae60 30%,#8B4513 70%); }
.avoider-sprite.broke { background: linear-gradient(180deg,#ffd4a8 30%,#555 30%,#333 70%); }
.avoider-sprite.procrastinator { background: linear-gradient(180deg,#ffd4a8 30%,#3498db 30%,#2c3e50 70%); }
.avoider-sprite.student { background: linear-gradient(180deg,#ffd4a8 30%,#e74c3c 30%,#1a1a2e 70%); }
.avoider-sprite.dreamer { background: linear-gradient(180deg,#ffd4a8 30%,#9b59b6 30%,#6c3483 70%); }

.home-panel .btn-wide { margin: 0 12px; width: calc(100% - 24px); }

.news-list { list-style: none; padding: 12px 14px; font-size: 1.05rem; line-height: 1.6; }
.news-list li { margin-bottom: 10px; display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.news-tag {
  background: var(--green); color: #111; font-family: 'Press Start 2P', monospace;
  font-size: 0.35rem; padding: 3px 6px; border: 2px solid #000;
}
.news-ico { width: 18px; height: 18px; flex-shrink: 0; border: 2px solid #000; }
.news-ico.monster { background: var(--purple); border-radius: 50%; }
.news-ico.note { background: var(--yellow); }

.leaderboard { list-style: none; padding: 12px 14px; font-size: 1.1rem; }
.leaderboard li {
  display: flex; align-items: center; gap: 8px; padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.lb-rank {
  font-family: 'Press Start 2P', monospace; font-size: 0.45rem;
  color: var(--yellow); min-width: 24px;
}
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-you-tag { color: var(--yellow); font-size: 0.95rem; font-weight: normal; }
.lb-score { margin-left: auto; color: var(--cyan); font-weight: bold; flex-shrink: 0; }
.leaderboard li.lb-you {
  background: rgba(255, 230, 109, 0.12);
  border-radius: 6px;
  padding-left: 6px;
  padding-right: 6px;
}
.leaderboard li.lb-empty { justify-content: center; opacity: 0.75; font-style: italic; }

#site-footer {
  position: relative; z-index: 20;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--navy-mid); border-top: 4px solid #000;
  padding: 14px 20px; font-size: 0.95rem;
}
#site-footer.hidden { display: none; }
.footer-left { color: var(--pink); }
.footer-social { opacity: 0.75; }
.footer-copy { opacity: 0.6; font-size: 0.85rem; }

#hud { display: none !important; }

/* Goal bar — in-game */
#goal-bar {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 25; width: min(420px, 92vw); pointer-events: none;
  background: var(--navy-panel); border: 4px solid #000;
  box-shadow: 6px 6px 0 #000; padding: 10px 14px 12px;
}
#goal-label {
  text-align: center; font-family: 'Press Start 2P', monospace;
  font-size: 0.42rem; font-weight: 400; margin-bottom: 8px;
  color: var(--yellow); text-shadow: 2px 2px 0 #000;
}
#goal-bar-track {
  height: 18px; background: var(--navy-panel);
  border: 3px solid #000; box-shadow: 4px 4px 0 #000; overflow: hidden;
}
#goal-bar-fill {
  height: 100%; width: 0%; background: var(--green);
  transition: width 0.3s; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2);
}
#goal-bar.boss-mode #goal-bar-fill { background: var(--pink); }

/* Boss intro overlay */
#boss-intro-screen { z-index: 19; }
#boss-intro-badge {
  background: #ff6b6b; color: #fff; padding: 6px 20px; border-radius: 20px;
  font-weight: 900; letter-spacing: 0.15em; margin-bottom: 12px; border: 3px solid #fff;
}
#boss-intro-name {
  font-size: clamp(1.6rem, 5vw, 2.8rem); font-weight: 900; color: #ffe66d;
  margin-bottom: 6px; max-width: 90vw;
}
#boss-intro-subtitle { font-size: 1rem; color: #4ecdc4; margin-bottom: 12px; font-weight: 700; }
#boss-intro-desc { font-size: 1.05rem; font-style: italic; margin-bottom: 16px; opacity: 0.9; max-width: 520px; }
#boss-intro-objective {
  background: rgba(255,230,109,0.2); border: 2px solid #ffe66d;
  padding: 12px 20px; border-radius: 12px; font-weight: 800; font-size: 1.05rem;
  margin-bottom: 14px; max-width: 520px;
}
#boss-intro-tips {
  list-style: none; text-align: left; max-width: 420px; margin-bottom: 16px;
}
#boss-intro-tips li {
  padding: 6px 0 6px 24px; position: relative; font-size: 0.95rem; opacity: 0.9;
}
#boss-intro-tips li::before {
  content: '→'; position: absolute; left: 0; color: #4ecdc4; font-weight: 900;
}
#boss-intro-countdown { font-size: 1.1rem; font-weight: 800; color: #4ecdc4; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Boss fight HUD */
#boss-hud {
  position: fixed; top: 68px; left: 50%; transform: translateX(-50%); z-index: 28;
  background: var(--navy-panel); border: 4px solid var(--pink);
  box-shadow: 6px 6px 0 #000; padding: 10px 20px; text-align: center;
  pointer-events: none; min-width: 260px;
}
#boss-hud.hidden { display: none; }
#boss-hud-header { display: flex; gap: 8px; justify-content: center; align-items: center; margin-bottom: 4px; }
#boss-hud-label {
  background: #ff6b6b; color: #fff; padding: 2px 10px; border-radius: 8px;
  font-size: 0.75rem; font-weight: 900; letter-spacing: 0.1em;
}
#boss-hud-name { font-size: 0.85rem; font-weight: 800; color: #ffe66d; }
#boss-hud-timer {
  font-size: 2.4rem; font-weight: 900; color: #fff; line-height: 1.1;
  text-shadow: 0 0 12px rgba(255,107,107,0.6);
}
#boss-hud-objective { font-size: 0.8rem; font-weight: 700; opacity: 0.85; margin-top: 2px; }
#boss-hud-lane {
  font-size: 0.82rem; font-weight: 800; margin-top: 4px; color: #a8e6cf;
  text-shadow: 0 1px 0 #000;
}
#boss-hud-lane.danger {
  color: #ff6b6b; animation: bossLanePulse 0.45s ease-in-out infinite alternate;
}
@keyframes bossLanePulse {
  from { transform: scale(1); }
  to { transform: scale(1.04); color: #ffe66d; }
}
#boss-hud-warning {
  margin-top: 6px; background: #ffe66d; color: #111; padding: 4px 12px;
  border-radius: 8px; font-size: 0.85rem; font-weight: 900;
  animation: shake 0.3s ease-in-out infinite;
}
#boss-hud-warning.hidden { display: none; }
#boss-hud.warning-close { border-color: #ffe66d; box-shadow: 0 0 16px rgba(255,230,109,0.5); }

#phase-badge.boss-mode { background: #ff6b6b; color: #fff; }
#phase-badge.boss-intro-mode { background: #a29bfe; color: #fff; }

/* Overlays */
.overlay {
  position: fixed; inset: 0; z-index: 35;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(12, 20, 69, 0.88); text-align: center; padding: 72px 24px 24px;
  pointer-events: none;
}
#intro-level-num { font-family: 'Press Start 2P', monospace; font-size: 0.5rem; color: var(--yellow); margin-bottom: 12px; }
#intro-level-name { font-family: 'Press Start 2P', monospace; font-size: clamp(0.6rem, 2.5vw, 0.9rem); color: var(--pink); margin-bottom: 12px; line-height: 1.6; }
.complete-title { font-family: 'Press Start 2P', monospace; font-size: 0.8rem; color: var(--green); margin-bottom: 16px; }
.overlay.hidden { display: none; }
#game-over-screen.hidden, #win-screen.hidden { display: none; }
#intro-tagline { font-size: 1.15rem; font-style: italic; margin-bottom: 16px; }
#intro-goal {
  background: var(--navy-panel); border: 3px solid #000; padding: 12px 20px;
  margin-bottom: 16px; font-weight: 700; box-shadow: 4px 4px 0 #000;
}
#intro-lines p, #complete-lines p { margin: 8px 0; font-size: 1.1rem; }

/* Popups */
#encounter-popup {
  position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%); z-index: 29;
  background: rgba(255,255,255,0.96); color: #222; padding: 14px 24px;
  border-radius: 14px; border: 4px solid #ff6b6b; text-align: center;
  max-width: 90vw; pointer-events: none;
  box-shadow: 6px 6px 0 #000;
}
#encounter-popup.hidden { display: none; }
#encounter-name { font-size: 1.15rem; font-weight: 800; color: #ff6b6b; }
#encounter-desc { font-size: 0.95rem; margin-top: 6px; font-style: italic; line-height: 1.35; }

#ambient-message {
  position: fixed; top: 42%; left: 50%; transform: translate(-50%,-50%); z-index: 24;
  color: rgba(255,255,255,0.95); font-size: 1.15rem; font-weight: 600; font-style: italic;
  text-shadow: 2px 2px 0 #000, 0 0 12px rgba(0,0,0,0.8);
  max-width: 85vw; text-align: center; pointer-events: none;
  background: rgba(12, 20, 69, 0.55); padding: 10px 18px; border: 3px solid #ff6b6b;
}
#ambient-message.hidden { display: none; }

#nonsense-event {
  position: fixed; top: 22%; left: 50%; transform: translate(-50%,-50%); z-index: 16;
  background: #ffe66d; color: #222; padding: 14px 24px; border-radius: 12px;
  border: 4px solid #ff6b6b; font-size: 1.05rem; font-weight: 800;
  max-width: 90vw; text-align: center; pointer-events: none;
  animation: shake 0.4s ease-in-out;
}
#nonsense-event.hidden { display: none; }

@keyframes shake {
  0%,100% { transform: translate(-50%,-50%) rotate(0); }
  25% { transform: translate(-52%,-50%) rotate(-2deg); }
  75% { transform: translate(-48%,-50%) rotate(2deg); }
}

#phase-message {
  position: fixed; top: 55%; left: 50%; transform: translate(-50%,-50%); z-index: 15;
  background: rgba(78,205,196,0.95); color: #111; padding: 12px 28px;
  border-radius: 20px; font-size: 1.2rem; font-weight: 900; border: 3px solid #fff;
  pointer-events: none;
}
#phase-message.hidden { display: none; }

@keyframes speech-pop {
  0% { transform: translate(-50%, -100%) scale(0.4); opacity: 0; }
  70% { transform: translate(-50%, -100%) scale(1.08); opacity: 1; }
  100% { transform: translate(-50%, -100%) scale(1); opacity: 1; }
}

#dodge-popup {
  position: fixed; top: 42%; left: 50%; transform: translate(-50%, -50%);
  z-index: 26; pointer-events: none;
  font-family: 'Press Start 2P', monospace; font-size: 0.65rem;
  color: #00ff88; text-shadow: 3px 3px 0 #000, 0 0 12px rgba(0,255,136,0.6);
  opacity: 0; transition: opacity 0.15s, transform 0.15s;
}
#dodge-popup.dodge-pop { opacity: 1; transform: translate(-50%, -60%) scale(1.1); }
#dodge-popup.hidden { display: none; }

#speech-bubble {
  position: fixed; z-index: 27;
  transform: translate(-50%, -100%);
  background: #fff; color: #111;
  padding: 10px 16px; border-radius: 18px;
  border: 3px solid #222;
  font-size: 0.95rem; font-weight: 800;
  max-width: 220px; line-height: 1.25;
  text-align: center; pointer-events: none;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
  transition: background 0.15s, color 0.15s;
}
#speech-bubble.speech-pop {
  animation: speech-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#speech-bubble.speech-yell {
  background: #ffe066; color: #111;
  border-color: #e74c3c;
  font-size: 1.05rem;
  max-width: 240px;
  box-shadow: 4px 4px 0 rgba(231,76,60,0.45);
}
#speech-bubble::before {
  content: '';
  position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%);
  border: 9px solid transparent; border-top-color: #fff;
  z-index: 1;
}
#speech-bubble::after {
  content: '';
  position: absolute; bottom: -13px; left: 50%; transform: translateX(-50%);
  border: 11px solid transparent; border-top-color: #222;
}
#speech-bubble.speech-yell::after { border-top-color: #e74c3c; }
#speech-bubble.hidden { display: none; }

/* Start */
#start-screen {
  position: fixed; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
  text-align: center; padding: 20px; overflow-y: auto;
}
#start-screen h1 { font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1.1; text-shadow: 3px 3px 0 #ff6b6b; margin-bottom: 10px; }
.tagline { font-size: 1rem; margin-bottom: 16px; opacity: 0.9; }

.mission-box {
  background: rgba(0,0,0,0.25); padding: 16px 24px; border-radius: 14px;
  margin-bottom: 16px; max-width: 420px; text-align: left; line-height: 1.7; font-size: 0.92rem;
}
.mission-box h3 { margin-bottom: 8px; color: #ffe66d; }

.controls-info {
  background: rgba(255,255,255,0.12); padding: 12px 20px; border-radius: 10px;
  margin-bottom: 20px; font-size: 0.85rem; line-height: 1.7;
}

button {
  cursor: pointer; font-family: inherit; font-size: 1.15rem; font-weight: 900;
  padding: 14px 32px; border: 4px solid #fff; border-radius: 30px;
  background: #ff6b6b; color: #fff; transition: transform 0.15s;
  pointer-events: auto;
}
button:hover { transform: scale(1.05); }

/* Game over & Win */
#game-over-screen, #win-screen {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; padding-top: 72px;
  background: rgba(12, 20, 69, 0.95);
  border: none;
}
#game-over-screen h2, #win-screen h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.9rem, 3vw, 1.2rem); line-height: 1.6;
}
#game-over-screen h2 { color: var(--pink); }
#win-screen h2 { color: var(--yellow); }
button#restart-btn, button#win-restart-btn {
  font-family: 'Press Start 2P', monospace; font-size: 0.55rem;
  background: var(--pink); border: 3px solid #000; box-shadow: 4px 4px 0 #000;
  border-radius: 0; padding: 14px 24px; cursor: pointer; color: #fff;
  width: min(360px, 90vw);
}
.end-screen-actions {
  display: flex; flex-direction: column; gap: 10px;
  width: min(360px, 90vw); margin-top: 4px;
}
.end-screen-actions button {
  width: 100%; cursor: pointer; pointer-events: auto;
}
button.end-btn-secondary, button.end-btn-leaderboard {
  font-family: 'Press Start 2P', monospace; font-size: 0.48rem;
  border: 3px solid #000; box-shadow: 4px 4px 0 #000;
  border-radius: 0; padding: 12px 18px; color: #fff;
}
button.end-btn-secondary { background: var(--blue); }
button.end-btn-leaderboard { background: var(--yellow); color: #111; }
button.end-btn-secondary:hover, button.end-btn-leaderboard:hover,
button#restart-btn:hover, button#win-restart-btn:hover {
  transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000;
}

.game-over-sub, .win-sub { font-size: 1.05rem; font-style: italic; margin-bottom: 28px; max-width: 440px; line-height: 1.5; opacity: 0.9; }

.stats { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; width: min(420px, 92vw); }
#game-over-screen .stat,
#win-screen .stat {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: rgba(255,255,255,0.08); padding: 14px 20px; border-radius: 10px; border-left: 4px solid #4ecdc4;
}
#game-over-screen .stat-label,
#win-screen .stat-label {
  font-family: 'VT323', monospace;
  font-size: 1.35rem;
  line-height: 1.2;
  opacity: 0.95;
  text-align: left;
  flex: 1;
}
#game-over-screen .stat span:last-child,
#win-screen .stat span:last-child {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.55rem, 2.8vw, 0.72rem);
  font-weight: normal;
  color: #4ecdc4;
  flex-shrink: 0;
}

/* Character Creation */
#char-creation {
  position: fixed; inset: 0; z-index: 25;
  overflow-y: auto;
  padding: calc(var(--site-header-offset) + 8px) 16px 32px;
  pointer-events: auto;
  background: rgba(12, 20, 69, 0.92);
}
.char-nickname-bar {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 10px 16px; max-width: 960px; margin: 0 auto 16px;
  padding: 12px 16px; background: rgba(0,0,0,0.35);
  border: 3px solid #000; box-shadow: 4px 4px 0 #000;
}
.char-nickname-hint {
  font-family: 'VT323', monospace; font-size: 1.1rem; opacity: 0.75; width: 100%;
  text-align: center;
}
.confirm-nickname {
  font-family: 'VT323', monospace; font-size: 1.45rem; color: var(--cyan);
  text-align: center; margin: 0 0 12px; padding-bottom: 10px;
  border-bottom: 2px dashed rgba(255,255,255,0.15);
}
.confirm-nickname.confirm-nickname-empty { color: var(--yellow); opacity: 0.9; }
#char-creation.hidden { display: none; }
.site-page { max-width: 960px; margin: 0 auto; }
.site-panel {
  background: var(--navy-panel); border: 4px solid #000;
  box-shadow: 8px 8px 0 #000; padding: 0 20px 24px;
}
.site-panel-narrow { max-width: 520px; margin: 0 auto; }
.char-step { margin-bottom: 24px; }
.char-step.hidden { display: none; }
.char-subtitle { text-align: center; opacity: 0.88; margin: 12px 0 20px; font-size: 1.1rem; }
.confirm-tagline {
  text-align: center; font-size: 1.2rem !important; color: var(--cyan) !important;
  line-height: 1.4; padding: 12px 8px 0; margin: 0;
}

.char-layout { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 700px) { .char-layout { grid-template-columns: 1fr; } }

.char-preview-box {
  position: relative;
  background: #0a1030;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  height: 340px;
  min-height: 340px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.char-preview-box .preview-label {
  position: absolute; top: 10px; left: 12px; z-index: 2;
  font-family: 'Press Start 2P', monospace; font-size: 0.4rem;
  color: var(--yellow); margin: 0;
  background: rgba(0,0,0,0.6); padding: 6px 10px; border: 2px solid #000;
  pointer-events: none;
}
.char-preview-box canvas,
.char-preview-canvas {
  display: block;
  flex: 1;
  width: 100% !important;
  height: 100% !important;
  min-height: 300px;
}

.option-group { margin-bottom: 16px; }
.option-group h3 {
  font-family: 'Press Start 2P', monospace; font-size: 0.4rem;
  color: var(--pink); margin-bottom: 8px; text-transform: uppercase;
}
.option-row { display: flex; gap: 8px; flex-wrap: nowrap; }
.option-row.wrap { flex-wrap: wrap; }
.option-btn {
  padding: 8px 12px; font-size: 1rem; font-family: 'VT323', monospace;
  background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.25);
  color: #fff;
}
.option-btn.selected { background: var(--pink); border-color: #000; box-shadow: 3px 3px 0 #000; }
.color-swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid #fff; display: inline-block; }

.gender-note { font-size: 0.82rem; color: #74b9ff; font-style: italic; margin-top: 8px; }
.gender-note.hidden { display: none; }

.archetype-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px; margin-bottom: 16px; max-height: 55vh; overflow-y: auto; padding: 4px;
}
.archetype-card {
  text-align: left; padding: 14px 16px;
  background: rgba(255,255,255,0.06); border: 3px solid rgba(255,255,255,0.2);
  color: #fff; font-size: 1rem; line-height: 1.45; width: 100%;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.3);
}
.archetype-card.selected { border-color: var(--yellow); background: rgba(255,215,0,0.12); box-shadow: 4px 4px 0 #000; }
.archetype-name { font-family: 'Press Start 2P', monospace; font-size: 0.42rem; color: var(--yellow); margin-bottom: 8px; line-height: 1.5; }
.archetype-desc { opacity: 0.9; margin-bottom: 8px; }
.archetype-bonus { color: var(--cyan); font-size: 0.95rem; margin-bottom: 2px; }
.archetype-penalty { color: var(--pink); font-size: 0.95rem; }
.char-btn { font-size: 0.48rem; padding: 12px 20px; margin: 4px; border-radius: 0; }
.char-btn.start-run { font-size: 0.55rem; padding: 16px 28px; }
.char-nav { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.char-error { text-align: center; color: #ff7675; font-weight: 700; margin-bottom: 8px; }
.char-error.hidden { display: none; }

.confirm-box {
  background: rgba(255,255,255,0.08); border-radius: 16px; padding: 24px;
  text-align: center; margin: 24px auto; max-width: 480px;
}
.confirm-box p:first-child { font-size: 1.4rem; font-weight: 900; color: #ffe66d; margin-bottom: 10px; }
.confirm-summary { opacity: 0.85; font-size: 0.95rem; line-height: 1.5; }

/* Responsibility Accepted — failure card */
#responsibility-card {
  position: fixed; inset: 0; z-index: 22;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(60, 10, 5, 0.82); pointer-events: none;
}
#responsibility-card.responsibility-hit-pop {
  animation: responsibility-slam 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes responsibility-slam {
  0% { opacity: 0; transform: scale(1.08); background: rgba(180, 30, 10, 0.95); }
  25% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); background: rgba(60, 10, 5, 0.82); }
}
#responsibility-card-title {
  background: var(--navy-panel); color: #ff6b6b;
  font-family: 'Press Start 2P', monospace; font-size: clamp(0.55rem, 2.5vw, 0.75rem);
  padding: 24px 28px; border: 4px solid #000;
  box-shadow: 8px 8px 0 #000; max-width: 92vw; text-align: center; line-height: 1.6;
}
#responsibility-card-desc {
  margin-top: 14px; max-width: min(520px, 92vw); padding: 0 16px;
  font-size: 1.05rem; font-style: italic; line-height: 1.45;
  color: #ffe66d; text-align: center; text-shadow: 2px 2px 0 #000;
}
#responsibility-card-desc.hidden { display: none; }
#responsibility-card-sub {
  margin-top: 20px; font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.45rem, 2vw, 0.6rem); color: var(--pink);
  letter-spacing: 0.08em; text-shadow: 3px 3px 0 #000;
}
#responsibility-card.hidden { display: none; }

#hit-flash {
  position: fixed; inset: 0; z-index: 21; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(220, 50, 30, 0.65) 0%, rgba(90, 15, 5, 0.88) 70%);
  opacity: 0;
}
#hit-flash.hidden { display: none; }
#hit-flash.hit-flash-active {
  display: block;
  animation: hit-flash-pulse 0.75s ease-out forwards;
}
@keyframes hit-flash-pulse {
  0% { opacity: 1; filter: brightness(1.4); }
  30% { opacity: 0.9; }
  100% { opacity: 0; filter: brightness(1); }
}
#game-container.screen-shake {
  animation: screen-shake-wobble 0.65s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes screen-shake-wobble {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  8% { transform: translate(-10px, 5px) rotate(-0.6deg); }
  16% { transform: translate(12px, -6px) rotate(0.5deg); }
  24% { transform: translate(-8px, -4px) rotate(-0.4deg); }
  32% { transform: translate(9px, 4px) rotate(0.35deg); }
  40% { transform: translate(-6px, 2px) rotate(-0.2deg); }
  55% { transform: translate(4px, -2px) rotate(0.15deg); }
  70% { transform: translate(-3px, 1px) rotate(0deg); }
}

.hidden { display: none !important; }
