/* css/pingpong.css */
:root {
    --bg: #ffffff;
    --line: #000000;
    --dialog-bg: #000000;

    --bs-btn-focus-ring-contrast-color: #ffffff;
    --bs-btn-focus-ring-color: #000000;
}

.pingpong-root {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.hud {
    position: absolute;
    z-index: 2;
    display: flex;
    justify-content: end;
    align-items: center;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.score {
    height: fit-content;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #000000;
    background-color: var(--bg);
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    padding: 0.2rem 1rem;
    border-radius: 12px;
    min-width: 100px;
    border: 2px solid var(--line);
    margin-right: -1rem;
}

@media (orientation: landscape) {
    .hud {
        bottom: 0;
        justify-content: center;
        align-items: end;
    }
    .score {
        background-color: var(--bg);
        font-size: 3rem;
        padding: 0.2rem 4rem;
        min-width: 200px;
        margin-right: 0rem;
        margin-bottom: -2rem;
    }
}

#game-canvas {
    display: block;
    width: 100%;
    /* Default height; JS will resize properly */
    aspect-ratio: 16 / 9;
    background: var(--bg);
    border-radius: 12px;
    outline: none;
    border: 2px solid var(--line);
}

#game-canvas {
    touch-action: none;
}

/* Portrait: hochkant spielen */
@media (orientation: portrait) {
    #game-canvas {
        height: 72vh;
    }
}

/* Landscape: näher an 16:9, aber flexibel */
@media (orientation: landscape) {
    #game-canvas {
        height: clamp(300px, 56vw, 70vh);
    }
}

/* Overlay */
.overlay[hidden] {
    display: none !important;
}

.overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}

.dialog {
    background: var(--dialog-bg);
    border-radius: 12px;
    padding: 24px 20px;
    min-width: min(65vw, 420px);
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 50;
}

.dialog h2 {
    font-size: 3rem;
}

.dialog p {
    max-width: 25ch;
    margin-bottom: 2rem;
}

.btn {
    transition:
        color 0.15s ease-in-out,
        background-color 0.15s ease-in-out,
        border-color 0.15s ease-in-out,
        box-shadow 0.15s ease-in-out;
}

.btn-secondary {
    background: transparent;
    color: #ffffff;
    padding: 24px 30px;
    font-size: clamp(16px, 2vw, 23px);
    border-radius: 8px;
    border: 2px solid;
    font-weight: 600;
}

.btn-secondary:hover,
.btn-secondary:active {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
    cursor: pointer;
}

@media only screen and (max-width: 767px) {
    .btn-secondary {
        font-weight: 300;
        padding: 14px 5px;
        border: 1px solid;
    }
}

@media (max-width: 1200px) {
    .btn-secondary {
        padding: 12px 15px;
    }
}