/* On-screen display, in the style of a first-person game: dark angular panels in the corners,
   condensed capitals, Olaf yellow as the accent. All text shown to the player is Finnish. */
:root {
  --olaf: #ffcf3a; --danger: #ff4d2e; --ok: #39ff88; --ice: #7fd4ff;
  --panel: rgba(9, 9, 13, 0.74); --line: rgba(255, 255, 255, 0.16); --dim: rgba(255, 255, 255, 0.62);
  --cut: 12px;
}
html, body { margin: 0; height: 100%; background: #0b0b0d; overflow: hidden; color: #fff;
  font-family: "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", system-ui, sans-serif; }
kbd { display: inline-block; min-width: 1.5em; padding: 1px 6px; margin: 0 2px; text-align: center; font: inherit; font-weight: 700;
  color: #111; background: #e9e9ee; border-radius: 4px; box-shadow: 0 2px 0 #8a8a92; }

/* ---- shared panel look ---- */
.panel { position: fixed; background: var(--panel);
  padding: 10px 14px 11px; border-left: 3px solid var(--olaf);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut))); }
.panel.right { border-left: 0; border-right: 3px solid var(--olaf); text-align: right;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.label { display: block; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); }
.value { font-size: 30px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.hud { transition: opacity 0.4s; }
body.cover .hud { opacity: 0; }                 /* title, pause and "thrown out" screens hide the display */

/* ---- bottom left: money, drunkenness, vibe ---- */
#status-panel { left: 18px; bottom: 18px; min-width: 232px; }
#status-panel .row { margin-top: 9px; }
#status-panel .row:first-child { margin-top: 0; }
#money { color: var(--olaf); }
.segs { display: flex; gap: 3px; margin-top: 4px; }
.segs i { flex: 1; height: 9px; background: rgba(255, 255, 255, 0.13); transform: skewX(-18deg); transition: background 0.15s; }
.segs i.on { background: var(--olaf); box-shadow: 0 0 8px rgba(255, 207, 58, 0.55); }
.segs.ok i.on { background: var(--ok); box-shadow: 0 0 8px rgba(57, 255, 136, 0.5); }
.segs.hot i.on { background: var(--danger); box-shadow: 0 0 8px rgba(255, 77, 46, 0.6); }
#status-panel .permille { color: #fff; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
#drunknote { float: right; font-size: 11px; letter-spacing: 0.16em; color: var(--danger); font-weight: 700; }

/* ---- bottom right: what is in your hand ---- */
#hand-panel { right: 18px; bottom: 18px; min-width: 190px; }
#hand { font-size: 24px; }
#hand-panel.empty #hand { color: var(--dim); }
.pips { display: flex; gap: 5px; justify-content: flex-end; margin: 6px 0 7px; min-height: 12px; }
.pips i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--olaf); box-sizing: border-box; }
.pips i.on { background: var(--olaf); }
.keys { font-size: 13px; color: var(--dim); letter-spacing: 0.04em; }
#hand-panel.empty .keys { opacity: 0.35; }

/* ---- top right: map ---- */
#map-panel { right: 18px; top: 18px; padding: 8px 10px 10px; }
#map { display: block; width: 176px; height: auto; margin-top: 5px; }

/* ---- top left: tonight's tasks ---- */
#objectives { left: 18px; top: 18px; min-width: 232px; max-width: 280px; }
#objectives ol { list-style: none; margin: 6px 0 0; padding: 0; font-size: 15px; line-height: 1.55; }
#objectives li { position: relative; padding-left: 22px; color: var(--dim); }
#objectives li::before { content: ""; position: absolute; left: 2px; top: 0.42em; width: 9px; height: 9px; border: 2px solid var(--dim); transform: rotate(45deg); box-sizing: border-box; }
#objectives li.now { color: #fff; font-weight: 700; }
#objectives li.now::before { border-color: var(--olaf); }
#objectives li.done { color: var(--ok); text-decoration: line-through; text-decoration-color: rgba(57, 255, 136, 0.5); }
#objectives li.done::before { background: var(--ok); border-color: var(--ok); }

