/* ============================================================
   SCENARIO SELECTOR — INJECTED CSS
   ============================================================ */
/* __SCENARIO_START_CSS__ */
/* Overlay covers everything via z-index:100000 — no opacity hack needed */

.scenario-overlay {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; flex-direction: column; align-items: center;
  background: #080a07;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  animation: scFadeIn 0.4s ease-out;
}
@keyframes scFadeIn { from { opacity: 0; } to { opacity: 1; } }
.scenario-overlay.closing { animation: scFadeOut 0.3s ease-in forwards; }
@keyframes scFadeOut { to { opacity: 0; } }

.sc-scanlines {
  position: fixed; inset: 0; z-index: 100001; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(143,176,106,0.03) 2px, rgba(143,176,106,0.03) 4px);
}

/* Hero in selector */
.sc-hero { position: relative; width: 100%; height: 130px; overflow: hidden; flex-shrink: 0; }
.sc-hero-slideshow { position: absolute; inset: 0; }
.sc-hero-slide {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 35%;
  opacity: 0; transition: opacity 2s ease-in-out;
}
.sc-hero-slide.active { opacity: 1; }
.sc-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,10,7,0.3) 0%, rgba(8,10,7,0.5) 60%, rgba(8,10,7,0.95) 100%);
  z-index: 1;
}
.sc-hero-content {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px;
}
.sc-hero-logo { height: 40px; width: auto; object-fit: contain; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6)); }
.sc-hero-titles { text-align: right; }
.sc-hero-brand {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 1.2rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7); line-height: 1.2;
}
.sc-hero-brand .crisis { color: #8fb06a; }
.sc-hero-slogan {
  position: absolute; bottom: 6px; left: 0; right: 0;
  font-family: 'Share Tech Mono', monospace; font-size: 0.55rem;
  color: rgba(255,255,255,0.6); letter-spacing: 0.1em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  text-align: center;
}

/* Body */
.sc-body {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 14px 24px; width: 100%; flex: 1;
}
.sc-instruction {
  font-family: 'Share Tech Mono', monospace; font-size: 0.7rem;
  color: #8a9478; letter-spacing: 0.06em; text-align: center; margin-bottom: 12px;
  animation: scSlideUp 0.5s ease-out;
}
@keyframes scSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Grid */
.sc-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; width: 100%; max-width: 400px;
}

/* Card */
.sc-card {
  position: relative; background: #1a2214; border: 1px solid #2a3520;
  border-radius: 6px; cursor: pointer; overflow: hidden;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: all 0.2s ease;
  animation: scCardReveal 0.4s ease-out backwards;
}
.sc-card:nth-child(1) { animation-delay: 0.08s; }
.sc-card:nth-child(2) { animation-delay: 0.12s; }
.sc-card:nth-child(3) { animation-delay: 0.16s; }
.sc-card:nth-child(4) { animation-delay: 0.20s; }
.sc-card:nth-child(5) { animation-delay: 0.24s; }
.sc-card:nth-child(6) { animation-delay: 0.28s; }
@keyframes scCardReveal {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.sc-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  z-index: 2; background: #4a5e3a; opacity: 0.5; transition: opacity 0.2s;
}

