/* Penali (⚽) — noćni stadion: tribine, reflektori, reklamni pano, 3D teren sa
   belim linijama, gol sa dubinskom mrežom. Prefiks .pn- */

:root {
    --text: #eaf4ff;
    --text-dim: #93a7c4;
    --surface: rgba(255, 255, 255, 0.06);
    --surface-bd: rgba(255, 255, 255, 0.13);
    --grass1: #0e8a4c;
    --grass2: #0b703d;
    --accent: #2fe085;
    --gold: #ffd86b;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: radial-gradient(ellipse at 50% -10%, #16345a 0%, #0a1a30 45%, #050b16 100%);
    overflow-x: hidden;
    overscroll-behavior: none;
}
body::before {
    content: '';
    position: fixed; inset: -20%; z-index: -1; pointer-events: none;
    background: radial-gradient(circle at 18% 6%, rgba(160, 210, 255, 0.15), transparent 30%),
                radial-gradient(circle at 82% 6%, rgba(160, 210, 255, 0.15), transparent 30%),
                radial-gradient(circle at 50% 100%, rgba(14, 138, 76, 0.22), transparent 55%);
    filter: blur(30px);
}

.pn-app {
    max-width: 520px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
}

/* ---------- Vrh ---------- */
.pn-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pn-top__btns { display: flex; gap: 8px; }
.pn-iconbtn {
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    color: var(--text); background: var(--surface); border: 1px solid var(--surface-bd);
    border-radius: 14px; cursor: pointer; text-decoration: none;
    backdrop-filter: blur(8px);
    transition: background 0.15s ease, transform 0.15s ease;
}
.pn-iconbtn:hover { background: rgba(255, 255, 255, 0.13); transform: translateY(-1px); }

.pn-title {
    margin: 0; text-align: center; font-size: 25px; font-weight: 900; letter-spacing: 0.5px;
    text-shadow: 0 2px 18px rgba(47, 224, 133, 0.35);
}

/* ---------- Semafor ---------- */
.pn-score {
    position: relative;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 11px 14px 10px; border-radius: 16px;
    background: linear-gradient(180deg, rgba(16, 34, 58, 0.9), rgba(8, 18, 34, 0.9));
    border: 1px solid var(--surface-bd);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}
