* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    touch-action: none;
}

body {
    width: 100vw;
    height: 100vh;
    background: linear-gradient(160deg, #0b0d1a 0%, #12152a 55%, #0b0d1a 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ===== Menu główne ===== */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background:
        radial-gradient(900px 520px at 12% -12%, rgba(124,108,255,0.3), transparent 65%),
        radial-gradient(820px 540px at 112% 6%, rgba(255,95,158,0.22), transparent 62%),
        linear-gradient(160deg, #0b0d1a 0%, #12152a 55%, #0b0d1a 100%);
    z-index: 100;
    padding: 26px 16px 34px;
    overflow-y: auto;
    text-align: center;
    -webkit-overflow-scrolling: touch;
}

/* Menu jest przewijalne na telefonie — pozwól na pionowy gest. */
#start-screen,
#start-screen * {
    touch-action: pan-y;
}

.menu {
    width: min(100%, 480px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.reflex-brandbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.reflex-brandbar .btn {
    flex: 0 0 auto;
    width: auto;
    padding: 7px 11px;
    font-size: 0.68rem;
}

.reflex-brand {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 800;
    white-space: nowrap;
}

.reflex-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.reflex-subtabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin: 0 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.18);
}

.reflex-subtab {
    flex: 1;
    min-width: 0;
    padding: 9px 6px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.reflex-subtab.active {
    background: linear-gradient(135deg, rgba(124, 108, 255, 0.8), rgba(255, 95, 158, 0.45));
    color: #fff;
    box-shadow: 0 4px 14px rgba(124, 108, 255, 0.24);
}

.reflex-subpanel[hidden] {
    display: none;
}

#reflex-play {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#reflex-play[hidden],
#reflex-pvp[hidden] {
    display: none;
}

#reflex-pvp {
    display: block;
}

#reflex-pvp .pvp-directory {
    margin-top: 4px;
}

.pvp-more-link {
    width: 100%;
    margin-top: 10px;
}

.menu-hero {
    text-align: center;
    margin-bottom: 18px;
}

.menu-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    font-size: 1.75rem;
    border-radius: 18px;
    background: linear-gradient(135deg, #7c6cff 0%, #ff5f9e 100%);
    box-shadow: 0 12px 30px rgba(124,108,255,0.42);
}

.menu-hero h1 {
    color: #fff;
    font-size: clamp(1.7rem, 7.5vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.menu-hero h1 span {
    background: linear-gradient(100deg, #b9b2ff 0%, #ff8fc2 60%, #feca57 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.menu-tagline {
    margin-top: 7px;
    color: rgba(255,255,255,0.62);
    font-size: clamp(0.78rem, 3.4vw, 0.9rem);
}

/* Czas gry — segmentowany przełącznik */
.time-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
}

.time-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    text-align: left;
    padding-left: 4px;
}

.segmented {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 15px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.08);
}

.seg-btn {
    flex: 1;
    min-width: 0;
    padding: 10px 6px;
    border: none;
    border-radius: 11px;
    background: transparent;
    color: rgba(255,255,255,0.7);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.stake-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(254, 202, 87, 0.28);
    border-radius: 16px;
    background: rgba(254, 202, 87, 0.075);
    text-align: left;
}

.casino-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(124, 108, 255, 0.3);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(254, 202, 87, 0.07), rgba(124, 108, 255, 0.09));
    text-align: left;
}

.casino-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 4px 0;
}

.casino-grid span {
    flex: 1;
    min-width: 120px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.68rem;
    font-weight: 700;
}

.casino-grid strong {
    display: block;
    margin-top: 2px;
    color: #feca57;
    font-size: 1.05rem;
    font-weight: 900;
}

.casino-link {
    color: #c9c1ff;
    font-size: 0.7rem;
    font-weight: 800;
    text-decoration: none;
}

.casino-link:hover {
    color: #fff;
    text-decoration: underline;
}

.stake-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
}

.stake-note {
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.64rem;
    font-weight: 700;
}

