/* Volei pe plajă — 2 v 2 on the sand in 3D (js/volei.js). Theme-aware like the other game pages:
   tokens on :root, redefined under body.dark-theme. The beach follows the theme too: a
   sunny afternoon in light, a lit evening court in dark. */
:root {
    --vo-accent: #0e7490;
    --vo-accent-2: #2563eb;
    --vo-on-accent: #ffffff;
    --vo-page-bg: #f0fbfc;
    --vo-card-bg: #ffffff;
    --vo-card-border: #b6e3ea;
    --vo-muted: #45606a;
    --vo-shadow: 0 10px 30px rgba(14, 76, 92, .16);
    --vo-stage-bg: #9cc8e6;
    --vo-overlay: rgba(28, 22, 18, .45);
    --vo-chip-bg: #e8f7f9;
    --vo-glass: rgba(8, 24, 32, .6);
    --vo-good: #16a34a;
    --vo-gold: #f59e0b;
}

body.dark-theme {
    --vo-accent: #22d3ee;
    --vo-accent-2: #60a5fa;
    --vo-on-accent: #04252c;
    --vo-page-bg: #071318;
    --vo-card-bg: #0f2027;
    --vo-card-border: #24434d;
    --vo-muted: #a9c6cf;
    --vo-shadow: 0 10px 30px rgba(0, 0, 0, .5);
    --vo-stage-bg: #0b1220;
    --vo-overlay: rgba(8, 6, 4, .6);
    --vo-chip-bg: #15303a;
    --vo-glass: rgba(8, 6, 4, .64);
    --vo-good: #4ade80;
    --vo-gold: #fbbf24;
}

/* clip, not hidden: the site-wide `body { overflow-x: hidden }` makes <body> a scroll
   container that never scrolls, which silently kills any position: sticky inside. */
.vo-body, body.vo-body#page-top {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--vo-page-bg);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: clip;
}
body.vo-max { overflow: hidden; }
.vo-main { padding-top: 96px; padding-bottom: 40px; }
.vo-game .container, .vo-hero .container { max-width: 760px; }

/* ---- hero ---- */
.vo-hero { text-align: center; padding: 4px 0 12px; }
.vo-hero h1 { font-weight: 800; font-size: clamp(1.6rem, 5vw, 2.3rem); margin: 0 0 6px; display: inline-flex; align-items: center; gap: 12px; }
.vo-hero-icon { width: 46px; height: 46px; border-radius: 14px; display: inline-grid; place-items: center; font-size: 22px; color: #fff; background: linear-gradient(135deg, #06b6d4, #0e7490); box-shadow: var(--vo-shadow); }
.vo-lead { max-width: 600px; margin: 0 auto; color: var(--vo-muted); font-size: 1rem; line-height: 1.55; }

/* ---- the stage ---- */
.vo-stage {
    --vo-h: clamp(440px, calc(100vh - 150px), 780px);
    position: relative;
    height: var(--vo-h);
    width: 100%;
    margin: 0 auto;
    background: var(--vo-stage-bg);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--vo-shadow);
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    color: #fff;
}
@supports (height: 100svh) {
    .vo-stage { --vo-h: clamp(440px, calc(100svh - 150px), 780px); }
}
.vo-stage:focus-visible { box-shadow: 0 0 0 3px var(--vo-accent), var(--vo-shadow); }
@media (max-width: 575.98px) {
    .vo-stage { width: calc(100% + 24px); margin: 0 -12px; border-radius: 0; }
}
.vo-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.vo-stage:fullscreen { width: 100%; height: 100%; border-radius: 0; margin: 0; }
.vo-stage:-webkit-full-screen { width: 100%; height: 100%; border-radius: 0; margin: 0; }
.vo-stage.is-max { position: fixed; inset: 0; z-index: 1052; width: 100vw; height: 100vh; margin: 0; border-radius: 0; }
@supports (height: 100dvh) { .vo-stage.is-max { height: 100dvh; } }

