/* Phone: one column, big tap targets (drunk-friendly), brand colours from /brand.css. */
/* A game controller, not a web page: it can't be pinched or zoomed out, doesn't rubber-band,
   and the text size stays put when the phone turns. */
html:has(body.phone) { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior: none; }
body.phone { background: var(--surface); color: var(--text); min-height: 100vh; overscroll-behavior: none; overflow-x: hidden; touch-action: pan-y; }
.ph-frame { max-width: 480px; margin: 0 auto; min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.ph-stage { display: grid; align-content: start; gap: 1rem; }
.ph-head { display: flex; align-items: center; gap: .9rem; padding: 1rem; background: var(--brand-primary); color: var(--on-brand); border-bottom: 4px solid var(--brand-accent); }
.ph-logo { height: 52px; width: auto; max-width: 70%; object-fit: contain; }
.ph-head[data-logo-size="small"] .ph-logo { height: 38px; }
.ph-head[data-logo-size="large"] .ph-logo { height: 84px; }
.ph-head[data-logo-pos="center"] { flex-direction: column; text-align: center; justify-content: center; }
.ph-head[data-logo-pos="right"] { flex-direction: row-reverse; text-align: right; }
.ph-head[data-show-name="false"] { justify-content: center; }
.ph-head[data-show-name="false"] .ph-name { display: none; }
.ph-at { margin: 0; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }
.ph-city { margin: 0; opacity: .8; }
.ph-stage { padding: 1.25rem; }
.ph-join { display: grid; gap: 1rem; }
.ph-join label { display: grid; gap: .35rem; font-weight: 700; }
.ph-nickname { display: grid; gap: .35rem; }
.ph-nickname-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 .5rem; }
.ph-nick-suggest { min-height: 44px; padding: 0 .15rem; border: 0; background: none; color: var(--text); font: inherit; font-size: .85rem; text-decoration: underline; }
.ph-nick-suggest:disabled { opacity: .55; }
.ph-nick-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ph-nick-reserved:not([hidden]) { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0 .75rem; }
.ph-nick-reserved p, .ph-nick-recovery p { margin: .35rem 0; overflow-wrap: anywhere; }
.ph-nick-recovery summary { min-height: 44px; padding: .65rem 0; }
.ph-nick-recovery label { margin-top: .4rem; }
[data-nick-keep]:not([hidden]) { width: 100%; padding-inline: .75rem; }
.ph-join input::placeholder { color: var(--text-muted); opacity: .8; }
.ph-join input { width: 100%; min-width: 0; font: inherit; font-size: 1.4rem; padding: .8rem; border-radius: var(--radius); border: 2px solid var(--text-muted); background: var(--surface-raised); color: var(--text); }
.ph-btn { font: inherit; font-size: 1.3rem; font-weight: 800; min-height: 3.5rem; border: 0; border-radius: var(--radius); background: var(--brand-primary); color: var(--on-brand); }
.ph-btn:disabled { opacity: .55; }
.ph-note { color: var(--text-muted); font-size: .95rem; }
.ph-notice { background: var(--surface-raised); border-left: 4px solid var(--brand-accent); padding: .8rem; border-radius: 8px; }
.ph-error { color: var(--danger); min-height: 1.2em; margin: 0; }
.ph-hello { font-size: 1.2rem; margin: 0 0 1rem; }
.ph-big { font-size: 1.6rem; font-weight: 800; text-align: center; }
.ph-count { font-size: 3rem; font-weight: 800; text-align: center; margin: .5rem 0; }
.ph-link { font: inherit; background: none; border: 0; color: var(--text-muted); text-decoration: underline; margin-top: 2rem; padding: .5rem 0; }
[data-lobby] .ph-btn { width: 100%; margin-top: 1rem; }
.tr-tap { width: 100%; aspect-ratio: 1; border-radius: 50%; border: 0; font: inherit; font-size: 3rem; font-weight: 900; background: var(--brand-primary); color: var(--on-brand); touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; transition: transform .05s; }
.tr-tap.tr-hit { transform: scale(.97); }
.tr-mine { text-align: center; font-size: 1.3rem; }
.bn-ph-prompt { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; line-height: 1.3; }
.bn-blank { display: inline-block; width: 4rem; border-bottom: 3px solid var(--brand-accent); margin: 0 .2rem; }
.bn-ph-timer { float: right; font-weight: 800; color: var(--text-muted); margin: 0; }
.bn-hint { color: var(--text-muted); }
.bn-hand { list-style: none; padding: 0; margin: .5rem 0 1rem; display: grid; gap: .6rem; }
.bn-card { display: block; width: 100%; text-align: left; font: inherit; font-size: 1.1rem; padding: .9rem 1rem; border-radius: var(--radius); border: 2px solid transparent; background: var(--surface-raised); color: var(--text); }
button.bn-card { cursor: pointer; } .bn-card.bn-sel { border-color: var(--brand-accent); }
.bn-card.bn-mine { opacity: .6; } .bn-card mark { background: none; color: var(--brand-accent); font-weight: 700; }
.ph-games { display: grid; gap: .5rem; margin-top: 1rem; } .ph-games button { font: inherit; padding: .7rem; border-radius: var(--radius); border: 2px solid var(--text-muted); background: transparent; color: var(--text); }
.ph-games button.on { border-color: var(--brand-accent); font-weight: 800; }

