/* Hoops AR — tabletop shootaround */

body {
    background-color: #f5f7fa;
}

.game-wrapper {
    position: relative;
    max-width: 1100px;
    margin: 1.25rem auto 2.5rem;
    padding: 0 12px;
}

.game-header-integrated {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #141a2e;
    border: 1px solid #232c4a;
    border-radius: 12px 12px 0 0;
    padding: 10px 14px;
}

.game-logo {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fff;
    font-size: 1.25rem;
    margin: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.high-score-display {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffd166;
    background: rgba(255, 209, 102, 0.12);
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    white-space: nowrap;
}

.mute-btn {
    background: #1d2440;
    color: #fff;
    border: 1px solid #2c3763;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.mute-btn:hover {
    background: #2c3763;
}

.canvas-container {
    position: relative;
    width: 100%;
    height: 74vh; /* fallback for browsers without dvh */
    height: max(480px, min(calc(100dvh - 200px), 900px));
    background: #0d1126;
    border: 1px solid #232c4a;
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    --chrome-accent: #fa5c5c;
}

#camera-feed {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none; /* shown once the stream is live */
}

.canvas-container canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.canvas-container:fullscreen {
    height: 100%;
    border: none;
    border-radius: 0;
}

.canvas-container:-webkit-full-screen {
    height: 100%;
    border: none;
    border-radius: 0;
}

/* On-screen controls */
.shoot-btn {
    position: absolute;
    left: 50%;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    width: 92px;
    height: 92px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.55);
    background: rgba(250, 92, 92, 0.82);
    color: #fff;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 1px;
    line-height: 1.3;
    cursor: pointer;
    z-index: 40;
    display: none;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.shoot-btn:active {
    background: rgba(255, 120, 110, 0.95);
    transform: translateX(-50%) scale(0.96);
}

.replace-btn {
    position: absolute;
    left: calc(10px + env(safe-area-inset-left, 0px));
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    display: none;
    background: rgba(20, 20, 24, 0.65);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
}

.replace-btn:hover {
    background: rgba(60, 60, 70, 0.8);
}

/* Start overlay */
.start-screen {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.4rem;
    padding: 20px;
    background: rgba(8, 10, 22, 0.88);
    color: #fff;
    font-family: 'Courier New', monospace;
}

.start-screen h2 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 7px;
    margin: 0;
}

.start-screen .tagline {
    color: #ffd166;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin: 0 0 0.8rem;
}

.start-screen .instructions p {
    margin: 0 0 0.7rem;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #c9d4f2;
}

.permission-note {
    margin-top: 1rem;
    font-size: 0.72rem;
    color: #7f8db3;
    line-height: 1.5;
}

.play-button {
    margin-top: 0.6rem;
    background: #fa5c5c;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 2.2rem;
    font-family: inherit;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.play-button:hover {
    background: #ff6b6b;
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .game-wrapper { padding: 0 6px; margin-top: 0.75rem; }
    .game-logo { font-size: 1.05rem; letter-spacing: 2px; }
    .high-score-display { font-size: 0.72rem; padding: 0.3rem 0.55rem; }
    .start-screen h2 { font-size: 1.8rem; letter-spacing: 5px; }
}
