/* Chaos Island wiki: "InGen Field Network", a 1998 intranet built from the game's own UI art.
   Images come from the CD at build time (port/web/wiki/build.py); nothing here is game data. */
@font-face { font-family: "CIStencil"; src: url(font/StardosStencil-Bold.ttf); font-display: swap; }
:root {
  --ingen: #215229; --ingen-hi: #3c7a46; --alert: #940000; --bevel: #c6c6c6;
  --sand: #f7de9c; --phos: #7cff8a; --panel: #1a1f1a; --text: #d8e6d0; --muted: #8fa58a;
  --mono: "Lucida Console", Monaco, "Courier New", monospace;
  --stencil: "CIStencil", Impact, "Arial Black", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #050805 url(img/tile_jungle.png); color: var(--text);
  font: 12px/1.5 Verdana, Tahoma, "MS Sans Serif", sans-serif;
}
body::before { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.78); z-index: -1; }
a { color: var(--sand); } a:visited { color: #d9b86a; } a:hover { color: #fff; }
img { max-width: 100%; }
.page { width: 820px; max-width: 100%; margin: 0 auto; padding: 8px 8px 24px; }

/* the game's popup window: green title bar over a grey bevel */
.win { background: var(--panel); border: 2px solid; border-color: var(--bevel) #3a3a3a #3a3a3a var(--bevel); margin-bottom: 8px; }
.win > .tb {
  display: flex; align-items: center; gap: 4px; min-height: 18px; padding: 0 4px 0 1px;
  background: var(--ingen); border-bottom: 1px solid #000; color: #e8f4e0;
  font: 10px/1.2 var(--mono); letter-spacing: 1px; text-transform: uppercase;
}
.win > .tb img { width: 16px; height: 16px; flex: none; }
.win > .tb.red { background: var(--alert); }
.win > .bd { padding: 8px; }
.win > .bd > :first-child { margin-top: 0; } .win > .bd > :last-child { margin-bottom: 0; }
.stone { background: url(img/tile_stone.png); color: #1c1a14; }
.stone a { color: #5a1200; }

/* header */
.top { display: flex; align-items: center; gap: 10px; background: #000; border: 2px solid; border-color: var(--bevel) #333 #333 var(--bevel); padding: 4px 8px; text-decoration: none; }
.top img.ingen { width: 82px; height: auto; }
.top .t { flex: 1; min-width: 0; }
.top .h1 { font: 22px/1 var(--stencil); color: var(--sand); margin: 0; letter-spacing: 2px; }
.top .sub { font: 10px var(--mono); color: var(--phos); }
.top .clock { font: 10px var(--mono); color: var(--phos); text-align: right; white-space: nowrap; }
.ticker { background: #000; color: #ff4a3a; font: bold 10px var(--mono); border: 1px solid #400; margin: 6px 0 8px; padding: 2px 0; overflow: hidden; white-space: nowrap; }
.ticker span { display: inline-block; padding-left: 100%; animation: tick 34s linear infinite; }
@keyframes tick { to { transform: translateX(-100%); } }

/* table-style column layout */
.cols { display: grid; grid-template-columns: 168px minmax(0, 1fr) 170px; gap: 8px; }
.cols.two { grid-template-columns: 168px minmax(0, 1fr); }

.nav a { display: flex; align-items: center; gap: 6px; padding: 2px 0; text-decoration: none; font: 13px var(--stencil); color: #1c1a14; letter-spacing: .5px; }
.nav a .k { width: 24px; height: 23px; background: url(img/knob_off.png) center/24px no-repeat; flex: none; }
.nav a:hover .k, .nav a.on .k { background-image: url(img/knob_on.png); }
.nav a:hover { color: var(--alert); }
.nav hr { border: 0; border-top: 1px solid #8b836c; border-bottom: 1px solid #fffbe8; margin: 6px 0; }
.sideplay { display: block; width: 150px; height: 75px; margin: 0 auto; background: url(img/play.png) center/150px no-repeat; }
.sideplay:hover { background-image: url(img/play_hover.png); }
.hide { position: absolute; left: -9999px; }

/* the game's own dialog border */
.hazard { border: 18px solid transparent; border-image: url(img/frame_hazard.png) 20 stretch; background: url(img/tile_stone.png); margin-bottom: 8px; }
.hero { text-align: center; padding: 6px 4px 10px; color: #1c1a14; }
.hero img.logo { width: 230px; display: block; margin: 0 auto; filter: drop-shadow(2px 3px 0 rgba(0,0,0,.5)); }
.hero p { margin: 4px 24px; font-size: 12px; }
.play { display: inline-block; width: 214px; height: 107px; background: url(img/play.png) no-repeat; margin: 2px auto 0; }
.play:hover { background-image: url(img/play_hover.png); }
.req { font: 9px var(--mono); color: #4b4535; }

/* content */
.doc h1 { font: 24px/1.1 var(--stencil); color: var(--sand); margin: 2px 0 8px; letter-spacing: 1px; }
.doc h2 { font: 17px/1.2 var(--stencil); color: var(--sand); margin: 18px 0 6px; letter-spacing: .5px; border-bottom: 1px solid #2c4a30; padding-bottom: 2px; }
.doc h3 { font: 14px var(--stencil); color: var(--sand); margin: 12px 0 4px; letter-spacing: .5px; }
.doc p, .doc li { font-size: 12px; }
.doc ul { padding-left: 18px; margin: 4px 0 8px; } .doc li { margin: 2px 0; }
.lede { font-size: 13px !important; color: #e8f4e0; }
.muted { color: var(--muted); font-size: 11px; }
.mono { font-family: var(--mono); }
kbd { font: 10px var(--mono); background: #000; color: var(--phos); border: 1px solid #2c4a30; border-bottom-width: 2px; padding: 0 4px; white-space: nowrap; }
code { font: 11px var(--mono); color: var(--phos); }
.toc { display: flex; flex-wrap: wrap; gap: 4px 12px; font: 11px var(--mono); text-transform: uppercase; }
.quote { border-left: 3px solid var(--ingen-hi); margin: 6px 0; padding: 2px 8px; color: #e8f4e0; font-style: italic; }
.quote cite { display: block; font: normal 9px var(--mono); color: var(--muted); text-transform: uppercase; margin-top: 2px; }

table.stats { border-collapse: collapse; width: 100%; font-size: 11px; background: #0d140e; margin: 4px 0 8px; }
table.stats th, table.stats td { border: 1px solid #2c4a30; padding: 2px 5px; text-align: left; vertical-align: middle; }
table.stats th { background: var(--ingen); color: #e8f4e0; font-weight: normal; text-transform: uppercase; letter-spacing: .5px; font-size: 10px; }
table.stats td.n, table.stats th.n { text-align: right; font-family: var(--mono); }
table.stats td.n { color: var(--phos); }
table.stats td.c, table.stats th.c { text-align: center; }
/* game pixel art is drawn at exactly half size (zoom): one image pixel per screen pixel on 2x screens, so it stays sharp */
table.stats img.icon { zoom: .5; max-width: none; display: block; margin: 0 auto; }
.scroll { overflow-x: auto; }

/* an encyclopedia entry: field card beside its facts */
.entry { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 10px; align-items: start; }
.entry > img { zoom: .5; border: 2px solid #000; }
.entry .facts { font: 10px var(--mono); color: var(--phos); text-transform: uppercase; margin-bottom: 4px; }
.entry .facts span { display: inline-block; margin-right: 10px; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cards a { text-align: center; text-decoration: none; font-size: 10px; }
.cards img { width: 100%; display: block; border: 1px solid #000; }
.team { display: flex; gap: 6px; justify-content: space-between; flex-wrap: wrap; }
.team a { text-align: center; text-decoration: none; font: 11px var(--stencil); letter-spacing: .5px; width: 64px; }
.team img { zoom: .5; display: block; margin: 0 auto 4px; }

.mission { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 10px; align-items: start; }
.mission > img { width: 176px; border: 1px solid #000; }
.map { display: block; border: 2px solid; border-color: #444 var(--bevel) var(--bevel) #444; image-rendering: auto; max-width: 100%; margin: 6px 0; }
.mlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; font-size: 11px; margin: 0; padding: 0; list-style: none; }
.mlist b { color: var(--sand); font-family: var(--mono); font-weight: normal; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.gallery img { width: 100%; display: block; border: 1px solid #000; }
.gallery figure { margin: 0; } .gallery figcaption { font: 10px var(--mono); color: var(--muted); text-transform: uppercase; }
.sprite { display: block; margin: 0 auto; image-rendering: pixelated; }

/* right column */
.bulletin { margin: 0 0 8px; font-size: 11px; }
.bulletin b { display: block; color: var(--sand); font-size: 11px; }
.bulletin small { color: var(--muted); font-family: var(--mono); font-size: 9px; }
.status div { display: flex; justify-content: space-between; gap: 4px; font: 10px var(--mono); padding: 1px 0; }
.led { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2f2; box-shadow: 0 0 4px #2f2; margin-right: 4px; }
.led.r { background: #f22; box-shadow: 0 0 4px #f22; animation: blink 1s steps(2) infinite; }
.led.y { background: #fc2; box-shadow: 0 0 4px #fc2; }
@keyframes blink { 50% { opacity: .15; } }
.walker { height: 52px; overflow: hidden; position: relative; border-top: 1px solid #2c4a30; margin-top: 6px; }
.walker i { position: absolute; top: 0; width: var(--fw); height: var(--fh); background-repeat: no-repeat; background-position: 0 0; background-size: calc(var(--fw) * 9) var(--fh);
  animation: frames .9s steps(9) infinite, walk 14s linear infinite; }
@keyframes frames { to { background-position-x: calc(var(--fw) * -9); } }
@keyframes walk { from { left: -160px; } to { left: 170px; } }
.tip { font-size: 11px; font-style: italic; }

.foot { margin-top: 10px; text-align: center; font-size: 10px; color: var(--muted); }
.foot .stripe { height: 8px; background: repeating-linear-gradient(-45deg, #f7c600 0 10px, #111 10px 20px); margin-bottom: 6px; border: 1px solid #000; }

@media (max-width: 760px) {
  .cols, .cols.two { grid-template-columns: minmax(0, 1fr); }
  .cols > .main { order: -1; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .entry, .mission { grid-template-columns: minmax(0, 1fr); }
  .entry > img, .mission > img { margin: 0 auto; }
  .team { justify-content: center; }
  .top .h1 { font-size: 17px; }
  .top img.ingen { width: 56px; }
  .gallery { grid-template-columns: minmax(0, 1fr); }
  .hero p { margin: 4px 4px; }
}