.stake-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.stake-input {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    outline: none;
}

.stake-input:focus {
    border-color: rgba(254, 202, 87, 0.6);
}

.stake-unit {
    color: var(--gold, #feca57);
    font-size: 0.75rem;
    font-weight: 800;
}

.stake-hint {
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.66rem;
    line-height: 1.35;
}

.stake-status {
    min-height: 1em;
    color: #ff8f8f;
    font-size: 0.7rem;
    font-weight: 700;
}

.stake-info-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 2px 0 4px;
    padding: 0;
    list-style: none;
}

.stake-info-list li {
    position: relative;
    padding-left: 14px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.68rem;
    line-height: 1.4;
}

.stake-info-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #feca57;
    font-weight: 900;
}

.stake-info-list strong {
    color: #fff;
}

.tile-stake {
    border-color: rgba(254, 202, 87, 0.32);
    background:
        radial-gradient(240px 100px at 100% 0%, rgba(254, 202, 87, 0.16), transparent 70%),
        rgba(254, 202, 87, 0.06);
}

.tile-stake .tile-icon {
    background: rgba(254, 202, 87, 0.16);
}

/* Stawka w lobby online */
.net-stake {
    margin-bottom: 12px;
    padding: 11px 12px;
    border: 1px solid rgba(254, 202, 87, 0.24);
    border-radius: 14px;
    background: rgba(254, 202, 87, 0.06);
    text-align: left;
}

.net-stake-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
}

.net-stake-badge {
    color: #ffd98a;
    font-size: 0.64rem;
    font-weight: 800;
}

.net-stake-presets,
.bot-stake-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 7px;
}

.net-stake-presets .seg-btn,
.bot-stake-presets .seg-btn {
    flex: 1 1 44px;
    padding: 7px 6px;
    font-size: 0.68rem;
}

.net-stake-input {
    margin-bottom: 6px;
    padding: 10px 12px;
    font-size: 0.95rem;
}

/* Modal stawki bota */
#bot-stake-screen {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 165;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(11, 13, 30, 0.8);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.bot-stake-card {
    position: relative;
    width: min(100%, 390px);
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px 20px 20px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 24px;
    background: rgba(15, 17, 32, 0.96);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58);
    text-align: center;
}

.bot-stake-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.bot-stake-close:hover {
    color: #fff;
}

.bot-stake-kicker {
    color: #ffd98a;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.bot-stake-card h2 {
    margin: 4px 0 8px;
    color: #fff;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.bot-stake-modes {
    margin: 10px 0 8px;
}

.bot-stake-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.bot-stake-actions .btn {
    width: 100%;
}

.seg-btn.active {
    background: rgba(124,108,255,0.34);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.24);
}

/* Sekcje menu */
.menu-section {
    margin-top: 14px;
    padding: 14px;
    border-radius: 22px;
    background:
        radial-gradient(360px 220px at 0% 0%, rgba(124, 108, 255, 0.14), transparent 70%),
        rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.09);
    text-align: left;
}

.section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.section-head h2 {
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
}

.section-icon {
    font-size: 1.05rem;
    line-height: 1;
}

.section-tag {
    margin-left: auto;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.55);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.subhead {
    margin: 15px 4px 8px;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.42);
}

.tile-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bot-list {
    margin-top: 8px;
}

.tile {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(124, 108, 255, 0.045));
    color: #fff;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.14s, background 0.14s, border-color 0.14s;
    -webkit-tap-highlight-color: transparent;
}

.tile:hover {
    border-color: rgba(124, 108, 255, 0.45);
    background:
        linear-gradient(135deg, rgba(124, 108, 255, 0.16), rgba(255, 95, 158, 0.08));
}

.tile:active {
    transform: scale(0.98);
    background: rgba(255,255,255,0.14);
}

.tile-icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    font-size: 1.15rem;
    line-height: 1;
}

.tile-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tile-title {
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.2;
}

.tile-desc {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.58);
    line-height: 1.25;
}

