/* Phones: portrait, 375px wide and up, thumbs not mice. */
body.phone {
  min-height: 100dvh;
  font-size: 17px;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  background:
    linear-gradient(rgba(23,18,47,.82), rgba(23,18,47,.92)),
    url('/art/stage.webp') center top / cover no-repeat fixed;
  background-color: var(--navy);
}
.ph-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; gap: 12px; min-height: 56px; }
.ph-logo { height: 40px; width: auto; }
body[data-screen="p-code"] .ph-logo, body[data-screen="p-pick"] .ph-logo { visibility: hidden; }
.ph-me { display: flex; align-items: center; gap: 8px; font-weight: 800; background: rgba(255,255,255,.1); border-radius: 999px; padding: 4px 12px 4px 4px; max-width: 60%; }
.ph-me .av { width: 34px; height: 34px; }
.ph-me .score { color: var(--sun); white-space: nowrap; }
.ph-me .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-net { background: var(--danger); text-align: center; font-weight: 800; padding: 6px; }

main { padding: 0 16px 24px; max-width: 560px; margin: 0 auto; }
.ph-screen { display: none; }
.ph-screen.on { display: block; animation: rise .3s ease both; }

.ph-hero-logo { display: block; width: min(86%, 380px); margin: 8px auto 16px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.4)); }
.ph-hero-logo.small { width: min(56%, 240px); margin: 0 auto 4px; }
.ph-card { background: rgba(23,18,47,.75); border-radius: 24px; padding: 20px; display: grid; gap: 14px; box-shadow: 0 0 0 2px rgba(255,122,89,.4); }
.ph-label { font-weight: 800; text-align: center; }
.ph-input {
  width: 100%; border: 3px solid transparent; border-radius: 16px; padding: 14px 16px;
  background: var(--paper); color: var(--ink); font-size: 20px; font-weight: 600;
}
.ph-input:focus { outline: none; border-color: var(--coral); }
.code-in { text-align: center; font-size: 40px; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; padding-left: .3em; }
.ph-wide { width: 100%; font-size: 22px; padding: 16px; min-height: 60px; }
.ph-h1 { font-size: 26px; font-weight: 800; text-align: center; margin: 8px 0 12px; }

.ph-center { min-height: 60dvh; display: grid; place-content: center; justify-items: center; text-align: center; gap: 10px; }
.ph-big { font-size: 28px; font-weight: 800; margin: 0; line-height: 1.15; }
.ph-sub { color: var(--muted); font-size: 18px; margin: 0; font-weight: 600; }
.ph-kicker { display: inline-block; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; background: var(--sun); color: var(--navy); padding: 4px 12px; border-radius: 999px; font-size: 14px; }
.ph-kicker:empty { display: none; }
.spinner { width: 48px; height: 48px; border-radius: 50%; border: 6px solid rgba(255,255,255,.15); border-top-color: var(--coral); animation: spin 1s linear infinite; }

#info-art img.art { width: 160px; height: auto; filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); }
#info-art .av { width: 120px; height: 120px; box-shadow: 0 0 0 5px var(--sun); font-size: 48px; margin: 0 auto; }
.result { font-size: 22px; font-weight: 800; padding: 10px 18px; border-radius: 999px; margin-top: 6px; display: inline-block; }
.result.yes { background: var(--mint); color: var(--ink); }
.result.no { background: rgba(255,255,255,.12); }
.answer-card { background: var(--paper); color: var(--navy); border-radius: 20px; padding: 14px 22px; display: grid; justify-items: center; gap: 4px; margin-top: 4px; }
.answer-card .al { font-size: 34px; font-weight: 800; color: var(--coral-dark); line-height: 1; }
.answer-card .who { font-size: 22px; font-weight: 800; }
.answer-card .av { width: 72px; height: 72px; }
.my-answer { width: 100%; max-width: 320px; aspect-ratio: 16 / 9; background: #fff; border-radius: 14px; display: grid; place-items: center; overflow: hidden; color: var(--navy); font-weight: 800; font-size: 26px; padding: 6px; margin: 4px auto 0; }
.my-answer img { width: 100%; height: 100%; object-fit: contain; }
.winners-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 4px; }
.winners-row .w { display: grid; justify-items: center; gap: 4px; font-weight: 800; color: var(--sun); }
.winners-row .av { width: 72px; height: 72px; box-shadow: 0 0 0 4px var(--sun); }

/* roster grid: three across at 375px */
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-top: 12px; }
.pick {
  border: 0; border-radius: 18px; background: rgba(255,255,255,.08); padding: 12px 6px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; min-height: 120px;
  -webkit-tap-highlight-color: transparent;
}
.pick .av { width: 72px; height: 72px; font-size: 30px; }
.pick span { font-weight: 800; font-size: 16px; line-height: 1.1; text-align: center; }
.pick:active { transform: scale(.96); }
.pick.taken { opacity: .3; filter: grayscale(1); cursor: not-allowed; }
.pick.taken span::after { content: ' (in)'; font-weight: 600; }

/* the draw pad */
.timebar { height: 10px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; margin: 4px 0 8px; }
.timebar i { display: block; height: 100%; width: 100%; background: var(--mint); border-radius: inherit; transform-origin: left; transition: transform .25s linear, background .3s; }
.timebar.hurry i { background: var(--coral); }
.draw-head { display: flex; justify-content: space-between; align-items: center; }
.draw-left { font-weight: 800; font-size: 24px; font-variant-numeric: tabular-nums; }
.pad-wrap { position: relative; border-radius: 18px; overflow: hidden; box-shadow: 0 0 0 4px var(--coral), 0 6px 0 4px var(--coral-dark); background: #fff; }
#pad { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; touch-action: none; cursor: crosshair; background: #fff; }
.pad-hint { position: absolute; inset: 0; display: grid; place-items: center; color: #c7c0e6; font-weight: 800; font-size: 20px; pointer-events: none; }
.type-wrap .ph-input { font-size: 26px; font-weight: 800; text-align: center; padding: 22px 16px; }
.tools { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; margin: 16px 0 12px; }
.tools .btn { padding: 12px 8px; min-height: 52px; font-size: 16px; }
body.typing .tools #undo, body.typing .tools #clear { visibility: hidden; }
.send { margin-top: 4px; }
.sent { text-align: center; color: var(--mint); font-weight: 800; margin: 10px 0 0; }

.ph-note { color: var(--muted); text-align: center; font-size: 15px; line-height: 1.4; margin: 14px 4px 0; }
#pick-err { text-align: center; margin: 12px 4px 0; line-height: 1.35; background: rgba(255,93,115,.12); border-radius: 14px; padding: 0; }
#pick-err:not(:empty) { padding: 10px 12px; }
