/* Up & Adder · app layout. Loads after tokens.css and ua.css (the design bundle). */

@font-face { font-family: "DynaPuff"; src: url(/fonts/dynapuff.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url(/fonts/bricolage.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }

html, body { margin: 0; min-height: 100%; }
body { min-height: 100vh; min-height: 100dvh; position: relative; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
body.ua { background-color: var(--cloth); }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.ua-sun { position: fixed; }
.ua-tile__icon { pointer-events: none; }
.ua-price img, .ua-chip img, .ua-btn img, .ua-feed__item img, .ua-coins img, .ua-toast__icon img { width: 22px; height: 22px; display: block; flex: none; }
.ua-price img { width: 14px; height: 14px; }
.ua-trick__art img { width: 76%; height: auto; display: block; }
.ua-player__crown img, .ua-heat__icon img, .ua-choice__to img { width: 100%; height: 100%; display: block; }
.ua-choice__to img { width: 22px; height: 22px; display: inline-block; vertical-align: -5px; }

/* ---------------------------------------------------------------- board */

.bd { position: relative; transform-origin: 0 0; flex: none; }
.bd-cam { perspective: 1400px; perspective-origin: 50% 0%; transition: transform var(--dur-stage) var(--ease-snap); }
.bd-cam.is-push { transform: scale(1.07); }
.bd-over { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.bd-tags, .bd-pips { position: absolute; inset: 0; pointer-events: none; }
.bd-tag { position: absolute; pointer-events: none; }
.ua-price.bd-tag--gold { background: var(--golden); }
.ua-price.bd-tag--bump { box-shadow: 0 0 0 3px var(--grape), var(--shadow-rest); }
.bd.is-chill .bd-tag { display: none; }
.bd-pip { position: absolute; left: 0; top: 0; transform-origin: 50% 100%; will-change: transform; }
.bd-pip > svg { display: block; position: relative; }
.bd-pip .ua-pip-you { z-index: -1; }
.ua-board .ua-tile:nth-child(even) { background: var(--board); }
.ua-board .ua-tile.bd-alt { background: var(--board-alt); }
.ua-board .ua-tile.bd-lost::after { content: ""; position: absolute; right: 8%; bottom: 8%; width: 30%; height: 30%; border-radius: 50%;
  background: var(--gold); border: 2px solid var(--outline); box-shadow: 0 2px 0 var(--gold-lip); animation: ua-pop-in var(--dur-pop) var(--ease-spring) both; }
.ua-board .ua-tile.bd-sticky { background-image: radial-gradient(circle at 40% 45%, rgba(176, 112, 48, .45) 0 30%, transparent 32%), radial-gradient(circle at 70% 70%, rgba(176, 112, 48, .35) 0 14%, transparent 16%); }
.ua-board .ua-tile.bd-pick { cursor: pointer; box-shadow: inset 0 0 0 3px var(--grape); animation: ua-wobble 1.6s ease-in-out infinite; }
.bd-hl { fill: #fff; fill-opacity: .5; }
.bd-eye { fill: #fff; stroke: var(--outline); stroke-width: 1.8; }
.bd-pupil { fill: var(--outline); }
.bd-tape-ink { fill: none; stroke: var(--outline); stroke-width: 10; }
.bd-tape { fill: none; stroke: var(--tape, #f2e3b0); stroke-width: 7; }
.pgm .bd-tape-ink { stroke-width: 6; }
.pgm .bd-tape { stroke-width: 4; }
.pg-board .ua-tile { border-radius: 6px; }
.pg-board .ua-tile__n { top: 2px; left: 3px; font-size: 9px; line-height: 10px; }
.pg-board .ua-tile__icon { width: 55%; height: 55%; }
.pg-board .ua-tile--target::before, .pg-board .ua-tile--danger::before { inset: -4px; border-radius: 9px; border-width: 2.5px; }
.pg-board .ua-price { transform: scale(.7); transform-origin: 0 0; }
.pg-board .ua-pip--md { width: 24px; height: 31.5px; }
.pg-board .ua-pip-you { border-width: 2px; }
.pg-board .ua-bubble { font-size: 13px; line-height: 16px; padding: 3px 9px 5px; }
.pg-board .ua-tile.bd-pick { box-shadow: inset 0 0 0 2px var(--grape); }
.pg-board .ua-tile.bd-lost::after { border-width: 1.5px; }
.pg-board .ua-tile.ua-tile--marbles::after { transform: scale(.8); }
.pg-board .ua-shout { font-size: 40px; line-height: 40px; }

.pg-board .ua-tile, .gm-board .ua-tile { overflow: visible; }
svg .pg { fill: #fff; }
.ua-pip__line.sw2 { stroke-width: 2; }
.bd-bubble { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); white-space: nowrap; font-size: 17px; line-height: 20px; z-index: 2; }
.sh-sp { display: inline-block; width: .32em; }

/* ---------------------------------------------------------------- toasts, errors */

.hs-toast, .ph-toast { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 90; pointer-events: none; max-width: calc(100% - 32px); }
.hs-toast { left: auto; right: 24px; transform: none; }
.hs-err { position: fixed; inset: 0; display: grid; place-items: center; background: var(--scrim); z-index: 100; padding: 16px; }
.hs-err .ua-panel { display: grid; gap: 18px; justify-items: center; max-width: 520px; text-align: center; }

/* ---------------------------------------------------------------- host lobby */

.lb { position: relative; min-height: 100vh; box-sizing: border-box; padding: 40px clamp(24px, 4vw, 64px); display: grid;
  grid-template-columns: minmax(340px, 460px) minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 28px 48px; align-content: start; }
.lb-left { display: flex; flex-direction: column; gap: 8px; grid-row: 1; }
.lb-logo { width: 220px; height: auto; margin: -8px 0 8px -10px; }
.lb-title { margin-top: 2px; }
.lb-join { margin-top: 16px; display: flex; gap: 20px; align-items: center; justify-content: space-between; padding: 20px 24px; }
.lb-join__code { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.lb-url { font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-qr { width: 168px; height: 168px; border-radius: 14px; flex: none; image-rendering: pixelated; }
.lb-mid { grid-row: 2; grid-column: 1; }
.lb-seathead { display: flex; align-items: center; gap: 10px; }
.lb-seats { display: grid; grid-template-columns: repeat(3, minmax(0, 132px)); gap: 14px 18px; margin-top: 14px; }
.lb-seats .ua-seat { position: relative; }
.ua-seat.is-away { opacity: .6; }
.lb-kick { position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.lb-wait { font-size: 14px; text-align: center; }
.lb-dots { color: var(--ink-soft); }
.lb-right { grid-column: 2; grid-row: 1 / 3; display: flex; flex-direction: column; align-self: stretch; min-height: 600px; }
.lb-rhead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.lb-right .ua-heat { margin-top: 32px; }
.lb-sum { margin-top: 18px; min-height: 48px; }
.lb-sum b { color: var(--ink); }
.lb-set { display: grid; grid-template-columns: 150px 1fr; align-items: center; }
.lb-seg { display: flex; gap: 8px; flex-wrap: wrap; }
.lb-go { margin-top: auto; padding-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.lb-ready { display: flex; flex-direction: column; gap: 2px; }
.lb .ua-rule { margin: 20px 0; }
/* Laptops and 720p/900p TVs: everything above the fold, Start included. */
@media (max-height: 1000px) {
  .lb { padding-top: 24px; padding-bottom: 24px; row-gap: 20px; }
  .lb-logo { width: 156px; margin-bottom: 0; }
  .lb-join { margin-top: 10px; padding: 14px 20px; }
  .lb-qr { width: 136px; height: 136px; }
  .lb-seats { margin-top: 10px; gap: 12px 18px; }
  .lb-seats .ua-seat { height: 136px; }
  .lb-seats .ua-seat .ua-pip { width: 52px; height: 68px; }
  .lb-seats .ua-seat.is-empty { height: 88px; }
  .lb-right { min-height: 0; }
}
.lb-heat--compact { grid-template-columns: 1fr; gap: 8px; }
.lb-heat--compact .ua-heat__opt { padding: 10px 12px; min-height: 0; text-align: left; }
.lb-heat--compact .ua-heat__icon { width: 40px; height: 40px; }
.lb-heat--compact .ua-heat__desc { font-size: 13px; line-height: 17px; }

@media (max-width: 1100px) {
  .lb { grid-template-columns: 1fr; }
  .lb-mid, .lb-right { grid-column: 1; grid-row: auto; min-height: 0; }
}

/* ---------------------------------------------------------------- host game */

.gm { position: relative; height: 100vh; height: 100dvh; box-sizing: border-box; padding: 12px clamp(16px, 2.6vw, 40px) 16px; display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 28vw, 420px); grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px clamp(20px, 3vw, 48px); }
.gm-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-height: 44px; }
.gm-top img { width: 36px; height: auto; }
.gm-spacer { flex: 1; }
.gm-board { position: relative; display: flex; justify-content: center; align-items: flex-start; min-height: 0; min-width: 0; }
.gm-board > .bd { position: absolute; left: 50%; top: 0; transform-origin: 50% 0; translate: -50% 0; }
.gm-shout { position: absolute; left: 0; right: 0; top: 42%; display: flex; justify-content: center; pointer-events: none; z-index: 30; }
.gm-twist, .pg-twist { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); z-index: 35; display: grid; justify-items: center; gap: 6px; text-align: center;
  padding: 20px 32px; background: var(--paper); border-radius: var(--radius-xl); box-shadow: 0 0 0 4px var(--grape), var(--shadow-cast); max-width: min(560px, 92%);
  animation: ua-pop-in var(--dur-pop) var(--ease-spring) both; }
.gm-deal { position: absolute; inset: -8px; z-index: 32; display: grid; place-items: center; padding-top: 72px; }
.gm-deal .ua-scrim { border-radius: var(--radius-xl); }
.gm-rail { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: hidden; }
.gm-chips { display: flex; flex-direction: column; gap: 8px; padding: 0 18px 0 12px; }
.gm-gap { margin-top: 12px; }
.gm-panel { grid-column: 1 / -1; display: flex; align-items: center; gap: 24px; padding: 14px 24px; min-height: 124px; box-sizing: border-box; }
.gm-tray { padding: 14px 24px 20px; gap: 20px; flex: none; }
.gm-dice, .sh-dice { display: flex; gap: 14px; align-items: center; }
.gm-dice { --die-size: 72px; gap: 26px; padding: 0 6px; }
.gm-dice.is-idle .ua-die, .sh-dice.is-idle .ua-die { opacity: .5; }
.gm-act { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.gm-row { display: flex; align-items: center; gap: 14px; min-height: 56px; }
.gm-hand { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gm-locked { flex-wrap: nowrap; pointer-events: none; }
.gm-locked .ua-choice { flex: 1 1 0; min-width: 0; max-width: 260px; }
.tn-best { margin-left: 4px; vertical-align: 2px; }
@media (max-width: 900px) {
  .gm { height: auto; grid-template-columns: 1fr; }
  .gm-board { min-height: 70vw; }
}

/* ---------------------------------------------------------------- victory */

.vc-wrap { position: fixed; inset: 0; z-index: 60; background: var(--scrim); display: grid; place-items: center; overflow: auto; padding: 16px; animation: ua-fade-in var(--dur-stage) var(--ease-snap) both; }
.vc { position: relative; width: min(920px, 100%); }
.vc-in { position: relative; background: var(--paper); border-radius: var(--radius-xl); box-shadow: var(--shadow-cast); padding: 28px clamp(16px, 4vw, 40px) 32px;
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; animation: ua-pop-in var(--dur-pop) var(--ease-spring) both; }
.vc-title { font-size: clamp(36px, 7vw, 64px); line-height: 1; color: var(--tomato-ink); }
.vc .ua-confetti { position: fixed; z-index: 1; }
.vc-podium { display: flex; align-items: flex-end; justify-content: center; gap: clamp(8px, 2vw, 24px); margin-top: 8px; }
.vc-step { display: flex; flex-direction: column; align-items: center; position: relative; }
.vc-crown { width: 48px; height: 48px; margin-bottom: -8px; }
.vc-crown img { width: 100%; height: 100%; }
.vc-block { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; width: clamp(92px, 20vw, 168px); padding: 10px 6px; border-radius: 16px 16px 6px 6px;
  background: var(--board); box-shadow: 0 6px 0 var(--board-edge); margin-top: -6px; }
.vc-step--1 .vc-block { min-height: 120px; background: var(--gold); box-shadow: 0 6px 0 var(--gold-lip); }
.vc-step--2 .vc-block { min-height: 88px; }
.vc-step--3 .vc-block { min-height: 64px; }
.vc-n { font-family: var(--font-display); font-size: 32px; line-height: 32px; }
.vc-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.vc-rest { margin: 0; padding-left: 1.4em; text-align: left; color: var(--ink-soft); }
.vc-awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; width: 100%; margin-top: 6px; }
.vc-award { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; }
.vc-award > img { width: 34px; height: 34px; flex: none; }
.vc-award div { display: flex; flex-direction: column; min-width: 0; }
.vc-again { margin-top: 8px; }
.vc-wait { margin-top: 8px; }

/* ---------------------------------------------------------------- phone shared */

.ph { --gut: 16px; }
.ph main { position: relative; box-sizing: border-box; width: 100%; max-width: 520px; margin: 0 auto; }
.ph-input { width: 100%; box-sizing: border-box; height: 52px; border: 0; border-radius: 14px; padding: 0 16px; font: inherit; font-size: 18px; font-weight: 700;
  color: var(--ink); background: var(--paper-sunk); box-shadow: inset 0 3px 0 var(--paper-lip); }
.ph-input:focus { outline: none; box-shadow: inset 0 3px 0 var(--paper-lip), var(--focus-ring); }
.ph-head { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.ph-mark { width: 30px; height: auto; flex: none; }
.ph-ht { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ph-hname { font-size: 17px; line-height: 21px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-wait { min-height: 100vh; display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.ph-wait[hidden] { display: none !important; }

/* join */
.jn { padding: 16px var(--gut) 32px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.jn-logo { width: 190px; height: auto; margin-top: 4px; }
.jn-card { width: 100%; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; padding: 20px; }
.jn-code { justify-content: space-between; width: 100%; }
.jn-code input { flex: 1 1 0; min-width: 0; max-width: 64px; font-family: var(--font-display); }
.jn-gap { margin-top: 12px; }
.jn-pips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.jn-pip { appearance: none; border: 0; padding: 6px 0 4px; border-radius: 14px; background: var(--paper-sunk); display: grid; place-items: center; cursor: pointer;
  transition: transform var(--dur-tap) var(--ease-snap), box-shadow var(--dur-tap) var(--ease-snap); }
.jn-pip[aria-checked="true"] { background: var(--gold-soft); box-shadow: 0 0 0 3px var(--gold); transform: translateY(-2px); }
.jn-pip:disabled { opacity: .3; cursor: not-allowed; }
.jn-pip:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.jn-err { min-height: 22px; color: var(--tomato-ink); font-weight: 700; font-size: 15px; line-height: 20px; margin-top: 4px; }
.jn-alt { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }

/* phone lobby */
.pl { padding: 8px var(--gut) 32px; display: flex; flex-direction: column; gap: 14px; }
.pl-me { display: flex; gap: 16px; align-items: center; padding: 16px; }
.pl-mepip .ua-pip { width: 96px; height: 126px; }
.pl-mebody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pl-host { display: flex; flex-direction: column; gap: 12px; }
.pl-share { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; }
.pl-share .ua-code { margin: 6px 0; }
.pl-share .ua-code__tile { width: 44px; height: 50px; font-size: 26px; }
.pl-qr { width: 112px; height: 112px; border-radius: 10px; flex: none; image-rendering: pixelated; }
.pl-timer { display: flex; flex-direction: column; gap: 8px; }
.pl-hint { font-size: 15px; }
.pl-seats { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pl-seat { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.pl-seat .ua-pip { width: 28px; height: 37px; }
.pl-seat b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-st { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.pl-seat.is-ready .pl-st { color: var(--mint-ink); }

/* phone game */
.pgm { min-height: 100vh; min-height: 100dvh; display: flex !important; flex-direction: column; padding: 4px 8px 0; }
.pgm[hidden] { display: none !important; }
.pgm .ph-head { padding: 0 8px; }
.pg-strip { display: flex; gap: 6px; padding: 4px 4px 2px; overflow-x: auto; scrollbar-width: none; }
.pg-chip { flex: 1 1 0; min-width: 52px; justify-content: center; gap: 4px; padding: 0 6px 0 4px; font-size: 13px; transition: box-shadow var(--dur-quick) var(--ease-snap); }
.pg-chip.is-turn { box-shadow: 0 0 0 3px var(--sky), var(--shadow-rest); }
.pg-chip.is-me { background: var(--gold-soft); }
.pg-chip.is-away { opacity: .5; }
.pg-chip__pip.ua-pip { width: 18px; height: 23.6px; margin-top: -6px; }
.pg-chip__n { font-family: var(--font-display); font-size: 14px; font-weight: 600; }
.pg-board { position: relative; flex: none; height: var(--fit-h, 92vw); margin: 6px 0 4px; }
.pg-board > .bd { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.pg-shout { position: absolute; left: 0; right: 0; top: 40%; display: flex; justify-content: center; pointer-events: none; z-index: 30; }
.pg-twist { top: 10%; padding: 12px 18px; gap: 2px; }
.pg-sheet { flex: 1; background: var(--paper); border-radius: 28px 28px 0 0; box-shadow: var(--shadow-cast); margin: 0 -8px; padding: 14px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 10; animation: sh-in var(--dur-stage) var(--ease-spring) both; }
.pg-sheet.is-sent button { pointer-events: none; opacity: .7; }
@keyframes sh-in { from { transform: translateY(40px); } to { transform: none; } }
.sh-r1 { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.sh-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sh-t b { font-size: 17px; line-height: 21px; }
.sh-r1 .ua-ring { flex: none; transform: scale(.82); margin: -5px; }
.sh-dice { --die-size: 40px; gap: 8px; flex: none; }
.sh-roll { min-height: 64px; }
.sh-emotes { gap: 6px; flex-wrap: wrap; justify-content: center; }
.sh-emotes .ua-emote { padding: 0 12px; }
.sh-hand { justify-content: center; padding: 8px 12px 0; }
.sh-hand .ua-trick { width: 104px; height: 152px; }
.sh-hand .ua-trick__fx { font-size: 11px; line-height: 14px; }
.sh-hand .ua-trick.is-off { filter: saturate(.35); opacity: .72; }
.sh-nohand { text-align: center; }
.sh-arm { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; box-shadow: 0 0 0 3px var(--grape), var(--shadow-rest); }
.sh-armb { display: flex; justify-content: flex-end; gap: 8px; }
.sh-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.sh-choices .ua-choice { min-width: 0; width: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; row-gap: 4px; align-items: start; padding: 8px 8px 10px; }
.sh-choices .ua-choice__move { grid-row: auto; font-size: 30px; line-height: 32px; }
.sh-choices .ua-choice__label { font-size: 12px; line-height: 16px; gap: 3px; flex-wrap: wrap; }
.sh-choices .ua-choice__to { font-size: 16px; line-height: 20px; }
.sh-choices .ua-choice__to small { font-size: 12px; line-height: 15px; }
.sh-tricks { display: flex; flex-wrap: wrap; gap: 8px; }
.sh-tricks .ua-btn.is-on { box-shadow: 0 0 0 3px var(--gold), 0 var(--lip) 0 var(--btn-lip); }

/* phone deal */
.pd { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 72px 16px 16px; }
.pd .ua-scrim { position: fixed; }
.pd .ua-deal { width: 100%; max-width: 420px; }
.pd .ua-deal__title { font-size: 26px; line-height: 30px; }
.pd-charm { margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  .bd-cam, .bd-pip { transition: none !important; }
  .ua-board .ua-tile.bd-pick, .pg-sheet, .gm-twist, .pg-twist, .vc-in, .vc-wrap { animation: none !important; }
}
