/* ============================================================
   KAIRBNB GOLD RINK AIR HOCKEY — STYLESHEET
   Barbershop Arcade Lounge (33 Blackwood St, North Melbourne)
   ============================================================ */

:root {
    --bg-dark: #09090c;
    --bg-surface: #121216;
    --bg-card: #181820;
    --gold: #d4a853;
    --gold-light: #f5cf6d;
    --gold-dark: #967026;
    --neon-blue: #38bdf8;
    --neon-red: #f43f5e;
    --neon-green: #2ed573;
    --rink-surface: #0e0e14;
    --rink-lines: rgba(212, 168, 83, 0.45);
    --rink-glow: rgba(212, 168, 83, 0.25);
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'Courier New', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body.hockey-body {
    background: var(--bg-dark);
    color: #f8fafc;
    font-family: var(--font-sans);
    height: 100%;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    max-height: 100dvh;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

/* Top Navbar */
.hockey-navbar {
    background: rgba(18, 18, 22, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 168, 83, 0.3);
    padding: 6px 12px;
    padding-top: max(env(safe-area-inset-top, 0px), 6px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    flex-shrink: 0;
    z-index: 20;
}

.hockey-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #fff;
}

.hockey-logo {
    height: 26px;
    width: auto;
    filter: drop-shadow(0 2px 6px rgba(212, 168, 83, 0.4));
}

.hockey-brand-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hockey-badge {
    background: linear-gradient(135deg, #d4a853 0%, #ffd700 100%);
    color: #0b0b0e;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.hockey-nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.arcade-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(212, 168, 83, 0.35);
    border-radius: 8px;
    color: var(--gold-light);
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.arcade-btn:active, .arcade-btn.active {
    background: rgba(212, 168, 83, 0.25);
    border-color: var(--gold);
    color: #fff;
    transform: scale(0.97);
}

.arcade-btn-gold {
    background: rgba(212, 168, 83, 0.2);
    border-color: var(--gold);
    color: #ffd700;
}

/* Arena Container */
.hockey-arena {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px calc(14px + env(safe-area-inset-bottom, 0px));
    position: relative;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    box-sizing: border-box;
}

/* HUD Top Controls & Scoreboard */
.hockey-hud {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 4px;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.player-score-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(20, 20, 28, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 4px 10px;
}

.player-score-card.opponent {
    border-color: rgba(244, 63, 94, 0.3);
}

.player-score-card.player {
    border-color: rgba(56, 189, 248, 0.3);
}

.score-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-value {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    min-width: 20px;
    text-align: center;
}

.score-value.p1 {
    color: var(--neon-blue);
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.score-value.p2 {
    color: var(--neon-red);
    text-shadow: 0 0 10px rgba(244, 63, 94, 0.5);
}

.match-target-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--gold);
    background: rgba(212, 168, 83, 0.12);
    border: 1px solid rgba(212, 168, 83, 0.3);
    border-radius: 20px;
    padding: 3px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Rink Frame & Canvas */
.rink-wrapper {
    position: relative;
    width: 100%;
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    padding: 6px;
    background: linear-gradient(145deg, #22222c, #0a0a0d);
    border: 2px solid;
    border-color: #d4a853 #5e4718 #3a2c0f #d4a853;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), inset 0 0 15px rgba(212, 168, 83, 0.15);
    overflow: hidden;
    margin-bottom: 4px;
}

#hockeyCanvas {
    display: block;
    border-radius: 14px;
    background: var(--rink-surface);
    touch-action: none;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
    max-width: 100%;
    max-height: 100%;
}

/* Mode Quick Select Strip */
.mode-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 4px 0 2px;
    flex-shrink: 0;
    z-index: 10;
}

.mode-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    color: #94a3b8;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 6px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.mode-chip.active {
    background: rgba(212, 168, 83, 0.22);
    border-color: var(--gold);
    color: #ffd700;
    box-shadow: 0 0 12px rgba(212, 168, 83, 0.25);
}

.status-live {
    color: var(--neon-green);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Overlays & Modals */
.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(9, 9, 12, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 30;
    text-align: center;
    transition: opacity 0.25s ease;
}

.hidden {
    display: none !important;
}

.game-overlay.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.overlay-modal {
    background: #14141c;
    border: 1.5px solid var(--gold);
    border-radius: 20px;
    padding: 24px 20px;
    max-width: 320px;
    width: 100%;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(212, 168, 83, 0.2);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}

.modal-title.winner-gold {
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.modal-subtitle {
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.4;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.btn-play-action {
    background: linear-gradient(135deg, #d4a853 0%, #ffd700 100%);
    color: #0b0b0e;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.95rem;
    padding: 12px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(212, 168, 83, 0.4);
    transition: transform 0.15s ease;
}

.btn-play-action:active {
    transform: scale(0.97);
}

/* Celebration Banner */
.goal-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid var(--gold);
    border-radius: 16px;
    padding: 12px 28px;
    color: #ffd700;
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    z-index: 25;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.goal-banner.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* 2-Player Flipped Score Indicator */
.score-flipped {
    transform: rotate(180deg);
}

/* Online Multiplayer Lobby & Controls */
.badge-online-live {
    color: var(--neon-green);
    font-size: 0.65rem;
    margin-left: 2px;
    animation: pulse-live 1.5s infinite ease-in-out;
}

@keyframes pulse-live {
    0%, 100% { opacity: 0.3; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.3); }
}

.lobby-tabs {
    display: flex;
    background: #09090d;
    border: 1px solid rgba(212, 168, 83, 0.25);
    border-radius: 12px;
    padding: 4px;
    gap: 6px;
    margin-bottom: 6px;
}

.lobby-tab {
    flex: 1;
    background: none;
    border: none;
    border-radius: 8px;
    color: #94a3b8;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lobby-tab.active {
    background: rgba(212, 168, 83, 0.25);
    color: #ffd700;
}

.lobby-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.room-code-display {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 8px;
    color: #ffd700;
    background: #08080c;
    border: 2px dashed rgba(212, 168, 83, 0.5);
    border-radius: 14px;
    padding: 14px;
    text-align: center;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8), 0 0 15px rgba(212, 168, 83, 0.15);
}

.room-code-input {
    background: #08080c;
    border: 2px solid rgba(212, 168, 83, 0.4);
    border-radius: 14px;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 6px;
    padding: 10px 14px;
    text-align: center;
    text-transform: uppercase;
    outline: none;
    transition: border-color 0.2s ease;
}

.room-code-input:focus {
    border-color: #ffd700;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

.connection-status-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(20, 20, 28, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.74rem;
    color: #94a3b8;
}

.radar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffd700;
    box-shadow: 0 0 8px #ffd700;
    animation: pulse-live 1.2s infinite;
}

@media (max-height: 700px) {
    .hockey-navbar { height: 44px; padding: 4px 10px; }
    .hockey-hud { margin-bottom: 2px; }
    .score-value { font-size: 1.25rem; }
    .rink-wrapper { border-radius: 16px; padding: 4px; margin-bottom: 2px; }
    .mode-chip { font-size: 0.72rem; padding: 5px 10px; }
}

@media (max-width: 360px) {
    .mode-chip { font-size: 0.68rem; padding: 4px 8px; gap: 3px; }
    .score-name { font-size: 0.65rem; }
}
