/* ============================================================
   Familie Pilz on tour · Nordkap 2026 · nordkap.familiepilz.at
   Single-Screen-Wizard, horizontal, kein Seiten-Scroll
   ============================================================ */

:root {
    --ink:      #14181d;
    --ink-2:    #1d242d;
    --ink-3:    #2a323d;
    --paper:    #f2ede2;
    --paper-2:  #e6dfd0;
    --red:      #c8102e;
    --red-2:    #e6304f;
    --sun:      #f6b47a;
    --line:     rgba(242, 237, 226, 0.14);
    --shadow:   0 10px 30px rgba(0, 0, 0, 0.35);
    --radius:   16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
    margin: 0;
    background:
        radial-gradient(ellipse 90% 50% at 50% -10%, #2e3a49 0%, transparent 60%),
        var(--ink);
    color: var(--paper);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.app {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

h1, h2, h3, h4 { font-weight: 900; line-height: 1.15; margin: 0 0 0.4em; }
a { color: var(--red-2); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 999px;
    border: 2px solid transparent;
    font-weight: 800;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}
.btn:active { transform: scale(0.96); }
.btn-red   { background: var(--red); color: #fff; box-shadow: 0 5px 16px rgba(200, 16, 46, 0.45); }
.btn-red:hover { background: var(--red-2); }
.btn-ghost { background: transparent; color: var(--paper); border-color: var(--paper); }
.btn-ghost:hover { background: rgba(242, 237, 226, 0.12); }
.btn-small { padding: 8px 13px; font-size: 0.85rem; }
.btn-big   { width: 100%; padding: 15px; font-size: 1.05rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Topbar ---------- */
.topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    background: var(--ink-2);
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.topbar-badge {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5));
}
.topbar-text { flex: 1; min-width: 0; line-height: 1.25; }
.topbar-text strong { display: block; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-text small { color: var(--paper-2); font-size: 0.72rem; }
.lang-select {
    background: var(--paper);
    color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: 999px;
    font-weight: 900;
    font-size: 0.85rem;
    padding: 6px 10px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
}

/* ---------- Wizard-Rahmen ---------- */
.wiz-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    padding: 10px 12px 6px;
}

.stepper {
    display: flex;
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    gap: 4px;
    flex-shrink: 0;
}
.stepper li { flex: 1; text-align: center; position: relative; color: var(--paper-2); opacity: 0.5; }
.stepper li.active, .stepper li.done { opacity: 1; }
.stepper li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 14px;
    left: calc(50% + 20px);
    right: calc(-50% + 20px);
    height: 3px;
    border-radius: 2px;
    background: var(--ink-3);
}
.stepper li.done:not(:last-child)::after { background: var(--red); }
.step-dot {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    margin: 0 auto 3px;
    border-radius: 50%;
    background: var(--ink-3);
    font-weight: 900;
    font-size: 0.85rem;
    position: relative;
}
.stepper li.active .step-dot { background: var(--red); color: #fff; box-shadow: 0 3px 12px rgba(200,16,46,0.5); }
.stepper li.done .step-dot { background: var(--ink); border: 2px solid var(--red); color: var(--red-2); font-size: 0; }
.stepper li.done .step-dot::before { content: "✓"; font-size: 0.9rem; }
.step-label { font-size: 0.7rem; font-weight: 700; }

/* ---------- Horizontaler Slider ---------- */
.wiz-viewport {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--ink-2);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.wiz-track {
    display: flex;
    width: 600%;
    height: 100%;
    margin: 0;
    transform: translateX(calc(var(--wstep, 0) * -16.6667%));
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.3, 1);
}
.wiz-panel {
    width: 16.6667%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 14px 16px 12px;
    min-width: 0;
}
.panel-scroll { flex: 1; min-height: 0; overflow-y: auto; padding-right: 4px; }
.wiz-panel h3 { color: var(--sun); font-size: 1.1rem; }
.panel-lead { color: var(--paper-2); font-size: 0.88rem; margin: 0 0 14px; }
.wiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
    flex-shrink: 0;
}

/* ---------- Spiel ---------- */
.game-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-shrink: 0; }
.game-head h3 { margin: 0; font-size: 1rem; color: var(--sun); }
.game-instructions { margin: 2px 0 6px; font-size: 0.78rem; color: var(--paper-2); }
.game-head-btns { display: flex; gap: 6px; flex-shrink: 0; }
.game-hud {
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    font-size: 0.88rem;
    padding: 6px 10px;
    background: var(--ink);
    border-radius: 9px;
    margin-bottom: 8px;
    min-height: 20px;
    flex-shrink: 0;
}
#hudMid { color: var(--sun); }
.game-stage { position: relative; flex: 1; min-height: 160px; }
#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--ink);
    border-radius: 10px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
