/* GONG WARS — proudly built with Microsoft FrontPage '98 energy */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", cursive;
  color: #000;
  background-color: #000080;
  background-image:
    radial-gradient(#ffff00 1px, transparent 1.5px),
    radial-gradient(#00ffff 1px, transparent 1.5px);
  background-size: 90px 90px, 60px 60px;
  background-position: 0 0, 30px 30px;
  min-height: 100vh;
}

a { color: #0000ee; }
a:visited { color: #551a8b; }

.page {
  display: flex;
  gap: 8px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px;
  align-items: flex-start;
}

.sidebar { width: 170px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; }
.main { flex: 1; min-width: 0; }

.panel {
  background: #c0c0c0;
  border: 3px outset #fff;
  padding: 8px;
  margin-bottom: 10px;
}

.panel h2, .panel h3 {
  margin: 0 0 6px 0;
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
  font-size: 14px;
  padding: 3px 6px;
  border: 1px solid #000;
}

/* ---------- header ---------- */
.masthead {
  text-align: center;
  background: #000;
  border: 4px ridge #ff00ff;
  padding: 10px 6px 4px;
  margin-bottom: 10px;
}

.masthead h1 {
  margin: 0;
  font-size: 44px;
  letter-spacing: 4px;
  font-weight: bold;
  background: linear-gradient(90deg, #f00, #ff8000, #ff0, #0f0, #0ff, #00f, #f0f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  animation: hueshift 4s linear infinite;
}

@keyframes hueshift { to { filter: hue-rotate(360deg); } }

.masthead .sub {
  color: #0f0;
  font-family: "Courier New", monospace;
  font-size: 12px;
}

marquee.ticker, .ticker {
  background: #000;
  color: #0f0;
  font-family: "Courier New", monospace;
  font-weight: bold;
  border: 2px inset #808080;
  display: block;
  padding: 2px 0;
}

.blink { animation: blink 0.9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.construction {
  text-align: center;
  font-size: 11px;
  background: repeating-linear-gradient(45deg, #ff0 0 12px, #000 12px 24px);
  color: #ff0;
  padding: 2px;
}
.construction span { background: #000; padding: 1px 8px; }

/* ---------- fake ads ---------- */
.ad {
  border: 2px solid #000;
  text-align: center;
  padding: 10px 6px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}
.ad small { font-weight: normal; display: block; }
.ad1 { background: #ff00ff; color: #ff0; animation: adflash 0.7s steps(1) infinite; }
.ad2 { background: #0f0; color: #f00; }
.ad3 { background: #000; color: #0ff; }
.ad4 { background: #ff0; color: #00f; animation: adflash 1.1s steps(1) infinite alternate; }
.ad5 { background: #f00; color: #fff; }
@keyframes adflash { 50% { filter: invert(1); } }
.ad .adbtn {
  background: #c0c0c0; border: 2px outset #fff; color: #000;
  font-size: 11px; margin-top: 6px; display: inline-block; padding: 2px 8px;
}

.counter-box { text-align: center; font-size: 11px; }
.counter {
  font-family: "Courier New", monospace;
  background: #000; color: #0f0;
  letter-spacing: 3px; font-size: 18px;
  padding: 2px 6px; display: inline-block;
  border: 2px inset #808080;
}

.badges { text-align: center; font-size: 10px; line-height: 1.8; }
.badge {
  display: inline-block; background: #000; color: #fff;
  border: 1px solid #808080; padding: 1px 5px; font-family: "Courier New", monospace;
}

/* ---------- status bar ---------- */
.statusbar table { width: 100%; border-collapse: collapse; }
.statusbar td {
  border: 2px inset #808080; background: #000; color: #0f0;
  font-family: "Courier New", monospace; font-weight: bold;
  padding: 3px 8px; font-size: 14px; text-align: center;
}
.statusbar td.warn { color: #ff0; }
.statusbar td.danger { color: #f00; }

#train-timer { font-size: 16px; }

/* ---------- market table ---------- */
table.market { width: 100%; border-collapse: collapse; background: #fff; }
table.market th {
  background: #000080; color: #fff; padding: 3px; font-size: 12px; border: 1px solid #000;
}
table.market td { border: 1px solid #808080; padding: 3px 5px; font-size: 13px; text-align: center; }
table.market td.drug { text-align: left; font-weight: bold; }
table.market tr:nth-child(even) td { background: #e8e8ff; }
td.price { font-family: "Courier New", monospace; font-weight: bold; }
td.price.spike { color: #f00; }
td.price.crash { color: #008000; }
td.pl { font-family: "Courier New", monospace; font-weight: bold; white-space: nowrap; }
td.pl.up { color: #008000; background: #cfc !important; }
td.pl.down { color: #f00; background: #fcc !important; }

button, .btn {
  font-family: "Comic Sans MS", cursive;
  background: #c0c0c0;
  border: 2px outset #fff;
  padding: 2px 7px;
  font-size: 12px;
  cursor: pointer;
}
button:active { border-style: inset; }
button:disabled { color: #808080; cursor: default; }
button.buy { background: #9f9; }
button.sell { background: #f99; }
button.big {
  font-size: 16px; font-weight: bold; padding: 6px 14px; border-width: 3px;
}

/* ---------- travel ---------- */
.stations { display: flex; flex-wrap: wrap; gap: 4px; }
.stations button { flex: 1 1 45%; font-size: 12px; padding: 4px 2px; }
.stations button.here { background: #ff0; font-weight: bold; }
.rail { font-family: "Courier New", monospace; font-size: 11px; white-space: pre; overflow-x: auto; background:#000; color:#fff; padding:4px; }

/* ---------- log ---------- */
#log {
  background: #000; color: #0f0; font-family: "Courier New", monospace;
  font-size: 12px; height: 120px; overflow-y: auto; padding: 4px;
  border: 2px inset #808080;
}
#log .bad { color: #f55; }
#log .good { color: #5f5; }
#log .info { color: #5ff; }

/* ---------- modals ---------- */
#overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  display: none; align-items: center; justify-content: center; z-index: 100;
}
#overlay.show { display: flex; }

.modal {
  background: #c0c0c0; border: 4px outset #fff; padding: 4px;
  width: 340px; max-width: 92vw; text-align: center;
}
.modal .titlebar {
  background: linear-gradient(90deg, #000080, #1084d0); color: #fff;
  font-weight: bold; padding: 3px 6px; text-align: left; font-size: 13px;
}
.modal .body { padding: 14px 10px; font-size: 14px; }
.modal .body .bigicon { font-size: 44px; }
.modal.ted { border-color: #f0f; }
.modal.cops .titlebar { background: linear-gradient(90deg, #f00, #00f); animation: adflash 0.5s steps(1) infinite; }

.timerbar-wrap { background: #fff; border: 2px inset #808080; height: 16px; margin: 8px 0; }
.timerbar { background: repeating-linear-gradient(90deg,#00f 0 10px,#0ff 10px 20px); height: 100%; width: 100%; }

.mash-count { font-size: 22px; font-family: "Courier New", monospace; font-weight: bold; }

/* ---------- screens ---------- */
.screen { display: none; }
.screen.active { display: block; }

.title-art {
  font-family: "Courier New", monospace; font-size: 10px; line-height: 1.1;
  white-space: pre; text-align: center; background: #000; color: #0ff; padding: 8px; overflow-x: auto;
}

table.scores { width: 100%; border-collapse: collapse; background: #fffff0; }
table.scores th { background: #800080; color: #ff0; border: 1px solid #000; padding: 3px; font-size: 12px; }
table.scores td { border: 1px solid #808080; padding: 2px 6px; font-size: 13px; }
table.scores td.money { font-family: "Courier New", monospace; text-align: right; font-weight: bold; color: #008000; }
table.scores tr.me td { background: #ff0; }

input[type=text] {
  font-family: "Courier New", monospace; font-size: 16px;
  border: 2px inset #808080; padding: 3px 6px; width: 180px;
}

.footer {
  text-align: center; color: #fff; font-size: 10px; padding: 10px;
  text-shadow: 1px 1px #000;
}

@media (max-width: 760px) {
  .page { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .sidebar .ad, .sidebar .panel { flex: 1 1 45%; margin-bottom: 0; }
  .masthead h1 { font-size: 30px; }
}

/* ================================================================
   POKIES — "SHINY SHEILA" mini-game.  APPEND ONLY.
   Every class here is namespaced .pk-  (do not edit rules above).
   ================================================================ */

.modal.pk-modal { width: 440px; border-color: #ff00ff; }

.pk-machine {
  background: linear-gradient(#2a0030, #4b006e);
  border: 4px outset #ff00ff;
  padding: 8px;
  text-align: center;
}
.pk-machine.pk-win    { animation: pk-winflash 0.28s steps(1) infinite; }
.pk-machine.pk-big    { animation: pk-winflash 0.18s steps(1) infinite, pk-shake 0.3s linear infinite; }
.pk-machine.pk-jackpot{ animation: pk-rainbow 0.16s steps(1) infinite, pk-shake 0.22s linear infinite; }
.pk-machine.pk-suspense .pk-reel { animation: pk-tension 0.3s steps(1) infinite; }

@keyframes pk-winflash { 0% { background: #4b006e; } 50% { background: #ffcc00; } }
@keyframes pk-rainbow {
  0%   { background: #f00; } 16% { background: #ff8000; } 33% { background: #ff0; }
  50%  { background: #0f0; } 66% { background: #00ffff; } 83% { background: #0000ff; }
  100% { background: #ff00ff; }
}
@keyframes pk-shake {
  0%,100% { transform: translate(0,0); } 25% { transform: translate(-3px,1px); }
  50% { transform: translate(3px,-1px); } 75% { transform: translate(-2px,-2px); }
}
@keyframes pk-tension { 50% { box-shadow: inset 0 0 0 3px #ff0; } }

/* flashing marquee bulbs */
.pk-lights { display: flex; justify-content: space-between; padding: 2px 4px 5px; }
.pk-bulb {
  width: 12px; height: 12px; border-radius: 50%;
  background: #ff0; border: 1px solid #000;
  box-shadow: 0 0 6px #ff0;
  animation: pk-bulbflash 0.7s steps(1) infinite;
}
.pk-bulb:nth-child(2n)   { animation-delay: 0.35s; background: #0ff; box-shadow: 0 0 6px #0ff; }
.pk-bulb:nth-child(3n)   { animation-delay: 0.175s; background: #f0f; box-shadow: 0 0 6px #f0f; }
@keyframes pk-bulbflash { 50% { opacity: 0.15; box-shadow: none; } }

.pk-title {
  font-weight: bold; font-size: 22px; letter-spacing: 2px;
  color: #ffef00;
  text-shadow: 2px 2px #ff0080, -1px -1px #00e5ff;
  background: linear-gradient(90deg,#f00,#ff0,#0f0,#0ff,#00f,#f0f);
  -webkit-background-clip: text; background-clip: text;
  animation: hueshift 3s linear infinite;
}
.pk-title small { font-size: 11px; letter-spacing: 1px; -webkit-text-fill-color: #ffef00; }

.pk-readout { display: flex; gap: 6px; margin: 6px 0; }
.pk-lcd {
  flex: 1; background: #000; border: 2px inset #808080;
  font-family: "Courier New", monospace; font-size: 13px; color: #0f0;
  padding: 3px 4px;
}
.pk-lcd b { font-size: 15px; }
.pk-cash { color: #0f0; }
.pk-net.pk-up   { color: #0f0; }
.pk-net.pk-down { color: #f55; }

/* reel window */
.pk-window { position: relative; background: #111; border: 3px inset #808080; padding: 8px; }
.pk-reels { display: flex; gap: 6px; justify-content: center; }
.pk-reel {
  width: 74px; height: 192px; /* 3 * 64 */
  overflow: hidden;
  background: linear-gradient(#fff,#ddd);
  border: 3px inset #888;
  border-radius: 4px;
}
.pk-strip { will-change: transform; }
.pk-strip.pk-blur { filter: blur(2px) brightness(1.05); }
.pk-cell {
  height: 64px; line-height: 64px; font-size: 42px; text-align: center;
  user-select: none;
}
/* payline highlight across the middle row */
.pk-payline {
  position: absolute; left: 4px; right: 4px; top: 72px; height: 64px;
  border-top: 3px solid rgba(255,0,0,0.85);
  border-bottom: 3px solid rgba(255,0,0,0.85);
  background: rgba(255,255,0,0.12);
  pointer-events: none; z-index: 3;
}
.pk-payline::before, .pk-payline::after {
  content: '►'; position: absolute; top: 50%; transform: translateY(-50%);
  color: #f00; font-size: 16px; text-shadow: 0 0 3px #ff0;
}
.pk-payline::before { left: -2px; }
.pk-payline::after  { right: -2px; content: '◄'; }

/* jackpot marquee overlay */
.pk-marquee-wrap {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  overflow: hidden; z-index: 5; display: none;
  background: #000; border-top: 2px solid #ff0; border-bottom: 2px solid #ff0;
}
.pk-marquee.pk-show { display: block; }
.pk-marquee-wrap:has(.pk-show) { display: block; }
.pk-marquee {
  display: none; white-space: nowrap; font-weight: bold; font-size: 20px;
  color: #ff0; padding: 6px 0;
  animation: pk-scroll 3.5s linear infinite, pk-rainbow 0.16s steps(1) infinite;
  -webkit-background-clip: initial;
}
@keyframes pk-scroll { from { transform: translateX(100%); } to { transform: translateX(-100%); } }

.pk-banner {
  margin: 8px 4px 4px; min-height: 22px; font-weight: bold; font-size: 14px;
  padding: 4px; border: 2px inset #808080; background: #000; color: #fff;
}
.pk-banner.pk-neutral   { color: #0ff; }
.pk-banner.pk-win-txt   { color: #0f0; animation: pk-winflash 0.28s steps(1) infinite; }
.pk-banner.pk-jackpot-txt { color: #000; animation: pk-rainbow 0.16s steps(1) infinite; }
.pk-banner.pk-loss-txt  { color: #f55; }

.pk-bets { display: flex; gap: 6px; justify-content: center; margin: 8px 0; }
.pk-bet {
  flex: 1; font-size: 16px; font-weight: bold; padding: 8px 4px;
  border: 3px outset #fff; background: #ffcc00; color: #a00000;
  font-family: "Comic Sans MS", cursive; cursor: pointer;
}
.pk-bet:active { border-style: inset; }
.pk-bet:disabled { background: #999; color: #666; cursor: default; }

.pk-paytable { width: 100%; border-collapse: collapse; margin: 4px 0; background: #fffff0; }
.pk-paytable td {
  border: 1px solid #808080; padding: 2px 5px; font-size: 13px; text-align: center;
}
.pk-paytable td:nth-child(2n) { font-family: "Courier New", monospace; font-weight: bold; color: #008000; }

.pk-leave {
  width: 100%; margin-top: 6px; font-size: 12px; padding: 5px;
  border: 2px outset #fff; background: #c0c0c0; cursor: pointer;
  font-family: "Comic Sans MS", cursive;
}
.pk-leave:active { border-style: inset; }
