/* --- BASIS & FARBEN --- */
:root {
    --bg: #0a0b14;
    --card: #151726;
    --p1: #00e5ff;
    --p2: #ff006e;
    --accent: #39ff14;
    --border: #2a2e45;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body, html { 
    margin: 0; 
    padding: 0; 
    height: 100vh; 
    width: 100vw;
    background: var(--bg); 
    color: white; 
    font-family: 'Segoe UI', Roboto, sans-serif; 
    overflow: hidden; /* Verhindert Scrollen an der Tafel */
}

.hidden { display: none !important; }

/* --- NAVIGATION --- */
.screen { 
    position: relative;
    height: 100%; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
}

/* Der Button oben links */
.top-left-back {
    position: absolute;
    top: 25px;
    left: 25px;
    color: #5c6285;
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
    border: 1px solid var(--border);
    padding: 12px 22px;
    border-radius: 12px;
    background: rgba(21, 23, 38, 0.8);
    transition: all 0.2s ease;
    z-index: 1001;
}

.top-left-back:hover {
    color: white;
    border-color: var(--p1);
    background: var(--card);
    transform: scale(1.05);
}

/* --- MENÜ (STARTSEITE) --- */
.menu-box { 
    background: var(--card); 
    padding: 40px; 
    border-radius: 35px; 
    border: 2px solid var(--border); 
    text-align: center; 
    width: 90%; 
    max-width: 580px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

h1 { 
    font-size: 2.8rem; 
    letter-spacing: 6px; 
    margin: 0 0 30px 0; 
    background: linear-gradient(to right, var(--p1), var(--p2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.opt-group { margin-bottom: 25px; }
.opt-group span { 
    display: block; 
    margin-bottom: 12px; 
    color: #5c6285; 
    text-transform: uppercase; 
    font-size: 0.9rem; 
    letter-spacing: 2px;
}

.btn-row { display: flex; gap: 12px; justify-content: center; }

/* Menü-Buttons */
.op-btn, .diff-btn { 
    border: none; 
    border-radius: 12px; 
    background: #2a2e45; 
    color: white; 
    font-size: 1.3rem; 
    cursor: pointer; 
    padding: 14px 24px; 
    transition: 0.2s; 
}

button.active { 
    background: var(--p1); 
    color: black; 
    font-weight: bold; 
    box-shadow: 0 0 15px var(--p1);
}

.start-btn { 
    background: var(--accent); 
    color: black; 
    font-size: 2rem; 
    font-weight: bold; 
    width: 100%; 
    margin-top: 20px; 
    padding: 18px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: 0.2s;
}

.start-btn:hover { 
    filter: brightness(1.2); 
    transform: translateY(-2px);
}

/* --- SPIELFELD --- */

/* Seil Bereich (Oben) */
.rope-area { 
    height: 12vh; 
    width: 100%; 
    position: relative; 
    display: flex; 
    align-items: center; 
}

.rope { 
    width: 85%; 
    height: 10px; 
    background: var(--border); 
    margin: 0 auto; 
    position: relative; 
    border-radius: 5px;
}

#marker { 
    position: absolute; 
    top: -50px; 
    font-size: 4.5rem; 
    transform: translateX(-50%); 
    transition: left 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28); 
}

.goal-label { position: absolute; top: 25px; font-weight: bold; font-size: 1rem; color: #5c6285; }
.left { left: 0; }
.right { right: 0; }

/* Arena (Mitte - Aufgaben) */
.arena { 
    flex: 1; 
    display: flex; 
    width: 100%; 
    align-items: center; 
}

.player-side { flex: 1; text-align: center; }

.task { 
    font-size: 9rem; 
    font-weight: 900; 
    margin: 0; 
    line-height: 1;
}

.p1 .task { color: var(--p1); text-shadow: 0 0 30px rgba(0, 210, 255, 0.2); }
.p2 .task { color: var(--p2); text-shadow: 0 0 30px rgba(255, 0, 110, 0.2); }

/* Eingabe Anzeige unter der Aufgabe */
.display { 
    font-size: 3.5rem; 
    height: 70px; 
    color: #fff; 
    font-family: 'Courier New', monospace; 
    margin-top: 10px;
    font-weight: bold;
    letter-spacing: 4px;
}

.vs-line { width: 2px; height: 35%; background: var(--border); }

/* Keypads (Unten - Ergonomisch für die Tafel) */
.controls { 
    height: 42vh; 
    width: 100%; 
    display: flex; 
    justify-content: space-around; 
    align-items: flex-end; 
    padding-bottom: 20px; 
}

.numpad { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 12px; 
    width: 300px; 
}

.numpad button { 
    height: 75px; 
    font-size: 2.2rem; 
    font-weight: bold;
    background: #1a1c2c; 
    border: 1px solid var(--border); 
    color: white;
    border-radius: 15px;
    cursor: pointer;
    transition: 0.1s;
}

.numpad button:active { background: #4ade80; color: black; }

.c-btn { background: #3d1421 !important; color: #ff4d8d !important; }
.ok-btn { background: #143d26 !important; color: #4dff91 !important; }

/* --- OVERLAY (GEWINNER-NACHRICHT) --- */
.overlay {
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.92);
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 2000;
}

.win-box { 
    background: var(--card); 
    padding: 60px; 
    border-radius: 40px; 
    border: 3px solid var(--border); 
    text-align: center;
    box-shadow: 0 0 100px rgba(0,0,0,0.8);
}

.win-box h2 { 
    font-size: 4.5rem; 
    margin: 0 0 40px 0; 
    letter-spacing: 5px; 
    font-weight: 900;
}