.game-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(16, 21, 27, 0.86);
    backdrop-filter: blur(3px);
    border-radius: 10px;
    z-index: 5;
    padding: 10px;
    overflow-y: auto;
}
.game-overlay[hidden] { display: none; }
.overlay-card { text-align: center; max-width: 400px; width: 100%; }
.overlay-emoji { font-size: 2.4rem; margin-bottom: 2px; }
.overlay-card h4 { font-size: 1.15rem; margin-bottom: 4px; color: var(--sun); }
.overlay-card p { color: var(--paper-2); margin: 0 0 10px; font-size: 0.85rem; }
.overlay-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- Highscores ---------- */
.hs-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    margin: 0 0 12px;
    text-align: left;
}
.hs-save { display: flex; gap: 6px; margin-bottom: 8px; }
.hs-save input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    font-size: 0.9rem;
    color: var(--paper);
    background: var(--ink);
    border: 1.5px solid var(--line);
    border-radius: 8px;
    outline: none;
    font-family: inherit;
}
.hs-save input:focus { border-color: var(--red-2); }
.hs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 128px;
    overflow-y: auto;
    font-size: 0.82rem;
}
.hs-list li { display: flex; gap: 8px; padding: 2px 0; align-items: baseline; }
.hs-rank { width: 26px; flex-shrink: 0; text-align: center; }
.hs-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-pts { font-weight: 800; color: var(--sun); }
.hs-empty { color: var(--paper-2); font-style: italic; }

/* ---------- Formular ---------- */
#photoForm label { display: block; margin-bottom: 11px; font-weight: 700; font-size: 0.85rem; }
#photoForm input[type="text"],
#photoForm input[type="email"],
#photoForm textarea {
    width: 100%;
    margin-top: 4px;
    padding: 11px 12px;
    font-size: 1rem;
    color: var(--paper);
    background: var(--ink);
    border: 1.5px solid var(--line);
    border-radius: 9px;
    outline: none;
    font-family: inherit;
}
#photoForm input:focus, #photoForm textarea:focus { border-color: var(--red-2); }
#photoForm input.invalid, #photoForm textarea.invalid { border-color: var(--red-2); background: rgba(200,16,46,0.08); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid-3 { display: grid; grid-template-columns: 0.8fr 1.2fr 1fr; gap: 0 12px; }

.file-label input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop {
    margin-top: 5px;
    border: 2px dashed var(--line);
    border-radius: 11px;
    padding: 20px 14px;
    text-align: center;
    color: var(--paper-2);
    cursor: pointer;
    transition: border-color 0.15s ease;
}
.file-drop:hover, .file-drop.drag { border-color: var(--red-2); background: rgba(200,16,46,0.06); }
.file-drop.invalid { border-color: var(--red-2); }
.file-drop.has-file { border-style: solid; border-color: var(--sun); }
.file-drop img { display: block; max-width: 100%; max-height: 150px; margin: 10px auto 0; border-radius: 9px; }

.consent { display: flex; gap: 9px; align-items: flex-start; font-weight: 400 !important; font-size: 0.75rem !important; color: var(--paper-2); }
.consent input { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--red); flex-shrink: 0; }

.form-error {
    margin: 10px 0 0;
    padding: 10px 12px;
    background: rgba(200, 16, 46, 0.15);
    border: 1px solid var(--red);
    border-radius: 9px;
    font-weight: 600;
    font-size: 0.85rem;
}

