/* Bier zapfen – full-screen game page (src/pages/bier_zapfen.rs). Stands alone, without main.css. */

@font-face {
    font-family: "ca";
    src: url("/assets/fonts/ca/ca-regular.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "ca";
    src: url("/assets/fonts/ca/ca-bold.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}

:root {
    --accent: #870a05;
    --beige: #fdf6e3;
    --ink: #2b2320;
}

* {
    box-sizing: border-box;
    margin: 0;
}

html,
body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    background: #2a1a10;
    color: var(--ink);
    font-family: "ca", "Times New Roman", serif;
    font-size: 1.125rem;
    line-height: 1.4;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

[hidden] {
    display: none !important;
}

#game {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
}

.game-home {
    position: fixed;
    top: max(0.75rem, env(safe-area-inset-top));
    left: max(1rem, env(safe-area-inset-left));
    color: var(--beige);
    font-size: 1.5rem;
    text-decoration: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.game-clock {
    position: fixed;
    top: max(0.75rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
    color: var(--beige);
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.game-flat {
    position: fixed;
    top: 4rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.4rem 0.9rem;
    border-radius: 0.5rem;
    background: var(--accent);
    color: var(--beige);
    white-space: nowrap;
}

.game-button {
    padding: 0.7rem 1.6rem;
    border: 0;
    border-radius: 18px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 1.2rem;
    cursor: pointer;
}

.game-button:disabled {
    opacity: 0.6;
}

.game-serve {
    position: fixed;
    left: 50%;
    bottom: max(1.25rem, env(safe-area-inset-bottom));
    transform: translateX(-50%);
}

/* Intro and result cards */
.game-card {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(26rem, calc(100% - 2rem));
    max-height: calc(100% - 2rem);
    overflow: auto;
    padding: 1.5rem;
    border: 1px solid var(--accent);
    border-radius: 0.75rem;
    background: var(--beige);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.game-card h1 {
    margin-bottom: 0.75rem;
    color: var(--accent);
    font-size: 1.9rem;
}

.game-card p {
    margin-bottom: 0.75rem;
}

.game-card .game-button {
    margin-top: 0.5rem;
}

.game-stats {
    display: grid;
    grid-template-columns: auto auto;
    gap: 0.25rem 1rem;
    justify-content: center;
    margin-bottom: 0.75rem;
    text-align: left;
}

.game-stats dt {
    font-weight: 700;
}

/* The two control explanations: one for touch screens, one for mouse and keyboard */
.only-touch {
    display: none;
}

@media (pointer: coarse) {
    .only-touch {
        display: block;
    }

    .only-mouse {
        display: none;
    }
}

/* The result sits at the bottom, so the poured beer stays visible above it */
#result {
    top: auto;
    bottom: max(1rem, env(safe-area-inset-bottom));
    transform: translateX(-50%);
}

/* Rows that only appear when they have something to say */
#row-fill[hidden] + dd,
#row-spilled[hidden] + dd {
    display: none;
}
