/* Highrise: a stacker in a midnight-blue cabinet, a tower against a night skyline. The canvas is the whole page; the
   scoreboard, the control deck with its stop 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: #0a0f2c;
  --card: rgba(14, 18, 52, .93);
  --line: rgba(251, 238, 210, .16);
  --blue: #5cc8ff;
  --indigo: #262c78;
  --warm: #ffc861;
  --gold: #f2c14e;
  --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(92, 200, 255, .16), 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(10, 15, 44, .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% - 112px); height: 112px;
  display: flex; align-items: center; justify-content: space-evenly; gap: 8px; padding: 10px 12px 14px;
  background: linear-gradient(#2a3184, #161c52); border-radius: 0 0 22px 22px;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .16), inset 0 -4px 0 rgba(0, 0, 0, .3), 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: 14px; }
.say { flex: 1; max-width: 8em; font: 400 12px/1.25 var(--disp); letter-spacing: .04em; text-transform: uppercase; color: var(--ink); text-align: center; opacity: .85; text-wrap: balance; }
.deck.side .say { flex: none; }
/* 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 270 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; }
.stop {
  flex: none; width: 92px; height: 92px; 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 #0b0f33, 0 10px 18px rgba(0, 0, 0, .45); touch-action: none;
}
.stop span {
  position: absolute; inset: 9px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 40% 32%, #d8f3ff, #5cc8ff 45%, #1f6fb8);
  box-shadow: 0 5px 0 #154e86, inset 0 -3px 6px rgba(0, 0, 0, .2);
  font: 400 16px var(--disp); letter-spacing: .06em; color: #06213d; text-shadow: 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .05s, box-shadow .05s;
}
.stop.down span { transform: translateY(4px); box-shadow: 0 1px 0 #154e86, inset 0 -2px 4px rgba(0, 0, 0, .25); }
.stop:focus-visible { outline-offset: 5px; border-radius: 50%; }

/* ---------- cards: title, the choice at floor 11, the end of a game, 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: #060a1e; border: 2px solid var(--gold);
  box-shadow: 0 0 0 4px rgba(242, 193, 78, .14), 0 10px 30px rgba(92, 200, 255, .25);
}
.marquee h1 {
  margin: 6px 0 4px; font: 400 42px/1 var(--disp); letter-spacing: .05em; color: #dff4ff;
  text-shadow: 0 0 6px var(--blue), 0 0 18px var(--blue), 0 0 34px rgba(92, 200, 255, .55);
}
.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; }
/* A top-out's card: the trophy, big, in a glow of its own, over the heading */
.trophy {
  margin: -2px auto 4px; width: 120px; font: 72px/1.15 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  background: radial-gradient(closest-side, rgba(242, 193, 78, .42), rgba(242, 193, 78, 0)); filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .45));
}
.trophy[hidden] { display: none; }
.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(#ffd56e, #e5a830); border: 1px solid #ffe7a0; color: #3a2405; box-shadow: 0 4px 0 #7a5410; }
.big:active { transform: translateY(2px); box-shadow: 0 2px 0 #7a5410; }
.big.alt { background: linear-gradient(#8bdcff, #3b9ee0); border-color: #c4ecff; color: #06213d; box-shadow: 0 4px 0 #154e86; }
.big.alt:active { box-shadow: 0 2px 0 #154e86; }
.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; }
.back { margin: 14px 0 0; font-size: 14px; }
/* 44 px tall to tap, its words where they were */
.back a { display: inline-flex; align-items: center; min-height: 44px; margin: -13.5px -10px; padding: 0 10px; color: var(--ink2); text-decoration: none; }
.back a:hover, .back a:focus-visible { color: var(--ink); text-decoration: underline; }

.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) {
  .hud .score b.bump { animation: none; }
  .stop span { transition: none; }
}

/* ---------- 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; }
  .trophy { margin-top: -6px; font-size: 52px; } /* (a top-out's, smaller, so its card fits an iPhone SE on its side) */
}