.tile-chevron {
    flex: 0 0 auto;
    font-size: 1.4rem;
    line-height: 1;
    color: rgba(255,255,255,0.33);
}

.tile-primary {
    background: linear-gradient(135deg, rgba(124,108,255,0.28), rgba(255,95,158,0.24));
    border-color: rgba(124,108,255,0.48);
}

.tile-primary .tile-icon {
    background: linear-gradient(135deg, #7c6cff, #ff5f9e);
}

.tile-puzzle .tile-icon {
    background: rgba(254,202,87,0.2);
}

.tile-bot .tile-icon {
    background: rgba(162,155,254,0.22);
}

.tile-net {
    background: rgba(29,209,161,0.09);
    border-color: rgba(29,209,161,0.24);
}

.tile-net .tile-icon {
    background: rgba(29,209,161,0.18);
}

/* Zasady */
.rules {
    margin-top: 14px;
    padding: 0 14px;
    border-radius: 18px;
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.08);
}

.rules summary {
    padding: 12px 0;
    color: rgba(255,255,255,0.72);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    text-align: left;
}

.rules summary::-webkit-details-marker {
    display: none;
}

.rules summary::after {
    content: '▾';
    float: right;
    opacity: 0.6;
}

.rules[open] summary::after {
    content: '▴';
}

.rules p {
    padding: 0 0 14px;
    color: rgba(255,255,255,0.6);
    font-size: 0.77rem;
    line-height: 1.55;
    text-align: left;
}

.btn {
    background: linear-gradient(100deg, #7c6cff 0%, #ff5f9e 100%);
    border: none;
    padding: 15px clamp(28px, 9vw, 38px);
    font-size: clamp(1.05rem, 4.2vw, 1.28rem);
    color: #fff;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    letter-spacing: -0.01em;
    box-shadow: 0 12px 34px rgba(124,108,255,0.35);
    transition: transform 0.14s, filter 0.14s, box-shadow 0.14s;
}

.btn:active {
    transform: scale(0.95);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Game UI */
#game-ui {
    display: none;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 600px;
    background: rgba(15,17,32,0.9);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 10px 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.45);
    backdrop-filter: blur(10px);
    color: #fff;
}

.hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.player-score {
    padding: 8px 12px;
    border-radius: 15px;
    font-weight: bold;
    min-width: 92px;
    text-align: center;
    color: white;
    line-height: 1.15;
    font-size: 0.95rem;
}

#p1-score, #p2-score {
    font-size: 1.5rem;
    display: block;
    line-height: 1.1;
}

#p1-label, #p2-label {
    font-size: 0.75rem;
    display: block;
    max-width: 118px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reaction-line {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 2px;
    opacity: 0.95;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

#score-player1 {
    background: linear-gradient(135deg, rgba(255,95,158,0.28), rgba(255,154,98,0.2));
    border: 1px solid rgba(255,95,158,0.5);
}

#score-player2 {
    background: linear-gradient(135deg, rgba(29,209,161,0.24), rgba(72,219,251,0.18));
    border: 1px solid rgba(29,209,161,0.46);
}

.timer-wrap {
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex: 0 0 auto;
}

#timer {
    font-size: 2.6rem;
    font-weight: 800;
    color: #b9b2ff;
    line-height: 1;
    min-width: 64px;
    text-align: center;
}

.timer-wrap small {
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255,255,255,0.55);
    margin-left: 2px;
}

#timer.timer-warning {
    color: #ff8aa8;
    animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* Game Area */
#game-area {
    position: absolute;
    top: 126px;
    left: 0;
    width: 100%;
    height: calc(100% - 126px);
    background:
        radial-gradient(900px 520px at 15% 0%, rgba(124,108,255,0.18), transparent 65%),
        linear-gradient(160deg, #0b0d1a 0%, #12152a 55%, #0b0d1a 100%);
}

/* Targets */
.target {
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    transition: transform 0.1s;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.target::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.7);
}

.target.p1-target {
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #c0392b);
}

