/* Virtual Pickleball: the page around the game (the game's own styles are in site.css) */
body.vp { min-height: 100vh; min-height: 100svh; background: radial-gradient(120% 70% at 80% -10%, #1b4179 0%, var(--night) 55%, var(--night-deep) 100%) fixed; }
.vp-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 12px var(--gut, 16px); }
.vp-bar__logo { display: inline-grid; place-items: center; padding: 6px 12px; border-radius: 999px; background: var(--chalk); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.vp-bar__logo img { height: 34px; width: auto; display: block; }
.vp-bar__on { display: inline-flex; align-items: center; gap: 0.5em; font-weight: 800; font-size: 0.92rem; padding: 0.35rem 0.8rem; border-radius: 999px; border: 2.5px solid color-mix(in srgb, var(--chalk) 45%, transparent); }
.vp-bar__on::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); }
.vp-bar__on.is-on::before { background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 30%, transparent); }
.vp-start { padding: clamp(1.2rem, 5vw, 3.5rem) 0 4rem; }
.vp-start .chip { margin-bottom: 0.9rem; }
.vp-title { font-size: clamp(3rem, 13vw, 7rem); line-height: 0.92; }
.vp-title span { display: block; color: var(--ball); -webkit-text-stroke: 0; text-shadow: 0 6px 0 var(--ink); }
.vp-start .lede { margin-top: 1.1rem; }
.vp-form { margin-top: 1.6rem; max-width: 560px; padding: clamp(1rem, 3vw, 1.5rem); border-radius: 24px; background: var(--night-2); border: 3px solid var(--chalk); box-shadow: 0 8px 0 var(--night-deep); }
.vp-form label { display: block; font-family: var(--f-d); font-size: 1.05rem; margin-bottom: 0.6rem; }
.vp-form__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.7rem; }
.vp-form input { min-width: 0; min-height: 62px; padding: 0 1.1rem; border-radius: 999px; border: 3px solid var(--ink); background: var(--chalk); color: var(--ink); font: 800 1.15rem Figtree, "Segoe UI", sans-serif; }
.vp-form input:focus-visible { outline: 4px solid var(--ball); outline-offset: 2px; }
.vp-form .small { margin-top: 0.7rem; }
@media (max-width: 420px) { .vp-form__row { grid-template-columns: minmax(0, 1fr); } .vp-form__row .btn { width: 100%; } }
.vp-how { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.4rem 0 0; padding: 0; max-width: 560px; }
.vp-how li { padding: 0.4rem 0.85rem; border-radius: 999px; border: 2.5px solid color-mix(in srgb, var(--chalk) 40%, transparent); font-weight: 600; font-size: 0.92rem; }
.vp-how b { color: var(--ball); font-weight: 800; }
body.vp .glive { padding: 0.4rem 0 2rem; }
body.vp .gcard .btn--ghost { color: var(--ink); }
/* while a game is on, a phone gives the whole screen to the court */
@media (max-width: 699px), (orientation: landscape) and (max-height: 540px) {
  body.vp.is-live .vp-bar { display: none; }
  body.vp.is-live .glive { padding: 0; }
  body.vp.is-live .glive > .wrap { width: 100%; }
  body.vp.is-live .gframe--live { height: 100vh; height: 100svh; min-height: 260px; border-radius: 0; border: 0; }
  body.vp.is-live .globby { margin: 16px; }
  body.vp.is-live .glive__foot { padding: 0 16px 12px; }
}
/* long names stay inside their own team's column */
body.vp .globby__teams > div { min-width: 0; }
body.vp .gslots { grid-template-columns: minmax(0, 1fr); }
body.vp .gslot { min-width: 0; }
/* a game, not a document: fast taps and drags must never select text, open the copy and paste
   bubble, flash a tap highlight or zoom the page. Only the name box stays a normal text field. */
