/* The park's windows: grey-blue bevelled game windows with tabs, a title bar and a status line. */
:root {
  --face: #7d8fa3; --hi: #b7c6d6; --lo: #3a4756; --edge: #141b23;
  --title: #2c3b4d; --title2: #3d5068; --body: #c3ceda; --page: #e6ecf1; --ink: #121820; --muted: #3e4a57;
  --font: 'Tiny5', 'Trebuchet MS', system-ui, sans-serif;
  --ab-fg: #121820; --ab-muted: #3e4a57; --ab-accent: #c0392b;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #3f7d2f; font-family: var(--font); color: var(--ink); }
body { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }

#park { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; outline: none; image-rendering: pixelated; }
#park.drag { cursor: grabbing; }
#park.hot { cursor: pointer; }
#park:focus-visible { box-shadow: inset 0 0 0 3px #f2c230; }

/* bevels */
.bev { border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi); }

/* toolbar: two button groups along the top, like the game's */
#bar { position: fixed; top: max(6px, env(safe-area-inset-top)); left: max(6px, env(safe-area-inset-left)); right: max(6px, env(safe-area-inset-right)); display: flex; justify-content: space-between; pointer-events: none; z-index: 20; }
#bar .grp { display: flex; gap: 2px; padding: 2px; background: var(--face); border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi); box-shadow: 0 0 0 1px var(--edge), 3px 3px 0 rgba(0, 0, 0, .3); pointer-events: auto; }
.tb { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; background: var(--face); border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi); cursor: pointer; }
.tb svg { width: 28px; height: 28px; image-rendering: pixelated; }
.tb:hover { background: #8ea0b4; }
.tb:active, .tb[aria-pressed="true"], .tb.on { border-color: var(--lo) var(--hi) var(--hi) var(--lo); background: #6c7e92; }
.tb:focus-visible, .wx:focus-visible, .tabs [role=tab]:focus-visible, .btn:focus-visible, .rows button:focus-visible { outline: 2px solid #f2c230; outline-offset: 1px; }
#b-snd .waves { display: none; }
#b-snd[aria-pressed="true"] .waves { display: inline; }
#b-snd[aria-pressed="true"] .mute { display: none; }

/* cash, bottom left: game state, not a control */
#cash { position: fixed; left: max(8px, env(safe-area-inset-left)); bottom: max(8px, env(safe-area-inset-bottom)); z-index: 15; pointer-events: none; display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 6px; background: var(--face); border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi); box-shadow: 0 0 0 1px var(--edge); font-size: 19px; color: #fff; text-shadow: 1px 1px 0 #1b2530; letter-spacing: .5px; }
#cash .coin { width: 14px; height: 14px; background: #f2c230; box-shadow: inset -2px -2px 0 #b8860b, inset 2px 2px 0 #ffe27a; }
#cash.blip #cash-n { color: #b8ff8a; }

/* hover label over a ride */
#tip { position: fixed; z-index: 16; pointer-events: none; display: none; padding: 3px 8px 4px; background: #fffbe0; color: var(--ink); border: 1px solid var(--edge); box-shadow: 2px 2px 0 rgba(0, 0, 0, .35); font-size: 15px; white-space: nowrap; transform: translate(-50%, -100%); }
#tip small { display: block; font-size: 12px; color: var(--muted); letter-spacing: .5px; }

/* windows */
.win { position: fixed; z-index: 30; display: flex; flex-direction: column; background: var(--face); border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi); box-shadow: 0 0 0 1px var(--edge), 5px 5px 0 rgba(0, 0, 0, .35); max-height: calc(100vh - 70px); max-height: calc(100dvh - 70px); }
.win[hidden] { display: none; }
.wt { flex: none; display: flex; align-items: center; gap: 8px; margin: 2px 2px 0; padding: 0 2px 0 8px; height: 30px; background: linear-gradient(90deg, var(--title), var(--title2)); color: #fff; cursor: move; touch-action: none; user-select: none; }
.wt h2 { flex: 1; margin: 0; font-size: 19px; font-weight: 400; letter-spacing: .4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 1px 1px 0 #0b1118; }
.wx { flex: none; width: 24px; height: 24px; padding: 0; display: grid; place-items: center; background: #c0392b; color: #fff; border: 2px solid; border-color: #ec7a6d #6e1a12 #6e1a12 #ec7a6d; cursor: pointer; }
.wx svg { width: 12px; height: 12px; }
.wx:active { border-color: #6e1a12 #ec7a6d #ec7a6d #6e1a12; }
.tabs { flex: none; display: flex; gap: 2px; padding: 4px 4px 0; }
.tabs [role=tab] { padding: 4px 14px 5px; min-height: 30px; background: #6c7e92; color: #e9eef3; border: 2px solid; border-bottom: 0; border-color: var(--hi) var(--lo) transparent var(--hi); cursor: pointer; font-size: 15px; }
.tabs [role=tab][aria-selected="true"] { background: var(--body); color: var(--ink); position: relative; top: 2px; padding-bottom: 7px; }
.tabs [role=tab][hidden] { display: none; }
.wb { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 0 4px 4px; background: var(--body); border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi); }
.panel { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 10px 12px 16px; outline: none; }
.panel[hidden] { display: none; }
.panel:focus-visible { box-shadow: inset 0 0 0 2px #f2c230; }
.ws { flex: none; display: flex; align-items: center; gap: 6px; margin: 0 4px 4px; padding: 3px 8px; font-size: 14px; color: #eef3f7; background: #66788c; border: 2px solid; border-color: var(--lo) var(--hi) var(--hi) var(--lo); }
.ws .lamp { width: 10px; height: 10px; background: #5fd35f; box-shadow: inset -2px -2px 0 #2c8a2c, 0 0 0 1px #1b3a1b; }

/* the ride window */
#ride { width: min(700px, calc(100vw - 24px)); height: min(860px, calc(100vh - 70px)); height: min(860px, calc(100dvh - 70px)); left: 50%; top: 58px; transform: translateX(-50%); }
#ride.moved { transform: none; }
.view { margin: 0 0 10px; height: 200px; background: #3f7d2f; border: 2px solid; border-color: var(--lo) var(--hi) var(--hi) var(--lo); overflow: hidden; }
.view canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.client { margin: 0 0 8px; font-size: 13px; letter-spacing: 1.5px; color: var(--muted); }
#ride-media { font-size: 18px; line-height: 1.4; --ab-chrome: 180px; }
#ride-media .ab-lede { font-size: 19px; }
#ride-media .ab-heading { font-size: 18px; font-weight: 400; padding: 3px 8px; background: #6c7e92; color: #fff; border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi); }
#ride-media .ab-text { color: var(--ink); }
#ride-media .ab-frame, #ride-media .ab-image img { box-shadow: 0 0 0 2px var(--lo); }
#ride-media audio { filter: grayscale(.3); }
.credits { margin: 0; font-size: 18px; line-height: 1.6; white-space: pre-line; }

/* the rides list */
#list { width: min(420px, calc(100vw - 24px)); height: min(640px, calc(100vh - 70px)); height: min(640px, calc(100dvh - 70px)); left: max(8px, env(safe-area-inset-left)); top: 58px; }
.rows { list-style: none; margin: 0; padding: 4px; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; flex: 1; min-height: 0; }
.rows li + li { margin-top: 2px; }
.rows button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; min-height: 48px; text-align: left; background: var(--page); border: 2px solid; border-color: #fff #8d9aa8 #8d9aa8 #fff; cursor: pointer; }
.rows button:hover { background: #fffbe0; }
.rows .ic { flex: none; width: 52px; height: 40px; display: grid; place-items: center; }
.rows .ic img { max-width: 52px; max-height: 40px; image-rendering: pixelated; }
.rows .nm { flex: 1; min-width: 0; font-size: 18px; }
.rows .cl { display: block; font-size: 11px; font-weight: 400; letter-spacing: 1.2px; color: var(--muted); }
.rows .st { flex: none; width: 10px; height: 10px; background: #5fd35f; box-shadow: inset -2px -2px 0 #2c8a2c, 0 0 0 1px #1b3a1b; }

/* park information */
#info { width: min(460px, calc(100vw - 24px)); max-height: min(620px, calc(100vh - 70px)); left: 50%; top: 58px; transform: translateX(-50%); }
#info-body h3 { margin: 0 0 6px; font-size: 20px; font-weight: 400; }
#info-body p { margin: 0 0 10px; font-size: 18px; line-height: 1.45; }
#info-body a { color: #1d4f91; }
#info-body .xp { margin: 12px 0 0; padding: 0; list-style: none; border-top: 2px solid #9eabb8; }
#info-body .xp li { padding: 6px 0; border-bottom: 1px solid #9eabb8; font-size: 15px; }
#info-body .xp b { display: block; font-weight: 400; font-size: 17px; }
#info-body .xp span { color: var(--muted); font-size: 13px; letter-spacing: 1px; }

/* a guest */
#guest { width: 230px; left: 20px; top: 70px; }
#guest .panel { display: grid; grid-template-columns: 30px 1fr; gap: 4px 10px; align-items: center; padding: 8px 10px 10px; }
#gface { width: 20px; height: 28px; image-rendering: pixelated; background: #8fbf6a; border: 2px solid; border-color: var(--lo) var(--hi) var(--hi) var(--lo); }
#guest-status { margin: 0; font-size: 15px; line-height: 1.3; }
.btn { grid-column: 1 / -1; min-height: 34px; padding: 4px 10px; background: var(--face); color: #fff; text-shadow: 1px 1px 0 #1b2530; border: 2px solid; border-color: var(--hi) var(--lo) var(--lo) var(--hi); cursor: pointer; font-size: 15px; }
.btn:active { border-color: var(--lo) var(--hi) var(--hi) var(--lo); }
.btn[hidden] { display: none; }

/* loading */
#loader { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: #3f7d2f; transition: opacity .35s; }
#loader.done { opacity: 0; pointer-events: none; }
#loader .lw { position: static; width: min(300px, 80vw); }
#loader .wb { padding: 14px; }
#loader .bar { height: 18px; background: #2a3440; border: 2px solid; border-color: var(--lo) var(--hi) var(--hi) var(--lo); }
#loader .bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, #5fd35f 0 8px, #49b849 8px 10px); transition: width .2s; }

/* phones: windows fill the screen, bigger targets */
@media (max-width: 640px) {
  .tb { width: 44px; height: 44px; }
  #ride, #list, #info { left: 0 !important; top: 0 !important; transform: none !important; width: 100vw; height: 100vh; height: 100dvh; max-height: none; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); border-width: 0; box-shadow: none; }
  .wt { height: 48px; cursor: default; }
  .wx { width: 44px; height: 44px; }
  .wx svg { width: 16px; height: 16px; }
  .view { height: 170px; }
  #guest { left: 8px !important; right: 8px; width: auto; top: auto !important; bottom: max(52px, calc(env(safe-area-inset-bottom) + 48px)); }
}
@media (prefers-reduced-motion: reduce) { #loader { transition: none; } }

.sentinel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