.pn-score::before {
    content: '';
    position: absolute; top: 0; left: 12%; right: 12%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--gold), transparent);
    opacity: 0.8;
}
.pn-score__side { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.pn-score__side--r { align-items: flex-end; }
.pn-score__name { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.pn-score__dots { font-size: 12px; letter-spacing: 2.5px; }
.pn-score__dots .g { color: var(--accent); text-shadow: 0 0 8px rgba(47, 224, 133, 0.7); }
.pn-score__dots .m { color: #ff7373; }
.pn-score__dots .p { color: rgba(255, 255, 255, 0.28); }
.pn-score__mid { display: flex; align-items: baseline; gap: 7px; font-weight: 900; }
.pn-score__num {
    font-size: 30px; min-width: 34px; text-align: center;
    padding: 0 6px; border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.pn-score__sep { color: var(--text-dim); font-size: 18px; }

/* ---------- Status box ---------- */
.pn-status {
    min-height: 46px;
    display: flex; align-items: center; justify-content: center; text-align: center;
    padding: 9px 14px; border-radius: 14px;
    font-size: 14.5px; font-weight: 700;
    background: var(--surface); border: 1px solid var(--surface-bd);
    backdrop-filter: blur(8px);
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.pn-status--goal { background: rgba(47, 224, 133, 0.16); border-color: rgba(47, 224, 133, 0.6); color: #8dffc4; text-shadow: 0 0 14px rgba(47, 224, 133, 0.5); }
.pn-status--save { background: rgba(255, 90, 90, 0.14); border-color: rgba(255, 90, 90, 0.55); color: #ffa3a3; }
.pn-status--you { border-color: rgba(47, 224, 133, 0.55); animation: pnGlowY 1.8s ease-in-out infinite; }
.pn-status--opp { border-color: rgba(255, 216, 107, 0.5); }
@keyframes pnGlowY {
    0%, 100% { box-shadow: 0 0 0 rgba(47, 224, 133, 0); }
    50% { box-shadow: 0 0 22px rgba(47, 224, 133, 0.28); }
}

/* ---------- Scena ----------
   Kadar = pogled šutera sa bele tačke (11m): gol stoji NA travi (gol-linija = vrh
   rotirane ravni terena), pano je odmah iza gola, lopta je na beloj tački pri dnu. */
.pn-stage {
    position: relative;
    /* širina se steže da geometrija (procenti) UVEK važi — umesto max-height koji lomi odnos */
    width: min(100%, calc(58vh * 0.909));
    margin: 0 auto;
    aspect-ratio: 10 / 11;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(#0a1830 0%, #0d2140 30%, #10294c 42%);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    perspective: 720px;
}
.pn-stage.shake { animation: pnShake 0.45s ease; }
@keyframes pnShake {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-6px, 3px); }
    40% { transform: translate(5px, -3px); }
    60% { transform: translate(-4px, 2px); }
    80% { transform: translate(3px, -2px); }
}

/* tribine — redovi publike (tačkice) iza gola */
.pn-stands {
    position: absolute; left: 0; right: 0; top: 0; height: 46.5%;
    background:
        radial-gradient(circle at 50% 120%, rgba(24, 50, 88, 0.0), rgba(5, 10, 20, 0.55)),
        radial-gradient(circle, rgba(199, 220, 255, 0.34) 1.1px, transparent 1.7px),
        radial-gradient(circle, rgba(140, 170, 220, 0.22) 1.1px, transparent 1.7px),
        linear-gradient(180deg, #0b1c36 0%, #10294c 100%);
    background-size: 100% 100%, 13px 9px, 13px 9px, 100% 100%;
    background-position: 0 0, 0 0, 6px 4px, 0 0;
}
/* reklamni pano — ODMAH iza gola (između tribina i trave) */
.pn-adboard {
    position: absolute; left: 0; right: 0; top: 46.5%; height: 5.5%;
    display: flex; align-items: center; overflow: hidden;
    background: linear-gradient(180deg, #182a4d, #101f3c);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    border-bottom: 2px solid rgba(0, 0, 0, 0.45);
}
.pn-adboard::after {
    content: 'vasa.games · vasa.games · vasa.games · vasa.games · vasa.games · vasa.games · vasa.games';
    white-space: nowrap;
    font-size: 9.5px; font-weight: 800; letter-spacing: 2px;
    color: rgba(150, 200, 255, 0.32);
    text-transform: uppercase;
    padding-left: 8px;
}
/* uska traka trave IZA gol-linije (prostor iza gola) */
.pn-grassback {
    position: absolute; left: 0; right: 0; top: 52%; height: 5.5%;
    background: linear-gradient(180deg, #0a5c33, #0c6b3b);
}
/* reflektori — samo mek sjaj na gornjoj polovini (bez oštrih traka preko trave) */
.pn-lights {
    position: absolute; left: 0; right: 0; top: 0; height: 62%;
    pointer-events: none; z-index: 4;
    background:
        radial-gradient(ellipse 70% 55% at 8% -6%, rgba(200, 230, 255, 0.12), transparent 65%),
        radial-gradient(ellipse 70% 55% at 92% -6%, rgba(200, 230, 255, 0.12), transparent 65%),
        radial-gradient(ellipse 62% 34% at 50% 52%, rgba(200, 235, 255, 0.10), transparent 72%);
    mix-blend-mode: screen;
}

/* teren u perspektivi — POČINJE na gol-liniji (vrh ravni = gol-linija) */
.pn-pitch {
    position: absolute; left: -30%; right: -30%; top: 57.5%; bottom: -8%;
    transform: rotateX(54deg);
    transform-origin: top center;
    background:
        /* gol-linija na samom vrhu ravni */
        linear-gradient(#ffffff, #ffffff) no-repeat top center / 100% 4px,
        radial-gradient(ellipse 60% 90% at 50% 0%, rgba(255, 255, 240, 0.10), transparent 60%),
        repeating-linear-gradient(0deg, var(--grass1) 0 30px, var(--grass2) 30px 60px);
    box-shadow: inset 0 26px 34px rgba(0, 0, 0, 0.22);
}
.pn-pitch__box {   /* golmanov (mali) prostor — visi sa gol-linije ka šuteru */
    position: absolute; left: 50%; top: 0; width: 34%; height: 44%;
    transform: translateX(-50%);
    border: 3px solid rgba(255, 255, 255, 0.7);
    border-top: none;
    border-radius: 0 0 4px 4px;
}
/* bela tačka — pod loptom (lopta stoji na njoj) */
.pn-spot {
    position: absolute; left: 50%; bottom: 4.6%; z-index: 1;
    width: clamp(42px, 12vw, 56px); height: 13px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.95), rgba(210, 222, 238, 0.75) 55%, rgba(200, 214, 232, 0.25) 78%, transparent 82%);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.35);
}

/* ---------- Gol ---------- */
/* Baza gola = 57.5% (tačno na gol-liniji / vrhu terena): top = 57.5% − visina gola
   (86% širine × 1.32/3 × 10/11 ≈ 34.4% visine scene) ≈ 23.1%. */
.pn-goalwrap { position: absolute; top: 23.1%; left: 50%; transform: translateX(-50%); width: 86%; z-index: 2; }
.pn-goal {
    position: relative;
    aspect-ratio: 3 / 1.32;
    border-radius: 8px 8px 0 0;
    /* tamnije pri dnu → pano iza gola se ne probija, golman se bolje vidi */
    background: linear-gradient(180deg, rgba(4, 10, 22, 0.34) 0%, rgba(3, 8, 18, 0.72) 100%);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}
/* stative — gradijent „metal" preko pseudo okvira */
.pn-goal::before {
    content: '';
    position: absolute; inset: -7px -7px 0;
    border-radius: 10px 10px 0 0;
    border-top: 7px solid;
    border-left: 7px solid;
    border-right: 7px solid;
    border-color: #f7fbff;
    border-image: linear-gradient(180deg, #ffffff 0%, #dbe6f5 55%, #aebdd2 100%) 1;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
    pointer-events: none;
}
.pn-net {
    position: absolute; inset: 0; pointer-events: none; overflow: hidden;
    border-radius: 6px 6px 0 0;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px 7.5%),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px 13%);
}
.pn-net::after {   /* dubinski sloj mreže (jedva vidljiv, bez moiré-a sa zonama) */
    content: '';
    position: absolute; inset: 7% 9% 0;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 6%),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 10%);
}

/* zone (3×2) — vide se u režimu ciljanja */
.pn-zones { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 5px; padding: 7px; z-index: 3; }
.pn-zone {
    position: relative;
    border: 1.5px solid rgba(255, 255, 255, 0);
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    pointer-events: none;
}
.pn-zone::after {   /* nišan-tačka u centru zone */
    content: '';
    position: absolute; left: 50%; top: 50%;
    width: 7px; height: 7px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
.pn-stage.aim .pn-zone {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.025);
    pointer-events: auto;
}
.pn-stage.aim .pn-zone::after {
    background: rgba(255, 255, 255, 0.5);
    animation: pnDot 1.6s ease-in-out infinite;
}
@keyframes pnDot {
    0%, 100% { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06); }
    50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.14); }
}
.pn-stage.aim .pn-zone:hover {
    background: rgba(47, 224, 133, 0.2);
    border-color: var(--accent);
    box-shadow: inset 0 0 18px rgba(47, 224, 133, 0.3), 0 0 12px rgba(47, 224, 133, 0.25);
}
.pn-stage.aim .pn-zone:hover::after { background: #fff; box-shadow: 0 0 10px rgba(47, 224, 133, 0.8); animation: none; }
.pn-zone.sel {
    background: rgba(47, 224, 133, 0.28) !important;
    border-color: var(--accent) !important;
    box-shadow: inset 0 0 22px rgba(47, 224, 133, 0.4);
}
.pn-zone.sel::after { background: #fff; animation: none; }
.pn-stage.aim .pn-zone.keeper-pick:hover {
    background: rgba(255, 216, 107, 0.18);
    border-color: var(--gold);
    box-shadow: inset 0 0 18px rgba(255, 216, 107, 0.28), 0 0 12px rgba(255, 216, 107, 0.22);
}
.pn-stage.aim .pn-zone.keeper-pick:hover::after { box-shadow: 0 0 10px rgba(255, 216, 107, 0.8); }

/* ---------- Golman i lopta ---------- */
.pn-keeper {
    position: absolute; left: 50%; bottom: -4px; z-index: 4;
    font-size: clamp(40px, 11vw, 58px);
    transform: translateX(-50%);
    transition: transform 0.42s cubic-bezier(0.34, 1.3, 0.64, 1);
    pointer-events: none;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 14px rgba(200, 230, 255, 0.18));
}
.pn-keeper::after {   /* senka golmana na gol-liniji */
    content: '';
    position: absolute; left: 50%; bottom: -7px;
    width: 74%; height: 11px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.5), transparent 70%);
}
.pn-keeper__i { display: inline-block; animation: pnIdle 2.6s ease-in-out infinite; }
@keyframes pnIdle {
    0%, 100% { transform: translateX(-7px) rotate(-4deg); }
    50% { transform: translateX(7px) rotate(4deg); }
}
.pn-ball {
    position: absolute; left: 50%; bottom: 5.2%; z-index: 5;
    font-size: clamp(38px, 11vw, 50px);
    transform: translateX(-50%);
    transition: transform 0.5s cubic-bezier(0.3, 0.6, 0.4, 1);
    pointer-events: none;
    filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.6));
}
.pn-ball__i { display: inline-block; animation: pnBob 2.2s ease-in-out infinite; }
@keyframes pnBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
.pn-ball.reset { transition: none; }