.sc-card-img {
  width: 100%; height: 75px; object-fit: cover; object-position: center center;
  display: block; filter: brightness(0.8) saturate(0.85);
  transition: filter 0.2s, transform 0.3s;
}
.sc-card-img-overlay {
  position: absolute; top: 0; left: 0; right: 0; height: 75px;
  background: linear-gradient(180deg, transparent 40%, #1a2214 100%);
  pointer-events: none;
}
.sc-card-text { padding: 6px 10px 10px; text-align: center; }
.sc-title {
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 0.8rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: #d4dcc8; margin-bottom: 2px;
}
.sc-desc { font-size: 0.58rem; color: #8a9478; line-height: 1.3; }
.sc-count {
  display: inline-block; margin-top: 5px;
  font-family: 'Share Tech Mono', monospace; font-size: 0.5rem; color: #6b8a52;
  background: rgba(74,94,58,0.15); border: 1px solid rgba(74,94,58,0.2);
  border-radius: 2px; padding: 1px 5px;
}

.sc-card:active { transform: scale(0.97); border-color: #4a5e3a; }
.sc-card:active::before { opacity: 1; }
.sc-card:active .sc-card-img { filter: brightness(1) saturate(1); transform: scale(1.03); }

@media (hover: hover) {
  .sc-card:hover { border-color: #4a5e3a; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
  .sc-card:hover::before { opacity: 1; }
  .sc-card:hover .sc-card-img { filter: brightness(1) saturate(1); transform: scale(1.05); }
}

.sc-card[data-scenario="war"]::before       { background: #8b4a2a; }
.sc-card[data-scenario="war"]:active        { border-color: #8b4a2a; }
.sc-card[data-scenario="flood"]::before     { background: #2a6b8b; }
.sc-card[data-scenario="flood"]:active      { border-color: #2a6b8b; }
.sc-card[data-scenario="earthquake"]::before{ background: #8b7a2a; }
.sc-card[data-scenario="earthquake"]:active { border-color: #8b7a2a; }
.sc-card[data-scenario="nuclear"]::before   { background: #b8860b; }
.sc-card[data-scenario="nuclear"]:active    { border-color: #b8860b; }
.sc-card[data-scenario="pandemic"]::before  { background: #6b2a6b; }
.sc-card[data-scenario="pandemic"]:active   { border-color: #6b2a6b; }
.sc-card[data-scenario="survival"]::before  { background: #4a5e3a; }
.sc-card[data-scenario="survival"]:active   { border-color: #6b8a52; }

@media (hover: hover) {
  .sc-card[data-scenario="war"]:hover       { border-color: #8b4a2a; }
  .sc-card[data-scenario="flood"]:hover     { border-color: #2a6b8b; }
  .sc-card[data-scenario="earthquake"]:hover{ border-color: #8b7a2a; }
  .sc-card[data-scenario="nuclear"]:hover   { border-color: #b8860b; }
  .sc-card[data-scenario="pandemic"]:hover  { border-color: #6b2a6b; }
  .sc-card[data-scenario="survival"]:hover  { border-color: #6b8a52; }
}

.sc-card.selected { border-color: #8fb06a !important; box-shadow: 0 0 20px rgba(143,176,106,0.12); }
.sc-card.selected::before { opacity: 1; height: 3px; }

/* ALL button */
.sc-all-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; max-width: 400px; padding: 12px 20px; margin-top: 10px;
  background: #141a10; border: 1px dashed #2a3520; border-radius: 6px;
  cursor: pointer; -webkit-user-select: none; user-select: none; transition: all 0.2s;
  animation: scCardReveal 0.4s ease-out 0.32s backwards;
}
.sc-all-btn:active { background: #1a2214; border-color: #4a5e3a; border-style: solid; transform: scale(0.98); }
@media (hover: hover) {
  .sc-all-btn:hover { background: #1a2214; border-color: #4a5e3a; border-style: solid; }
  .sc-all-btn:hover .sc-all-label { color: #d4dcc8; }
}
.sc-all-icon { font-size: 1rem; }
.sc-all-label {
  font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 0.75rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: #8a9478; transition: color 0.2s;
}

/* Footer */
.sc-footer { margin-top: 14px; text-align: center; animation: scFadeIn 0.5s ease-out 0.4s backwards; }
.sc-footer-text {
  font-family: 'Share Tech Mono', monospace; font-size: 0.5rem;
  color: #566048; letter-spacing: 0.1em; text-transform: uppercase;
}
.sc-status-dot {
  display: inline-block; width: 5px; height: 5px;
  background: #8fb06a; border-radius: 50%; margin-right: 5px;
  animation: scPulse 2s ease-in-out infinite;
}
@keyframes scPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Responsive */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .sc-body { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
@media (max-height: 650px) {
  .sc-hero { height: 90px; }
  .sc-hero-logo { height: 28px; }
  .sc-hero-brand { font-size: 1rem; }
  .sc-body { padding: 8px 12px 18px; }
  .sc-instruction { margin-bottom: 8px; font-size: 0.6rem; }
  .sc-grid { gap: 8px; }
  .sc-card-img { height: 60px; }
  .sc-card-img-overlay { height: 60px; }
  .sc-card-text { padding: 4px 8px 8px; }
  .sc-title { font-size: 0.7rem; }
  .sc-desc { font-size: 0.52rem; }
  .sc-count { font-size: 0.45rem; }
  .sc-all-btn { padding: 10px 16px; margin-top: 8px; }
  .sc-footer { margin-top: 8px; }
}
@media (min-width: 420px) {
  .sc-hero { height: 140px; }
  .sc-hero-logo { height: 45px; }
  .sc-grid { max-width: 420px; gap: 12px; }
  .sc-card-img { height: 85px; }
  .sc-card-img-overlay { height: 85px; }
  .sc-title { font-size: 0.85rem; }
  .sc-all-btn { max-width: 420px; }
}
@media (min-width: 700px) {
  .sc-hero { height: 160px; }
  .sc-hero-logo { height: 55px; }
  .sc-hero-brand { font-size: 1.5rem; }
  .sc-grid { grid-template-columns: repeat(3, 1fr); max-width: 660px; gap: 14px; }
  .sc-card-img { height: 100px; }
  .sc-card-img-overlay { height: 100px; }
  .sc-card-text { padding: 8px 12px 12px; }
  .sc-title { font-size: 0.95rem; }
  .sc-desc { font-size: 0.65rem; }
  .sc-all-btn { max-width: 660px; }
}

/* Hide original SURVIVAL hero until scenario chosen */
body:not(.scenario-dismissed) .hero {
  display: none !important;
}
body:not(.scenario-dismissed) #map {
  visibility: hidden !important;
}
/* __SCENARIO_END_CSS__ */