.recap {
    display: flex;
    gap: 13px;
    align-items: center;
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 11px;
    margin-bottom: 12px;
}
.recap img { width: 74px; height: 74px; object-fit: cover; border-radius: 9px; flex-shrink: 0; }
.recap div { font-size: 0.87rem; line-height: 1.45; color: var(--paper-2); min-width: 0; }
.recap strong { color: var(--paper); }

.form-success { display: grid; place-items: center; text-align: center; }
.form-success h3 { color: var(--sun); font-size: 1.3rem; }
.form-success p { color: var(--paper-2); max-width: 430px; font-size: 0.92rem; }
.lock-emoji { font-size: 2.6rem; margin-bottom: 4px; }

.hp { position: absolute; left: -9999px; top: -9999px; }

/* ---------- Fußzeile ---------- */
.minibar {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 14px;
    font-size: 0.7rem;
    color: var(--paper-2);
    border-top: 1px solid var(--line);
    flex-shrink: 0;
}
.minibar a { color: var(--paper-2); }

/* ---------- Bestätigungs- & Rechtsseiten (eigene Seiten, scrollbar) ---------- */
.page-confirm { display: grid; min-height: 100vh; place-items: center; padding: 20px; overflow: auto; }
.confirm-wrap { width: 100%; max-width: 520px; }
.confirm-card {
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    padding: 38px 24px;
}
.confirm-badge { width: 140px; aspect-ratio: 1/1; object-fit: cover; border-radius: 50%; margin-bottom: 16px; filter: drop-shadow(0 10px 24px rgba(0,0,0,0.5)); }
.confirm-card h1 { font-size: 1.5rem; color: var(--sun); }
.confirm-card p { color: var(--paper-2); margin-bottom: 24px; }

.legal { max-width: 720px; margin: 0 auto; padding: 50px 20px; }
.legal h1 { color: var(--sun); }
.legal h2 { font-size: 1.05rem; margin-top: 1.8em; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 0; }
    .topbar-text small { display: none; }
    .step-label { font-size: 0.62rem; }
    .game-instructions { display: none; }
    .wiz-main { padding: 8px 8px 4px; }
    .wiz-panel { padding: 11px 12px 10px; }
}
@media (max-height: 620px) {
    .stepper { margin-bottom: 6px; }
    .step-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}


/* ---------- Intro-Schritt ---------- */
.intro { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.intro-badge {
    width: clamp(90px, 16vh, 150px);
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 50%;
    filter: drop-shadow(0 8px 22px rgba(0,0,0,0.55));
    margin-bottom: 8px;
}
.hero-kicker {
    display: inline-block;
    margin: 4px 0 6px;
    padding: 4px 12px;
    border: 1.5px dashed var(--red-2);
    border-radius: 999px;
    color: var(--red-2);
    font-weight: 800;
    font-size: 0.7rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}
.intro-title { font-size: clamp(1.4rem, 4.5vw, 2rem); text-transform: uppercase; letter-spacing: 1px; color: var(--paper); margin-bottom: 6px; }
.intro-sub { color: var(--paper-2); font-size: 0.9rem; max-width: 560px; margin: 0 0 12px; }
.intro-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 520px;
    text-align: left;
    font-size: 0.88rem;
}
.intro-list li { padding: 4px 0; }
@media (max-height: 640px) {
    .intro-sub { display: none; }
    .intro-badge { width: 76px; }
}


/* ---------- Intro: 1-2-3-4 kompakt ---------- */
.intro-steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 6px 0 0;
    padding: 0;
    width: 100%;
    max-width: 560px;
}
.intro-steps li {
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 6px;
    text-align: center;
}
.istep-num {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin: 0 auto 7px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-weight: 900;
    font-size: 0.95rem;
}
.istep-label { display: block; font-size: 0.82rem; font-weight: 700; line-height: 1.3; }
@media (max-width: 560px) {
    .intro-steps { grid-template-columns: repeat(2, 1fr); }
}
