/* ==========================================================================
   STRATTON ARCADE — the games' own chrome.
   Win95 furniture above; everything inside the black screen is drawn in
   js/px.js, so nothing in here styles the pixels themselves.
   ========================================================================== */

/* ---- stage toggles (C / T) ---- */
body.no-taskbar #taskbar { display: none; }
body.no-taskbar #desktop { inset: 0; }
body.no-crt #crt, body.no-crt #degauss { display: none; }
#start-menu { width: 260px; }

/* ---- the low-res screen ---- */
.px-screen {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
}
.gm-screenwrap {
  flex: none;
  background: #000;
  box-shadow: var(--bevel-sunken);
  padding: 2px;
  display: flex; justify-content: center;
}

/* ---- a game window ---- */
.gm-root {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--face);
  padding: 3px;
  gap: 3px;
}
.gm-panel {
  flex: 1;
  min-height: 0;
  display: flex; gap: 4px;
  overflow: hidden;
}
.gm-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gm-col.grow { flex: 1; }

/* a titled group box, Win95 style */
.gm-group {
  position: relative;
  box-shadow: var(--bevel-thin-raised);
  border: 1px solid var(--shadow);
  border-right-color: var(--hilite); border-bottom-color: var(--hilite);
  padding: 12px 6px 6px;
  min-height: 0;
  display: flex; flex-direction: column;
}
.gm-group > legend, .gm-group > .gm-legend {
  position: absolute; top: -6px; left: 6px;
  background: var(--face);
  padding: 0 4px;
  font-size: 10px; font-weight: bold; letter-spacing: .3px;
  color: #000080;
}
.gm-scroll { overflow: auto; min-height: 0; }