/* ---- centre: crosshair, beat ring, prompts, messages ---- */
#crosshair { position: fixed; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(255, 255, 255, 0.75); box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.45); }
#beat { position: fixed; left: 50%; bottom: max(11%, 74px); width: 38px; height: 38px; margin-left: -19px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.5); box-sizing: border-box; }
#beat::after { content: "VÄLI"; position: absolute; left: 50%; top: 100%; transform: translate(-50%, 7px); font-size: 10px; letter-spacing: 0.2em; color: var(--dim); }
#combo { position: fixed; left: 50%; bottom: calc(max(11%, 74px) + 50px); transform: translateX(-50%); font-size: 17px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ok); text-shadow: 0 1px 6px #000; white-space: nowrap; }
#prompt { position: fixed; left: 50%; top: 58%; transform: translateX(-50%); background: var(--panel); padding: 7px 14px; font-size: 16px; letter-spacing: 0.04em; display: none; white-space: nowrap; border-bottom: 2px solid var(--olaf); }
#prompt .seen, #prompt .unseen { margin-left: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
#prompt .seen { color: var(--danger); } #prompt .unseen { color: var(--ok); }
#toast { position: fixed; left: 50%; bottom: 24%; transform: translateX(-50%); max-width: min(680px, 86vw); background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.78) 12%, rgba(0, 0, 0, 0.78) 88%, transparent); padding: 9px 46px; font-size: 18px; text-align: center; opacity: 0; transition: opacity 0.3s; pointer-events: none; text-shadow: 0 1px 3px #000; }
#alert { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); min-width: 320px; padding: 8px 18px 10px; text-align: center; background: rgba(120, 10, 0, 0.82); border-top: 3px solid var(--danger); display: none; animation: alertpulse 0.7s ease-in-out infinite alternate; }
#alert b { display: block; font-size: 16px; letter-spacing: 0.18em; }
#alert span { font-size: 13px; letter-spacing: 0.06em; color: #ffd9d0; }
#alert .timer { height: 4px; margin-top: 7px; background: rgba(255, 255, 255, 0.2); }
#alert .timer i { display: block; height: 100%; background: #fff; }
@keyframes alertpulse { from { box-shadow: 0 0 0 rgba(255, 77, 46, 0); } to { box-shadow: 0 0 26px rgba(255, 77, 46, 0.75); } }
#legend { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); font-size: 12px; letter-spacing: 0.08em; color: var(--dim); white-space: nowrap; transition: opacity 1.2s; text-shadow: 0 1px 3px #000; }
#legend kbd { font-size: 11px; padding: 0 5px; box-shadow: 0 1px 0 #8a8a92; }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 4; }
#status { position: fixed; left: 50%; top: 4px; transform: translateX(-50%); font-size: 11px; opacity: 0.6; display: none; }

/* ---- bar menu ---- */
#menu { left: 50%; top: 50%; transform: translate(-50%, -50%); min-width: 300px; padding: 16px 22px 14px; font-size: 18px; line-height: 2; display: none; }
#menu h2 { margin: 0 0 4px; font-size: 13px; letter-spacing: 0.24em; color: var(--olaf); font-weight: 700; }
#menu .price { float: right; margin-left: 28px; color: var(--olaf); font-weight: 700; font-variant-numeric: tabular-nums; }
#menu .close { font-size: 13px; color: var(--dim); line-height: 1.6; margin-top: 4px; }

/* ---- ticket shop at the desk ---- */
#shop { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(660px, 92vw); box-sizing: border-box; padding: 16px 20px 14px; font-size: 16px; display: none; }
#shop h2 { margin: 0 0 8px; font-size: 13px; letter-spacing: 0.24em; color: var(--olaf); font-weight: 700; }
#shop h3 { margin: 12px 0 5px; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); font-weight: 400; }
#shop .row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 4px 9px; border: 1px solid transparent; }
#shop .row.gig { grid-template-columns: 92px 1fr auto 10px; }
#shop .row.on { background: rgba(255, 207, 58, 0.14); border-color: var(--olaf); }
#shop .day { color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
#shop .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; letter-spacing: 0.02em; }
#shop .price { color: var(--olaf); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
#shop .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
#shop .few .dot { background: var(--olaf); } #shop .last .dot { background: var(--danger); } #shop .soldout .dot { background: #777; }
#shop .soldout .name, #shop .soldout .price { color: var(--dim); }
#shop .venue .name, #shop .shut .name { font-weight: 400; color: #e6e6ea; }
#shop .more, #shop .note { font-size: 12px; color: var(--dim); padding: 1px 10px; letter-spacing: 0.06em; }
#shop .info { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 14px; color: #e6e6ea; min-height: 1.3em; }
#shop .close { font-size: 13px; color: var(--dim); margin-top: 6px; }

