/* FREE PEOPLE'S ASSEMBLY — Web 1.0 Shrine Theme
   blood-red / amber / black + relic UI
*/

:root{
  --bg: #050000;
  --panel: rgba(0,0,0,0.78);
  --panel2: rgba(18,0,0,0.72);
  --amber: #ffb000;
  --amber2: #ffd27a;
  --blood: #b00000;
  --blood2: #ff2a2a;
  --ink: #f3e6d0;
  --inkSoft: #d8c8b0;
  --link: #ffb000;
  --visited: #ff5a00;
  --borderA: rgba(255,176,0,0.75);
  --borderB: rgba(176,0,0,0.75);

  --bgimg: url("/img/tile.gif");
  --cursorCross: url("/img/sigil-cursor.png") 2 2;
  --cursorPointer: url("/img/sigil-cursor.png") 2 2;
  --foldClosed: url("/img/fold-rune-closed.gif");
  --foldOpen: url("/img/fold-rune-open.gif");
}

/* Old-school defaults */
html, body { height:100%; }
body{
  margin:0;
  font-family: Verdana, Arial, sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  background-image: var(--bgimg);
  background-repeat: repeat;
  background-attachment: fixed;
cursor: var(--cursorCross), crosshair;
}

a{ color: var(--link); text-decoration: underline; }
a:visited{ color: var(--visited); }
a:hover{
  background: var(--amber);
  color:#000;
  text-decoration:none;
}

code, pre{ font-family: "Courier New", Courier, monospace; color: var(--amber2); }

.page{
  width: 920px;
  max-width: 95vw;
  margin: 16px auto 60px;
  border: 4px ridge var(--borderA);
  background: var(--panel);
  box-shadow: 0 0 0 4px #000, 0 0 28px rgba(255,176,0,0.16);
}

/* header */
.topbar{
  border-bottom: 4px ridge var(--borderA);
  padding: 10px 12px 8px;
  background:
    linear-gradient(180deg, rgba(176,0,0,0.45), rgba(0,0,0,0.75));
}

.sigil{
  display: table;
  width: 100%;
}
.sigil td{
  border: none;
  vertical-align: middle;
}
.sigil .dot{
  width:16px; height:16px;
  background: var(--blood2);
  border: 2px outset var(--amber2);
  box-shadow: 0 0 16px rgba(255,42,42,0.6);
  display:inline-block;
  margin-right: 10px;
}
h1{
  font-size: 18px;
  margin: 0;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--amber2);
}
.subtitle{
  font-size: 11px;
  color: var(--inkSoft);
  margin-top: 4px;
}

/* marquee */
.marqwrap{
  margin-top: 8px;
  border: 2px groove rgba(255,176,0,0.55);
  background: rgba(0,0,0,0.55);
  padding: 6px;
}
marquee{
  color: var(--amber);
  font-size: 12px;
  letter-spacing: 1px;
}

/* table layout like it's 2001 */
table.layout{
  width:100%;
  border-collapse: collapse;
}
td{
  border: 2px groove rgba(255,176,0,0.35);
  vertical-align: top;
}

/* left nav */
.nav{
  width: 230px;
  background: var(--panel2);
  padding: 10px;
}

.nav h2{
  margin:0 0 8px;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--amber2);
  text-transform: uppercase;
}

.nav ul{
  margin:0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.65;
}

/* content */
.main{
  padding: 12px 14px;
  background: rgba(0,0,0,0.62);
}

/* boxes */
.box{
  border: 2px inset rgba(255,176,0,0.25);
  background: rgba(0,0,0,0.45);
  padding: 10px;
  margin: 10px 0;
}
.box h3{
  margin:0 0 6px;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--blood2);
}
.tiny{
  font-size: 11px;
  color: var(--inkSoft);
  line-height: 1.55;
}
.hr{
  height: 1px;
  background: rgba(255,176,0,0.28);
  margin: 10px 0;
}

/* construction banner */
.construction{
  font-family: "Courier New", monospace;
  color: var(--amber2);
  background: rgba(255,176,0,0.08);
  border: 1px dashed rgba(255,176,0,0.65);
  padding: 8px;
}

/* stamps/buttons */
.stamp-row{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}
.stamp{
  font-size: 10px;
  border: 1px solid rgba(255,176,0,0.25);
  padding: 4px 6px;
  background: rgba(10,0,0,0.8);
  color: var(--amber2);
}

/* blink (since <blink> is dead) */
.blink{ animation: blink 1.05s steps(2, end) infinite; }
@keyframes blink{ 50%{ opacity:0; } }

/* footer */
.footer{
  border-top: 4px ridge var(--borderA);
  padding: 10px 12px;
  font-size: 11px;
  color: var(--inkSoft);
  background: rgba(0,0,0,0.85);
  display:flex;
  justify-content: space-between;
  gap:10px;
  flex-wrap: wrap;
}

/* subtle scanlines (optional vibe) */
.scanlines{
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.10;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,176,0,0.10),
    rgba(255,176,0,0.10) 1px,
    transparent 2px,
    transparent 4px
  );
}

/* --- Relic UI elements --- */
.divider{
  display:block;
  margin: 10px auto;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.button88{
  image-rendering: pixelated;
  border: 1px solid rgba(255,176,0,0.25);
  background: rgba(0,0,0,0.25);
}

.snippet{
  width: 100%;
  box-sizing: border-box;
  background: rgba(0,0,0,0.7);
  color: var(--amber2);
  border: 1px inset rgba(255,176,0,0.35);
  padding: 6px;
  font-family: "Courier New", monospace;
  font-size: 11px;
  resize: none;
}


/* Cursor behavior */
a, button, input[type="button"], input[type="submit"]{
  cursor: var(--cursorPointer), pointer;
}

/* Amber selection highlight */
::selection{
  background: rgba(255,176,0,0.55);
  color: #000;
}

/* --- Mobile cleanup (keep the Web 1.0 vibe, make it readable) --- */
img, video, canvas{
  max-width: 100%;
  height: auto;
}
body{ overflow-x: hidden; }

/* Transmission player sizing (Drive iframe) */
#txWrap iframe{
  width: 100%;
  height: 150px;
  border: 0;
}

