/* GONZOWIRE OS - narrative scenes layer
   Параллельный слой поверх десктопной OS. Когда активна сцена, #stage поверх всего.
*/

#stage {
  position: fixed;
  inset: 0;
  z-index: 7800;
  background: #0a0604;
  display: none;
  overflow: hidden;
  font-family: var(--display);
  color: #f4e9c1;
}
#stage.active { display: block; }

/* Top bar сцены */
.scene-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 36px;
  background: linear-gradient(180deg, #ffe21a 0%, #d9b16c 100%);
  color: var(--ink);
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
  z-index: 10;
  border-bottom: 2px solid var(--ink);
}
.scene-bar .scene-name { flex: 1; font-weight: 900; }
.scene-bar button {
  background: var(--ink);
  color: var(--neon-yellow);
  border: 2px solid var(--ink);
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  margin-left: 6px;
  text-transform: uppercase;
}
.scene-bar button:hover { background: var(--neon-pink); color: var(--ink); }
.scene-bar .pmeter {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px;
}
.scene-bar .pbar {
  width: 80px; height: 10px;
  background: #000;
  border: 1px solid var(--ink);
  position: relative;
}
.scene-bar .pbar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, #06FFA5 0%, #ffe21a 50%, #ff2a1f 100%);
  width: 0%;
  transition: width .4s;
}

/* Main scene area */
.scene-area {
  position: absolute;
  top: 36px; left: 0; right: 0; bottom: 0;
  overflow: hidden;
}

/* SVG art canvas (background of every scene) */
.scene-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Hotspot - clickable invisible (slightly visible on hover) area */
.hotspot {
  position: absolute;
  cursor: pointer;
  border: 2px dashed transparent;
  transition: all .2s;
}
.hotspot:hover {
  border-color: var(--neon-yellow);
  background: rgba(255,226,26,.08);
  box-shadow: 0 0 16px rgba(255,226,26,.3);
}
.hotspot.found {
  border-color: var(--neon-acid);
  border-style: solid;
}
.hotspot::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  top: -22px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--neon-yellow);
  padding: 2px 8px;
  font-size: 11px;
  font-family: var(--mono);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.hotspot:hover::after { opacity: 1; }

/* Reveal modal - bouncy popup with content from hotspot */
.reveal {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  background: #1a0d04;
  border: 3px solid var(--neon-pink);
  box-shadow: 0 0 48px rgba(255,43,143,.6), 8px 8px 0 #000;
  z-index: 50;
  padding: 0;
  font-family: var(--mono);
  color: var(--bone);
  animation: revealIn .35s cubic-bezier(.2,1.6,.4,1);
}
@keyframes revealIn {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(.5) rotate(-3deg); }
  100% { opacity: 1; transform: translate(-50%,-50%) scale(1)  rotate(0); }
}
.reveal .rh {
  background: var(--neon-pink);
  color: var(--ink);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 13px;
}
.reveal .rh .rt { flex: 1; }
.reveal .rh button {
  background: var(--ink); color: var(--neon-yellow);
  border: 0; padding: 2px 8px; font-family: var(--mono); font-size: 14px; cursor: pointer;
}
.reveal .rb {
  padding: 18px 22px;
  max-height: 60vh;
  overflow-y: auto;
  line-height: 1.55;
}
.reveal .rb h3 { color: var(--neon-yellow); font-family: var(--display); margin: 14px 0 6px; }

/* Receipt fragment style */
.receipt {
  background: #f4e9c1;
  color: #1a0d04;
  font-family: var(--mono);
  padding: 14px 18px;
  border: 1px dashed #1a0d04;
  width: 280px;
  margin: 0 auto;
  white-space: pre;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 4px 0 #8a5a2b, 0 8px 12px rgba(0,0,0,.5);
  transform: rotate(-1.5deg);
}
.receipt .center { text-align: center; }
.receipt .total { font-weight: bold; border-top: 1px dashed #000; padding-top: 6px; margin-top: 6px; }

/* Newspaper clipping */
.clipping {
  background: #e8d5a2;
  color: #1a0d04;
  font-family: 'Special Elite', serif;
  padding: 14px 18px;
  border: 1px solid #5c4033;
  box-shadow: 4px 4px 0 rgba(0,0,0,.4);
  transform: rotate(.6deg);
}
.clipping h2 { font-family: 'Rubik Mono One', sans-serif; color: #8b0000; margin: 0 0 6px; font-size: 18px; }
.clipping .byline { font-style: italic; color: #5c4033; font-size: 12px; }

/* Note (handwritten / typed) */
.handnote {
  background: #f4e9c1;
  color: #1a0d04;
  font-family: 'Special Elite', monospace;
  padding: 14px;
  border: 1px solid #8a5a2b;
  transform: rotate(-.8deg);
  box-shadow: 4px 4px 0 rgba(0,0,0,.3);
}

/* Overheard line (italic faint) */
.overheard {
  font-style: italic;
  color: var(--neon-cyan);
  border-left: 3px solid var(--neon-cyan);
  padding-left: 12px;
  margin: 12px 0;
}

/* Bottom hint bar */
.scene-hint {
  position: absolute;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.7);
  color: var(--neon-cyan);
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 13px;
  border: 1px dashed var(--neon-cyan);
  z-index: 5;
}

/* Exit signs - jumpers between scenes */
.exit-sign {
  position: absolute;
  background: var(--ink);
  border: 2px solid var(--neon-acid);
  color: var(--neon-acid);
  padding: 6px 12px;
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 13px;
  cursor: pointer;
  letter-spacing: .08em;
  z-index: 6;
  box-shadow: 0 0 16px rgba(182,255,0,.4);
  transition: all .2s;
}
.exit-sign:hover {
  background: var(--neon-acid);
  color: var(--ink);
  transform: scale(1.05);
}

/* Footnote ambush - words that subtly shimmer */
.fn {
  cursor: help;
  color: var(--bone);
  border-bottom: 1px dotted rgba(255,226,26,.3);
  position: relative;
}
.fn:hover {
  color: var(--neon-yellow);
  text-shadow: 0 0 8px rgba(255,226,26,.6);
}
@keyframes fnShimmer {
  0%,100% { text-shadow: none; }
  50%     { text-shadow: 0 0 8px rgba(255,43,143,.6); }
}
.fn { animation: fnShimmer 4s ease-in-out infinite; animation-delay: var(--d, 0s); }

/* Two modes: clean editorial vs compromised reality */
#stage[data-mode="editorial"] {
  background: #f4e9c1;
  color: #1a0d04;
}
#stage[data-mode="editorial"] .scene-bar {
  background: #1a0d04;
  color: #f4e9c1;
  border-bottom-color: #f4e9c1;
}
#stage[data-mode="editorial"] .scene-bar button {
  background: #f4e9c1;
  color: #1a0d04;
  border-color: #1a0d04;
}
#stage[data-mode="editorial"] .scene-art { filter: saturate(.4) brightness(.95); }
#stage[data-mode="editorial"] .reveal {
  background: #f4e9c1;
  color: #1a0d04;
  border-color: #1a0d04;
  box-shadow: 6px 6px 0 #8a5a2b;
}
#stage[data-mode="editorial"] .reveal .rh { background: #1a0d04; color: #f4e9c1; }
#stage[data-mode="editorial"] .scene-hint {
  background: #1a0d04;
  color: #f4e9c1;
  border-color: #f4e9c1;
}