/* ---------- Efekti ---------- */
.pn-fx { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.pn-boom { position: absolute; font-size: 44px; transform: translate(-50%, -50%) scale(0.3); animation: pnBoom 0.7s ease forwards; }
@keyframes pnBoom {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
    30% { opacity: 1; transform: translate(-50%, -50%) scale(1.4); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}
.pn-conf { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: pnConf linear forwards; }
@keyframes pnConf {
    to { transform: translateY(115vh) rotate(720deg); opacity: 0.9; }
}

/* ---------- Dugmad / kartice / overlays ---------- */
.pn-back {
    margin: 2px auto 0; padding: 9px 18px;
    font-size: 13px; font-weight: 700; color: var(--text-dim);
    background: transparent; border: 1px solid var(--surface-bd); border-radius: 12px; cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}
.pn-back:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

.pn-adbanner {
    min-height: 56px; display: flex; align-items: center; justify-content: center;
    border: 1px dashed var(--surface-bd); border-radius: 14px;
    color: var(--text-dim); font-size: 12px;
}

.pn-overlay {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    background: rgba(3, 8, 16, 0.82);
    backdrop-filter: blur(9px);
    animation: pnFade 0.25s ease;
}
.pn-overlay[hidden] { display: none; }
@keyframes pnFade { from { opacity: 0; } to { opacity: 1; } }
.pn-card {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    min-width: 290px; max-width: 340px;
    padding: 28px 30px; border-radius: 26px; text-align: center;
    background: linear-gradient(160deg, #12294a, #081524);
    border: 1px solid rgba(255, 255, 255, 0.13);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: pnCard 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pnCard {
    from { opacity: 0; transform: scale(0.85) translateY(16px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.pn-card h2 { margin: 0; font-size: 24px; font-weight: 900; }
.pn-card__sub { margin: 0; font-size: 13px; color: var(--text-dim); }
.pn-btn {
    width: 100%; padding: 13px 18px;
    font-size: 16px; font-weight: 800; color: #04220f;
    border: none; border-radius: 14px; cursor: pointer;
    background: linear-gradient(135deg, #3ef29a 0%, #18b467 100%);
    box-shadow: 0 10px 24px rgba(47, 224, 133, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pn-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(47, 224, 133, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.pn-btn:active { transform: translateY(0); }
.pn-btn:disabled { filter: grayscale(0.6) brightness(0.75); cursor: default; transform: none; }
.pn-btn--ghost { color: var(--text); background: rgba(255, 255, 255, 0.07); border: 1px solid var(--surface-bd); box-shadow: none; }
.pn-btn--ghost:hover { background: rgba(255, 255, 255, 0.12); box-shadow: none; }
.pn-btn small { font-weight: 600; opacity: 0.75; }
.pn-input {
    width: 100%; padding: 11px 12px; border-radius: 12px;
    border: 1px solid var(--surface-bd); background: rgba(255, 255, 255, 0.06);
    color: var(--text); font-size: 15px; text-align: center; outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pn-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 224, 133, 0.2); }
.pn-wager { width: 100%; display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-dim); text-align: left; }
.pn-wait { margin: 0; font-size: 13px; color: var(--text-dim); }
.pn-room__code { font-size: 34px; font-weight: 900; letter-spacing: 8px; text-shadow: 0 0 20px rgba(47, 224, 133, 0.4); }
.pn-room__wager { margin: 0; font-size: 14px; font-weight: 700; color: var(--gold); }
.pn-room__btns { display: flex; gap: 8px; width: 100%; }
.pn-room__btns .pn-btn { flex: 1; }
.pn-search__spin { font-size: 44px; animation: pnSpin 1.2s linear infinite; }
@keyframes pnSpin { to { transform: rotate(360deg); } }
.pn-rematch__msg { margin: 0; font-size: 13px; color: var(--text-dim); }
.pn-win { color: var(--accent); text-shadow: 0 0 20px rgba(47, 224, 133, 0.5); }
.pn-lose { color: #ff7373; }