/* On small screens, stack the table layout so boxes align */
@media (max-width: 760px){
  .page{
    width: 96vw;
    max-width: 96vw;
    margin: 10px auto 40px;
  }

  /* Turn the table layout into a vertical stack */
  table.layout, table.layout tbody, table.layout tr, table.layout td{
    display: block;
    width: 100% !important;
  }

  /* Make borders look intentional when stacked */
  table.layout{ border-collapse: separate; }
  td{
    border-left: 2px groove rgba(255,176,0,0.35);
    border-right: 2px groove rgba(255,176,0,0.35);
  }

  .nav{
    width: auto !important;
    padding: 10px 10px 2px;
  }

  .main{ padding: 10px; }
  .topbar{ padding: 10px 10px 8px; }

  h1{ font-size: 14px; letter-spacing: 1px; }
  .subtitle{ font-size: 10px; }

  .marqwrap{ padding: 4px; }
  marquee{ font-size: 11px; }

  /* Make the 468px divider not force overflow */
  .divider{ width: 100%; height: auto; }

  /* Mobile nav becomes a top link grid */
  .nav ul{
    list-style: none;
    padding-left: 0;
    margin: 6px 0 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .nav ul li{ margin: 0; }
  .nav ul a{
    display: inline-block;
    padding: 6px 8px;
    border: 1px solid rgba(255,176,0,0.45);
    background: rgba(0,0,0,0.55);
    text-decoration: none;
  }

  /* Hide the long copy/paste textarea on phones */
  .nav textarea.snippet{ display: none; }

  /* Give the Drive player enough vertical room (fix overlapping controls) */
  #txWrap iframe{ height: 180px; }

  /* Buttons are easier to tap */
  button, input, select, textarea{ font-size: 14px; }
}

/* Extra-small phones */
@media (max-width: 420px){
  .stamp-row{ gap: 4px; }
  .stamp{ font-size: 9px; }
  .nav ul a{ padding: 5px 7px; }
}


/* --- Mobile refinement: prevent right-edge overflow + keep content inside the border --- */
@media (max-width: 760px){
  /* Make the bordered frame truly contain everything */
  .page{
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    overflow-x: hidden;
    overflow-y: visible;
  }

  /* Prevent any long strings (URLs, code) from forcing horizontal scroll */
  .page, .nav, .main, .box, .tiny, p, li, td{
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  a, code, pre{
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* If a link is extremely long, allow it to wrap cleanly */
  a{
    display: inline;
  }

  /* Media + embeds never exceed frame */
  iframe, img, textarea, input, button, select{
    max-width: 100%;
  }

  /* Keep marquee from pushing width */
  .marqwrap{ overflow: hidden; }

  /* Hide the big copy/paste textarea on phones (it’s the #1 overflow culprit on small screens) */
  .snippet{
    display: none;
  }
}


/* --- Collapsible sidebar (mobile-friendly, still Web 1.0) --- */

/* Rune icons for collapsible sidebar (sigil style) */
details.sidefold > summary{
  display: block;
}
details.sidefold > summary::before{
  content: " ";
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 7px;
  vertical-align: -3px;
  background-image: var(--foldClosed);
  background-repeat: no-repeat;
  background-size: 15px 15px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 6px rgba(255,176,0,0.35));
}
details.sidefold[open] > summary::before{
  background-image: var(--foldOpen);
  filter: drop-shadow(0 0 6px rgba(255,42,42,0.25));
}


details.sidefold{
  padding: 0;
}
details.sidefold > summary{
  list-style: none;
  cursor: pointer;
  user-select: none;
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--blood2);
}
details.sidefold > summary::-webkit-details-marker{ display:none; }

/* Add a little triangle indicator */
@media (max-width: 760px){
  details.sidefold > summary{
    font-size: 13px;
    padding: 4px 0;
  }
}


/* Sidefold header styling */
details.sidefold > summary{
  border-bottom: 1px dotted rgba(255,176,0,0.55);
  padding-bottom: 4px;
}
details.sidefold[open] > summary{
  border-bottom: 1px dotted rgba(176,0,0,0.55);
}


/* --- Header animated sigil/logo --- */
.headergif{
  display: block;
  image-rendering: pixelated;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 0 10px rgba(255,176,0,0.25));
}
.topbar .sigil td{
  vertical-align: top;
}

/* Header banner refinement */
.topbar h1{ margin: 0; }
.headergif{
  margin: 0 auto;
}


/* --- Desktop alignment for banner header (compensate for left dot cell) --- */
@media (min-width: 761px){
  .topbar .sigil{
    width: 100%;
  }
  /* The left dot cell is 30px; shifting the content cell left by half centers the banner */
  .topbar .sigil td:nth-child(2){
    position: relative;
    left: -15px;
  }
  .topbar .subtitle{
    text-align: center;
  }
}


/* --- Remove top-left dot (banner header looks cleaner without it) --- */
.topbar .sigil .dot{
  display: none !important;
}
/* Collapse the empty cell that used to hold the dot */
.topbar .sigil td:first-child{
  width: 0 !important;
  padding: 0 !important;
}
/* Undo the earlier desktop shift now that the dot cell is collapsed */
@media (min-width: 761px){
  .topbar .sigil td:nth-child(2){
    left: 0 !important;
  }
}


/* --- Heaven theme (toggle via <html class="heaven">) --- */
html.heaven{
  --bg: #f5fbff;
  --panel: rgba(255,255,255,0.80);
  --panel2: rgba(235,246,255,0.90);
  --amber: #ffd66a;
  --amber2: #fff2c6;
  --blood: #2a5bd7;
  --blood2: #6aa7ff;
  --ink: #122656;
  --inkSoft: rgba(18,38,86,0.75);
  --link: #1a58d8;
  --visited: #7a4bd6;
  --borderA: rgba(255,215,90,0.85);
  --borderB: rgba(106,167,255,0.70);

  --bgimg: url("/img/tile-heaven.gif");
  --cursorCross: url("/img/heaven-cursor.png") 0 0;
  --cursorPointer: url("/img/heaven-cursor.png") 0 0;
  --foldClosed: url("/img/fold-rune-closed-heaven.gif");
  --foldOpen: url("/img/fold-rune-open-heaven.gif");
}



/* --- Heaven readability pass: keep boxes white, shift text to blues --- */
html.heaven{
  --ink: #10244a;        /* deep navy for body text */
  --inkSoft: #274274;    /* softer navy for secondary text */
  --link: #1a58d8;       /* clear blue link */
  --visited: #6a2bd8;    /* readable purple visited */
}
html.heaven .tiny,
html.heaven p,
html.heaven li,
html.heaven td{
  color: var(--ink);
}
html.heaven .box{
  color: var(--ink);
}
html.heaven h1, html.heaven h2, html.heaven h3{
  color: #1a58d8;
  text-shadow: none;
}
html.heaven a{
  color: var(--link);
}
html.heaven a:visited{
  color: var(--visited);
}