/* ---- LED read-outs ---- */
.gm-led {
  box-shadow: var(--bevel-sunken);
  background: #050d07;
  color: #39ff7a;
  font-family: "IBM Plex Mono", var(--font-mono);
  font-weight: 700;
  padding: 4px 8px;
  text-align: right;
  letter-spacing: .5px;
  text-shadow: 0 0 6px rgba(57,255,122,.45);
  white-space: nowrap; overflow: hidden;
}
.gm-led.big { font-size: 19px; padding: 5px 8px; }
.gm-led.amber { color: #ffcc33; text-shadow: 0 0 6px rgba(255,204,51,.45); }
.gm-led.red { color: #ff5b50; text-shadow: 0 0 6px rgba(255,91,80,.45); }
.gm-ledlab {
  font-size: 9.5px; letter-spacing: .6px; color: #333;
  text-transform: uppercase; margin-bottom: 2px;
}

/* ---- fields and buttons ---- */
.gm-field {
  box-shadow: var(--bevel-sunken);
  background: #fff;
  padding: 3px 5px;
  font-family: "IBM Plex Mono", var(--font-mono);
  font-size: 12px;
  border: 0; outline: none;
  width: 100%;
  cursor: inherit;
}
.gm-row { display: flex; gap: 4px; align-items: center; }
.gm-row.wrap { flex-wrap: wrap; }
.gm-lab { font-size: 10px; color: #222; text-transform: uppercase; letter-spacing: .4px; }

.gm-btn {
  box-shadow: var(--bevel-raised);
  background: var(--face);
  padding: 4px 10px;
  font-size: 11px;
  border: 0;
  min-width: 34px;
  color: #000;
}
.gm-btn:active:not([disabled]) { box-shadow: var(--bevel-sunken); padding: 5px 9px 3px 11px; }
.gm-btn[disabled] { color: var(--shadow); text-shadow: 1px 1px 0 var(--hilite); }
.gm-btn.wide { width: 100%; }
.gm-btn.go {
  font-weight: bold; font-size: 15px; letter-spacing: .6px;
  padding: 9px 10px;
  color: #003c14;
}
.gm-btn.go.sell { color: #7a1400; }
.gm-btn.go:active:not([disabled]) { padding: 10px 9px 8px 11px; }
.gm-btn.small { padding: 2px 6px; font-size: 10px; min-width: 0; }
.gm-btn.on { box-shadow: var(--bevel-sunken); background:
  repeating-conic-gradient(#c0c0c0 0 25%, #d8d8d8 0 50%) 0 0 / 4px 4px; }

/* ---- result chips ---- */
.gm-chips { display: flex; gap: 3px; flex-wrap: wrap; }
.gm-chip {
  font-family: "IBM Plex Mono", var(--font-mono);
  font-size: 10px; font-weight: 700;
  padding: 2px 4px;
  box-shadow: var(--bevel-thin-raised);
  background: #d4d0c8;
}
.gm-chip.win { background: #157a3a; color: #eaffe9; }
.gm-chip.mid { background: #b08a12; color: #fff8e0; }
.gm-chip.lose { background: #8f1712; color: #ffe6e4; }

.gm-note { font-size: 9.5px; color: #444; line-height: 1.35; }
.gm-note b { color: #000080; }
.gm-warn { color: #8f1712; font-weight: bold; }

/* ==========================================================================
   THE PUMP
   ========================================================================== */
.pu-hist { display: flex; flex-direction: column; gap: 1px; }
.pu-row {
  display: flex; align-items: center; gap: 6px;
  font-family: "IBM Plex Mono", var(--font-mono);
  font-size: 10.5px;
  padding: 2px 4px;
  background: #fff;
  box-shadow: var(--bevel-thin-sunken);
}
.pu-row .pu-n { color: #666; width: 34px; flex: none; }
.pu-row .pu-m { flex: 1; font-weight: 700; }
.pu-row .pu-v { font-weight: 700; }
.pu-row.win .pu-m, .pu-row.win .pu-v { color: #157a3a; }
.pu-row.lose .pu-m, .pu-row.lose .pu-v { color: #8f1712; }

/* ==========================================================================
   THE CALLING FLOOR
   ========================================================================== */
.fl-card { width: 100%; border-collapse: collapse; font-size: 10px; }
.fl-card th {
  background: var(--face); box-shadow: var(--bevel-thin-raised);
  font-size: 9px; text-transform: uppercase; letter-spacing: .3px;
  padding: 2px 3px; text-align: left; color: #000080;
  position: sticky; top: 0; z-index: 2;
}
.fl-card td { padding: 1px 3px; border-bottom: 1px solid #b8b4ac; vertical-align: middle; white-space: nowrap; }
.fl-card tr.on td { background: #b8d0f0; }
.fl-card canvas { image-rendering: pixelated; display: block; }
.fl-name { font-weight: bold; font-size: 10.5px; white-space: nowrap; }
.fl-nick { font-size: 9px; color: #444; font-style: italic; white-space: nowrap; }
.fl-form { font-family: "IBM Plex Mono", var(--font-mono); font-size: 10px; letter-spacing: 1px; }
.fl-form b { color: #157a3a; }
.fl-cond.up { color: #157a3a; font-weight: bold; }
.fl-cond.dn { color: #8f1712; font-weight: bold; }
.fl-odds { font-family: "IBM Plex Mono", var(--font-mono); font-weight: 700; min-width: 42px; }
.fl-tickets { display: flex; flex-direction: column; gap: 2px; }
.fl-ticket {
  display: flex; gap: 4px; align-items: center;
  font-size: 10px;
  background: #fff; box-shadow: var(--bevel-thin-sunken);
  padding: 2px 4px;
}
.fl-ticket .x { margin-left: auto; }
.fl-empty { font-size: 9.5px; color: #666; font-style: italic; padding: 3px; }

/* ==========================================================================
   PHONES — one column, the screen takes the width it can get, and every
   tap target grows. The Win95 window goes full-screen so nothing is lost
   off the right edge.
   ========================================================================== */
@media (max-width: 720px) {
  .w95-window.phone-full {
    left: 0 !important; top: 0 !important;
    width: 100% !important; height: 100% !important;
    padding: 2px;
  }

  /* the low-res screen scales to the width, nearest-neighbour */
  .px-screen { width: 100% !important; height: auto !important; }
  .gm-screenwrap { padding: 1px; }

  /* the panel stops being three columns and becomes one scrolling stack */
  .gm-root { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 2px; gap: 4px; }
  .gm-panel { flex-direction: column; overflow: visible; flex: none; }
  .gm-col, .gm-col.grow { flex: none !important; width: 100% !important; }
  .gm-panel .gm-group { flex: none !important; min-height: 0; padding: 13px 7px 8px; }
  .gm-scroll { overflow: visible; max-height: none; }

  /* fingers, not mice */
  .gm-btn { min-height: 32px; padding: 6px 12px; }
  .gm-btn.small { min-height: 28px; padding: 5px 9px; font-size: 11px; }
  .gm-btn.go { font-size: 16px; padding: 12px 10px; }
  /* 16px keeps iOS from zooming the page when the field takes focus */
  .gm-field { font-size: 16px; padding: 6px 7px; }
  .gm-row.wrap { gap: 5px; }
  .gm-led.big { font-size: 18px; }
  .gm-chip { font-size: 11px; padding: 3px 5px; }

  /* the sheet drops the columns the screen already shows in full */
  .fl-card .fl-hide, .gm-note .fl-hide { display: none; }
  .fl-card td { padding: 3px; }
  .fl-ticket { padding: 4px 5px; font-size: 11px; }
  .pu-row { font-size: 11.5px; padding: 4px 5px; }

  /* long dialogs (the rules, the bell) scroll instead of overflowing */
  .dlg-text { font-size: 11px; overflow-x: auto; }
  .w95-dialog-body { max-height: 62vh; overflow-y: auto; }
}

/* very small phones: give the screen every pixel */
@media (max-width: 400px) {
  .gm-root { padding: 1px; }
  .gm-panel .gm-group { padding: 12px 5px 7px; }
  .gm-btn.small { padding: 5px 7px; }
}

/* ── PUMP LIVE (the on-chain desk) ── */
.pl-root { padding: 10px 12px; font: 12px "IBM Plex Mono", monospace; background: #0a0a08; color: #e4e4d8; height: 100%; overflow-y: auto; }
.pl-note { color: #9a9a84; padding: 18px 6px; line-height: 1.6; }
.pl-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 4px 0 8px; border-bottom: 1px solid #2b2b1c; }
.pl-row b { color: #ffd75e; }
.pl-house { margin-left: auto; color: #9a9a84; font-size: 11px; }
.pl-halt { color: #ff5b4d; }
.pl-ticket { display: flex; gap: 8px; align-items: center; padding: 12px 0 4px; flex-wrap: wrap; }
.pl-lbl { color: #8a8a72; font-size: 10px; letter-spacing: .6px; }
.pl-ticket .gm-field { width: 90px; }
.pl-pump { font-weight: 700; padding: 4px 18px; }
.pl-quote { color: #9a9a84; font-size: 11px; padding: 2px 0 10px; line-height: 1.5; }
.pl-quote b { color: #7fe08f; }
.pl-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.pl-table th { text-align: left; color: #ff9900; border-bottom: 1px solid #2b2b1c; padding: 3px 6px; font-weight: 700; }
.pl-table td { padding: 4px 6px; border-bottom: 1px dotted #22221a; }
.pl-table a { color: #ffc233; }
.pl-st-2 { color: #7fe08f; font-weight: 700; }
.pl-st-3 { color: #ff8a7a; }
.pl-st-4 { color: #9a9a84; }
.pl-act { font-size: 11px; padding: 1px 10px; }
.pl-fair { color: #6f6f5c; font-size: 10px; line-height: 1.5; padding: 10px 0 4px; border-top: 1px solid #2b2b1c; margin-top: 10px; }
.pl-tape { font-size: 10px; padding-top: 4px; color: #b9b9d4; }
.pl-tape a { color: #ffc233; }
.pl-tx-pending { color: #ffd75e; }
.pl-tx-confirmed { color: #7fe08f; }
.pl-tx-failed { color: #ff5b4d; }