/* ---- full-screen cards: title / pause, controls, thrown out ---- */
#overlay, #ejected, #help { position: fixed; inset: 0; display: grid; place-items: center; text-align: center; z-index: 5; }
#overlay { background: radial-gradient(ellipse at center, rgba(11, 11, 13, 0.55), rgba(11, 11, 13, 0.92)); cursor: pointer; }
#ejected { display: none; background: rgba(0, 0, 0, 0.9); }
#help { display: none; background: rgba(0, 0, 0, 0.72); z-index: 6; }
.card { max-width: min(720px, 92vw); }
#presents { font-size: clamp(11px, 1.6vw, 15px); letter-spacing: 0.5em; text-transform: uppercase; color: #e9dcc2; opacity: 0.85; margin: 0 0 2px; padding-left: 0.5em; text-shadow: 0 1px 6px #000; }
#titlelogo { display: block; width: min(620px, 86vw); max-height: 42vh; object-fit: contain; margin: 0 auto 4px; }
body.haslogo #overlay .card h1, body.haslogo #overlay #kicker:not(.show) { display: none; }   /* the logo already says it; the kicker comes back as TAUKO */
.kicker { font-size: 13px; letter-spacing: 0.42em; color: var(--olaf); }
.card h1 { margin: 6px 0 4px; font-size: clamp(40px, 8vw, 84px); line-height: 0.95; letter-spacing: 0.04em; font-weight: 800; text-shadow: 0 0 34px rgba(255, 58, 138, 0.55); }
#ejected h1 { color: var(--danger); text-shadow: 0 0 34px rgba(255, 77, 46, 0.5); }
.pick { margin: 16px 0 2px; display: flex; gap: 10px; justify-content: center; align-items: center; }
.pick .label { margin-right: 6px; min-width: 104px; text-align: right; }
#pickgig, #pickmouse { margin-top: 8px; }
.mousehint { font-size: 13px !important; color: var(--dim); margin: 4px 0 0 !important; min-height: 1.2em; }
body.freelook canvas { cursor: grab; } body.freelook.dragging canvas { cursor: grabbing; }
#pickgig button { padding: 7px 16px; }
.pick button { font: inherit; font-size: 17px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #fff; background: rgba(255, 255, 255, 0.08);
  border: 2px solid var(--line); padding: 7px 22px; cursor: pointer; transform: skewX(-10deg); }