/* --- Heaven: footer should match the light palette (no dark bar) --- */
html.heaven .footer,
body.heaven .footer{
  background: rgba(255,255,255,0.78);
  color: var(--inkSoft);
}
html.heaven .footer a,
body.heaven .footer a{
  color: var(--link);
}



/* Make panels read well in heaven mode */
html.heaven body{
  text-shadow: none;
}
html.heaven .page{
  box-shadow: 0 0 0 4px rgba(255,255,255,0.55), 0 0 28px rgba(106,167,255,0.22);
}
html.heaven .topbar{
  background: linear-gradient(180deg, rgba(106,167,255,0.30), rgba(255,255,255,0.80));
}
html.heaven .main{
  background: rgba(255,255,255,0.70);
}
html.heaven .box{
  background: rgba(255,255,255,0.65);
}
html.heaven a:hover{
  background: rgba(255,215,90,0.85);
  color: #122656;
}
html.heaven ::selection{
  background: rgba(106,167,255,0.45);
  color: #0b1020;
}

/* Portal button: always looks like the *other* realm */
.portalWrap{ display:flex; justify-content: flex-end; }
.portalBtn{
  font-family: "Courier New", monospace;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 10px;
  border: 2px outset rgba(255,215,90,0.85);
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(160,210,255,0.65));
  color: #122656;
  box-shadow: 0 0 16px rgba(106,167,255,0.35);
}
.portalBtn:hover{
  filter: brightness(1.06);
}
html.heaven .portalBtn{
  border: 2px outset rgba(255,176,0,0.55);
  background: linear-gradient(180deg, rgba(35,0,0,0.92), rgba(120,0,0,0.70));
  color: #ffd27a;
  box-shadow: 0 0 16px rgba(255,42,42,0.20);
}


/* --- Portal flash transition (Heaven/Hell) --- */
.portalFlash{
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 9999;
  /* default (hell-ish) */
  background:
    radial-gradient(circle at 50% 50%, rgba(255,176,0,0.92) 0%, rgba(176,0,0,0.35) 28%, rgba(0,0,0,0) 65%),
    repeating-linear-gradient(0deg, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 3px, rgba(255,90,0,0.10) 4px);
  mix-blend-mode: screen;
  filter: blur(0px) saturate(1.25);
}

.portalFlash.flash-heaven{
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.95) 0%, rgba(160,210,255,0.55) 32%, rgba(0,0,0,0) 70%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0) 0px, rgba(255,255,255,0) 3px, rgba(255,215,120,0.12) 4px);
  mix-blend-mode: screen;
  filter: blur(0px) saturate(1.1);
}

.portalFlash.flash-hell{
  background:
    radial-gradient(circle at 50% 50%, rgba(255,176,0,0.92) 0%, rgba(255,42,42,0.35) 30%, rgba(0,0,0,0) 70%),
    repeating-linear-gradient(0deg, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 3px, rgba(255,90,0,0.12) 4px);
  mix-blend-mode: screen;
  filter: blur(0px) saturate(1.25);
}

@keyframes portalFlash{
  0%   { opacity: 0; transform: scale(0.98); }
  18%  { opacity: 1; transform: scale(1.00); }
  55%  { opacity: 0.85; transform: scale(1.01); }
  100% { opacity: 0; transform: scale(1.03); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .portalFlash{ display:none; }
}


/* --- Hidden rune gate + secret links --- */
.runeRow{
  margin-top: 6px;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.runeGate{
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--borderB);
  background: rgba(0,0,0,0.35);
  color: var(--amber2);
  text-decoration: none;
  letter-spacing: 1px;
  opacity: 0.55;
  filter: drop-shadow(0 0 6px rgba(255,176,0,0.18));
}
.runeGate:hover{
  opacity: 1;
  border-color: var(--borderA);
}
.secretLinks{
  opacity: 0.8;
}
.secretLinks a{
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px dotted rgba(255,176,0,0.35);
}
.secretLinks a:hover{ border-bottom-style: solid; }

/* --- Node gates: clickable commands --- */
.gateBtns{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}
.gateBtn{
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid var(--borderB);
  background: rgba(0,0,0,0.28);
  color: var(--amber2);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.2;
  opacity: 0.95;
}
.gateBtn:hover{
  border-color: var(--borderA);
  opacity: 1;
}

/* --- Hidden node: consolidated directory list --- */
.nodeDir{
  list-style: none;
  padding-left: 0;
  margin: 10px 0 8px;
}
.nodeDir li{
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 8px 0;
}
.nodeDir .gateBtn{
  padding: 6px 10px;
  font-size: 13px;
}


/* --- Rare notice toast (system errors / angelic compliance) --- */
#fpaToast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 9997; /* under portalFlash, above everything else */
  max-width: min(560px, 92vw);
  padding: 10px 12px;
  border: 1px solid var(--borderA);
  background: rgba(0,0,0,0.88);
  color: var(--ink);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.45), 0 0 22px rgba(255,176,0,0.16);
  display: none;
}
#fpaToast.show{ display:block; animation: toastIn 220ms ease-out; }
#fpaToast .tTitle{
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: var(--amber2);
}
#fpaToast .tBody{ color: var(--inkSoft); }
#fpaToast .tClose{
  float: right;
  margin-left: 10px;
  border: 1px solid var(--borderB);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 2px 6px;
  font-family: inherit;
}
#fpaToast .tClose:hover{ border-color: var(--borderA); }

@keyframes toastIn{
  from{ opacity: 0; transform: translateX(-50%) translateY(10px); }
  to{ opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Make toast more "heavenly" in heaven mode */
html.heaven #fpaToast{
  background: rgba(255,255,255,0.92);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.55), 0 0 22px rgba(106,167,255,0.20);
}
html.heaven #fpaToast .tTitle{ color: #1a58d8; }
html.heaven #fpaToast .tBody{ color: rgba(18,38,86,0.85); }

/* --- Shrine gallery --- */
.galleryGrid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.galItem{
  display: block;
  padding: 6px;
  border: 1px solid var(--borderA);
  background: var(--panel2);
  text-decoration: none;
}
.galItem img{
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}
.galCap{
  margin-top: 6px;
  font-size: 11px;
  color: var(--inkSoft);
  letter-spacing: 0.5px;
}

