/* ============================================================
   theme.css — "How to Write at the End of the World"
   A late-80s verb-bar adventure: the room on top, a sentence
   line, a 4x3 grid of green verbs and an inventory of the
   speaker's books underneath; narration in colored text over
   the speaker's head. Panels are close-ups: CRT screens for
   screenshots, gilt frames for book covers, parchment notes
   for long quotes, a brass plaque for Haraway.
   ============================================================ */

:root {
  --ink: #f2eadb;
  --dim: #a99fc4;
  --accent: #ffd257;
  --accent-2: #8fe3ff;
  --accent-3: #e08cf8;
  --font-display: 'Press Start 2P', monospace;
  --font-body: 'VT323', monospace;
  --fs: 28px;
  --panel-bg: rgba(10, 7, 18, 0.94);
  --panel-edge: #6a52a8;
  --console-bg: #08060e;
  --console-edge: #2c2240;
  --hud-bg: rgba(6, 4, 12, 0.7);
  --hud-ink: #b8a8e0;
  --verb: #58a464;
  --verb-hi: #c8ffa0;
  --sentence: #d890f4;
  --overhead-fs: 30px;
}

/* ---------- top bar: room name, act tabs, score ---------- */
#hud { height: 30px; padding: 0 12px; background: linear-gradient(rgba(6, 4, 12, 0.86), rgba(6, 4, 12, 0.5)); font-size: 9px; }
#hud-mark { color: var(--sentence); }
#room-name { color: var(--hud-ink); }
#counter { color: var(--accent); }
#section-nav { gap: 4px; }
#section-nav button { font-size: 8px; padding: 4px 7px; color: #6a5a90; border-color: #3a2e58; }
#section-nav button:hover { color: var(--verb-hi); border-color: var(--verb); }
#section-nav button.active { color: #140c1c; background: var(--accent); border-color: var(--accent); }

/* ---------- the verb bar ---------- */
body.narration-overhead #console {
  display: grid;
  grid-template-columns: 604px 62px 1fr;
  grid-template-rows: 32px 1fr;
  grid-template-areas: "line line line" "verbs ctrl inv";
  gap: 0 14px;
  padding: 4px 16px 12px;
  background: var(--console-bg);
  border-top: 4px solid var(--console-edge);
  box-shadow: inset 0 3px 0 #120c1e;
}
#hover-line {
  position: static; grid-area: line; text-align: left; align-self: center;
  font-family: var(--font-display); font-size: 14px; letter-spacing: 1px; color: var(--sentence); text-shadow: none; padding-left: 6px;
}
#verbs {
  grid-area: verbs; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr);
  gap: 0 8px; align-content: stretch; justify-content: stretch; font-size: 14px; padding: 0;
}
#verbs button { text-align: left; color: var(--verb); font-family: var(--font-display); font-size: 14px; padding: 4px 6px; letter-spacing: 0; }
#verbs button:hover, #verbs button.active { color: var(--verb-hi); }
#verbs button.active { text-shadow: 0 0 6px rgba(200, 255, 160, 0.6); }
#play-btn { color: #7a6aa8 !important; }
#play-btn:hover { color: var(--accent) !important; }
body.autoplay #play-btn { color: var(--accent) !important; }
#controls { grid-area: ctrl; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; }
#controls button { width: 54px; height: 40px; font-size: 16px; color: var(--verb); background: #0c160e; border: 2px solid #24442a; }
#controls button:hover { color: var(--verb-hi); border-color: var(--verb); }

/* inventory: one shelf, ten slots */
#inventory-wrap { grid-area: inv; display: flex; flex-direction: column; gap: 5px; padding: 5px 9px 7px; background: #100a1a; border: 2px solid #2c2240; transition: box-shadow 0.6s steps(4), border-color 0.6s steps(4); }
#inventory-wrap.complete { border-color: var(--accent); box-shadow: 0 0 14px rgba(255, 210, 87, 0.45); }
#inv-head { display: flex; justify-content: space-between; font-family: var(--font-display); font-size: 9px; color: #7a6aa8; letter-spacing: 1px; }
#inv-count { color: var(--accent); }
#inventory { flex: 1 1 auto; display: grid; grid-template-columns: repeat(10, 1fr); gap: 7px; min-height: 0; }
#inventory .slot { border: 1px dashed #2c2240; background: #0c0814; }
#inventory .item { position: relative; padding: 0; border: 2px solid #5a4690; background: #000; cursor: pointer; overflow: hidden; }
#inventory .item:hover { border-color: var(--verb-hi); }
#inventory .item img { width: 100%; height: 100%; object-fit: cover; display: block; image-rendering: auto; }
#inventory .item.new { animation: pickup 1.1s steps(7) both; }
@keyframes pickup { 0% { transform: translateY(-80px) scale(1.5); opacity: 0; } 35% { opacity: 1; } 70% { transform: translateY(4px) scale(1); } 100% { transform: none; } }

/* ---------- narration over the head ---------- */
#overhead-text { font-family: var(--font-body);
  text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 0 2px 0 #000, 2px 0 0 #000, 0 -2px 0 #000, -2px 0 0 #000,
    0 0 8px rgba(0, 0, 0, 0.95), 0 0 16px rgba(0, 0, 0, 0.85); }
