/* 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: #1e2329;    /* #11161d + 6 % Weiß, wie die Karten der Vereinsseite */
    --line: #33373d;         /* entspricht Weiß 12 % auf dunklem Grund */
    --accent: #C00000;       /* Wölfe-Rot */
    --accent-hover: #a00000;
    --accent-dark: #8a0000;
    --link: #FF4D4D;         /* helleres Rot für Text auf dunklem Grund */
    --ice: #eaf4fb;
    --text: #ffffff;
    --muted: rgba(255, 255, 255, .7);
    --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 {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 14px;
}
/* Rote „Bandenlinie“ unter dem Kopf */
.menu-head::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent) 0 62%, transparent 62% 64%, var(--accent) 64% 70%, transparent 70% 72%, var(--accent) 72% 76%, transparent 76%);
}
.menu-logo { width: 84px; height: auto; flex: none; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .6)); }
.kicker {
    margin: 0 0 2px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--link);
}
h1 { margin: 0; font-size: 1.9rem; letter-spacing: .5px; line-height: 1.05; }
.menu-head h1 {
    font-size: 2.3rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transform: skewX(-8deg);
    transform-origin: left bottom;
    text-shadow: 3px 3px 0 var(--accent-dark);
}
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }

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

.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;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
}
.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: .78rem;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    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 8px;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    transition: background .15s;
}
.segmented button small { font-weight: 400; font-size: .75rem; color: var(--muted); }
/* Stärke als Pfoten-Punkte: 1, 2, 3 */
.segmented button::after {
    content: "";
    width: 30px;
    height: 6px;
    margin-top: 4px;
    background: radial-gradient(circle, currentColor 2.5px, transparent 3px) left center / 10px 6px repeat-x;
    opacity: .35;
}
.segmented [data-value="welpe"]::after { width: 10px; }
.segmented [data-value="jungwolf"]::after { width: 20px; }
.segmented button[aria-checked="true"] {
    background: var(--accent);
    box-shadow: 0 4px 12px rgba(192, 0, 0, .35);
}
.segmented button[aria-checked="true"]::after { opacity: .9; }
.segmented button[aria-checked="true"] small { color: rgba(255, 255, 255, .85); }

.cards {
    flex: 1 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(150px, 1fr);
    gap: 10px;
    max-height: 560px;
}
.card {
    --tint: 192, 0, 0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 4px;
    padding: 14px;
    background:
        radial-gradient(circle at 100% 0%, rgba(var(--tint), .28), transparent 60%),
        var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
    transition: transform .1s, border-color .15s;
}
/* Bullykreis als Deko in der Ecke */
.card::after {
    content: "";
    position: absolute;
    right: -38px;
    top: -38px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid rgba(var(--tint), .35);
    box-shadow: inset 0 0 0 26px transparent, 0 0 0 14px rgba(var(--tint), .06);
    pointer-events: none;
}
.card:not(:disabled):hover { border-color: rgba(var(--tint), .9); }
.card:not(:disabled):active { transform: scale(.97); }
.card:disabled { opacity: .5; cursor: default; }
.card-title { font-weight: 700; font-size: 1.25rem; margin-top: auto; }
.card-text { font-size: .85rem; color: var(--muted); line-height: 1.3; }
.card-icon { width: 44px; height: 44px; display: block; }
.card .card-icon {
    width: 58px;
    height: 58px;
    padding: 8px;
    border-radius: 16px;
    background: rgba(var(--tint), .16);
    border: 1px solid rgba(var(--tint), .35);
}
.card-icon.big { width: 64px; height: 64px; }
.card-icon svg { width: 100%; height: 100%; display: block; }
.card-best {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px 3px 7px;
    border-radius: 999px;
    background: rgba(192, 0, 0, .18);
    border: 1px solid rgba(192, 0, 0, .55);
    color: var(--text);
    font-size: .75rem;
    font-weight: 700;
}
.card-best[hidden] { display: none; }
/* kleiner Pokal */
.card-best::before, .record::before {
    content: "";
    width: 12px;
    height: 12px;
    background: var(--link);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 3h12v3h3v2a5 5 0 0 1-5 5h-.3A5 5 0 0 1 13 15.9V19h4v2H7v-2h4v-3.1A5 5 0 0 1 8.3 13H8a5 5 0 0 1-5-5V6h3zm0 5V8H5a3 3 0 0 0 1 2.2zm12 0v2.2A3 3 0 0 0 19 8z'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 3h12v3h3v2a5 5 0 0 1-5 5h-.3A5 5 0 0 1 13 15.9V19h4v2H7v-2h4v-3.1A5 5 0 0 1 8.3 13H8a5 5 0 0 1-5-5V6h3zm0 5V8H5a3 3 0 0 0 1 2.2zm12 0v2.2A3 3 0 0 0 19 8z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.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);
}
#btn-sound { flex-direction: row; gap: 8px; }
#btn-sound svg { display: block; }
#btn-sound[aria-pressed="false"] { color: var(--muted); }

/* Niedrige Handys: kompakter, damit möglichst viel ohne Scrollen passt */
@media (max-height: 700px) {
    .menu-logo { width: 68px; }
    .menu-head h1 { font-size: 2rem; }
    .mascot-row { margin-top: 8px; }
    .mascot-row .mascot { width: 64px; height: 64px; }
    .label { margin: 10px 0 6px; }
    .cards { grid-auto-rows: minmax(132px, 1fr); }
    .card .card-icon { width: 48px; height: 48px; padding: 6px; }
}

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

.btn-primary, .btn-secondary, .btn-ghost {
    border-radius: 16px;
    padding: 15px 18px;
    font-weight: 700;
    font-size: 1.2rem;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: transform .1s, background .15s, border-color .15s;
}
.btn-primary {
    background: var(--accent);
    box-shadow: 0 6px 18px rgba(192, 0, 0, .3);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-dark); }
.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: .82rem; opacity: .85; }

.btn-back {
    align-self: flex-start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    font-size: .95rem;
    padding: 7px 14px 7px 10px;
}
.btn-back:active { transform: scale(.97); }

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

.mode-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 14px 0 12px;
}
.mode-head .card-icon {
    width: 72px;
    height: 72px;
    padding: 10px;
    border-radius: 20px;
    background: rgba(192, 0, 0, .16);
    border: 1px solid rgba(192, 0, 0, .4);
    flex: none;
}
.mode-head h1 {
    font-size: 2.1rem;
    text-transform: uppercase;
    transform: skewX(-8deg);
    transform-origin: left bottom;
    text-shadow: 3px 3px 0 var(--accent-dark);
}
.mode-level {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: .8rem;
    color: var(--muted);
}
.howto {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 4px 16px;
    line-height: 1.45;
}
.howto h3 {
    margin: 12px 0 4px;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    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;
}
.record {
    align-self: center;
    margin: 14px 0 0;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(192, 0, 0, .18);
    border: 1px solid rgba(192, 0, 0, .55);
    color: var(--text);
    font-size: .9rem;
    font-weight: 700;
    text-align: center;
}
.record[hidden] { display: none; }
.record::before { display: inline-block; vertical-align: -1px; margin-right: 6px; }
/* Start-Knöpfe unten – dort, wo der Daumen ist */
.mode-buttons {
    display: grid;
    gap: 10px;
    margin-top: auto;
    padding-top: 16px;
}

/* ---------- 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.3rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: center;
    padding: 3px 14px;
    border-radius: 10px;
    background: var(--primary);
    border: 1px solid var(--line);
    box-shadow: inset 0 -2px 0 var(--accent);
}
.hud-center:empty { visibility: hidden; }
.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; }
}