/* Overlay viewer */
#galleryOverlay{
  position: fixed;
  inset: 0;
  z-index: 9996;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.86);
}
#galleryOverlay.open{ display:flex; }
#galleryOverlay .galModal{
  width: min(760px, 92vw);
  border: 1px solid var(--borderA);
  background: rgba(0,0,0,0.92);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.5), 0 0 28px rgba(255,176,0,0.14);
  padding: 10px;
}
html.heaven #galleryOverlay{
  background: rgba(245,251,255,0.88);
}
html.heaven #galleryOverlay .galModal{
  background: rgba(255,255,255,0.94);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.55), 0 0 28px rgba(106,167,255,0.18);
}
#galleryOverlay .galTop{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}
#galleryOverlay .galTitle{
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--amber2);
  text-transform: uppercase;
}
html.heaven #galleryOverlay .galTitle{ color: #1a58d8; }
#galleryOverlay .galClose{
  border: 1px solid var(--borderB);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 2px 8px;
  font-family: inherit;
}
#galleryOverlay .galClose:hover{ border-color: var(--borderA); }
#galleryOverlay .galImg{
  margin-top: 10px;
  text-align:center;
}
#galleryOverlay .galImg img{
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
  border: 1px solid rgba(255,176,0,0.35);
}
#galleryOverlay .galText{
  margin-top: 8px;
  font-size: 12px;
  color: var(--inkSoft);
}



/* --- Ritual player (desktop): soften harsh default audio UI --- */
@media (min-width: 760px){
  #ritualPlayer{
    max-width: 100%;
    border: 1px solid var(--borderA);
    border-radius: 8px;
    padding: 4px;
    background: rgba(0,0,0,0.35);
  }
  /* Many desktop browsers render audio controls very bright; this gently darkens them for Hell mode. */
  html:not(.heaven) #ritualPlayer{
    filter: invert(1) hue-rotate(190deg) saturate(0.85) contrast(1.05);
  }
  /* Keep Heaven clean (no inversion), but slightly reduce glare. */
  html.heaven #ritualPlayer{
    filter: saturate(0.95) contrast(1.05);
    background: rgba(255,255,255,0.35);
    border-color: rgba(255, 208, 120, 0.9);
  }
}



/* --- Sidebar 88x31 link button --- */
.linkButton{
  image-rendering: pixelated;
  border: 1px solid rgba(255,176,0,0.6);
  box-shadow: 0 0 10px rgba(255,176,0,0.15);
}
html.heaven .linkButton{
  border-color: rgba(255, 208, 120, 0.9);
  box-shadow: 0 0 10px rgba(106,167,255,0.12);
}



/* --- Visual polish: cooler glow + crisper panels (low-risk) --- */
.box{
  box-shadow: 0 0 0 1px rgba(255,176,0,0.12), 0 10px 24px rgba(0,0,0,0.55);
}
a:hover{
  text-shadow: 0 0 8px rgba(255,176,0,0.25);
}
html.heaven a:hover, body.heaven a:hover{
  text-shadow: 0 0 10px rgba(106,167,255,0.20);
}
.siteBanner{
  display:block;
  margin: 0 auto;
  filter: drop-shadow(0 0 10px rgba(255,176,0,0.12));
}
html.heaven .siteBanner, body.heaven .siteBanner{
  filter: drop-shadow(0 0 10px rgba(106,167,255,0.18));
}



/* --- Pixel tile sizing (keeps RPG-style tiling consistent on desktop + mobile) --- */
body{
  background-size: 256px 256px;
}



/* --- Pixel banner rendering --- */
.siteBanner, .banner img, .banner{
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}



/* --- FIELD REPORT ticker + SIGIL OF THE DAY --- */
.fieldReport .fieldLine{
  font-weight: bold;
  letter-spacing: 0.5px;
  padding: 6px 8px;
  border: 1px dashed rgba(255,176,0,0.55);
  background: rgba(0,0,0,0.25);
  margin-bottom: 6px;
}
.fieldReport .fieldSub{
  opacity: 0.92;
  padding: 4px 8px;
  border: 1px solid rgba(176,0,0,0.35);
  background: rgba(18,0,0,0.20);
}

html.heaven .fieldReport .fieldLine, body.heaven .fieldReport .fieldLine{
  border-color: rgba(255,208,120,0.8);
  background: rgba(255,255,255,0.55);
}
html.heaven .fieldReport .fieldSub, body.heaven .fieldReport .fieldSub{
  border-color: rgba(106,167,255,0.35);
  background: rgba(240,250,255,0.65);
}

.sigilDay{
  text-align: center;
}
.sigilGlyph{
  font-size: 28px;
  line-height: 1;
  margin: 6px 0 8px;
  text-shadow: 0 0 10px rgba(255,42,42,0.20);
}
.sigilText{
  opacity: 0.95;
  padding: 6px 8px;
  border-top: 1px solid rgba(255,176,0,0.25);
}
html.heaven .sigilGlyph, body.heaven .sigilGlyph{
  text-shadow: 0 0 10px rgba(106,167,255,0.22);
}
html.heaven .sigilText, body.heaven .sigilText{
  border-top-color: rgba(255,208,120,0.35);
}

/* --- CRT MODE (subtle, optional) --- */
.portalBtnSmall{
  margin-left: 8px;
  font-size: 12px;
  padding: 6px 10px;
  opacity: 0.95;
}

html.crt body, body.crt{
  /* tiny contrast bump without killing readability */
  filter: contrast(1.02) saturate(1.03);
}

body.crt::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0.00) 0px,
    rgba(0,0,0,0.00) 2px,
    rgba(0,0,0,0.08) 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.35;
}

body.crt::after{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.06) 0%, rgba(0,0,0,0.25) 68%, rgba(0,0,0,0.45) 100%);
  opacity: 0.65;
}

/* Reduced intensity on small screens */
@media (max-width: 760px){
  body.crt::before{ opacity: 0.22; }
  body.crt::after{ opacity: 0.48; }
}



/* --- DISPLAY MODES (Cathometer-ish) --- */
/* These apply on top of Heaven/Hell, using overlay + filter. */

.portalBtnSmall{
  margin-left: 8px;
  font-size: 12px;
  padding: 6px 10px;
  opacity: 0.98;
  min-width: 108px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* baseline: no overlays */
body.display-off::before, body.display-off::after{ content:none !important; }

/* CRT */
body.display-crt{
  filter: contrast(1.08) saturate(1.08);
}
body.display-crt::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0.00) 0px,
    rgba(0,0,0,0.00) 2px,
    rgba(0,0,0,0.11) 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.42;
}
body.display-crt::after{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.08) 0%, rgba(0,0,0,0.22) 68%, rgba(0,0,0,0.50) 100%),
    repeating-linear-gradient(90deg, rgba(255,0,0,0.02) 0px, rgba(255,0,0,0.02) 1px, rgba(0,255,255,0.02) 2px);
  mix-blend-mode: multiply;
  opacity: 0.78;
}