#overhead-text em { font-style: normal; color: #ffffff; }

/* ---------- panels: close-ups ---------- */
.panel { font-family: var(--font-body); }
.panel .bar { font-size: 9px; letter-spacing: 1px; }
.panel .gap { display: block; height: 0.45em; }

/* CRT screens for screenshots and charts */
.frame-crt { border: 10px solid #2a2532; border-radius: 10px; background: #0b0a10;
  box-shadow: inset 0 0 0 2px #120f18, 0 0 0 2px #050408, 6px 6px 0 rgba(0, 0, 0, 0.6); }
.frame-crt .bar { background: #120f18; color: #9ff0a8; padding: 6px 8px 7px; }
.frame-crt .bar a { color: var(--accent); }
.frame-crt .screen { border-radius: 4px; }
.frame-crt .screen::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, 0.07) 2px 3px); box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.4); }
.panel.embed.frame-crt .screen::after { display: none; }

/* gilt frames for book covers (yours get a +1) */
.frame-book { border: 8px solid #8a6a2a; background: #1a1008;
  box-shadow: inset 0 0 0 2px #e0c070, 0 0 0 2px #3a2810, 6px 6px 0 rgba(0, 0, 0, 0.6); }
.frame-book .bar { background: #24160a; color: #ffe08a; padding: 6px 8px 7px; }
.frame-book .screen { background: #1a1008; }
.frame-book .bar { letter-spacing: 0; }
.frame-book .bar span, .tile .bar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.panel.got .bar::after { content: '+1 BOOK'; flex: 0 0 auto; white-space: nowrap; color: #8aff8a; animation: blink 1s steps(2) 3; }
.tile.frame-book { border-width: 8px; }

/* newspaper clipping */
.frame-paper { border: 6px solid #d8d0bc; background: #f6f2e8; box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.6); }
.frame-paper .bar { background: #d8d0bc; color: #2a2620; }
.frame-paper .screen { background: #ffffff; }

/* parchment notes for long quotes */
.panel.frame-note { background: #efe3c2; color: #2a1e14; border: 3px solid #5a4024; box-shadow: 0 0 0 3px #1a120a, 7px 7px 0 rgba(0, 0, 0, 0.6);
  background-image: repeating-linear-gradient(to bottom, transparent 0 30px, rgba(90, 64, 36, 0.1) 30px 31px); }
.frame-note .tag { color: #8a2a2a; }
.frame-note .tag .right { color: #6a5a40; }
.frame-note blockquote { font-size: 1.05em; line-height: 1.08; }
.frame-note blockquote::before, .frame-note blockquote::after { color: #8a2a2a; }
.frame-note cite { color: #5a4a34; }
.frame-note a { color: #23468a; }

/* the brass plaque */
.panel.frame-brass { background: linear-gradient(#3e2c14, #2a1e0c); color: #ffeab8; text-align: center; padding: 1.1em 1.4em;
  border: 6px double #c8a04a; box-shadow: 0 0 0 3px #140c04, 7px 7px 0 rgba(0, 0, 0, 0.6); }
.frame-brass blockquote { font-size: 1.3em; line-height: 1.12; }
.frame-brass blockquote::before, .frame-brass blockquote::after { color: #c8a04a; }
.frame-brass cite { color: #d8b870; font-size: 0.9em; }

/* the game's own dialog boxes: lists, links */
.panel.frame-scumm { background: rgba(8, 6, 14, 0.95); border: 3px solid var(--verb); box-shadow: 0 0 0 3px #08060e, 6px 6px 0 rgba(0, 0, 0, 0.6); }
.frame-scumm h2 { color: var(--verb-hi); }
.frame-scumm .tag { color: var(--sentence); }
.frame-scumm ul li::before { color: var(--verb); }
.frame-scumm em { color: var(--accent); }
.frame-scumm .small { color: #8a7ab8; margin-top: 0.6em; }

/* the building directory, a brass-edged wall plaque */
.panel.frame-plaque { background: #24180c; border: 6px double #b08a3a; color: #f0e2c0; }
.frame-plaque .tag { color: #e0b860; }
.frame-plaque .tag .right { color: #a08860; }
.frame-plaque h2 { color: #ffe08a; }
.frame-plaque ul li::before { content: '\25B8'; color: #e0b860; }
.frame-plaque em { color: #ffd257; }

/* title card */
.panel.title.frame-title { text-align: center; background: rgba(8, 5, 18, 0.9); border: 3px solid #7a62b8; box-shadow: 0 0 0 3px #08060e, 8px 8px 0 rgba(0, 0, 0, 0.6); }
.panel.title h1 { font-size: 1.2em; line-height: 1.55; color: var(--accent); text-shadow: 3px 3px 0 #5a2a8a, 6px 6px 0 rgba(0, 0, 0, 0.55); }
.panel.title .kicker { color: var(--sentence); }
.panel.title .sub { color: var(--accent-2); font-size: 1.1em; }
.panel.title .byline { color: #c8bce4; font-size: 0.95em; }
.panel.title .start { color: var(--verb-hi); }

/* preloader in the game's colors */
#preloader { color: var(--verb-hi); }
#preloader .pl-outer { border-color: var(--verb); }
#preload-bar { background: var(--verb); }
