/* Wölfe-Cup – Stylesheet
 * Farben und Schrift wie auf www.esc-vilshofener-woelfe.de (dunkler Grund, Wölfe-Rot, Roboto).
 * Keine externen Ressourcen. */

@font-face {
    font-family: "Roboto";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../assets/fonts/roboto-latin-400-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Roboto";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../assets/fonts/roboto-latin-700-normal.woff2") format("woff2");
}

:root {
    --primary: #0A0F14;      /* fast schwarz */
    --surface: #11161d;
    --surface-2: #1a212b;
    --line: #2a3340;
    --accent: #C00000;       /* Wölfe-Rot */
    --accent-dark: #8a0000;
    --link: #FF4D4D;         /* helleres Rot für Text auf dunklem Grund */
    --ice: #eaf4fb;
    --text: #f2f4f7;
    --muted: #a9b3c1;
    --radius: 14px;
    --hud-h: 52px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--primary);
    color: var(--text);
    font-family: "Roboto", system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}

body { overflow: hidden; }

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

a { color: var(--link); }

#app {
    position: relative;
    height: 100vh;
    height: 100dvh;
    max-width: 560px;
    margin: 0 auto;
    background:
        radial-gradient(circle at 50% -10%, rgba(192, 0, 0, .25), transparent 55%),
        var(--primary);
    box-shadow: 0 0 60px rgba(0, 0, 0, .6);
}

/* Auf großen Bildschirmen: Rand in Vereinsfarben */
@media (min-width: 600px) {
    body {
        background:
            repeating-linear-gradient(135deg, rgba(192, 0, 0, .08) 0 40px, transparent 40px 80px),
            var(--primary);
    }
}

/* ---------- Bildschirme ---------- */

.screen {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    overflow-y: auto;
}
.screen.active { display: flex; }

/* ---------- Menü ---------- */

.menu-head {
    display: flex;
    align-items: center;
    gap: 14px;
}
.menu-logo { width: 72px; height: auto; flex: none; }
h1 { margin: 0; font-size: 1.9rem; letter-spacing: .5px; }
.subtitle { margin: 2px 0 0; color: var(--muted); font-size: .95rem; }

.mascot-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 6px;
}
.mascot { width: 96px; height: 96px; flex: none; }
.mascot svg { width: 100%; height: 100%; display: block; }

.bubble {
    position: relative;
    margin: 0;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 1.05rem;
    line-height: 1.35;
}
.bubble::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    margin-top: -8px;
    border: 8px solid transparent;
    border-left: 0;
    border-right-color: var(--line);
}

.label {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--muted);
    margin: 14px 0 8px;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 5px;
}
.segmented button {
    border: 0;
    background: transparent;
    border-radius: 10px;
    padding: 9px 4px;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.segmented button small { font-weight: 400; font-size: .75rem; color: var(--muted); }
.segmented button[aria-checked="true"] { background: var(--accent); }
.segmented button[aria-checked="true"] small { color: #ffd6d6; }

.cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 4px;
    padding: 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: transform .1s, border-color .15s;
}
.card:not(:disabled):hover { border-color: var(--accent); }
.card:not(:disabled):active { transform: scale(.97); }
.card:disabled { opacity: .5; cursor: default; }
.card-title { font-weight: 700; font-size: 1.15rem; }
.card-text { font-size: .85rem; color: var(--muted); line-height: 1.3; }
.card-icon { width: 44px; height: 44px; display: block; }
.card-icon.big { width: 64px; height: 64px; }
.card-icon svg { width: 100%; height: 100%; }
.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--line);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-foot {
    margin-top: auto;
    padding-top: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: .85rem;
    color: var(--muted);
}

/* ---------- Buttons ---------- */