/* GBA / LCD */
body.display-gba{
  filter: contrast(1.12) saturate(1.18) brightness(1.03);
}
body.display-gba::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.08) 0px, rgba(0,0,0,0.08) 1px, rgba(0,0,0,0.00) 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.05) 0px, rgba(0,0,0,0.05) 1px, rgba(0,0,0,0.00) 4px);
  mix-blend-mode: multiply;
  opacity: 0.55;
}
body.display-gba::after{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.06) 0%, rgba(0,0,0,0.18) 70%, rgba(0,0,0,0.40) 100%);
  opacity: 0.70;
}

/* Apple II-ish (soft chroma + mild bleed) */
body.display-apple2{
  filter: contrast(1.12) saturate(0.92) sepia(0.18) hue-rotate(-12deg);
}
body.display-apple2::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.00) 0px, rgba(0,0,0,0.00) 5px, rgba(0,0,0,0.09) 6px),
    radial-gradient(circle at 20% 30%, rgba(255,208,120,0.07) 0%, rgba(0,0,0,0) 55%);
  mix-blend-mode: multiply;
  opacity: 0.55;
}
body.display-apple2::after{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.03) 0%, rgba(0,0,0,0.22) 70%, rgba(0,0,0,0.45) 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 2px, rgba(0,0,0,0.00) 3px);
  opacity: 0.75;
}

/* DOS terminal (amber phosphor) */
body.display-dos{
  filter: grayscale(1) sepia(1) hue-rotate(15deg) saturate(6) contrast(1.12);
}
body.display-dos::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0.00) 0px,
    rgba(0,0,0,0.00) 2px,
    rgba(0,0,0,0.14) 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.42;
}
body.display-dos::after{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,176,0,0.11) 0%, rgba(0,0,0,0.22) 70%, rgba(0,0,0,0.55) 100%);
  opacity: 0.85;
}

/* Mobile: keep overlays lighter */
@media (max-width: 760px){
  body.display-crt::before{ opacity: 0.28; }
  body.display-crt::after{ opacity: 0.55; }
  body.display-gba::before{ opacity: 0.38; }
  body.display-gba::after{ opacity: 0.50; }
  body.display-apple2::before{ opacity: 0.36; }
  body.display-apple2::after{ opacity: 0.55; }
  body.display-dos::before{ opacity: 0.30; }
  body.display-dos::after{ opacity: 0.65; }
}



/* --- Button Wall (Vault) --- */
.buttonWall{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  align-items: center;
  justify-items: center;
  padding: 6px 2px;
}
.btn88{
  display: inline-block;
  width: 88px;
  height: 31px;
  border: 1px solid rgba(255,176,0,0.65);
  background: rgba(0,0,0,0.25);
  box-shadow: 0 0 0 1px rgba(176,0,0,0.35) inset;
}
html.heaven .btn88{
  border-color: rgba(255,208,120,0.80);
  box-shadow: 0 0 0 1px rgba(106,167,255,0.25) inset;
  background: rgba(255,255,255,0.55);
}
.btn88 img{
  width: 88px;
  height: 31px;
  image-rendering: pixelated;
  display: block;
}
.btn88Text{
  width: 88px;
  height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  border: 1px dashed rgba(255,176,0,0.65);
  background: rgba(18,0,0,0.25);
  color: var(--ink);
  font-size: 10px;
  line-height: 1.05;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.btn88Text:hover{
  filter: brightness(1.06);
}
html.heaven .btn88Text{
  border-color: rgba(255,208,120,0.80);
  background: rgba(240,250,255,0.70);
  color: #14305a;
}

/* --- Handout (Print-friendly) --- */
.handoutBox .handoutTitle{
  margin: 4px 0 6px;
  font-size: 28px;
  letter-spacing: 1px;
  text-align: center;
}
.handoutTag{
  text-align: center;
  opacity: 0.92;
  margin: 0 0 14px;
}
.handoutGrid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 10px 0 10px;
}
.handoutPanel{
  border: 1px solid rgba(255,176,0,0.40);
  background: rgba(0,0,0,0.18);
  padding: 10px;
}
html.heaven .handoutPanel{
  border-color: rgba(255,208,120,0.55);
  background: rgba(255,255,255,0.55);
}
.handoutPanel h4{
  margin: 0 0 8px;
  letter-spacing: 1px;
}
.handoutRule{
  margin-top: 10px;
  border-top: 1px solid rgba(255,176,0,0.25);
  padding-top: 10px;
  text-align: center;
}
html.heaven .handoutRule{
  border-top-color: rgba(255,208,120,0.35);
}
@media (max-width: 760px){
  .handoutGrid{ grid-template-columns: 1fr; }
}

/* Print rules: isolate the handout */
@media print{
  body{ background: #fff !important; color: #000 !important; filter: none !important; }
  body::before, body::after{ display: none !important; }
  .nav, .footer, .portalWrap, details.sidefold, #portalFlash, .printHide{ display: none !important; }
  a{ color: #000 !important; text-decoration: none !important; }
  .box{ background: #fff !important; border: 1px solid #000 !important; box-shadow: none !important; }
  .printOnly{ display: block !important; }
}




/* Optional: reduce eye strain in Heaven by slightly lowering brightness when Anti-Fun is on */
html.antifun.heaven body, body.antifun.heaven{
  filter: grayscale(1) contrast(1.04) brightness(0.98);
}

/* Ensure any display-mode overlays do not stack with Anti-Fun */
body.antifun::before,
body.antifun::after{
  content: none !important;
}

/* --- ANTI-FUN (Xerox / zine photocopy mode) --- */
.portalBtnSmall{
  margin-left: 8px;
  font-size: 12px;
  padding: 6px 10px;
  opacity: 0.98;
  min-width: 108px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Override palette variables so Heaven/Hell become irrelevant while Anti-Fun is active */
html.antifun{
  --bg: #f6f2e9;
  --panel: rgba(255,255,255,0.72);
  --panel2: rgba(255,255,255,0.66);
  --amber: #111111;
  --amber2: #2a2a2a;
  --blood: #111111;
  --blood2: #2a2a2a;
  --ink: #121212;
  --inkSoft: #1f1f1f;
  --link: #0b0b0b;
  --visited: #2b2b2b;
  --borderA: rgba(0,0,0,0.65);
  --borderB: rgba(0,0,0,0.50);
}

/* Kill animated theme backgrounds and replace with paper */
html.antifun body,
body.antifun{
  background: #f6f2e9 !important;
  background-image: none !important;
  color: #141414;
  /* photocopy harshness */
  filter: grayscale(1) contrast(1.35) brightness(0.98);
}

/* Ensure any display-mode overlays do not stack with Anti-Fun */
body.antifun::before,
body.antifun::after{
  content: none !important;
}

/* Add Xerox grime overlays (paper fiber + dots + smudge) */
html.antifun body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  /* paper fiber + faint smudges */
  background:
    radial-gradient(circle at 18% 22%, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0) 42%),
    radial-gradient(circle at 76% 58%, rgba(0,0,0,0.07) 0%, rgba(0,0,0,0) 46%),
    radial-gradient(circle at 42% 86%, rgba(0,0,0,0.06) 0%, rgba(0,0,0,0) 40%),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.02) 0px, rgba(0,0,0,0.02) 1px, rgba(0,0,0,0) 5px),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.018) 0px, rgba(0,0,0,0.018) 1px, rgba(0,0,0,0) 7px);
  mix-blend-mode: multiply;
  opacity: 0.55;
}