#stage[data-mode="compromised"] {
  animation: stageGlitch 6s ease-in-out infinite;
}
@keyframes stageGlitch {
  0%,100% { filter: hue-rotate(0deg) saturate(1); }
  50%     { filter: hue-rotate(20deg) saturate(1.4); }
}
#stage[data-mode="compromised"] .scene-art {
  filter: saturate(1.6) contrast(1.1);
}
#stage[data-mode="compromised"]::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0) 0, rgba(0,0,0,0) 3px, rgba(255,43,143,.06) 4px);
  z-index: 100;
}
#stage[data-mode="compromised"] .reveal { animation: lsdDrool 4s ease-in-out infinite; }

/* Lift transition overlay - падение вниз */
.lift-trans {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9800;
  pointer-events: none;
  animation: liftDrop 1.4s cubic-bezier(.7,0,.3,1) forwards;
}
@keyframes liftDrop {
  0%   { transform: translateY(-100%); }
  40%  { transform: translateY(0); }
  60%  { transform: translateY(0); }
  100% { transform: translateY(100%); }
}
.lift-trans::before {
  content: attr(data-floor);
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-family: var(--psy);
  font-size: 60px;
  color: var(--neon-pink);
  text-shadow: 0 0 30px rgba(255,43,143,.8);
}

/* Ashtray wipe transition - бумага горит */
.ash-wipe {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 30% 30%, transparent 0%, transparent 10%, #1a0d04 30%, #000 100%);
  z-index: 9800;
  pointer-events: none;
  animation: ashBurn 1.2s ease-out forwards;
}
@keyframes ashBurn {
  0%   { background-size: 0% 0%; opacity: 1; }
  100% { background-size: 300% 300%; opacity: 0; }
}

/* Inventory panel */
.inv-panel {
  position: absolute;
  top: 50px; right: 12px;
  width: 220px;
  background: var(--ink);
  border: 2px solid var(--neon-yellow);
  padding: 10px;
  font-family: var(--mono);
  font-size: 12px;
  z-index: 8;
  display: none;
  max-height: 60vh;
  overflow-y: auto;
}
.inv-panel.open { display: block; }
.inv-panel h3 { color: var(--neon-yellow); margin: 0 0 8px; font-family: var(--display); font-size: 14px; }
.inv-panel ul { padding-left: 18px; margin: 0; color: var(--bone); }
.inv-panel ul li { margin-bottom: 4px; }
.inv-panel .empty { color: var(--sand); font-style: italic; }

/* Mini terminal embedded in archive scene */
.scene-term {
  position: absolute;
  bottom: 30px; right: 20px;
  width: 360px;
  height: 200px;
  background: #000;
  color: var(--neon-acid);
  border: 2px solid var(--sand);
  padding: 8px;
  font-family: var(--mono);
  font-size: 12px;
  display: none;
  z-index: 9;
  overflow-y: auto;
}
.scene-term.open { display: block; }
.scene-term input {
  width: 100%;
  background: transparent;
  color: var(--neon-acid);
  border: 0;
  outline: 0;
  font: inherit;
}

/* Mobile scenes */
@media (max-width: 820px) {
  .scene-bar { font-size: 12px; padding: 0 8px; height: 32px; flex-wrap: wrap; }
  .scene-area { top: 32px; }
  .scene-bar .pmeter { display: none; }
  .scene-bar button { font-size: 11px; padding: 3px 6px; }
  .reveal { width: 94%; max-height: 84vh; }
  .reveal .rb { padding: 14px; max-height: 70vh; }
  .exit-sign { font-size: 11px; padding: 5px 8px; }
  .scene-hint { font-size: 11px; }
}