.btn-primary, .btn-secondary, .btn-ghost {
    border-radius: var(--radius);
    padding: 14px 18px;
    font-weight: 700;
    font-size: 1.15rem;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: transform .1s, background .15s;
}
.btn-primary { background: var(--accent); }
.btn-primary:hover { background: #a00000; }
.btn-secondary { background: var(--surface-2); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-ghost {
    background: transparent;
    border-color: var(--line);
    font-size: .95rem;
    padding: 8px 16px;
}
.btn-primary:active, .btn-secondary:active, .btn-ghost:active { transform: scale(.97); }
.btn-primary small, .btn-secondary small { font-weight: 400; font-size: .8rem; opacity: .8; }

.btn-back {
    align-self: flex-start;
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 1rem;
    padding: 6px 0;
}

/* ---------- Modus-Auswahl ---------- */

.mode-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 10px 0 8px;
}
.howto {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 4px 16px;
    line-height: 1.45;
}
.howto h3 { margin: 12px 0 4px; font-size: 1rem; color: var(--link); }
.howto p { margin: 0 0 8px; }
.howto kbd {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0 5px;
    font-family: inherit;
    font-size: .85em;
}
.mode-buttons {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}
.record { text-align: center; color: var(--muted); min-height: 1.4em; }

/* ---------- Spiel ---------- */

#screen-game { padding: 0; overflow: hidden; }

.hud {
    height: var(--hud-h);
    margin-top: env(safe-area-inset-top);
    flex: none;
    display: grid;
    grid-template-columns: 44px 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    background: var(--surface);
    border-bottom: 2px solid var(--accent);
    font-weight: 700;
}
.hud-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    display: grid;
    place-items: center;
}
.hud-btn svg { fill: currentColor; }
.hud-left { text-align: left; font-size: .95rem; }
.hud-right { text-align: right; font-size: .95rem; }
.hud-center { font-size: 1.35rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hud .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
    border: 1px solid rgba(255, 255, 255, .6);
}
.hud small { display: block; font-weight: 400; font-size: .72rem; color: var(--muted); }

.stage {
    flex: 1;
    position: relative;
    display: grid;
    place-items: center;
    min-height: 0;
    padding-bottom: env(safe-area-inset-bottom);
}
#canvas {
    display: block;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

/* ---------- Overlay & Einblendung ---------- */

.overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(5, 8, 12, .75);
    backdrop-filter: blur(3px);
}
.overlay[hidden] { display: none; }
.dialog {
    width: 100%;
    max-width: 380px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-top: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
    animation: pop .25s ease-out;
}
.dialog .mascot { margin: -66px auto 4px; width: 110px; height: 110px; }
.dialog h2 { margin: 0 0 6px; font-size: 1.6rem; }
.dialog p { margin: 0 0 16px; color: var(--muted); line-height: 1.4; }
.dialog p strong { color: var(--text); }
.dialog-buttons { display: grid; gap: 10px; }

.flash {
    position: absolute;
    inset: var(--hud-h) 0 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.flash[hidden] { display: none; }
.flash .mascot { width: 130px; height: 130px; animation: jump .5s ease-in-out infinite alternate; }
.flash-text {
    font-size: 4rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 4px 0 var(--accent-dark), 0 0 24px rgba(0, 0, 0, .7);
    animation: pop .35s ease-out;
    text-align: center;
    line-height: 1.05;
}
.flash-text small { display: block; font-size: 1.3rem; text-shadow: 0 2px 6px rgba(0, 0, 0, .9); }
.flash.small .flash-text { font-size: 2.6rem; }

@keyframes pop {
    from { transform: scale(.6); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
@keyframes jump {
    from { transform: translateY(0); }
    to   { transform: translateY(-14px); }
}

/* ---------- Hochkant-Hinweis (nur Handys quer) ---------- */

.rotate-hint {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--primary);
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    padding: 16px;
}
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
    .rotate-hint { display: flex; }
}

.noscript { padding: 20px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
    .flash .mascot, .flash-text, .dialog { animation: none; }
}