html.antifun body::after{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  /* halftone-ish dot grid + vignette */
  background:
    radial-gradient(circle, rgba(0,0,0,0.10) 1px, rgba(0,0,0,0) 1.8px),
    radial-gradient(circle at 50% 50%, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.14) 70%, rgba(0,0,0,0.22) 100%);
  background-size: 6px 6px, cover;
  background-position: 0 0, center;
  mix-blend-mode: multiply;
  opacity: 0.45;
  animation: xeroxDrift 2.8s steps(2,end) infinite;
}

/* Slight jitter drift for that "copier walking" feel */
@keyframes xeroxDrift{
  0%{ transform: translate(0px,0px); }
  25%{ transform: translate(1px,0px); }
  50%{ transform: translate(1px,1px); }
  75%{ transform: translate(0px,1px); }
  100%{ transform: translate(0px,0px); }
}

@media (prefers-reduced-motion: reduce){
  html.antifun body::after{ animation: none; }
}

/* Make panels look like photocopied cutouts */
html.antifun .box{
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(0,0,0,0.70);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.18) inset, 2px 2px 0 rgba(0,0,0,0.22);
}

/* Roughen inner borders and separators */
html.antifun hr{
  border: 0;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(0,0,0,0.75) 0px, rgba(0,0,0,0.75) 6px, rgba(0,0,0,0) 10px);
  opacity: 0.85;
}

/* Links like a printed pamphlet */
html.antifun a{
  color: #0b0b0b !important;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
html.antifun a:hover{
  filter: contrast(1.2);
}

/* Pixelate + dirty up images/gifs (including banners/buttons/sigils) */
html.antifun img,
html.antifun video,
html.antifun canvas{
  image-rendering: pixelated;
  filter: grayscale(1) contrast(1.55) brightness(0.96);
}

/* Make text look slightly ink-bled */
html.antifun body,
html.antifun .box,
html.antifun p,
html.antifun li,
html.antifun td{
  text-shadow: 0.3px 0.4px 0 rgba(0,0,0,0.20), -0.2px 0 0 rgba(0,0,0,0.10);
}

/* Buttons become stamped labels */
html.antifun .portalBtn{
  background: rgba(255,255,255,0.85);
  color: #111;
  border: 1px solid rgba(0,0,0,0.80);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.25);
}
html.antifun .portalBtn:hover{
  filter: contrast(1.12);
}

/* Mobile: keep overlays lighter so it doesn't turn into mud */
@media (max-width: 760px){
  html.antifun body{ filter: grayscale(1) contrast(1.22) brightness(1.02); }
  html.antifun body::before{ opacity: 0.40; }
  html.antifun body::after{ opacity: 0.33; background-size: 7px 7px, cover; }
}



/* --- EGO-DEATH (kaleidoscope drift mode) --- */
html.egodeath{
  /* make existing theme variables less dominant */
  --borderA: rgba(255,255,255,0.38);
  --borderB: rgba(255,255,255,0.22);
}

html.egodeath body,
body.egodeath{
  background: #07080d !important;
  background-image: none !important;
  color: rgba(255,255,255,0.92);
  overflow-x: hidden;
}

/* Disable Anti-Fun paper overlays if both classes ever collide */
html.egodeath body::before,
html.egodeath body::after{
  content: "" !important;
}

/* Kaleidoscope layers (behind everything) */
body.egodeath::before{
  content:"";
  position: fixed;
  inset: -40%;
  pointer-events: none;
  z-index: -1;
  background:
    conic-gradient(from 0deg,
      rgba(255,0,150,0.65),
      rgba(0,220,255,0.60),
      rgba(255,210,0,0.62),
      rgba(130,255,0,0.58),
      rgba(255,0,150,0.65)
    );
  filter: blur(0.2px) saturate(1.55);
  opacity: 0.85;
  transform-origin: center;
  animation: egoSpin 16s linear infinite, egoBreathe 5.2s ease-in-out infinite;
  mix-blend-mode: screen;
}

body.egodeath::after{
  content:"";
  position: fixed;
  inset: -25%;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 30% 40%, rgba(255,255,255,0.08) 0%, rgba(0,0,0,0) 55%),
    conic-gradient(from 180deg,
      rgba(30,0,255,0.35),
      rgba(0,255,180,0.35),
      rgba(255,60,0,0.35),
      rgba(255,0,200,0.35),
      rgba(30,0,255,0.35)
    );
  opacity: 0.55;
  filter: blur(1.2px) saturate(1.35);
  mix-blend-mode: overlay;
  animation: egoSpin2 22s linear infinite reverse, egoBreathe 6.6s ease-in-out infinite;
}

/* Floating boxes */
html.egodeath .box{
  background: rgba(0,0,0,0.30);
  border-color: rgba(255,255,255,0.30);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset, 0 8px 30px rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  transform: translate(var(--ego-x, 0px), var(--ego-y, 0px)) rotate(var(--ego-r, 0deg));
  animation: egoFloat var(--ego-d, 10s) ease-in-out infinite;
  animation-delay: var(--ego-delay, 0s);
}

@keyframes egoFloat{
  0%{ transform: translate(calc(var(--ego-x,0px) * -0.6), calc(var(--ego-y,0px) * -0.6)) rotate(calc(var(--ego-r,0deg) * -0.3)); }
  50%{ transform: translate(var(--ego-x,0px), var(--ego-y,0px)) rotate(var(--ego-r,0deg)); }
  100%{ transform: translate(calc(var(--ego-x,0px) * -0.6), calc(var(--ego-y,0px) * -0.6)) rotate(calc(var(--ego-r,0deg) * -0.3)); }
}

@keyframes egoSpin{ from{ transform: rotate(0deg) scale(1.00); } to{ transform: rotate(360deg) scale(1.00); } }
@keyframes egoSpin2{ from{ transform: rotate(0deg) scale(1.06); } to{ transform: rotate(360deg) scale(1.06); } }

