/* The public play page. Phones first: the game fills the screen, the stack runs along the bottom, one big
   button under it. On a computer the stack moves to the right like the recording tool. */

html { height: 100%; background: var(--bg); }
body.pl {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template: "top" auto "stage" minmax(0, 1fr) "board" auto "action" auto "after" auto "foot" auto / minmax(0, 1fr);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: radial-gradient(120% 70% at 50% 30%, #161b23 0%, #0b0d11 60%, #07080a 100%);
  -webkit-tap-highlight-color: transparent;
}
body.pl button { touch-action: manipulation; }

/* top bar */
.pl-top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 8px; }
.pl-brand { display: grid; font: 800 20px/0.9 var(--display); letter-spacing: 0.12em; }
.pl-brand i { font: 700 10px/1.2 var(--display); font-style: normal; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); }
.pl-hud { font: 700 13px/1 var(--display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); text-align: center; }
.pl-hud b { color: var(--text); }
.pl-sound { padding: 7px 10px 6px; border: 1px solid var(--line-2); font: 700 11px/1 var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.pl-sound[aria-pressed="true"] { color: var(--text); }

/* the game */
.pl-stage { grid-area: stage; position: relative; min-height: 0; overflow: hidden; }
.pl .draft { cursor: default; }

/* your stack, along the bottom on a phone */
.pl .board { --bu: 3px; grid-area: board; gap: 6px; padding: 8px 12px; background: rgba(8, 10, 13, 0.7); border-left: 0; border-top: 1px solid var(--line); }
.pl .board-head { font-size: 11px; }
.pl .df-body { gap: 0; }
.pl .slots { grid-auto-flow: column; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: none; height: auto; max-height: none; gap: 6px; }
.pl .slot { height: 40px; gap: 6px; padding: 0 6px 0 0; }
.pl .slot-n { width: 18px; font-size: 13px; }
.pl .slot.filled .slot-n { display: none; }
.pl .slot img { width: 26px; height: 26px; margin-left: 6px; }
.pl .slot-name { font-size: 13px; }
.pl .df-sitebrief { display: none; }

/* the big button, and share next to it once a game is over */
.pl-action { grid-area: action; display: flex; justify-content: center; gap: 8px; padding: 10px 14px 6px; }
.pl .spin { flex: 1; max-width: 520px; min-width: 0; height: 58px; padding: 0 16px; }
.pl .spin-label { font-size: 26px; }
.pl-share { flex: 1; max-width: 260px; height: 58px; background: var(--good); color: #0a0c0f; font: 800 22px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; clip-path: polygon(0 0, 100% 0, 100% 72%, 94% 100%, 0 100%); }
.pl-share:active, .pl .spin:active { transform: scale(0.98); }
.pl-share[disabled] { opacity: 0.6; }

/* follow, after a game */
.pl-after { grid-area: after; display: flex; justify-content: center; align-items: center; gap: 14px; padding: 2px 14px 4px; font: 700 13px/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.pl-after b { color: var(--text); }
.pl-after a { padding: 7px 10px 6px; border: 1px solid var(--line-2); color: var(--text); text-decoration: none; }

/* the small print */
.pl-foot { grid-area: foot; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; padding: 6px 14px 8px; font: 500 11px/1.3 var(--body); color: #6b727c; text-align: center; }
.pl-foot a { color: #8a929d; text-decoration: none; }
.pl-foot a b { color: var(--text); font-weight: 600; letter-spacing: 0.04em; }

/* the email ask and the share sheet */
.pl-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(4, 5, 7, 0.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); overflow-y: auto; }
.pl-modal[hidden] { display: none; }
.pl-card { position: relative; display: grid; gap: 12px; width: min(100%, 400px); padding: 26px 22px 18px; background: #12161c; border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); animation: rvUp 0.35s var(--ease-out) both; }
.pl-kicker { font: 700 12px/1 var(--display); letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); }
.pl-card h2 { margin: 0; font: 800 44px/0.9 var(--display); text-transform: uppercase; }
.pl-lead { margin: 0 0 4px; font: 500 15px/1.35 var(--body); color: #c9ced6; }
.pl-field { display: grid; gap: 6px; font: 700 12px/1 var(--display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.pl-field input { height: 50px; padding: 0 14px; border: 1px solid var(--line-2); background: #0b0d11; color: var(--text); font: 500 17px/1 var(--body); letter-spacing: 0; text-transform: none; border-radius: 0; }
.pl-field input:focus { outline: 2px solid var(--bone); outline-offset: 0; }
.pl-check { display: flex; align-items: center; gap: 10px; font: 500 15px/1.2 var(--body); color: #c9ced6; }
.pl-check input { width: 22px; height: 22px; accent-color: var(--good); }
.pl-hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.pl-err { margin: 0; padding: 8px 10px; background: color-mix(in srgb, var(--bad) 18%, transparent); color: #ffb3b3; font: 500 14px/1.3 var(--body); }
.pl-btn { display: grid; place-items: center; height: 54px; background: var(--bone); color: #0a0c0f; font: 800 24px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; }
.pl-btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-2); }
.pl-btn[disabled] { opacity: 0.6; }
.pl-fine { margin: 0; font: 400 12px/1.4 var(--body); color: #7d848e; }
.pl-fine a { color: #b9bcc6; }
.pl-skip { justify-self: center; padding: 6px 10px; font: 600 13px/1 var(--body); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.pl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pl-sharecard { width: min(100%, 420px); }
.pl-sharecard img { width: 100%; max-height: 62vh; object-fit: contain; background: #0b0d11; -webkit-touch-callout: default; user-select: auto; -webkit-user-select: auto; }

/* short phones: tighten everything around the game */
@media (max-height: 700px) {
  .pl-top { padding: 6px 12px 4px; }
  .pl .board { padding: 6px 10px; }
  .pl .board-head { display: none; }
  .pl .slot { height: 34px; }
  .pl .spin, .pl-share { height: 50px; }
  .pl .spin-label { font-size: 22px; }
  .pl-foot { padding: 4px 10px 6px; font-size: 10px; }
}

/* a computer or a tablet on its side: the stack goes to the right, like the recording tool */
@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  body.pl {
    grid-template: "top top" auto "stage board" minmax(0, 1fr) "action board" auto "after board" auto "foot foot" auto / minmax(0, 1fr) clamp(260px, 24vw, 340px);
    max-width: 1500px;
    margin: 0 auto;
  }
  .pl .board { --bu: 3.4px; gap: calc(var(--bu) * 3.4); padding: calc(var(--bu) * 5); border-top: 0; border-left: 1px solid var(--line); }
  .pl .board-head { font-size: calc(var(--bu) * 5.4); }
  .pl .slots { grid-auto-flow: row; grid-template-columns: none; grid-template-rows: repeat(5, minmax(0, 1fr)); height: 100%; max-height: 520px; gap: calc(var(--bu) * 1.7); }
  .pl .slot { height: auto; gap: calc(var(--bu) * 3); padding-right: calc(var(--bu) * 3); }
  .pl .slot-n, .pl .slot.filled .slot-n { display: grid; width: calc(var(--bu) * 15); font-size: calc(var(--bu) * 10); }
  .pl .slot img { width: calc(var(--bu) * 12 * 1.2); height: calc(var(--bu) * 12 * 1.2); margin: 0; }
  .pl .slot-name { font-size: calc(var(--bu) * 8 * 1.2); }
  .pl .df-body { gap: calc(var(--bu) * 3.4); }
  .pl .df-sitebrief { display: grid; }
  .pl-top { padding: 14px 20px 10px; }
  .pl-brand { font-size: 24px; }
  .pl-hud { font-size: 15px; }
}
