/* ============================================================
   WASTELAND & WHIMSY — Retro Terminal Stylesheet (Chunk 1)
   Pure CSS effects: scanlines, vignette, flicker, phosphor glow,
   5 zone gradients, 5 animated weather overlays.
   ============================================================ */

:root{
  --green:#33ff66;
  --green-dim:#1f9c3f;
  --green-deep:#0a3d1a;
  --amber:#ffcc33;
  --danger:#ff4444;
  --bg:#020a04;
  --font: "Courier New", Courier, monospace;
}

*{ box-sizing:border-box; margin:0; padding:0; }

html,body{ height:100%; width:100%; overflow:hidden; }

body{
  font-family:var(--font);
  color:var(--green);
  background:var(--bg);
  position:relative;
  transition: background 1.5s ease;
}

/* ---------- ZONE BASE GRADIENTS ---------- */
body.zone-culdesac{ background:radial-gradient(ellipse at center,#0d2614 0%,#04120a 70%,#020a04 100%); }
body.zone-mallhalla{ background:radial-gradient(ellipse at center,#0a2424 0%,#05151a 70%,#020a0a 100%); }
body.zone-glade{ background:radial-gradient(ellipse at center,#10330f 0%,#082006 70%,#031203 100%); }
body.zone-lake{ background:radial-gradient(ellipse at center,#06283a 0%,#04161f 70%,#020a0e 100%); }
body.zone-downtown{ background:radial-gradient(ellipse at center,#2a0d0d 0%,#160606 70%,#0a0202 100%); }

/* ---------- CRT EFFECTS ---------- */
.crt-scanlines,.crt-vignette,.crt-flicker{
  position:fixed; inset:0; pointer-events:none; z-index:9000;
}
.crt-scanlines{
  background:repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.25) 3px,
    rgba(0,0,0,0.25) 4px);
  mix-blend-mode:multiply;
}
.crt-vignette{
  background:radial-gradient(ellipse at center,
    rgba(0,0,0,0) 55%,
    rgba(0,0,0,0.6) 90%,
    rgba(0,0,0,0.9) 100%);
}
.crt-flicker{
  background:rgba(51,255,102,0.03);
  animation:flicker 0.15s infinite alternate;
}
@keyframes flicker{
  0%{opacity:0.85;} 100%{opacity:1;}
}

/* ---------- ANIMATED WEATHER LAYER ---------- */
.weather-layer{
  position:fixed; inset:0; pointer-events:none; z-index:8000;
  transition:opacity 1.5s ease;
}
/* Clear: nothing */
body.weather-clear .weather-layer{ opacity:0; }

/* Acid Drizzle: diagonal falling streaks */
body.weather-acid .weather-layer{
  opacity:1;
  background:repeating-linear-gradient(
    115deg,
    rgba(120,255,120,0) 0px,
    rgba(120,255,120,0) 6px,
    rgba(120,255,120,0.10) 7px,
    rgba(120,255,120,0) 8px);
  background-size:200px 200px;
  animation:rainfall 0.4s linear infinite;
}
@keyframes rainfall{ from{background-position:0 0;} to{background-position:-60px 200px;} }

/* Fallout Flurry: drifting particles */
body.weather-fallout .weather-layer{
  opacity:1;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(180,255,120,0.4) 50%, transparent 51%),
    radial-gradient(2px 2px at 70% 60%, rgba(180,255,120,0.3) 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 80%, rgba(180,255,120,0.4) 50%, transparent 51%),
    radial-gradient(2px 2px at 90% 20%, rgba(180,255,120,0.3) 50%, transparent 51%);
  background-size:300px 300px;
  animation:drift 8s linear infinite;
}
@keyframes drift{ from{background-position:0 0;} to{background-position:80px 300px;} }

/* Scrap Storm: fast horizontal shake + flicker */
body.weather-storm .weather-layer{
  opacity:1;
  background:repeating-linear-gradient(
    90deg,
    rgba(255,200,80,0) 0px,
    rgba(255,200,80,0.06) 40px,
    rgba(255,200,80,0) 80px);
  animation:storm 0.2s steps(2) infinite;
}
@keyframes storm{ 0%{transform:translateX(0);} 100%{transform:translateX(-10px);} }

/* Glowfog: pulsing blur layer */
body.weather-fog .weather-layer{
  opacity:1;
  background:radial-gradient(ellipse at 50% 60%,
    rgba(120,255,160,0.12) 0%,
    rgba(80,200,120,0.18) 50%,
    rgba(20,60,30,0.25) 100%);
  animation:fogpulse 6s ease-in-out infinite;
}
@keyframes fogpulse{ 0%,100%{opacity:0.5;} 50%{opacity:0.9;} }

/* ---------- GLOW HELPERS ---------- */
.glow{ text-shadow:0 0 4px var(--green),0 0 8px rgba(51,255,102,0.5); }
.glow-dim{ color:var(--green-dim); text-shadow:0 0 3px rgba(31,156,63,0.6); }

/* ---------- SCREENS ---------- */
.screen{
  position:fixed; inset:0; z-index:100;
  display:none; flex-direction:column;
  align-items:center; justify-content:center;
  padding:24px;
}
.screen--active{ display:flex; }

/* ---------- TITLE SCREEN ---------- */
.title-wrap{ text-align:center; }
.game-title{
  font-size:64px; line-height:1; letter-spacing:6px; font-weight:bold;
  animation:titlepulse 3s ease-in-out infinite;
}
.game-title .amp{ color:var(--amber); text-shadow:0 0 6px var(--amber); }
@keyframes titlepulse{ 0%,100%{opacity:1;} 50%{opacity:0.82;} }
.tagline{ margin:16px 0 32px; font-size:16px; letter-spacing:2px; }
.menu{ display:flex; flex-direction:column; gap:14px; width:260px; margin:0 auto 28px; }
.blink{ animation:blink 1s steps(2) infinite; }
@keyframes blink{ 50%{opacity:0;} }

/* ---------- BUTTONS ---------- */
.btn{
  font-family:var(--font); font-size:15px; letter-spacing:1px;
  color:var(--green); background:transparent;
  border:1px solid var(--green-dim); padding:10px 16px;
  cursor:pointer; transition:all 0.15s ease; text-transform:uppercase;
}
.btn:hover{
  background:var(--green-deep); color:#fff;
  border-color:var(--green); box-shadow:0 0 10px rgba(51,255,102,0.6);
}
.btn-sm{ font-size:12px; padding:6px 10px; }
.btn-danger{ border-color:var(--danger); color:var(--danger); }
.btn-danger:hover{ background:#3a0a0a; box-shadow:0 0 10px rgba(255,68,68,0.6); }
.btn-back{ margin-top:24px; }

/* ---------- PANEL (slots / difficulty) ---------- */
.panel{
  border:1px solid var(--green-dim); padding:28px 32px;
  background:rgba(2,20,8,0.6); max-width:760px; width:100%;
  box-shadow:0 0 24px rgba(51,255,102,0.15);
}
.panel h2{ margin-bottom:22px; font-size:22px; letter-spacing:2px; }

/* ---------- SAVE SLOTS ---------- */
.slots{ display:flex; flex-direction:column; gap:14px; }
.slot{
  border:1px dashed var(--green-dim); padding:14px 18px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.slot h3{ font-size:16px; letter-spacing:2px; }
.slot-info{ flex:1; color:var(--green-dim); font-size:13px; }
.slot-actions{ display:flex; gap:8px; }

/* ---------- DIFFICULTY ---------- */
.diff-list{ display:flex; flex-direction:column; gap:12px; }
.diff-card{
  text-align:left; font-family:var(--font); cursor:pointer;
  border:1px solid var(--green-dim); background:transparent;
  padding:12px 16px; color:var(--green);
  display:flex; flex-direction:column; gap:4px; transition:all 0.15s ease;
}
.diff-card:hover{ background:var(--green-deep); box-shadow:0 0 12px rgba(51,255,102,0.4); }
.diff-name{ font-size:16px; letter-spacing:1px; }
.diff-desc{ font-size:12px; color:var(--green-dim); }
.diff-black{ border-color:var(--danger); }
.diff-black .diff-name{ color:var(--danger); text-shadow:0 0 6px var(--danger); }
.diff-black:hover{ background:#2a0606; box-shadow:0 0 12px rgba(255,68,68,0.5); }

/* ---------- GAME HUD ---------- */
#screen-game{ justify-content:flex-start; align-items:stretch; padding:12px; }
.hud-top{
  display:flex; justify-content:space-between; align-items:center;
  border:1px solid var(--green-dim); padding:8px 14px; margin-bottom:8px;
}
.hud-top .lbl{ color:var(--green-dim); font-size:11px; margin-right:6px; }
.hud-clock{ text-align:center; display:flex; flex-direction:column; gap:2px; font-size:13px; }
.hud-soda,.hud-zone{ font-size:14px; }

/* stats */
.hud-stats{
  border:1px solid var(--green-dim); padding:10px 14px; margin-bottom:8px;
  display:flex; flex-direction:column; gap:6px;
}
.bar{ display:flex; align-items:center; gap:10px; }
.bar-lbl{ width:40px; font-size:12px; color:var(--green-dim); }
.bar-track{
  flex:1; height:12px; background:#031a0c;
  border:1px solid var(--green-deep); overflow:hidden;
}
.bar-fill{ height:100%; transition:width 0.4s ease; }
.bar-fill.hp{ background:linear-gradient(90deg,#1f9c3f,#33ff66); }
.bar-fill.sta{ background:linear-gradient(90deg,#1f7c9c,#33ccff); }
.bar-fill.hype{ background:linear-gradient(90deg,#9c7c1f,#ffcc33); }
.bar-fill.rad{ background:linear-gradient(90deg,#9c1f1f,#ff6633); }
.bar-val{ width:78px; text-align:right; font-size:12px; }
.hud-mini{
  display:flex; flex-wrap:wrap; gap:14px; margin-top:6px;
  font-size:12px; color:var(--green-dim); border-top:1px dashed var(--green-deep); padding-top:8px;
}
.hud-mini b{ color:var(--green); }

/* log window */
.log-window{
  flex:1; border:1px solid var(--green-dim); padding:14px;
  overflow-y:auto; background:rgba(2,16,6,0.5); margin-bottom:8px;
  min-height:120px;
}
.log-content p{ margin-bottom:8px; font-size:14px; line-height:1.5; }
.log-window::-webkit-scrollbar{ width:8px; }
.log-window::-webkit-scrollbar-thumb{ background:var(--green-deep); }

/* typewriter cursor */
.tw-cursor::after{
  content:"_"; animation:blink 1s steps(2) infinite; color:var(--green);
}

/* actions */
.actions{
  display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:8px;
}
.act{ padding:12px 6px; }

/* bottom bar */
.hud-bottom{
  display:flex; align-items:center; gap:12px;
  border:1px solid var(--green-dim); padding:8px 14px;
}
.hud-bottom .btn-back{ margin-left:auto; margin-top:0; }

/* ---------- MODAL ---------- */
.modal{
  position:fixed; inset:0; z-index:9500; display:none;
  align-items:center; justify-content:center; background:rgba(0,0,0,0.7);
}
.modal.open{ display:flex; }
.modal-box{
  border:1px solid var(--green); background:var(--bg);
  width:90%; max-width:600px; max-height:80vh; overflow-y:auto;
  box-shadow:0 0 30px rgba(51,255,102,0.4);
}
.modal-head{
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 16px; border-bottom:1px solid var(--green-dim);
}
.modal-body{ padding:16px; font-size:14px; line-height:1.6; }

/* ---------- RESPONSIVE ---------- */
@media (max-width:600px){
  .game-title{ font-size:40px; }
  .actions{ grid-template-columns:repeat(2,1fr); }
  .hud-mini{ gap:8px; font-size:11px; }
}

/* ============================================================================
   WASTELAND & WHIMSY — CSS POLISH ADD-ON (Chunk 8)
   Append below the Chunk-1 stylesheet. Styles the combat, inventory, travel,
   and skill/HOA modals that later chunks introduced.
   ============================================================================ */

/* ---- Combat layout inside the modal ---- */
.cb-foe{ border-bottom:1px dashed var(--green-deep); padding-bottom:8px; margin-bottom:8px; }
.cb-name{ font-size:15px; margin-bottom:6px; }
.cb-you{ border-top:1px dashed var(--green-deep); padding-top:8px; margin-top:8px; }
.cb-status{ font-size:12px; margin-top:4px; }

/* Scrollable combat log */
.cb-log{
  border:1px solid var(--green-deep); background:rgba(2,16,6,0.6);
  padding:8px 10px; margin:8px 0; max-height:160px; overflow-y:auto;
  font-size:13px; line-height:1.5;
}
.cb-log p{ margin-bottom:5px; }
.cb-log::-webkit-scrollbar{ width:6px; }
.cb-log::-webkit-scrollbar-thumb{ background:var(--green-deep); }

/* Combat action grid */
.cb-actions{
  display:grid; grid-template-columns:repeat(4,1fr); gap:6px; margin-top:8px;
}
.cb-actions .btn[disabled]{ opacity:0.4; cursor:not-allowed; box-shadow:none; }
.cb-actions .btn[disabled]:hover{ background:transparent; color:var(--green); border-color:var(--green-dim); }

/* ---- Inventory / craft / skills / HOA list rows ---- */
.inv-list{ display:flex; flex-direction:column; gap:8px; margin:10px 0; }
.inv-row{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  border:1px dashed var(--green-deep); padding:8px 10px; font-size:13px;
}
.inv-row .btn{ white-space:nowrap; }
.modal-body h4{ margin:14px 0 6px; font-size:14px; letter-spacing:1px; }

/* ---- Travel modal ---- */
.travel-list{ display:flex; flex-direction:column; gap:10px; margin:10px 0; }
.travel-row{ border:1px dashed var(--green-deep); padding:10px 12px; font-size:13px; line-height:1.6; }

/* ---- Generic disabled button polish everywhere ---- */
.btn[disabled]{ opacity:0.4; cursor:not-allowed; }
.btn[disabled]:hover{ background:transparent; color:var(--green); border-color:var(--green-dim); box-shadow:none; }

/* ---- Make the modal a touch taller for combat/long lists ---- */
.modal-box{ max-height:86vh; }

/* ---- Small-screen combat grid ---- */
@media (max-width:600px){
  .cb-actions{ grid-template-columns:repeat(2,1fr); }
}