.pick button:hover { border-color: #fff; }
.pick button.on { color: #111; background: var(--olaf); border-color: var(--olaf); }
.loadwrap { margin: 16px 0 18px; }
.load { display: inline-block; font-size: 18px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.load.ready { color: #111; background: var(--olaf); font-size: 22px; font-weight: 800; letter-spacing: 0.24em; padding: 12px 46px; cursor: pointer;
  transform: skewX(-10deg); box-shadow: 0 0 22px rgba(255, 207, 58, 0.45); animation: pulse 1.4s ease-in-out infinite alternate; }
.load.ready:hover { box-shadow: 0 0 30px rgba(255, 207, 58, 0.7); }
@keyframes pulse { from { box-shadow: 0 0 10px rgba(255, 207, 58, 0.3); } to { box-shadow: 0 0 28px rgba(255, 207, 58, 0.7); } }
@keyframes blink { from { opacity: 1; } to { opacity: 0.45; } }
.keys-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 26px; text-align: left; font-size: 15px; color: #e6e6ea; margin: 0 auto; max-width: 560px; }
.keys-grid div { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 3px 0; }
.keys-grid span { color: var(--dim); }
.card p { font-size: 17px; margin: 8px 0; }

/* ---- touch screens: a compact display that leaves the picture free ---- */
#touch, #rotate, .touchhint, #touchsettings { display: none; }
body.touch { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.touch canvas { touch-action: none; }
body.touch #touch { display: block; position: fixed; inset: 0; pointer-events: none; z-index: 3; }
body.touch #stick { position: absolute; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); width: 128px; height: 128px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.07); border: 2px solid rgba(255, 255, 255, 0.25); pointer-events: auto; touch-action: none; display: grid; place-items: center; }
body.touch #knob { width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, 0.32); border: 2px solid rgba(255, 255, 255, 0.55); transition: background 0.15s; }
body.touch #knob.run { background: rgba(255, 207, 58, 0.7); border-color: var(--olaf); }
body.touch #tbuttons { position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(2, auto); gap: 8px; justify-items: end; align-items: end; }
body.touch #touch button { pointer-events: auto; touch-action: none; font: inherit; font-weight: 700; letter-spacing: 0.05em; color: #fff; background: rgba(9, 9, 13, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.28); border-radius: 999px; padding: 9px 12px; min-width: 66px; font-size: 12px; text-transform: uppercase; }
body.touch #touch button:active { background: rgba(255, 207, 58, 0.35); }
body.touch #tUse { grid-column: 1 / span 2; min-width: 140px; max-width: 52vw; padding: 13px 16px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.touch #tUse.ready { border-color: var(--olaf); color: var(--olaf); background: rgba(9, 9, 13, 0.72); }
body.touch #touch button.off { opacity: 0.3; }
body.touch #ttop { position: absolute; left: max(16px, env(safe-area-inset-left)); bottom: calc(max(16px, env(safe-area-inset-bottom)) + 140px); display: flex; gap: 6px; }
body.touch #ttop button { padding: 6px 10px; min-width: 0; font-size: 10px; }
/* top bar: money and promilles in a small chip, the current task beside it, a small map on the right */
body.touch #status-panel { left: max(8px, env(safe-area-inset-left)); top: max(8px, env(safe-area-inset-top)); bottom: auto; min-width: 0; width: 112px; padding: 5px 9px 6px; transform: none; }
body.touch #status-panel .row { margin-top: 2px; }
body.touch #status-panel .value { font-size: 19px; }
body.touch #status-panel .label { font-size: 8px; letter-spacing: 0.12em; }
body.touch #status-panel .segs { margin-top: 2px; gap: 2px; } body.touch #status-panel .segs i { height: 4px; }
body.touch #drunknote { font-size: 8px; }
body.touch #objectives { left: calc(max(8px, env(safe-area-inset-left)) + 122px); top: max(8px, env(safe-area-inset-top)); min-width: 0; max-width: calc(100vw - 250px); padding: 5px 9px; transform: none; }
body.touch #objectives .label { display: none; }
body.touch #objectives ol { margin: 0; font-size: 12px; line-height: 1.35; }
body.touch #objectives li { display: none; } body.touch #objectives li.now { display: block; }
body.touch #map-panel { right: max(8px, env(safe-area-inset-right)); top: max(8px, env(safe-area-inset-top)); transform: scale(0.5); transform-origin: top right; }
body.touch #hand-panel { right: max(8px, env(safe-area-inset-right)); top: calc(max(8px, env(safe-area-inset-top)) + 84px); bottom: auto; min-width: 0; padding: 4px 9px; }
body.touch #hand-panel.empty { display: none; }
body.touch #hand-panel .label, body.touch #hand-panel .keys { display: none; }
body.touch #hand { font-size: 14px; } body.touch .pips { margin: 3px 0 0; } body.touch .pips i { width: 8px; height: 8px; }
/* prompt and messages above the controls; no key letters on touch */
body.touch #prompt { top: auto; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 150px); font-size: 13px; padding: 5px 10px; white-space: normal; max-width: 60vw; text-align: center; }
body.touch #prompt kbd, body.touch #menu kbd, body.touch #menu .close, body.touch #shop .close, body.touch #toast kbd { display: none; }
body.touch #toast { font-size: 14px; padding: 7px 28px; bottom: 46%; }
body.touch #beat { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 4px); width: 30px; height: 30px; margin-left: -15px; }
body.touch #beat::after { content: ""; } body.touch #combo { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 40px); font-size: 13px; }
body.touch #alert { min-width: 0; width: 70vw; top: 60px; padding: 5px 10px 7px; }
body.touch #legend, body.touch #crosshair, body.touch #pickmouse, body.touch #mousehint, body.touch .keys-grid { display: none !important; }
body.touch .touchhint { display: block; font-size: 13px; color: var(--dim); max-width: 520px; margin: 8px auto; }
body.touch #touchsettings { display: flex; flex-wrap: wrap; } body.touch #touchsettings button { font-size: 12px; padding: 6px 12px; }
body.touch .card h1 { font-size: clamp(30px, 9vw, 64px); }
body.touch .pick { margin: 8px 0 2px; flex-wrap: wrap; } body.touch .pick button { font-size: 13px; padding: 6px 14px; }
body.touch .pick .label { min-width: 0; width: 100%; text-align: center; margin: 0 0 2px; }
/* menus: big rows to tap, above the controls */
body.touch #shop, body.touch #menu { left: 50%; top: 46%; width: min(560px, 92vw); max-height: 70vh; overflow-y: auto; z-index: 4; font-size: 15px; padding: 10px 12px; }
body.touch #menu { line-height: 1.5; }
body.touch .pickrow { margin: 6px 0; padding: 9px 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); }
body.touch .pickrow.closer { text-align: center; color: var(--dim); }
body.touch #shop .row { padding-top: 8px; padding-bottom: 8px; }
.pickrow.closer { display: none; } body.touch .pickrow.closer { display: block; }
.pickrow { cursor: pointer; } #shop .row[data-row] { cursor: pointer; }
/* phone held upright: controls along the bottom, buttons in a column on the right */
@media (orientation: portrait) {
  body.touch #objectives { max-width: calc(100vw - 230px); }
  body.touch #tbuttons { grid-template-columns: repeat(2, auto); }
  body.touch #tUse { max-width: 60vw; }
  body.touch #prompt { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 210px); max-width: 86vw; }
  body.touch #beat { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 200px); }
  body.touch #combo { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 240px); }
  body.touch #ttop { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 140px); }
}

@media (max-width: 760px) {
  #objectives, #map-panel { transform: scale(0.82); transform-origin: top left; }
  #map-panel { transform-origin: top right; }
  .keys-grid { grid-template-columns: 1fr; }
  #legend { display: none; }
}
@media (prefers-reduced-motion: reduce) { #alert, .load.ready { animation: none; } }
