/* Culprit Arcade: the game fills the screen; the palette is the one of Culprit. */
:root {
  --ink: #05060a;
  --paper: #efe3c4;
  --neon: #e8b23a;
  --blood: #c0392b;
  --slate: #12141d;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; background: var(--ink); overflow: hidden; overscroll-behavior: none; }
body { font-family: 'Nunito', sans-serif; color: var(--paper); -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; }

.app { position: fixed; inset: 0; overflow: hidden; }
.stage { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* ---------- top bar: the name, the clock, the tools ---------- */
.hud { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: flex-start; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) 26px calc(14px + env(safe-area-inset-left)); background: linear-gradient(to bottom, rgba(5, 6, 10, .88), rgba(5, 6, 10, 0)); pointer-events: none; }
.hud > * { pointer-events: auto; }
.brand { text-shadow: 0 2px 0 var(--ink); }
.brand span { display: block; font-family: 'Special Elite', monospace; font-size: 10px; letter-spacing: .32em; color: var(--neon); }
.brand b { display: block; font-family: 'Anton', sans-serif; font-weight: 400; font-size: 24px; line-height: 1; letter-spacing: .05em; }
/* Super Arcade: the word SUPER over the name, in the colour of a power */
.app.super .brand span::after { content: ' · SUPER'; color: #7ad7ff; }
.clock.low { color: #ff7a5c; text-shadow: 0 0 12px rgba(255, 110, 80, .8); animation: low .5s steps(2) infinite; }
@keyframes low { 50% { opacity: .55; } }
.clock { margin-left: auto; min-width: 3.4em; padding-top: 6px; text-align: right; font-family: 'Special Elite', monospace; font-size: 20px; font-variant-numeric: tabular-nums; color: var(--neon); text-shadow: 0 0 10px rgba(232, 178, 58, .55); }
.tools { display: flex; gap: 6px; }
.tool, .lang, .tab { min-width: 34px; height: 34px; padding: 0 8px; background: rgba(5, 6, 10, .7); border: 1px solid rgba(239, 227, 196, .45); font-family: 'Special Elite', monospace; font-size: 13px; }
.tool { font-size: 17px; line-height: 1; }
.tool.off { opacity: .4; text-decoration: line-through; }
.tool.star { border-color: var(--neon); color: var(--neon); }
.tool[hidden] { display: none; }
.lang.on, .tab.on { background: var(--paper); color: var(--ink); }
.tabs { display: flex; gap: 6px; }
/* a narrow phone: while playing the tools of the game take the place of the languages */
@media (max-width: 480px) {
  .playing .lang { display: none; }
}
/* the narrowest phones: with the star there are four tools, and they all stay on the screen */
@media (max-width: 350px) {
  .playing .hud { gap: 6px; }
  .playing .clock { min-width: 0; font-size: 18px; }
  .playing .tools { gap: 4px; }
  .playing .tool { min-width: 30px; height: 30px; padding: 0 4px; font-size: 15px; }
}
.tab { padding: 0 12px; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- the night so far: how many caught, how many clues ---------- */
.tally { position: absolute; left: calc(14px + env(safe-area-inset-left)); top: calc(52px + env(safe-area-inset-top)); font-family: 'Special Elite', monospace; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--neon); text-shadow: 0 2px 0 var(--ink); pointer-events: none; }

/* ---------- the power on: a bar that empties in its seconds ---------- */
.power { position: absolute; right: calc(14px + env(safe-area-inset-right)); top: calc(52px + env(safe-area-inset-top)); width: 150px; height: 18px; border: 1px solid rgb(var(--tone)); background: rgba(5, 6, 10, .7); pointer-events: none; --tone: 60, 200, 185; }
.power[hidden] { display: none; }
.power[data-kind="speed"] { --tone: 200, 100, 230; }
/* the spiteful powers: in the reds of a warning, with a striped bar */
.power[data-kind="slow"] { --tone: 200, 90, 50; }
.power[data-kind="leap"] { --tone: 225, 50, 80; }
.power[data-kind="turbo"] { --tone: 250, 140, 30; }
.power:is([data-kind="slow"], [data-kind="leap"], [data-kind="turbo"]) i { background: repeating-linear-gradient(-45deg, rgba(var(--tone), .85) 0 6px, rgba(var(--tone), .5) 6px 12px); }
.power i { position: absolute; inset: 2px; background: rgba(var(--tone), .75); box-shadow: 0 0 10px rgba(var(--tone), .8); transform-origin: left center; }
.power b { position: absolute; inset: 0; display: grid; place-items: center; font-family: 'Special Elite', monospace; font-weight: 400; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--paper); text-shadow: 0 1px 0 var(--ink); }
.power.out i { animation: low .25s steps(2) infinite; }
/* a narrow phone: the count of the night takes the whole top line, the bar goes over the buttons */
@media (max-width: 480px) {
  .power { right: auto; left: 50%; top: auto; bottom: calc(112px + env(safe-area-inset-bottom)); transform: translateX(-50%); }
}

/* ---------- what the detective says ---------- */
.say { position: absolute; left: 50%; top: calc(80px + env(safe-area-inset-top)); width: min(92%, 560px); transform: translateX(-50%); text-align: center; font-family: 'Special Elite', monospace; font-size: 17px; line-height: 1.35; text-shadow: 0 2px 0 var(--ink), 0 0 14px rgba(5, 6, 10, .95); opacity: 0; transition: opacity .35s ease; pointer-events: none; }
.say.on { opacity: 1; }
.say b { font-weight: 400; color: var(--neon); text-shadow: 0 0 12px rgba(232, 178, 58, .7), 0 2px 0 var(--ink); }

/* ---------- the touch buttons: move on the left, jump and letters on the right ---------- */
.pad { position: absolute; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom)); display: none; justify-content: space-between; align-items: flex-end; padding: 0 calc(14px + env(safe-area-inset-right)) 0 calc(14px + env(safe-area-inset-left)); pointer-events: none; }
.touch .pad { display: flex; }
.pad > * { pointer-events: auto; touch-action: none; }
.move { display: flex; width: 164px; height: 76px; overflow: hidden; background: rgba(18, 20, 29, .74); border: 2px solid rgba(239, 227, 196, .5); border-radius: 40px; }
.move i { flex: 1; display: grid; place-items: center; font-style: normal; font-size: 24px; pointer-events: none; }
.move i.on { background: rgba(239, 227, 196, .22); }
.acts { display: flex; align-items: flex-end; gap: 10px; }
.acts button { width: 76px; height: 76px; padding: 0; background: rgba(18, 20, 29, .74); border: 2px solid rgba(239, 227, 196, .5); border-radius: 50%; font-family: 'Anton', sans-serif; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
.acts .grab { margin-bottom: 26px; border-color: var(--neon); color: var(--neon); }
.acts .grab.idle { opacity: .45; }
.acts button.on { background: rgba(239, 227, 196, .24); transform: scale(.95); }

/* ---------- the cards: who is wanted, and the arrest ---------- */
.card { position: absolute; inset: 0; display: grid; place-content: safe center; justify-items: center; gap: 18px; padding: 24px; background: rgba(5, 6, 10, .8); text-align: center; overflow: auto; }
.card[hidden] { display: none; }
/* a pause: the street is not to be read while the clock is still */
.paused .card { background: #05060a; }
.paused .say, .paused .tally { visibility: hidden; }
.poster { position: relative; width: min(56vw, 220px); padding: 8px 10px 12px; background: var(--paper); color: var(--ink); box-shadow: 6px 8px 0 rgba(0, 0, 0, .6); transform: rotate(-2deg); }
.poster .stamp { display: block; margin-bottom: 6px; font-family: 'Anton', sans-serif; font-size: 30px; line-height: 1.15; letter-spacing: .12em; text-transform: uppercase; }
.poster img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; border: 2px solid var(--ink); }
.poster b { display: block; margin-top: 8px; font-family: 'Anton', sans-serif; font-weight: 400; font-size: 22px; line-height: 1.1; letter-spacing: .04em; text-transform: uppercase; }
.poster i { font-family: 'Special Elite', monospace; font-style: normal; font-size: 14px; }
.poster.caught .stamp { position: absolute; left: 50%; top: 46%; z-index: 1; margin: 0; padding: 0 12px; transform: translate(-50%, -50%) rotate(-14deg); border: 4px solid var(--blood); background: rgba(239, 227, 196, .84); color: var(--blood); font-size: 38px; white-space: nowrap; }
.words { display: grid; justify-items: center; gap: 12px; max-width: 420px; }
.day { font-family: 'Special Elite', monospace; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--neon); }
.line { font-family: 'Special Elite', monospace; font-size: 16px; line-height: 1.4; }
.line.rules { color: var(--neon); font-size: 14px; }
.nextup { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; background: rgba(239, 227, 196, .08); border: 1px solid rgba(239, 227, 196, .3); text-align: left; }
.nextup img { width: 54px; height: 54px; object-fit: cover; object-position: 50% 28%; border: 2px solid var(--paper); }
.nextup span { display: block; font-family: 'Special Elite', monospace; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--neon); }
.nextup b { display: block; font-family: 'Anton', sans-serif; font-weight: 400; font-size: 18px; letter-spacing: .04em; text-transform: uppercase; line-height: 1.15; }
.nextup i { font-family: 'Special Elite', monospace; font-style: normal; font-size: 13px; }
.how { font-size: 13px; line-height: 1.45; color: rgba(239, 227, 196, .72); }
.how.skipped { color: #ff7a5c; }   /* what the words left behind cost: the colour of a clock running out */
.btn { padding: 12px 28px 10px; background: var(--neon); border: 2px solid var(--ink); box-shadow: 4px 5px 0 rgba(0, 0, 0, .6); color: var(--ink); font-family: 'Anton', sans-serif; font-size: 20px; letter-spacing: .08em; text-transform: uppercase; }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 3px 0 rgba(0, 0, 0, .6); }
.btn.ghost { padding: 8px 18px 6px; background: rgba(5, 6, 10, .6); border-color: rgba(239, 227, 196, .55); box-shadow: none; color: var(--paper); font-size: 15px; text-decoration: none; }
.btn.super { background: #7ad7ff; }   /* the way into Super Arcade */
.how.locked { color: rgba(122, 215, 255, .8); }

/* ---------- the board: who caught most tonight ---------- */
.words.wide { width: min(92vw, 440px); max-width: none; }
.board { display: grid; justify-items: center; gap: 8px; width: 100%; }
.board ol { width: 100%; margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; }
.board li { display: grid; grid-template-columns: 26px 30px 1fr auto; align-items: center; gap: 8px; padding: 4px 10px 4px 6px; background: rgba(239, 227, 196, .07); border: 1px solid rgba(239, 227, 196, .16); text-align: left; }
.board li.me { background: rgba(232, 178, 58, .2); border-color: var(--neon); }
.board li.far { margin-top: 8px; }
.board .rank { font-family: 'Anton', sans-serif; font-size: 18px; text-align: center; color: var(--neon); }
.board img, .board .face { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(239, 227, 196, .5); background: #12141d; }
/* no picture: a detective in a hat */
.board .face { background: #12141d url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cg fill='%23efe3c4' opacity='.62'%3E%3Cpath d='M3 31c0-7 5-10.5 12-10.5S27 24 27 31z'/%3E%3Ccircle cx='15' cy='14.5' r='5'/%3E%3Cellipse cx='15' cy='11' rx='9.5' ry='1.9'/%3E%3Cpath d='M9.8 11l.9-5.2Q15 4 19.3 5.8l.9 5.2z'/%3E%3C/g%3E%3C/svg%3E") center / cover; }
.board b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: 'Anton', sans-serif; font-weight: 400; font-size: 17px; letter-spacing: .04em; }
.board .got { font-family: 'Special Elite', monospace; font-size: 12px; white-space: nowrap; color: rgba(239, 227, 196, .85); }
.score span { display: block; font-family: 'Special Elite', monospace; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--neon); }
.score b { font-family: 'Anton', sans-serif; font-weight: 400; font-size: 46px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.best { font-family: 'Special Elite', monospace; font-size: 14px; }

/* ---------- who is playing: the account of Culprit on the card of who is wanted ---------- */
.account { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; background: rgba(239, 227, 196, .07); border: 1px solid rgba(239, 227, 196, .2); text-align: left; }
.account img, .account .face { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(239, 227, 196, .5); background: #12141d; }
.account .face { background: #12141d url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cg fill='%23efe3c4' opacity='.62'%3E%3Cpath d='M3 31c0-7 5-10.5 12-10.5S27 24 27 31z'/%3E%3Ccircle cx='15' cy='14.5' r='5'/%3E%3Cellipse cx='15' cy='11' rx='9.5' ry='1.9'/%3E%3Cpath d='M9.8 11l.9-5.2Q15 4 19.3 5.8l.9 5.2z'/%3E%3C/g%3E%3C/svg%3E") center / cover; }
.account span { display: block; font-family: 'Special Elite', monospace; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--neon); }
.account b { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: 'Anton', sans-serif; font-weight: 400; font-size: 18px; letter-spacing: .04em; line-height: 1.15; }
.account .stars { margin-left: 6px; font-family: 'Anton', sans-serif; font-style: normal; font-size: 18px; color: var(--neon); white-space: nowrap; }
a.account { color: inherit; text-decoration: none; cursor: pointer; transition: border-color .15s, background .15s; }
a.account:hover, a.account:focus-visible { border-color: var(--neon); background: rgba(239, 227, 196, .12); }
.account.out { flex-direction: column; gap: 8px; padding: 10px 14px; text-align: center; }

/* ---------- the night to send around: the picture, and what to do with it ---------- */
.shot { display: block; width: auto; max-width: 100%; height: min(52vh, 480px); aspect-ratio: 4 / 5; background: var(--slate); border: 2px solid rgba(239, 227, 196, .55); box-shadow: 6px 8px 0 rgba(0, 0, 0, .6); }
.sends { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }

/* the cards that carry the board: a smaller poster, and on a wide screen the board next to it */
.card.over .poster, .card.next .poster { width: min(40vw, 168px); }
.card.over .poster .stamp, .card.next .poster .stamp { font-size: 28px; }
.card.over .poster b, .card.next .poster b { font-size: 17px; }
@media (min-width: 760px) {
  .card.over { grid-auto-flow: column; align-items: center; gap: 36px; }
  .card.over .poster { width: 220px; }
  .card.over .poster .stamp { font-size: 38px; }
  .card.over .poster b { font-size: 22px; }
}

/* a phone held sideways: the poster next to the words, everything smaller */
@media (max-height: 520px) {
  .card { grid-auto-flow: column; align-items: center; gap: 28px; }
  .poster { width: min(30vw, 150px); }
  .poster .stamp { font-size: 22px; }
  .poster.caught .stamp { font-size: 28px; }
  .say { top: calc(64px + env(safe-area-inset-top)); font-size: 15px; }
  .tally { top: calc(46px + env(safe-area-inset-top)); }
  .line.rules, .how { font-size: 12px; }
  .move { width: 148px; height: 64px; }
  .acts button { width: 64px; height: 64px; font-size: 12px; }
  .acts .grab { margin-bottom: 14px; }
  .pad { bottom: calc(10px + env(safe-area-inset-bottom)); }
}

/* the card of the arrest carries the most (the time, the stars, who is next): on a short screen it closes up, so that the way on stays in sight */
.card.next .words { gap: 8px; }
@media (max-height: 700px) {
  .card.next { gap: 10px; padding: 10px 24px; }
  .card.next .poster { width: min(32vw, 124px); }
  .card.next .poster .stamp { font-size: 22px; }
  .card.next .poster b { font-size: 15px; }
  .card.next .score b { font-size: 36px; }
  .card.next .nextup img { width: 44px; height: 44px; }
}
@media (max-height: 600px) {
  .card.next { gap: 8px; padding: 6px 24px; }
  .card.next .words { gap: 6px; }
}
@media (max-height: 520px) {
  .card.next { gap: 28px; padding: 8px 24px; }
  .card.next .words { gap: 5px; }
  .card.next .score span { font-size: 11px; }
  .card.next .score b { font-size: 28px; }
  .card.next .best { font-size: 12px; }
  .card.next .btn { padding: 7px 24px 5px; font-size: 17px; }
  .card.next .btn.ghost { padding: 5px 14px 3px; font-size: 13px; }
  .card.next .nextup { padding: 5px 12px 5px 5px; }
  .card.next .nextup img { width: 38px; height: 38px; }
  .card.next .nextup b { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .say { transition: none; }
  .clock.low { animation: none; }
}

/* the guide: how the game is played, and its controls; it reads from the top, left aligned */
.card.guide { place-content: start center; }
.guide { justify-items: stretch; gap: 8px; text-align: left; }
.guide .day { justify-self: center; }
.guide h3 { margin: 10px 0 0; font-family: 'Anton', sans-serif; font-size: 17px; font-weight: normal; letter-spacing: .06em; text-transform: uppercase; color: var(--neon); }
.guide p { margin: 0; font-size: 14px; line-height: 1.5; color: rgba(239, 227, 196, .88); }
.guide dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 13px; line-height: 1.45; }
.guide dt { font-family: 'Special Elite', monospace; color: var(--paper); }
.guide dd { margin: 0; color: rgba(239, 227, 196, .8); }
.guide .btn { justify-self: center; margin-top: 10px; }
@media (max-width: 480px) {
  .guide dl { grid-template-columns: 1fr; gap: 2px; }
  .guide dd { margin-bottom: 6px; }
}
