﻿/* What If? — Pixel Styles */
#whatif-app {
  position: relative;
  min-height: 100vh;
  background:
    repeating-conic-gradient(rgba(137,233,225,.05) 0% 25%, transparent 0% 50%) 0 0 / 16px 16px,
    radial-gradient(ellipse at 50% 12%, rgba(137,233,225,.08), transparent 54%), var(--bg);
  color: #e6e6e6;
  overflow-x: hidden;
}

.wi-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(24px, 5vw, 64px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 700ms steps(14), visibility 700ms steps(14);
  z-index: 1;
}

.wi-screen.active {
  opacity: 1;
  visibility: visible;
}

.wi-filmgrain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 700 700'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='700' height='700' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  animation: wi-grain 0.8s steps(2) infinite;
}

@keyframes wi-grain {
  0% { transform: translate(0,0); }
  10% { transform: translate(-1%,-1%); }
  20% { transform: translate(1%,-1%); }
  30% { transform: translate(-1%,1%); }
  40% { transform: translate(1%,1%); }
  50% { transform: translate(-1%,-1%); }
  60% { transform: translate(1%,-1%); }
  70% { transform: translate(-1%,1%); }
  80% { transform: translate(1%,1%); }
  90% { transform: translate(-1%,-1%); }
  100% { transform: translate(1%,-1%); }
}

.wi-eyebrow {
  display: inline-block;
  padding: 8px 13px;
  background: #07050f;
  border: 2px solid rgba(200,255,104,0.5);
  box-shadow: 4px 4px 0 rgba(7,5,15,0.9);
  font-family: 'Silkscreen', 'IBM Plex Mono', monospace;
  font-size: clamp(9px, 1.6vw, 13px);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #89e9e1;
  margin-bottom: clamp(16px, 3vw, 28px);
}

.wi-title {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: clamp(26px, 7vw, 84px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
  margin: 0 0 clamp(16px, 3vw, 32px);
  text-shadow: 6px 6px 0 #07050f, 6px 6px 0 2px rgba(168,145,255,0.4);
}

.wi-scenario {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: clamp(15px, 3.6vw, 42px);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
  white-space: pre-line;
  max-width: min(1200px, 90vw);
  margin: 0 auto clamp(24px, 4vw, 40px);
  text-shadow: 4px 4px 0 #07050f;
}

.wi-sub {
  font-size: clamp(14px, 2.5vw, 20px);
  line-height: 1.8;
  color: rgba(230,230,230,0.7);
  max-width: min(720px, 85vw);
  margin: 0 auto clamp(32px, 5vw, 48px);
}

.wi-btn-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(12px, 2vw, 20px);
}

.wi-btn {
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
  padding: clamp(14px, 2vw, 18px) clamp(22px, 4vw, 44px);
  font-family: 'Silkscreen', 'IBM Plex Mono', monospace;
  font-size: clamp(12px, 1.8vw, 15px);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e6e6e6;
  background: #191436;
  border: 3px solid #07050f;
  border-radius: 0;
  cursor: pointer;
  box-shadow: 5px 5px 0 #07050f;
  transition: transform 160ms steps(3), box-shadow 160ms steps(3), background 160ms steps(3), color 160ms steps(3);
  text-decoration: none;
}

.wi-btn:hover {
  background: #221c4a;
  transform: translate(-3px, -3px);
  box-shadow: 8px 8px 0 #07050f, 8px 8px 0 2px rgba(200,255,104,0.55);
}
.wi-btn:active {
  transform: translate(5px, 5px);
  box-shadow: 0 0 0 #07050f;
}

.wi-btn.primary {
  background: #c8ff68;
  color: #0b1403;
  border-color: #07050f;
  box-shadow: 5px 5px 0 #07050f;
}
.wi-btn.primary:hover {
  background: #d8ff9b;
  color: #0b1403;
  box-shadow: 8px 8px 0 #07050f, 8px 8px 0 2px rgba(137,233,225,0.6);
}

.wi-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 85vw), 1fr));
  gap: clamp(12px, 2vw, 20px);
  width: min(1200px, 90vw);
  margin: 0 auto;
}

.wi-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: clamp(8px, 1.5vw, 12px);
  padding: clamp(20px, 3vw, 36px);
  background: rgba(10,8,25,0.72);
  border: 3px solid #07050f;
  border-radius: 0;
  cursor: pointer;
  box-shadow: 6px 6px 0 #07050f;
  transition: transform 160ms steps(3), box-shadow 160ms steps(3), background 160ms steps(3), border-color 160ms steps(3);
  min-height: clamp(140px, 20vw, 180px);
}