.target.p2-target {
    background: radial-gradient(circle at 30% 30%, #48dbfb, #16a085);
}

/* Cel-podpucha — nie wolno w niego klikać (-5 pkt) */
.target.decoy-target {
    background: radial-gradient(circle at 30% 30%, #feca57, #e67e22);
    color: rgba(0,0,0,0.55);
    font-size: 30px;
    font-weight: 900;
}

.target.decoy-target::before {
    border-color: rgba(0,0,0,0.3);
    border-style: dashed;
}

/* Tryb 2 — wspólna plansza */
.target.shared-target:not(.decoy-target) {
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
    text-shadow: 0 2px 6px rgba(0,0,0,0.45);
}

.target.shared-small::before {
    border-width: 3px;
}

/* Ostatni cel — ramka zwężającej się areny */
.net-arena-frame {
    position: absolute;
    border: 2px solid rgba(67, 231, 255, 0.55);
    border-radius: 18px;
    box-shadow:
        inset 0 0 46px rgba(67, 231, 255, 0.16),
        0 0 18px rgba(67, 231, 255, 0.14);
    pointer-events: none;
    z-index: 1;
    transition: left 0.9s linear, top 0.9s linear, right 0.9s linear, bottom 0.9s linear;
}

/* Blef — trzy identyczne cele; znak zapytania zamiast podpowiedzi */
.target.bluff-target {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.5rem;
    font-weight: 900;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.target.bluff-target::after {
    content: '?';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.target.bluff-target::before {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.55);
}

.target.bluff-tap {
    box-shadow: 0 0 26px rgba(255, 255, 255, 0.85);
}

/* Pływające komunikaty punktowe */
.score-float {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 30px;
    font-weight: 900;
    pointer-events: none;
    z-index: 50;
    text-shadow: 0 2px 8px rgba(0,0,0,0.65);
    animation: floatUp 0.8s ease-out forwards;
}

.score-float.bad { color: #ff4757; }
.score-float.good { color: #2ed573; }
.score-float.p1 { color: #ff6b6b; }
.score-float.p2 { color: #48dbfb; }

@keyframes floatUp {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
    25% { opacity: 1; transform: translate(-50%, -80%) scale(1.15); }
    100% { opacity: 0; transform: translate(-50%, -170%) scale(1); }
}

.target.hit {
    transform: scale(0.7) rotate(180deg);
    opacity: 0;
}

/* Touch feedback */
#game-area::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

#game-area:active::after {
    background: rgba(255,255,255,0.03);
}

/* End Screen */
#end-screen {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(800px 480px at 15% 0%, rgba(124,108,255,0.28), transparent 65%),
        radial-gradient(700px 460px at 100% 100%, rgba(255,95,158,0.18), transparent 62%),
        linear-gradient(160deg, #0b0d1a 0%, #12152a 55%, #0b0d1a 100%);
    z-index: 90;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 24px;
    text-align: center;
}

#end-screen h1 {
    color: white;
    font-size: clamp(2rem, 9vw, 3rem);
    text-align: center;
    margin: 0;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.25);
}

.winner-display {
    background: rgba(255,255,255,0.055);
    border: 1px solid rgba(255,255,255,0.13);
    padding: 24px 28px;
    border-radius: 22px;
    width: min(90%, 420px);
    text-align: center;
    box-shadow: 0 18px 50px rgba(0,0,0,0.42);
    backdrop-filter: blur(10px);
}

.winner-display p {
    color: rgba(255,255,255,0.58);
    margin: 0 0 8px;
}

.winner-name {
    font-size: clamp(1.6rem, 7vw, 2.4rem);
    font-weight: 800;
    color: #ffcf7a;
    line-height: 1.15;
}

.winner-score {
    font-size: clamp(1rem, 4.5vw, 1.4rem);
    font-weight: 700;
    color: #fff;
    margin-top: 12px;
}

.winner-display .end-stats {
    font-size: clamp(0.8rem, 3.6vw, 1rem);
    font-weight: 700;
    color: rgba(255,255,255,0.66);
    margin: 6px 0 14px;
    line-height: 1.35;
}

#end-screen .btn {
    margin-top: 4px;
}

#sound-toggle {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 200;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(15,17,32,0.82);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
    line-height: 1;
}

.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(100%, 340px);
    margin-top: 18px;
}

.btn-net {
    background: linear-gradient(100deg, #1dd1a1 0%, #7c6cff 100%);
    color: #fff;
}

.btn.small {
    padding: 12px 20px;
    font-size: 0.9rem;
    width: 100%;
}

.btn.ghost {
    background: rgba(255,255,255,0.05);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow: none;
    margin-top: 12px;
}

.menu-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.menu-link {
    flex: 1 1 130px;
    color: #fff;
    border-color: rgba(255,255,255,0.32);
    background: rgba(255,255,255,0.06);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.net-mode-hint {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    line-height: 1.35;
    margin: -8px 0 14px;
}

/* ===== HUD dla jednego gracza ===== */
#game-ui.solo-hud .hud {
    gap: 12px;
}

#game-ui.solo-hud #score-player2 {
    display: none;
}

/* ===== Cele mini-zagadek ===== */
.target.puzzle-green {
    background: radial-gradient(circle at 30% 30%, #2ed573, #0f9d58);
    color: #fff;
    font-size: 28px;
    font-weight: 900;
}

.target.puzzle-red {
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #c0392b);
    color: #fff;
    font-size: 28px;
    font-weight: 900;
}

.target.puzzle-seq {
    background: radial-gradient(circle at 30% 30%, #a29bfe, #6c5ce7);
    color: #fff;
    font-size: 28px;
    font-weight: 900;
}

.target.puzzle-wrong {
    animation: puzzle-shake 0.22s ease;
}

@keyframes puzzle-shake {
    0%, 100% { transform: translateX(0) scale(1); }
    25% { transform: translateX(-6px) scale(1); }
    75% { transform: translateX(6px) scale(1); }
}

/* ===== Ekran sieciowy ===== */
#net-screen {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 110;
    background:
        radial-gradient(800px 480px at 15% 0%, rgba(124,108,255,0.24), transparent 65%),
        radial-gradient(700px 460px at 100% 100%, rgba(255,95,158,0.16), transparent 62%),
        linear-gradient(160deg, #0b0d1a 0%, #12152a 55%, #0b0d1a 100%);
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.net-card {
    width: min(100%, 380px);
    background: rgba(15,17,32,0.92);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 22px;
    padding: 24px 22px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.5);
    backdrop-filter: blur(12px);
    text-align: center;
    color: #eef0ff;
}

.net-card h2 {
    color: #fff;
    margin-bottom: 18px;
    font-size: 1.5rem;
}

/* Powiązanie pokoju z Your Hero */
.net-hero {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -2px 0 14px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.055);
    border: 1px solid rgba(255,255,255,0.12);
    text-align: left;
}

.net-hero.connected {
    background: linear-gradient(135deg, rgba(29,209,161,0.14), rgba(124,108,255,0.12));
    border-color: rgba(29,209,161,0.34);
}

.net-hero-icon {
    flex: 0 0 auto;
    font-size: 1.35rem;
    line-height: 1;
}

.net-hero-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.net-hero-title {
    color: #fff;
    font-size: 0.84rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.net-hero-sub {
    color: rgba(255,255,255,0.6);
    font-size: 0.71rem;
    line-height: 1.3;
}

.net-hero-link {
    flex: 0 0 auto;
    color: #b9b2ff;
    font-size: 0.73rem;
    font-weight: 800;
    text-decoration: none;
}

.net-hero-link:hover {
    text-decoration: underline;
}

/* Adres gry do wysłania drugiemu graczowi */
.net-share {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: -4px 0 16px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.055);
    border: 1px solid rgba(255,255,255,0.12);
    text-align: left;
}

.net-share-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
}

.net-share-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.net-share-row code {
    flex: 1;
    min-width: 0;
    align-self: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.82rem;
    font-weight: 700;
    color: #d9d4ff;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
}

.net-copy {
    flex: 0 0 auto;
    padding: 7px 12px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(100deg, #7c6cff 0%, #ff5f9e 100%);
    color: #fff;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.net-copy:active {
    transform: scale(0.96);
}

.net-share-hint {
    font-size: 0.68rem;
    line-height: 1.3;
    color: rgba(255,255,255,0.45);
}

.net-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 14px;
    font-size: 1.1rem;
    margin-bottom: 10px;
    text-align: center;
    color: #fff;
    background: rgba(0,0,0,0.26);
    outline: none;
    font-family: inherit;
}

.net-input::placeholder {
    color: rgba(255,255,255,0.35);
}

.net-input:focus {
    border-color: rgba(124,108,255,0.75);
}

.code-input {
    letter-spacing: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    padding-left: 24px;
}

.divider {
    margin: 16px 0 14px;
    color: rgba(255,255,255,0.42);
    font-size: 0.85rem;
    position: relative;
}

.net-hint {
    color: rgba(255,255,255,0.62);
    margin-bottom: 8px;
}

/* Pytanie o grę z inną długością czasu */
.net-offer {
    margin: 12px 0 6px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(254,202,87,0.1);
    border: 1px solid rgba(254,202,87,0.32);
    text-align: left;
}

.net-offer-text {
    color: #ffd98a;
    font-size: 0.86rem;
    line-height: 1.4;
    margin-bottom: 10px;
}

.net-offer-actions {
    display: flex;
    gap: 8px;
}

.net-offer-actions .btn {
    flex: 1;
}

.room-code {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 10px;
    color: #dcd8ff;
    background: rgba(124,108,255,0.16);
    border: 1px solid rgba(124,108,255,0.34);
    border-radius: 16px;
    padding: 10px 0 10px 10px;
    margin: 8px 0 16px;
}

.net-error {
    color: #ff8aa8;
    font-size: 0.9rem;
    min-height: 1.2em;
    margin-top: 10px;
    font-weight: 600;
}

#net-lobby p {
    color: rgba(255,255,255,0.62);
    margin-bottom: 6px;
}

