:root {
    --bg: #f4efe6;
    --surface: #fffdf8;
    --fg: #5a5347;
    --accent: #a8b5a0;
    --track: #e4dccb;
    --font: Georgia, 'Times New Roman', serif;
    --radius: 12px;
}

* { box-sizing: border-box; }

/* position:fixed statt overflow:hidden allein — iOS ignoriert letzteres fürs Rubber-Banding */
html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    font-family: var(--font);
    color: var(--fg);
    background-color: var(--bg);
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    inset: 0;
    margin: 0;
}

.screen {
    width: 90%;
    max-width: 440px;
    max-height: 100%;
    overflow-y: auto;
    padding: 16px 0;
    text-align: center;
}

#logo {
    width: 72px;
    height: 72px;
    display: block;
    margin: 8px auto 0;
}

h1 { letter-spacing: 0.1em; }
.tagline { opacity: 0.7; }

.btn {
    font-family: var(--font);
    font-size: 1rem;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--surface);
    cursor: pointer;
    margin-top: 16px;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--fg); border: 1px solid var(--track); }

#hud {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 24px;
}

#mech-area { min-height: 200px; display: flex; align-items: center; justify-content: center; }
.mech { width: 100%; }

.bar {
    width: 100%;
    height: 20px;
    background: var(--track);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 20px 0;
}
.bar-fill {
    height: 100%;
    width: 0;
    background: var(--accent);
}

.status-text { min-height: 1.4em; font-size: 0.9rem; opacity: 0.75; }

#session-list { list-style: none; padding: 0; font-size: 0.9rem; }
#session-list li { margin: 4px 0; }

.spinner {
    width: 48px;
    height: 48px;
    margin: 20px auto;
    border: 5px solid var(--track);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.dh-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.dh-box {
    background: var(--surface);
    color: var(--fg);
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 360px;
    text-align: center;
}

.dh-terms {
    height: 140px;
    overflow-y: auto;
    text-align: left;
    font-size: 0.8rem;
    border: 1px solid var(--track);
    padding: 8px;
    margin: 12px 0;
}

body.bsod {
    background: #0f6cbd;
    color: #fff;
    font-family: 'Segoe UI', system-ui, sans-serif;
}
body.bsod .status-text { color: #fff; opacity: 0.9; }
.bsod-face { font-size: 5rem; text-align: left; }

body.crt {
    background: #000;
    color: #33ff33;
    font-family: 'Courier New', monospace;
}
.boot-log {
    text-align: left;
    color: #33ff33;
    font-family: 'Courier New', monospace;
    min-height: 6em;
    margin: 0;
}
.cursor {
    display: inline-block;
    color: #33ff33;
    animation: blink 0.8s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.presence-hint { font-style: italic; opacity: 0.8; }

.shake { animation: shake 0.4s; }
@keyframes shake {
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.breathe-circle {
    width: 100px;
    height: 100px;
    margin: 20px auto;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.8;
    animation: breathe 8s ease-in-out infinite;
}
@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.6); }
}
.breathe-label { font-style: italic; }

#nickname {
    font-family: var(--font);
    font-size: 1rem;
    padding: 8px;
    border: 1px solid var(--track);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--fg);
}

#leaderboard-list {
    text-align: left;
    font-size: 0.9rem;
    max-height: 200px;
    overflow-y: auto;
    padding-left: 2.5em;
}
#leaderboard-list .me { font-weight: bold; color: var(--accent); }