@keyframes egoBreathe{
  0%,100%{ filter: blur(0.2px) saturate(1.35) hue-rotate(0deg); }
  50%{ filter: blur(0.6px) saturate(1.80) hue-rotate(40deg); }
}

/* Links become glowing and slightly "alive" */
html.egodeath a{
  color: rgba(255,255,255,0.96) !important;
  text-shadow: 0 0 10px rgba(255,255,255,0.15), 0 0 18px rgba(0,220,255,0.18);
}
html.egodeath a:hover{
  text-shadow: 0 0 10px rgba(255,255,255,0.22), 0 0 22px rgba(255,210,0,0.22);
}

/* Keep nav + footer readable */
html.egodeath .nav,
html.egodeath .footer{
  backdrop-filter: blur(6px);
}

/* Reduced motion: keep colors but stop drifting */
@media (prefers-reduced-motion: reduce){
  body.egodeath::before,
  body.egodeath::after{ animation: none !important; }
  html.egodeath .box{ animation: none !important; transform: none !important; }
}


/* Safety: if both somehow active, prefer EGO-DEATH visuals */
html.antifun.egodeath body{ background:#07080d !important; }
html.antifun.egodeath body::before, html.antifun.egodeath body::after{ content:none !important; }
body.egodeath::before, body.egodeath::after{ z-index:-1; }

/* ============================================================
   FPA FUN PACK v9.23 — whispers, lamp, stamps, relic popups
   ============================================================ */

#whisperTip{
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
  padding: 6px 8px;
  font-size: 12px;
  letter-spacing: 0.3px;
  border: 1px solid rgba(255,176,0,0.55);
  background: rgba(0,0,0,0.78);
  color: var(--amber2);
  max-width: 220px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.45);
}
html.heaven #whisperTip{
  border-color: rgba(219,178,88,0.65);
  background: rgba(255,255,255,0.86);
  color: #1d3b6d;
}
#whisperTip.on{
  opacity: 1;
  transform: translateY(0);
}

.signalLamp{
  display: inline-block;
  margin-left: 10px;
  padding: 2px 6px;
  font-size: 11px;
  letter-spacing: 0.8px;
  border: 1px solid rgba(255,176,0,0.55);
  background: rgba(0,0,0,0.55);
  color: var(--amber2);
  text-transform: uppercase;
}
html.heaven .signalLamp{
  border-color: rgba(219,178,88,0.65);
  background: rgba(255,255,255,0.78);
  color: #1d3b6d;
}
.signalLamp.sigFlick{
  animation: sigFlick 220ms steps(2,end);
}
@keyframes sigFlick{
  0%{ opacity: 1; }
  50%{ opacity: 0.55; }
  100%{ opacity: 1; }
}
.signalLamp.sigLive{ box-shadow: 0 0 12px rgba(255,176,0,0.14); }
.signalLamp.sigNoise{ box-shadow: 0 0 12px rgba(255,0,0,0.12); }
.signalLamp.sigAscend{ box-shadow: 0 0 12px rgba(220,255,255,0.14); }
.signalLamp.sigDegrade{ box-shadow: 0 0 12px rgba(255,90,0,0.14); }
.signalLamp.sigUnknown{ box-shadow: 0 0 12px rgba(255,255,255,0.08); }

.box{ position: relative; }
.sigilStamp{
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
  padding: 0;
  font-family: "Courier New", monospace;
  font-size: 10px;
  line-height: 10px;
  opacity: 0.17;
  pointer-events: none;
  white-space: pre;
  color: var(--amber2);
  text-shadow: 0 0 10px rgba(255,176,0,0.08);
}
html.heaven .sigilStamp{
  opacity: 0.14;
  color: #2a4e85;
  text-shadow: 0 0 10px rgba(219,178,88,0.08);
}
html.antifun .sigilStamp{
  opacity: 0.22;
  color: rgba(0,0,0,0.75);
  text-shadow: none;
}

/* Pocket relic popups */
.relicPop{
  position: fixed;
  left: 16px;
  bottom: 16px;
  width: min(340px, calc(100vw - 32px));
  background: rgba(0,0,0,0.82);
  border: 1px solid rgba(255,176,0,0.68);
  box-shadow: 0 12px 28px rgba(0,0,0,0.55);
  z-index: 99990;
  transform: translateY(12px);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}
.relicPop.on{ transform: translateY(0); opacity: 1; }
.relicPop.bye{ transform: translateY(10px); opacity: 0; }

html.heaven .relicPop{
  background: rgba(255,255,255,0.90);
  border-color: rgba(219,178,88,0.70);
}
html.antifun .relicPop{
  background: rgba(255,255,255,0.92);
  border-color: rgba(0,0,0,0.75);
}

.relicHead{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,176,0,0.35);
}
html.heaven .relicHead{ border-bottom-color: rgba(219,178,88,0.35); }
html.antifun .relicHead{ border-bottom-color: rgba(0,0,0,0.25); }

.relicTitle{
  font-size: 12px;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--amber2);
}
html.heaven .relicTitle{ color: #1d3b6d; }
html.antifun .relicTitle{ color: #111; }

.relicClose{
  font-size: 18px;
  line-height: 18px;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255,176,0,0.45);
  background: rgba(0,0,0,0.45);
  color: var(--amber2);
  cursor: pointer;
}
html.heaven .relicClose{
  border-color: rgba(219,178,88,0.55);
  background: rgba(255,255,255,0.65);
  color: #1d3b6d;
}
html.antifun .relicClose{
  border-color: rgba(0,0,0,0.65);
  background: rgba(255,255,255,0.65);
  color: #111;
}

.relicBody{
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink);
}
html.heaven .relicBody{ color: #1d3b6d; }
html.antifun .relicBody{ color: #111; }

.relicBody code{
  padding: 1px 4px;
  background: rgba(255,176,0,0.16);
  border: 1px solid rgba(255,176,0,0.22);
}
html.heaven .relicBody code{
  background: rgba(219,178,88,0.12);
  border-color: rgba(219,178,88,0.22);
}
html.antifun .relicBody code{
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.18);
}

.relicFoot{
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255,176,0,0.25);
}
html.heaven .relicFoot{ border-top-color: rgba(219,178,88,0.25); }
html.antifun .relicFoot{ border-top-color: rgba(0,0,0,0.20); }

.relicOk{
  padding: 6px 10px;
  border: 1px solid rgba(255,176,0,0.55);
  background: rgba(0,0,0,0.55);
  color: var(--amber2);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 12px;
}
html.heaven .relicOk{
  border-color: rgba(219,178,88,0.55);
  background: rgba(255,255,255,0.70);
  color: #1d3b6d;
}
html.antifun .relicOk{
  border-color: rgba(0,0,0,0.65);
  background: rgba(255,255,255,0.70);
  color: #111;
}

