/* Friend challenges (PVP-SPEC.md phase 2): the start-screen entry, the challenge panel, the friend's state in the dock.
   Classes start with pv- so they cannot collide with other pages' rules. */
.pv-entry { margin-top: 22px; display: grid; gap: 8px; justify-items: start; }
.pv-entry h2 { margin: 0; }

/* the panel scrolls on a short screen (a phone held sideways) instead of cutting off its buttons */
.overlay.pv { place-items: start center; overflow-y: auto; overscroll-behavior: contain; z-index: 45; }
.pv-box { margin: auto 0; min-width: 0; }
.pv-box h2 { font-size: clamp(22px, 6vw, 30px); overflow-wrap: anywhere; }
.pv-box .pv-h { margin: 4px 0 0; font-size: 16px; }
.pv-lede { color: var(--dim); margin: 0; }
.pv-code { font: 700 clamp(30px, 10vw, 44px)/1 var(--mono); letter-spacing: .18em; text-align: center; padding: 12px 8px; border: 1px dashed var(--line); border-radius: 12px; color: #72DCFF; user-select: all; }
.pv-link { font: 12px/1.45 var(--mono); color: var(--dim); background: var(--void); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; overflow-wrap: anywhere; user-select: all; }
.pv-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pv-row .btn { flex: 1 1 140px; }
.pv-status { margin: 0; min-height: 1.4em; }
.pv-status b { color: #8FD0B8; }
.pv-decks { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.pv-decks .choice { min-width: 0; }
@media (pointer: coarse) { .pv-box .btn, .pv-entry .btn { min-height: 44px; } .pv-decks .choice { min-height: 44px; } }

.pv-entry-row { display: flex; flex-wrap: wrap; gap: 8px; }
/* the ranked queue: a calm clock, no flashing */
.pv-time { font: 700 clamp(28px, 9vw, 40px)/1 var(--mono); text-align: center; color: #72DCFF; letter-spacing: .08em; }
.pv-fallback { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.pv-fallback[hidden] { display: none; }
.pv-fallback p { margin: 0; }
/* the result screen after a match with a person: rematch or the rating */
.pv-after { display: grid; gap: 8px; }
.pv-after[hidden] { display: none; }
.pv-after a.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.pv-after .btn:disabled { opacity: .7; color: #c9d8e1; background: rgba(255,255,255,.08); }
.pv-rating { margin: 0; font: 500 14px/1.45 var(--mono); }
.pv-pick { display: flex; align-items: center; gap: 8px; flex: 1 1 180px; min-width: 0; }
.pv-pick select { flex: 1; min-width: 0; min-height: 40px; background: var(--void); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; }
@media (pointer: coarse) { .pv-entry-row .btn, .pv-after .btn { min-height: 44px; } }

/* the friend's state at the end of the budget row: planning, ready, reconnecting */
.pv-opp { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 60%; }
.pv-opp b { color: #FF7A59; font-weight: 700; }
.pv-opp.ready { color: #8FD0B8; }
.pv-opp.away { color: #E0BE72; }

/* Reveal after you revealed: "Waiting for <name>", in the same box (long names wrap, never widen the dock) */
/* a narrow phone: name and state first, the hand count only where it fits */
@media (max-width: 480px) { .pv-hand { display: none; } .pv-opp { max-width: 55%; } }
/* sideways phones: a wider panel, so the deck picker takes two rows instead of five */
@media (orientation: landscape) and (max-height: 560px) { .pv-box { width: min(760px, 100%); } .pv-decks { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }

#reveal.pv-wait { white-space: normal; line-height: 1.15; max-width: 48vw; overflow-wrap: anywhere; opacity: .85; }