/* ---- scoreboard ---- */
.vo-board { position: absolute; left: 10px; top: 10px; z-index: 2; min-width: 170px; max-width: calc(100% - 76px); padding: 6px 8px 6px; border-radius: 12px; background: var(--vo-glass); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); pointer-events: none; font-variant-numeric: tabular-nums; }
.vo-board[hidden] { display: none; }
.vo-row { display: flex; align-items: center; gap: 6px; height: 26px; font-weight: 800; }
.vo-srv { width: 9px; height: 9px; flex: none; border-radius: 50%; background: transparent; }
.vo-row.is-srv .vo-srv { background: #d9f99d; box-shadow: 0 0 6px rgba(217, 249, 157, .8); }
.vo-name { flex: 1; min-width: 0; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vo-row:first-child .vo-name { color: #fdba74; }
.vo-row:nth-child(2) .vo-name { color: #93c5fd; }
.vo-sets { display: flex; gap: 6px; font-size: .9rem; opacity: .8; }
.vo-sets span { min-width: 1ch; text-align: center; }
.vo-games { min-width: 1.4ch; text-align: center; font-size: 1.05rem; }
.vo-pts { min-width: 2.6ch; padding: 0 5px; border-radius: 6px; text-align: center; background: rgba(255, 255, 255, .16); font-size: 1.05rem; }
.vo-status { font-size: .74rem; font-weight: 700; opacity: .9; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vo-status:empty { display: none; }

.vo-tools { position: absolute; right: 10px; top: 10px; z-index: 4; display: flex; flex-direction: column; gap: 8px; }
.vo-round { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--vo-glass); color: #fff; font-size: 16px; cursor: pointer; touch-action: manipulation; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.vo-round:hover, .vo-round:focus-visible { background: rgba(14, 116, 144, .9); }
.vo-round:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.vo-round[hidden], .vo-round span[hidden] { display: none; }

/* ---- messages ---- */
.vo-banner { position: absolute; left: 50%; top: 30%; z-index: 3; transform: translate(-50%, -50%) scale(.9); margin: 0; padding: 10px 22px; border-radius: 18px; max-width: 92%; text-align: center; color: #fff; font-weight: 900; font-size: clamp(1.4rem, 7vw, 2.3rem); line-height: 1.15; text-shadow: 0 3px 12px rgba(0, 0, 0, .5); background: rgba(20, 14, 10, .55); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.vo-banner.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.vo-banner small { display: block; font-size: .5em; font-weight: 700; opacity: .92; }
.vo-banner.is-good { background: linear-gradient(135deg, rgba(234, 88, 12, .92), rgba(154, 52, 18, .9)); }
.vo-banner.is-gold { background: linear-gradient(135deg, rgba(245, 158, 11, .95), rgba(234, 88, 12, .9)); }
.vo-banner.is-cool { background: linear-gradient(135deg, rgba(37, 99, 235, .9), rgba(14, 165, 233, .9)); }
.vo-hint { position: absolute; left: 50%; bottom: 14px; z-index: 2; transform: translateX(-50%); margin: 0; padding: 8px 14px; border-radius: 999px; background: var(--vo-glass); font-weight: 700; font-size: .92rem; white-space: nowrap; pointer-events: none; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.vo-hint[hidden] { display: none; }
.vo-loading { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; margin: 0; padding: 20px; text-align: center; color: #fff; font-weight: 700; background: linear-gradient(#67c3e6, #e7c98f); }
.vo-loading[hidden] { display: none; }

/* ---- overlays ---- */
.vo-overlay { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; padding: 14px; background: var(--vo-overlay); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); overflow-y: auto; touch-action: manipulation; color: var(--text-color); }
.vo-overlay[hidden] { display: none; }
.vo-card { width: 100%; max-width: 380px; margin: auto; display: flex; flex-direction: column; gap: 10px; padding: 18px 16px; border-radius: 18px; background: var(--vo-card-bg); border: 1px solid var(--vo-card-border); box-shadow: var(--vo-shadow); color: var(--text-color); text-align: center; }
.vo-card h2 { font-weight: 800; font-size: 1.4rem; margin: 0; }
.vo-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.vo-mode { min-height: 64px; padding: 8px; border: 1px solid var(--vo-card-border); border-radius: 12px; background: var(--vo-chip-bg); color: inherit; font-weight: 800; font-size: .9rem; line-height: 1.15; display: flex; align-items: center; gap: 8px; cursor: pointer; touch-action: manipulation; text-align: left; }
.vo-mode > svg, .vo-mode > i { flex: none; width: 1.1em; font-size: 1.05rem; color: var(--vo-accent); }
.vo-mode small { display: block; margin-top: 2px; font-weight: 500; font-size: .74rem; color: var(--vo-muted); }
.vo-mode[aria-checked="true"] { background: var(--vo-accent); border-color: var(--vo-accent); color: var(--vo-on-accent); }
.vo-mode[aria-checked="true"] > svg, .vo-mode[aria-checked="true"] > i { color: inherit; }
.vo-mode[aria-checked="true"] small { color: inherit; opacity: .85; }
.vo-opt { display: flex; flex-direction: column; gap: 6px; }
.vo-opt[hidden] { display: none; }
.vo-label { font-weight: 700; font-size: .9rem; color: var(--vo-muted); }
.vo-chips { display: flex; gap: 6px; justify-content: center; }
.vo-chip { flex: 1; min-height: 46px; padding: 4px 6px; border-radius: 12px; border: 1px solid var(--vo-card-border); background: var(--vo-chip-bg); color: inherit; font-weight: 700; cursor: pointer; touch-action: manipulation; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.vo-chip small { font-weight: 500; font-size: .7rem; opacity: .8; }
.vo-chip[aria-checked="true"] { background: var(--vo-accent); border-color: var(--vo-accent); color: var(--vo-on-accent); }
.vo-mode-note { margin: 0; font-size: .85rem; color: var(--vo-muted); line-height: 1.4; }
.vo-mode-note:empty { display: none; }
.vo-mode:focus-visible, .vo-chip:focus-visible, .vo-btn:focus-visible { outline: 2px solid var(--vo-accent); outline-offset: 2px; }

.vo-btn { min-height: 48px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--vo-card-border); background: var(--vo-card-bg); color: inherit; font-weight: 700; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; touch-action: manipulation; }
.vo-btn:hover { border-color: var(--vo-accent); }
.vo-btn[hidden] { display: none; }
.vo-btn-primary { background: var(--vo-accent); border-color: var(--vo-accent); color: var(--vo-on-accent); }
.vo-btn-ghost { background: transparent; border-color: transparent; color: var(--vo-muted); }
.vo-over-icon { width: 54px; height: 54px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 24px; color: #fff; background: linear-gradient(135deg, #f59e0b, #0e7490); }
.vo-over-big { margin: 0; font-size: 2rem; font-weight: 900; line-height: 1.1; color: var(--vo-accent); font-variant-numeric: tabular-nums; }
.vo-over-big:empty { display: none; }
.vo-over-sub { margin: 0; color: var(--vo-muted); font-size: .92rem; line-height: 1.45; }
.vo-over-sub:empty { display: none; }

.vo-actions { display: flex; justify-content: center; margin: 14px 0 10px; }
.vo-actions .vo-btn { min-width: 180px; }
.vo-record { margin: 12px 0 0; text-align: center; color: var(--vo-muted); font-size: .9rem; line-height: 1.6; }
.vo-record:empty { display: none; }
.vo-reset-wrap { text-align: center; margin: 2px 0 12px; }
.vo-link { border: 0; background: none; padding: 6px; color: var(--vo-muted); font-size: .85rem; text-decoration: underline; cursor: pointer; }

/* ---- help ---- */
.vo-help { margin: 8px auto 0; padding: 12px 14px; border-radius: 14px; background: var(--vo-card-bg); border: 1px solid var(--vo-card-border); }
.vo-help summary { font-weight: 700; cursor: pointer; min-height: 32px; }
.vo-help ul { margin: 10px 0 4px; padding-left: 20px; line-height: 1.55; }
.vo-help li { margin-bottom: 4px; }
.vo-credit { margin: 8px 0 0; font-size: .82rem; color: var(--vo-muted); }
.vo-credit a, .vo-powered a { color: var(--vo-accent); }
.vo-powered { text-align: center; color: var(--vo-muted); font-size: .85rem; margin: 22px 0 0; }
body.dark-theme .vo-help kbd { background: #24434d; }
body.dark-theme .vo-board, body.dark-theme .vo-round, body.dark-theme .vo-hint { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }

@media (max-width: 420px) {
    .vo-main { padding-top: 88px; }
    .vo-mode { font-size: .84rem; gap: 6px; padding: 7px 6px; min-height: 60px; }
    .vo-mode small { font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) {
    .vo-banner { transition: none; }
}
