/* The Phantom (1996) — modernized stylesheet.
   Recreates the Netscape-era presentation (BODY colors, FONT sizes,
   CENTER, layout tables) with plain CSS. Per-page colors are injected
   as an inline <style> by the converter. */

:root {
  --link: #00ff00;
  --vlink: #ffffff;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0 auto;
  padding: 24px clamp(12px, 3vw, 40px) 48px;
  max-width: 1200px;
  font-family: "Times New Roman", Times, Georgia, serif;
  font-size: 20px;
  line-height: 1.45;
  background-attachment: fixed;
}

a { color: var(--link); }
a:visited { color: var(--vlink); }

img {
  border: 0;
  max-width: 100%;
  height: auto;
  vertical-align: bottom;
}

h1 { text-align: center; font-size: 2.4em; margin: 0.4em 0; }

.center { text-align: center; }

.img-left  { float: left;  margin: 0 14px 10px 0; }
.img-right { float: right; margin: 0 0 10px 14px; }
.img-middle { vertical-align: middle; }
.img-top    { vertical-align: top; }

hr {
  border: 0;
  border-top: 3px solid currentColor;
  opacity: 0.5;
  margin: 1.2em auto;
}

blockquote { margin: 1em clamp(12px, 4vw, 52px); }

/* 1996 markup uses empty <PRE> blocks as vertical spacers and <PRE> around
   image rows to keep them on one line */
pre {
  font-family: inherit;
  margin: 0.6em 0;
  white-space: pre-wrap;
}

/* Sliced-image composites (e.g. cave entrance + Guran) rebuilt from
   image-only <PRE> strips: the pieces scale together as one image and
   never wrap onto a second line. */
.strip {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  margin: 0 auto;
}
.strip a { display: contents; }
.strip img {
  display: block;
  height: auto;
  max-width: none;
  flex: 0 0 auto;
}

/* Multi-row sliced scenes (e.g. the chronicle bookshelf): stacked strips
   sharing one container so every row scales in lockstep. */
.strip-stack {
  width: 100%;
  margin: 0 auto;
}
.strip-stack .strip { margin: 0 auto; }

/* EPK menu: stone buttons flanked by the two animated torches */
.epk-menu {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: clamp(8px, 2vw, 32px);
  margin: 0.8em 0;
}
.epk-menu .torch {
  width: 18%;
  max-width: 180px;
  height: auto;
  flex: 0 1 auto;
}
.epk-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  max-width: 640px;
  min-width: 0;
  flex: 0 1 auto;
}
.epk-buttons a { flex: 0 1 auto; font-size: 0; }
.epk-buttons img { max-width: 100%; height: auto; }

/* Layout tables, recreated as flexbox (.tbl/.row/.cell replace TABLE/TR/TD) */
.tbl { margin: 0 auto; width: 100%; }
.tbl .row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: var(--gap, 10px);
  margin-bottom: var(--gap, 10px);
}
.tbl .cell { min-width: 0; }
.tbl .cell.ta-center { text-align: center; }
.tbl .cell.va-middle { align-self: center; }

/* Quiz form */
form { margin: 0; }
input[type="text"] {
  font: inherit;
  padding: 4px 10px;
  border: 2px solid currentColor;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.75);
  color: #1a1a1a;
}
input[type="radio"] { transform: scale(1.3); margin-right: 8px; accent-color: #4b0082; }
input[type="submit"] {
  font: inherit;
  font-weight: bold;
  padding: 8px 22px;
  border: 2px solid currentColor;
  border-radius: 6px;
  background: #2e1a47;
  color: #f3e9d2;
  cursor: pointer;
}
input[type="submit"]:hover { background: #4b0082; }
dl { margin: 0.4em 0; }
dd { margin: 0.25em 0 0.25em 40px; }

/* Radio-room sound clips: links play inline via js/phantom.js */
a.sound { position: relative; }
a.sound.playing { outline: 3px solid var(--link); outline-offset: 3px; }

/* Lightbox: full-size stills open in a floating box instead of a new page */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.88);
  cursor: zoom-out;
}
.lightbox img {
  max-width: min(1600px, 94vw);
  max-height: 92vh;
  width: auto;
  height: auto;
  cursor: default;
  box-shadow: 0 0 48px rgba(0, 0, 0, 0.9);
}
.lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  width: 48px;
  height: 48px;
  border: 2px solid #f3e9d2;
  border-radius: 50%;
  background: #2e1a47;
  color: #f3e9d2;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover { background: #4b0082; }

/* Certificate page prints cleanly */
@media print {
  body { background: #fff !important; color: #000 !important; }
  script { display: none; }
}