/* Bar Trivia (phone) */
.tq-ph-head { margin: 0; color: var(--text-muted); font-weight: 700; }
.tq-ph-q { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; line-height: 1.3; margin: .4rem 0 .2rem; }
.tq-ph-opts { display: grid; gap: .6rem; margin: .6rem 0; }
.tq-ph-opts .tq-opt { display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left; font: inherit; font-size: 1.15rem; font-weight: 700; padding: .9rem 1rem;
  min-height: 3.6rem; border-radius: var(--radius); border: 3px solid transparent; background: var(--surface-raised); color: var(--text); touch-action: manipulation; cursor: pointer; }
.tq-ph-opts .tq-l { display: grid; place-items: center; flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--brand-primary); color: var(--on-brand); }
.tq-ph-opts .tq-opt:disabled { cursor: default; }
.tq-ph-opts .tq-mine { border-color: var(--brand-accent); }
.tq-ph-opts .tq-right { border-color: var(--success); } .tq-ph-opts .tq-right .tq-l { background: var(--success); color: var(--surface); }
.tq-ph-opts .tq-wrong { border-color: var(--danger); opacity: .7; } .tq-ph-opts .tq-dim { opacity: .45; }
.tq-ph-opts .tq-opt:disabled:not(.tq-right):not(.tq-wrong):not(.tq-dim):not(.tq-mine) { opacity: .6; }
.tq-me { color: var(--text-muted); text-align: center; margin: .4rem 0 0; } .tq-streak { text-align: center; font-weight: 800; margin: 0; }
.tq-ph-q-small { font-size: 1.05rem; }
.dd-c1 { --dd-silk: var(--brand-primary); --dd-num: var(--on-brand); }
.dd-c2 { --dd-silk: var(--brand-accent); --dd-num: var(--on-accent); }
.dd-c3 { --dd-silk: var(--brand-primary); --dd-num: var(--on-brand); }
.dd-c4 { --dd-silk: var(--brand-accent); --dd-num: var(--on-accent); }
.dd-c5 { --dd-silk: var(--brand-primary); --dd-num: var(--on-brand); }
.dd-c6 { --dd-silk: var(--brand-accent); --dd-num: var(--on-accent); }
.dd-c7 { --dd-silk: var(--brand-primary); --dd-num: var(--on-brand); }
.dd-c8 { --dd-silk: var(--brand-accent); --dd-num: var(--on-accent); }
.dd-c9 { --dd-silk: var(--brand-primary); --dd-num: var(--on-brand); }
.dd-c10 { --dd-silk: var(--brand-accent); --dd-num: var(--on-accent); }
.dd-c11 { --dd-silk: var(--brand-primary); --dd-num: var(--on-brand); }
.dd-c12 { --dd-silk: var(--brand-accent); --dd-num: var(--on-accent); }
/* Derby Dash (phone) */
.dd-me { display: flex; align-items: center; justify-content: center; gap: .5rem; font-weight: 800; margin: 0; }
.dd-me b { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 8px; background: var(--dd-silk); color: var(--dd-num); font-size: 1.2rem; }
.dd-progress { height: 14px; border-radius: 999px; background: var(--surface-raised); overflow: hidden; margin: .8rem 0; }
.dd-progress span { display: block; height: 100%; width: 0; background: var(--brand-accent); transition: width .25s linear; }
.dd-tap { font-size: 2.4rem; }