/* ===== Menu w trakcie gry (przycisk w HUD) ===== */
#menu-toggle {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

#menu-toggle:active {
    transform: scale(0.92);
}

@media (max-width: 440px) {
    .hud { gap: 6px; }
    .player-score { min-width: 72px; padding: 6px 8px; font-size: 0.85rem; }
    #p1-score, #p2-score { font-size: 1.25rem; }
    #p1-label, #p2-label { max-width: 82px; font-size: 0.68rem; }
    #timer { font-size: 2.1rem; min-width: 52px; }
    .timer-wrap small { font-size: 0.85rem; }
    .reaction-line { font-size: 0.62rem; }
    #menu-toggle { width: 32px; height: 32px; border-radius: 10px; font-size: 0.95rem; }
}

/* ===== Pauza / menu gry ===== */
#pause-screen {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 150;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(11, 13, 30, 0.78);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.pause-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(100%, 340px);
    padding: 24px 20px;
    border-radius: 24px;
    background: rgba(15,17,32,0.94);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 70px rgba(0,0,0,0.55);
    text-align: center;
}

.pause-card h2 {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.pause-mode {
    margin: -4px 0 8px;
    color: rgba(255,255,255,0.6);
    font-size: 0.82rem;
    line-height: 1.35;
}

.pause-card .btn {
    width: 100%;
}

.pause-card .btn.ghost {
    margin-top: 0;
    color: #fff;
    border-color: rgba(255,255,255,0.18);
}

/* ===== Akcje na ekranie konca gry ===== */
.end-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(90%, 380px);
}

.end-actions .btn {
    width: 100%;
    margin-top: 0;
}

#end-screen .end-actions .btn.ghost {
    color: #fff;
    border-color: rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.12);
}