.wi-choice:hover {
  background: #221c4a;
  border-color: #c8ff68;
  transform: translate(-4px, -4px);
  box-shadow: 10px 10px 0 #07050f, 10px 10px 0 2px rgba(200,255,104,0.55);
}
.wi-choice:active {
  transform: translate(6px, 6px);
  box-shadow: 0 0 0 #07050f;
}

.wi-choice-num {
  display: inline-block;
  padding: 5px 8px;
  background: #07050f;
  border: 2px solid rgba(200,255,104,0.5);
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(10px, 1.5vw, 12px);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #c8ff68;
}

.wi-choice-title {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: clamp(12px, 1.9vw, 15px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.7;
  text-shadow: 3px 3px 0 #07050f;
}

.wi-choice-desc {
  margin-top: auto;
  font-size: clamp(13px, 2vw, 15px);
  line-height: 1.7;
  color: rgba(230,230,230,0.65);
}

.wi-btn-group[hidden] {
  display: none;
}

.wi-story {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(12px, 2vw, 18px);
  line-height: 1.9;
  white-space: pre-wrap;
  text-align: left;
  max-width: min(900px, 85vw);
  max-height: min(70vh, 640px);
  overflow-y: auto;
  padding: clamp(20px, 4vw, 40px);
  background: rgba(4,2,10,0.82);
  border: 3px solid #07050f;
  box-shadow: inset 0 0 0 2px rgba(200,255,104,0.25), 6px 6px 0 #07050f;
}

.wi-timeline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(16px, 3vw, 28px);
  width: min(900px, 85vw);
  position: relative;
  padding-left: clamp(32px, 5vw, 48px);
  max-height: min(56vh, 560px);
  overflow-y: auto;
  padding-right: clamp(8px, 2vw, 16px);
  scrollbar-width: thin;
  scrollbar-color: var(--accent) #07050f;
}

.wi-timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: calc(clamp(-32px,-5vw,-48px) + clamp(11px,2vw,15px) - clamp(4px,1vw,6px) + clamp(5px,0.75vw,7px) - 2px);
  top: calc(clamp(20px,3vw,24px) + clamp(10px,1.5vw,14px));
  width: 4px;
  height: calc(100% + clamp(16px,3vw,28px) - 3px);
  background: repeating-linear-gradient(180deg, rgba(200,255,104,0.75) 0 10px, rgba(90,81,172,0.5) 10px 18px);
}

.wi-timeline-item {
  position: relative;
  text-align: left;
  padding: clamp(16px, 2vw, 20px) clamp(16px, 3vw, 24px);
  background: rgba(10,8,25,0.72);
  border: 3px solid #07050f;
  border-radius: 0;
  box-shadow: 6px 6px 0 #07050f;
  width: 100%;
}

.wi-timeline-item::before {
  content: '';
  position: absolute;
  left: calc(clamp(-32px,-5vw,-48px) + clamp(11px,2vw,15px) - clamp(4px,1vw,6px));
  top: clamp(20px, 3vw, 24px);
  width: clamp(10px, 1.5vw, 14px);
  height: clamp(10px, 1.5vw, 14px);
  border-radius: 0;
  background: var(--accent);
  box-shadow: 0 0 0 3px #07050f, 0 0 clamp(30px,5vw,60px) var(--accent);
}

.wi-timeline-day {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(10px, 1.8vw, 13px);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: clamp(4px, 1vw, 8px);
}

.wi-timeline-text {
  font-size: clamp(14px, 2.2vw, 20px);
  line-height: 1.65;
  letter-spacing: -0.01em;
}

.wi-ending {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: clamp(20px, 5vw, 56px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  margin: clamp(16px, 3vw, 32px) 0;
  text-shadow: 6px 6px 0 #07050f, 6px 6px 0 2px rgba(200,255,104,0.45);
}

.wi-ending-sub {
  font-size: clamp(14px, 2.5vw, 20px);
  line-height: 1.8;
  color: rgba(230,230,230,0.7);
  max-width: min(760px, 85vw);
  margin: 0 auto clamp(32px, 5vw, 48px);
}

.wi-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(8px, 2vw, 12px);
  margin: clamp(16px, 3vw, 32px) 0;
}

.wi-stat {
  padding: clamp(7px, 1.5vw, 9px) clamp(12px, 2vw, 20px);
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(9px, 1.5vw, 11px);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #c8ff68;
  background: rgba(10,8,25,0.82);
  border: 3px solid #07050f;
  border-radius: 0;
  box-shadow: 4px 4px 0 #07050f;
}

@media (prefers-reduced-motion: reduce) {
  .wi-filmgrain { animation: none; }
  .wi-screen { transition: none; }
  .wi-btn, .wi-choice { transition: none; transform: none !important; }
}