/* The Big Board (phone) */
.bb-buzz { font-size: 3.2rem; }
.bb-buzz:disabled { opacity: .45; }
.tq-ph-opts .bb-out { opacity: .3; text-decoration: line-through; }
.bb-ph-board { display: grid; gap: .7rem; }
.bb-ph-cat { margin: 0 0 .3rem; font-weight: 800; text-transform: uppercase; font-size: .95rem; }
.bb-ph-vals { display: grid; grid-template-columns: repeat(5, 1fr); gap: .35rem; }
.bb-ph-val { font: inherit; font-weight: 900; font-size: 1rem; min-height: 3rem; border: 0; border-radius: var(--radius); background: var(--brand-primary); color: var(--on-brand); padding: 0; }
.bb-ph-val:disabled { background: var(--surface-raised); opacity: .4; }
.bb-betbox { display: grid; gap: .6rem; }
.bb-bet { width: 100%; min-width: 0; font: inherit; font-size: 2rem; font-weight: 800; text-align: center; padding: .6rem; border-radius: var(--radius); border: 2px solid var(--text-muted); background: var(--surface-raised); color: var(--text); }
.bb-quicks { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.bb-quick { font: inherit; font-weight: 700; padding: .7rem 0; border-radius: var(--radius); border: 2px solid var(--text-muted); background: transparent; color: var(--text); }

/* No bar yet (the players' installed app opens here): BarPlay's own neutral charcoal, not a bar's look */
body.ph-plain { --surface: #121417; --surface-raised: #1c1f24; --text: #f2f4f7; --text-muted: #a3acb9; --brand-primary: #f5a524; --brand-accent: #ffc94d; --on-brand: #121417; --on-accent: #121417; }

/* voting on the next game */
.ph-vote { display: grid; gap: .6rem; margin-top: 1rem; }
.ph-vote-head { margin: 0; font-weight: 800; font-size: 1.15rem; }
.ph-vote-left { color: var(--text-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.ph-vote button { font: inherit; font-size: 1.15rem; font-weight: 800; display: flex; justify-content: space-between; align-items: center; gap: .6rem;
  min-height: 3.6rem; padding: .7rem 1rem; border-radius: var(--radius); border: 2px solid var(--text-muted); background: transparent; color: var(--text); text-align: left; }
.ph-vote button.on { border-color: var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 18%, transparent); }
.ph-vote button strong { color: var(--brand-accent); }

/* Bar Napkins: tap a card (it lights up in the bar's colour, the rest dim), then ✓ on the card */
.bn-hand li { display: grid; border-radius: var(--radius); transition: opacity .15s; }
.bn-hand.bn-focus li:not(.bn-on) { opacity: .45; }
.bn-card.bn-sel { background: color-mix(in srgb, var(--brand-accent) 24%, var(--surface-raised)); border-color: var(--brand-accent); }
.bn-on:has(.bn-confirm) .bn-card { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.bn-badge { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; margin-right: .5rem; border-radius: 999px; background: var(--brand-accent); color: var(--on-accent); font-size: .95rem; }
.bn-confirm { font: inherit; font-size: 1.25rem; font-weight: 900; min-height: 3.6rem; border: 0; border-radius: 0 0 var(--radius) var(--radius);
  background: var(--brand-accent); color: var(--on-accent); }

[data-away] { display: grid; gap: .75rem; }
[data-away] :is(h1, p) { margin: 0; }
[data-away] .ph-error:empty { display: none; }
[data-away] a { color: var(--text); padding-block: .65rem; }

.ph-return:not([hidden]) { display: grid; gap: .5rem; }
