/* Clutch: a candy-pink claw machine on the arcade carpet. The canvas is the whole page; the scoreboard, the control
   deck with its big button, and the cards float over it. */

/* The fonts, the prize counter and the toast come from ../shared/arcade.css. */

:root {
  --ink: #fbeed2;
  --ink2: rgba(251, 238, 210, .74);
  --ink3: rgba(251, 238, 210, .5);
  --bg: #140b26;
  --card: rgba(26, 14, 44, .92);
  --line: rgba(251, 238, 210, .16);
  --pink: #ff5fa2;
  --pink2: #c92a68;
  --teal: #4ff0e0;
  --gold: #ffd36a;
  --chrome: #d5dbe4;
  --disp: "Bungee", Impact, sans-serif;
  --body: "Figtree", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* what a card says, and its buttons: side by side on a phone on its side (at the end), and otherwise as if they weren't
   there */
.words, .acts { display: contents; }
[data-single] .to-floor { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  color: var(--ink); font: 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 95, 162, .18), transparent 60%), var(--bg);
}
#stage { position: fixed; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
svg { width: 1.3em; height: .9em; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- the scoreboard ---------- */
.hud {
  position: fixed; left: 0; right: 0; top: 0; z-index: 2; pointer-events: none;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px));
  display: flex; justify-content: space-between; align-items: flex-start;
}
.hud .score { line-height: 1; }
.hud .score small { display: block; font: 600 11px var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--ink2); margin: 0 0 4px 2px; }
.hud .score b {
  display: inline-block; min-width: 2ch; font: 400 30px/1 var(--disp); color: var(--gold); letter-spacing: .02em;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 14px rgba(255, 170, 60, .55), 0 2px 0 rgba(0, 0, 0, .4);
}
.hud .score b.bump { animation: bump .5s ease-out; }
@keyframes bump { 30% { transform: scale(1.35); } }
.hud .right { display: flex; gap: 8px; align-items: center; pointer-events: auto; }
.hud button {
  height: 40px; border-radius: 999px; border: 1px solid var(--line); background: rgba(20, 11, 38, .6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
/* The 40 px buttons answer a tap 4 px round them too, 48 px in all (a box the layout doesn't see). */
.hud button { position: relative; }
.hud button::after { content: ""; position: absolute; inset: -5px; border-radius: inherit; } /* (from inside the border) */
.hud .tix { display: flex; align-items: center; gap: 6px; padding: 0 12px 0 10px; font: 400 15px var(--disp); }
.hud .menu { width: 40px; display: grid; place-content: center; gap: 4px; padding: 0; }
.hud .menu span { display: block; width: 16px; height: 2px; border-radius: 2px; background: var(--ink); }

/* ---------- the control deck: under the cabinet on a phone, beside it on a wide screen (js/app.js places it) ---------- */
.deck {
  position: fixed; z-index: 1; left: 0; width: 100%; top: calc(100% - 118px); height: 118px;
  display: flex; align-items: center; justify-content: space-evenly; gap: 6px; padding: 10px 12px 14px;
  background: linear-gradient(#d43a75, #a61f55); border-radius: 0 0 22px 22px;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .25), inset 0 -4px 0 rgba(0, 0, 0, .25), 0 14px 30px rgba(0, 0, 0, .45);
}
.deck.side { flex-direction: column; justify-content: center; height: auto; padding: 22px 16px; border-radius: 22px; gap: 12px; }
.deck.side .say br { display: none; }
.say { flex: 1; max-width: 9em; font: 400 12px/1.25 var(--disp); letter-spacing: .04em; text-transform: uppercase; color: #fff1f6; text-align: center; opacity: .9; }
.deck.side .say { flex: none; }
/* a press too short to be a go: "Hold to move the claw" lights up for a moment (js/app.js) */
.say.nudge { animation: nudge 1.6s ease-out; }
@keyframes nudge { 0%, 55% { color: #ffe28a; opacity: 1; transform: scale(1.12); } }
/* On a short phone the cabinet is narrower, and the deck under it (js/app.js marks it): under 290 px the hint goes
   down to 11 px, the smallest size Apple's guidelines give for iOS, in no more lines than the deck has room for, and
   under 220 px, where it can't fit whole at that size, it goes, as the title card says it too. */
.deck.narrow .say { font-size: 11px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
.deck.narrower .say { display: none; }
.hold {
  flex: none; width: 88px; height: 88px; border-radius: 50%; padding: 0; position: relative;
  border: 0; background: radial-gradient(circle at 50% 50%, #9aa3b4 0 60%, #e9edf3 61% 66%, #6b7487 67%);
  box-shadow: 0 6px 0 #5e1132, 0 10px 18px rgba(0, 0, 0, .4); touch-action: none;
}
.hold span {
  position: absolute; inset: 9px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 40% 32%, #ff9cc4, #ff3d8b 45%, #b8135a);
  box-shadow: 0 5px 0 #7d0c3c, inset 0 -3px 6px rgba(0, 0, 0, .25);
  font: 400 15px var(--disp); letter-spacing: .06em; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
  transition: transform .06s, box-shadow .06s;
}
.hold.down span { transform: translateY(4px); box-shadow: 0 1px 0 #7d0c3c, inset 0 -2px 4px rgba(0, 0, 0, .3); background: radial-gradient(circle at 40% 32%, #ffb3d2, #ff5a9c 45%, #c81c66); }
.hold:focus-visible { outline-offset: 5px; border-radius: 50%; }

/* ---------- cards: title, a win, the menu ---------- */
/* left: over the cabinet on a wide screen, where the deck stands beside it (js/app.js sets --card-x) */
.card {
  position: fixed; z-index: 3; left: var(--card-x, 50%); top: 50%; transform: translate(-50%, -50%);
  width: min(380px, calc(100vw - 32px)); max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain;
  padding: 22px 22px 16px; text-align: center; background: var(--card);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.card h2 { margin: 2px 0 10px; font: 400 24px/1.15 var(--disp); color: var(--ink); text-wrap: balance; }
.marquee {
  margin: 0 auto 14px; padding: 12px 10px 10px; border-radius: 14px; position: relative;
  background: #170a26; border: 2px solid var(--gold);
  box-shadow: 0 0 0 4px rgba(255, 211, 106, .14), 0 10px 30px rgba(255, 95, 162, .3);
}
.marquee::before, .marquee::after {
  content: ""; position: absolute; left: 10px; right: 10px; height: 6px;
  background: radial-gradient(circle, #fff1c4 0 2px, rgba(255, 220, 140, .35) 2.6px, transparent 3.4px) 0 0 / 14px 6px repeat-x;
  animation: chase .9s steps(2) infinite;
}
.marquee::before { top: 4px; }
.marquee::after { bottom: 4px; animation-delay: .45s; }
@keyframes chase { 50% { background-position: 7px 0; } }
.marquee h1 {
  margin: 6px 0 4px; font: 400 44px/1 var(--disp); color: #ffd0e3; letter-spacing: .04em;
  text-shadow: 0 0 6px var(--pink), 0 0 18px var(--pink), 0 0 36px rgba(255, 95, 162, .6);
}
.lede { margin: 0 0 8px; font-weight: 600; text-wrap: balance; }
.how { margin: 0 0 14px; font-size: 14px; color: var(--ink2); }
.best { margin: 12px 0 0; font-size: 13px; color: var(--ink3); min-height: 1em; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.col { display: grid; gap: 8px; margin-bottom: 14px; }
.big, .plain {
  min-height: 48px; padding: 0 22px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.big { font: 400 18px var(--disp); background: linear-gradient(#ff6aa8, #e0347a); border: 1px solid #ff9cc4; color: #fff; box-shadow: 0 4px 0 #7d0c3c; }
.big:active { transform: translateY(2px); box-shadow: 0 2px 0 #7d0c3c; }
.plain { font-weight: 600; background: rgba(251, 238, 210, .07); border: 1px solid var(--line); }
.plain:active { background: rgba(251, 238, 210, .14); }
a.plain { color: inherit; text-decoration: none; }
/* The way back to the floor is 44 px tall to tap, and placed so its words sit where they did in a 25 px box. */
.floor {
  display: flex; align-items: center; width: max-content; min-height: 44px; margin: -15.5px 0 .5px -10px; padding: 0 10px;
  font: 600 14px var(--body); color: var(--ink2); text-decoration: none;
}
.floor:hover, .floor:focus-visible { color: var(--ink); text-decoration: underline; }
.art { display: block; width: 220px; height: 170px; margin: -4px auto 4px; }
#win { border-color: rgba(255, 211, 106, .45); box-shadow: 0 0 0 4px rgba(255, 211, 106, .1), 0 20px 60px rgba(0, 0, 0, .5); }

.jd-foot { margin-top: 16px; font-size: 12px; color: var(--ink3); }
/* each link 44 px tall to tap (and a little wider), its words where they were */
.jd-foot a { padding: 15px 4px; margin: 0 -4px; color: var(--ink3); text-decoration: none; }
.jd-foot a:hover, .jd-foot a:focus-visible { text-decoration: underline; color: var(--ink2); }
.jd-foot span { margin: 0 6px; }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .marquee::before, .marquee::after, .hud .score b.bump { animation: none; }
  .say.nudge { animation: none; color: #ffe28a; opacity: 1; }
}

/* ---------- a phone on its side ---------- */
/* Each card in two columns, what it says on the left and its buttons on the right, so Play and the rest are in sight
   without scrolling (and stay in sight if a short window makes the card scroll). It stands in the middle of the screen,
   clear of the notch, over the deck beside the cabinet. The menu has Paused and how to play on the left. */
@media (orientation: landscape) and (max-height: 500px) {
  .card {
    left: 50%; width: min(720px, calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-height: calc(100dvh - 16px); padding: 14px 22px;
    display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); column-gap: 26px; align-items: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5), 0 0 0 100vmax rgba(0, 0, 0, .45); /* (the rest of the screen dimmed behind it) */
  }
  .words, .acts { display: block; min-width: 0; }
  .acts { position: sticky; top: 0; }
  .card .row { flex-direction: column; align-items: stretch; }
  .acts .row + .row { margin-top: 10px; }
  .marquee { margin-bottom: 10px; padding: 8px 10px 6px; }
  .marquee h1 { margin: 4px 0 2px; font-size: 34px; }
  .fp-payout { min-height: 96px; }
  .fp-strip { max-height: 88px; } /* (the strip of tickets hangs four long, as it does on Tilt's short screens) */
  #menu { grid-template-areas: ". col" "h col" "t col" "k col" "f col" ". col"; grid-template-rows: 1fr repeat(4, auto) 1fr; }
  #menu h2 { grid-area: h; }
  #menu .col { grid-area: col; margin: 0; }
  #menu .touch { grid-area: t; }
  #menu .how.keys { grid-area: k; }
  #menu .jd-foot { grid-area: f; }
  #win { box-shadow: 0 0 0 4px rgba(255, 211, 106, .1), 0 20px 60px rgba(0, 0, 0, .5), 0 0 0 100vmax rgba(0, 0, 0, .45); }
}