body.vp, body.vp * { -webkit-tap-highlight-color: transparent; }
body.vp :not(input) { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.vp input { -webkit-user-select: text; user-select: text; }
body.vp { touch-action: manipulation; }
body.vp.is-live { overscroll-behavior: none; }
body.vp .gframe--live, body.vp .gframe--live * { touch-action: none; }
body.vp img { -webkit-user-drag: none; pointer-events: none; }
body.vp .vp-bar__logo img { pointer-events: none; }
/* notices: the game cannot start here, or this is an app's built-in browser */
.vp-fail, .vp-inapp { display: grid; gap: 0.5rem; justify-items: start; margin: 12px var(--gut, 16px) 0; padding: 0.9rem 1rem; border-radius: 18px; border: 3px solid var(--ink); font-weight: 700; line-height: 1.35; }
.vp-fail { background: var(--coral); color: var(--ink); }
.vp-inapp { background: var(--ball); color: var(--ink); }
.vp-fail[hidden], .vp-inapp[hidden] { display: none; }
.vp-inapp small { font-weight: 600; font-size: 0.82rem; opacity: 0.85; }
.vp-fail .btn, .vp-inapp .btn { --bg: var(--ink); --fg: var(--chalk); --edge: var(--ink-3); }
body.vp.is-live .vp-fail, body.vp.is-live .vp-inapp { display: none; }
/* leave, in the corner of the court (the foot under the court is off screen on a phone) */
.ghud__leave { font: 900 1.05rem Figtree, sans-serif; }
@media (min-width: 700px) and (min-height: 541px) { .ghud__leave { display: none; } }
/* while a game is on, a phone screen is the court and nothing else: the page cannot scroll, bounce or be dragged */
@media (max-width: 699px), (orientation: landscape) and (max-height: 540px) {
  html:has(body.vp.is-live) { overflow: hidden; overscroll-behavior: none; height: 100%; }
  body.vp.is-live { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; overflow: hidden; width: 100%; }
  body.vp.is-live #live-stage .gframe--live { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; height: auto; width: 100%; z-index: 20; }
  body.vp.is-live .glive__foot { display: none; }
}
body.vp canvas, body.vp .gbtn, body.vp .gjoy { -webkit-user-drag: none; }
.ghud__full svg { width: 20px; height: 20px; }
.ghud__full[hidden] { display: none; }
/* in fullscreen the court fills the screen on any device */
:fullscreen body.vp.is-live #live-stage .gframe--live, :-webkit-full-screen body.vp.is-live #live-stage .gframe--live { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; height: auto; width: 100%; z-index: 20; border: 0; border-radius: 0; }
:fullscreen body.vp.is-live .vp-bar, :fullscreen body.vp.is-live .glive__foot { display: none; }
:fullscreen .ghud__leave { display: grid; }
/* a phone: the corner buttons sit in a small block, two across, beside the score */
@media (max-width: 699px) {
  body.vp .ghud { gap: 0.4rem; }
  body.vp .ghud__btns { display: grid; grid-template-columns: repeat(2, 42px); gap: 6px; justify-content: end; flex: none; }
  body.vp .ghud__btns > * { width: 42px; min-width: 0; height: 42px; padding: 0; }
  body.vp .ghud__cam { font-size: 0.6rem; letter-spacing: -0.02em; border-radius: 50%; }
  body.vp .gscore2 { min-width: 0; }
}
@media (max-width: 699px) { body.vp .g3-banner { top: 112px; } }
/* quick reactions: the Say button and its four lines, dropping down from the corner buttons */
.gsay { position: relative; display: block; }
.gsay[hidden] { display: none; }
.gsay__btn { width: 100%; }
.gsay__list { position: absolute; top: calc(100% + 8px); right: 0; z-index: 6; display: grid; gap: 6px; width: 132px; }
.gsay__list[hidden] { display: none; }
.gsay__list button { height: 40px; padding: 0 0.6rem; border-radius: 999px; background: var(--chalk); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); font-weight: 800; font-size: 0.9rem; white-space: nowrap; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.gsay__list button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
@media (max-width: 699px) {
  body.vp .ghud__btns > .gsay { grid-column: 1 / -1; width: auto; height: auto; }
  body.vp .gsay__btn { width: 100%; height: 34px; border-radius: 999px; font-size: 0.7rem; letter-spacing: 0; }
}
.vp-fail small { font-weight: 600; font-size: 0.78rem; opacity: 0.85; word-break: break-word; }
/* the result card is centred the old, safe way: some phone browsers stretch it over the whole court otherwise */
body.vp .gcard { top: 50%; right: auto; bottom: auto; left: 50%; inset: 50% auto auto 50%; margin: 0; height: auto; transform: translate(-50%, -50%); align-content: start; animation: none; max-height: calc(100% - 24px); overflow: auto; }
body.vp .gcard > * { align-self: start; }
body.vp .gwait { z-index: 5; }
/* the second way to play, under the main button */
.vp-form__bots { width: 100%; margin-top: 0.7rem; min-height: 52px; color: var(--chalk); }
.vp-form__bots[hidden] { display: none; }
/* the lobbies on the start page */
.vp-rooms { margin-top: 1.6rem; max-width: 560px; }
.vp-rooms[hidden] { display: none; }
.vp-rooms h2 { font-size: 1.5rem; margin-bottom: 0.7rem; }
.vp-rooms__list { display: grid; gap: 0.6rem; }
.vp-rooms__none { margin: 0; padding: 0.9rem 1rem; border-radius: 18px; border: 2.5px dashed rgba(247, 241, 225, 0.4); font-weight: 600; }
.vp-room { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name tip" "what tip"; align-items: center; gap: 0.1rem 0.8rem; width: 100%; text-align: left; padding: 0.7rem 0.9rem 0.7rem 1.1rem; border-radius: 20px; background: var(--chalk); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--night-deep); font: inherit; cursor: pointer; }
.vp-room:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--night-deep); }
.vp-room b { grid-area: name; font-family: var(--f-d); font-weight: 400; font-size: 1.15rem; }
.vp-room span { grid-area: what; font-weight: 600; font-size: 0.92rem; min-width: 0; }
.vp-room i { grid-area: tip; font-style: normal; font-weight: 800; font-size: 0.86rem; padding: 0.45rem 0.8rem; border-radius: 999px; background: var(--ball); border: 2.5px solid var(--ink); white-space: nowrap; }
.vp-room.is-full { opacity: 0.6; cursor: not-allowed; }
.vp-room.is-full i { background: transparent; }
/* inside a lobby */
.vp-lobby { display: grid; gap: 0.8rem; }
.vp-lobby h3 { font-family: var(--f-d); font-weight: 400; font-size: 1.05rem; margin: 0; }
.vp-lobby .gslot small { background: var(--ball); }
.vp-now { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto minmax(0, 1fr); align-items: center; gap: 0.5rem; padding: 0.8rem; border-radius: 18px; background: var(--chalk); color: var(--ink); border: 3px solid var(--ink); font-weight: 800; }
.vp-now span { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 0.9rem; }
.vp-now span:last-child { text-align: right; }
.vp-now b { font-family: var(--f-d); font-weight: 400; font-size: 1.8rem; line-height: 1; padding: 0.2rem 0.55rem; border-radius: 12px; border: 3px solid var(--ink); background: var(--coral); }
.vp-now b:nth-of-type(2) { background: var(--chalk-2); }
.vp-now i { font-style: normal; font-size: 0.75rem; opacity: 0.7; }
.vp-turn { margin: 0; font-size: 1.15rem; font-weight: 700; }
.vp-turn b { color: var(--ball); }
#lobby-start[hidden] { display: none; }
body.is-loading .vp-room { opacity: 0.6; }