/* Gallery overlay (visions) */
#galleryOverlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99980;
  padding: 18px;
}
#galleryOverlay.on{ display: flex; }
#galleryOverlay .galModal{
  width: min(860px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  background: rgba(0,0,0,0.86);
  border: 1px solid rgba(255,176,0,0.65);
  box-shadow: 0 18px 40px rgba(0,0,0,0.65);
  overflow: hidden;
}
html.heaven #galleryOverlay .galModal{
  background: rgba(255,255,255,0.92);
  border-color: rgba(219,178,88,0.70);
}
html.antifun #galleryOverlay .galModal{
  background: rgba(255,255,255,0.94);
  border-color: rgba(0,0,0,0.75);
}
#galleryOverlay .galTop{
  display:flex;
  justify-content: space-between;
  align-items:center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,176,0,0.35);
}
html.heaven #galleryOverlay .galTop{ border-bottom-color: rgba(219,178,88,0.35); }
html.antifun #galleryOverlay .galTop{ border-bottom-color: rgba(0,0,0,0.20); }
#galleryOverlay .galTitle{
  font-size: 12px;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--amber2);
}
html.heaven #galleryOverlay .galTitle{ color: #1d3b6d; }
html.antifun #galleryOverlay .galTitle{ color: #111; }
#galleryOverlay .galClose{
  padding: 6px 10px;
  border: 1px solid rgba(255,176,0,0.55);
  background: rgba(0,0,0,0.55);
  color: var(--amber2);
  cursor:pointer;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 12px;
}
html.heaven #galleryOverlay .galClose{
  border-color: rgba(219,178,88,0.55);
  background: rgba(255,255,255,0.70);
  color: #1d3b6d;
}
html.antifun #galleryOverlay .galClose{
  border-color: rgba(0,0,0,0.65);
  background: rgba(255,255,255,0.70);
  color: #111;
}
#galleryOverlay .galImg{
  padding: 12px;
  text-align: center;
  overflow: auto;
  max-height: calc(100vh - 140px);
}
#galleryOverlay .galImg img{
  max-width: 100%;
  height: auto;
  image-rendering: auto;
}
#galleryOverlay .galText{
  padding: 0 12px 14px;
  font-size: 13px;
  opacity: 0.9;
  color: var(--inkSoft);
}
html.heaven #galleryOverlay .galText{ color: #355d96; }
html.antifun #galleryOverlay .galText{ color: #111; }

/* Glitch Lens */
html.glitchlens img,
html.glitchlens .main img{
  filter: saturate(1.55) contrast(1.35) hue-rotate(35deg) brightness(1.02);
}
html.heaven.glitchlens img{
  filter: saturate(1.25) contrast(1.25) hue-rotate(-25deg) brightness(1.02);
}
html.antifun.glitchlens img{
  filter: contrast(1.70) brightness(0.98);
}
@media (prefers-reduced-motion: no-preference){
  html.glitchlens img{
    animation: glitchHue 3.6s linear infinite;
  }
  @keyframes glitchHue{
    0%{ filter: saturate(1.55) contrast(1.35) hue-rotate(0deg) brightness(1.02); }
    50%{ filter: saturate(1.65) contrast(1.40) hue-rotate(60deg) brightness(1.05); }
    100%{ filter: saturate(1.55) contrast(1.35) hue-rotate(120deg) brightness(1.02); }
  }
  html.heaven.glitchlens img{
    animation: glitchHueHeaven 4.2s linear infinite;
  }
  @keyframes glitchHueHeaven{
    0%{ filter: saturate(1.20) contrast(1.22) hue-rotate(-10deg) brightness(1.02); }
    50%{ filter: saturate(1.30) contrast(1.25) hue-rotate(-45deg) brightness(1.04); }
    100%{ filter: saturate(1.20) contrast(1.22) hue-rotate(-80deg) brightness(1.02); }
  }
}

/* Small in-content Glitch button */
.glitchBtn{ margin-top: 6px; }


/* Terminal + Cipher pages */
.terminalBox .termScreen{
  height: 260px;
  overflow: auto;
  padding: 10px;
  border: 2px inset rgba(255,176,0,0.45);
  background: rgba(0,0,0,0.65);
  font-family: "Courier New", monospace;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink);
}
html.heaven .terminalBox .termScreen{
  background: rgba(255,255,255,0.82);
  border-color: rgba(219,178,88,0.55);
  color: #1d3b6d;
}
html.antifun .terminalBox .termScreen{
  background: rgba(255,255,255,0.92);
  border-color: rgba(0,0,0,0.75);
  color: #111;
}

.termLine{ margin: 2px 0; }
.termDim{ opacity: 0.75; }
.termInputRow{
  display:flex;
  gap: 8px;
  align-items:center;
  margin-top: 10px;
}
.termPrompt{
  font-family: "Courier New", monospace;
  font-size: 13px;
  opacity: 0.9;
}
.termInput{
  flex: 1;
  padding: 6px 8px;
  border: 2px inset rgba(255,176,0,0.45);
  background: rgba(0,0,0,0.55);
  color: var(--ink);
  font-family: "Courier New", monospace;
}
html.heaven .termInput{
  background: rgba(255,255,255,0.78);
  border-color: rgba(219,178,88,0.55);
  color: #1d3b6d;
}
html.antifun .termInput{
  background: rgba(255,255,255,0.92);
  border-color: rgba(0,0,0,0.75);
  color: #111;
}

.termBtn{
  padding: 6px 10px;
  border: 2px outset rgba(255,176,0,0.55);
  background: rgba(0,0,0,0.55);
  color: var(--amber2);
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
html.heaven .termBtn{
  border-color: rgba(219,178,88,0.55);
  background: rgba(255,255,255,0.70);
  color: #1d3b6d;
}
html.antifun .termBtn{
  border-color: rgba(0,0,0,0.75);
  background: rgba(255,255,255,0.70);
  color: #111;
}

.cipherPre{
  margin: 6px 0;
  padding: 10px;
  border: 2px inset rgba(255,176,0,0.45);
  background: rgba(0,0,0,0.55);
  color: var(--ink);
  font-family: "Courier New", monospace;
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
}
html.heaven .cipherPre{
  background: rgba(255,255,255,0.82);
  border-color: rgba(219,178,88,0.55);
  color: #1d3b6d;
}
html.antifun .cipherPre{
  background: rgba(255,255,255,0.92);
  border-color: rgba(0,0,0,0.75);
  color: #111;
}


