:root {
    --gold: #ffd700;
    --gold-dark: #b89c00;
    --bg-base: #0a0a10;
    --panel-bg: #14141e;
    --border-color: #4a4a5a;
    --text-main: #d1d5d8;
    --text-muted: #888;

    /* PoE Rarity Colors */
    --color-normal: #c8c8c8;
    --color-magic: #8888ff;

    /* Stats */
    --int-color: #3388ff;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    color: var(--text-main);
    margin: 0;
    padding: 0;
    background-color: var(--bg-base);

    /* REINES CSS PIXEL-GITTER (Ersetzt das Hintergrundbild) */
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 2px, transparent 2px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 2px, transparent 2px);
    background-size: 32px 32px;
    background-position: center center;

    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Alle Überschriften & Retro-Texte */
h1, h2, h3, .pixel-font, .logo, .btn {
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
}

/* HEADER & LOGIN BAR */
header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 40px;
    background: #050508;
    border-bottom: 4px solid #1a1a24;
    /* Harter Pixel-Schatten */
    box-shadow: 0 8px 0px rgba(0,0,0,0.5);
    z-index: 100;
}

.logo {
    color: var(--gold);
    font-size: 24px;
    /* Blockiger Text-Schatten */
    text-shadow: 4px 4px 0 #000;
    letter-spacing: 2px;
}

#loginForm { display: flex; gap: 10px; align-items: center; }

input {
    background: #000;
    border: 2px solid var(--border-color);
    color: white;
    padding: 10px 15px;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    outline: none;
}
input:focus { border-color: var(--gold); }

/* RETRO BUTTONS */
.btn {
    background: var(--border-color);
    border: 2px solid #fff;
    border-right-color: #111;
    border-bottom-color: #111;
    color: #fff;
    padding: 10px 20px;
    font-size: 10px;
    cursor: pointer;
    text-shadow: 2px 2px 0 #000;
}
.btn:active {
    border: 2px solid #111;
    border-right-color: #fff;
    border-bottom-color: #fff;
    padding: 12px 18px 8px 22px; /* Text verschiebt sich nach unten rechts */
}

.btn-play {
    background: var(--gold-dark);
    color: #fff;
    font-size: 14px;
    padding: 15px;
    margin-top: 15px;
    border: 2px solid #fff;
    border-right-color: #554400;
    border-bottom-color: #554400;
}
.btn-play:hover { background: var(--gold); color: #000; text-shadow: none; }

/* MAIN CONTENT */
.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.hero { text-align: center; margin-bottom: 40px; }
.hero h1 {
    font-size: 32px;
    color: #fff;
    margin-bottom: 15px;
    text-shadow: 6px 6px 0 #000;
}
.hero p {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.8;
}

/* CHARACTER CARD */
.class-card {
    background: var(--panel-bg);
    border: 4px solid var(--border-color);
    padding: 30px;
    width: 450px;
    display: flex; flex-direction: column; align-items: center;
    /* Harter Pixel-Schatten */
    box-shadow: 12px 12px 0px #000;
}

.class-title {
    font-size: 20px;
    color: var(--int-color);
    margin-top: 0;
    margin-bottom: 25px;
    text-shadow: 3px 3px 0 #000;
}

/* ATTRIBUTES */
.attr-box {
    display: flex;
    width: 100%;
    justify-content: space-around; /* Bessere Verteilung für 4 Elemente */
    margin-bottom: 25px;
    background: #050508;
    padding: 15px;
    border: 2px solid #222;
}
.attr { display: flex; flex-direction: column; align-items: center; font-weight: bold; font-size: 24px; }
.attr span { font-family: 'Press Start 2P', cursive; font-size: 8px; color: #666; margin-top: 8px; }
.attr-str { color: #888; } /* Grau, da Magier Int braucht */
.attr-dex { color: #888; }
.attr-int { color: var(--int-color); text-shadow: 2px 2px 0 #000;}
.attr-vit { color: #ffaa55; text-shadow: 2px 2px 0 #000; }

/* POE ITEM TOOLTIP (Retro Style) */
.poe-tooltip {
    width: 100%;
    background: #050508;
    border: 2px solid var(--color-normal);
    margin-bottom: 20px;
}
.tooltip-header { text-align: center; padding: 10px; background: rgba(255,255,255,0.05); }
.poe-normal .tooltip-header { color: var(--color-normal); }
.tooltip-name { font-family: 'Press Start 2P', cursive; font-size: 12px; line-height: 1.6; }
.tooltip-type { font-size: 12px; color: #888; margin-top: 5px; }

.separator { height: 2px; background: #333; margin: 0; }

.tooltip-body { padding: 15px; font-size: 14px; }
.stat-line { display: flex; justify-content: space-between; margin-bottom: 5px; }
.stat-label { color: #aaa; }
.stat-value { color: #fff; font-weight: bold; }

/* MODAL / FEHLERMELDUNGEN */
#error-message {
    position: fixed; top: 90px; left: 50%; transform: translateX(-50%); z-index: 99999;
    background-color: #000; padding: 15px 25px; font-family: 'Press Start 2P', cursive; font-size: 10px;
    text-align: center; border: 4px solid white; display: none; box-shadow: 8px 8px 0 #000;
}
#error-message.state-error { border-color: #ff4d4d; color: #ff4d4d; }
#error-message.state-loading { border-color: var(--gold); color: var(--gold); }
#error-message.state-success { border-color: #33ff33; color: #33ff33; }

#registerModal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 2000;
    align-items: center; justify-content: center;
}
.modal-box {
    background: var(--panel-bg);
    border: 4px solid var(--gold);
    width: 450px;
    padding: 30px;
    position: relative;
    box-shadow: 15px 15px 0 #000;
}
.modal-box h2 { color: var(--gold); text-align: center; margin-top: 0; font-size: 16px; margin-bottom: 25px; text-shadow: 3px 3px 0 #000;}
.form-group { margin-bottom: 20px; }
.form-group label { display: block; color: var(--text-muted); font-family: 'Press Start 2P', cursive; font-size: 8px; margin-bottom: 10px; }
.form-group input { width: 100%; }
.close-btn {
    position: absolute; top: -20px; right: -20px;
    background: #000; border: 4px solid var(--border-color); color: #fff;
    width: 40px; height: 40px; font-family: 'Press Start 2P', cursive; font-size: 16px; cursor: pointer;
    display: flex; justify-content: center; align-items: center;
}
.close-btn:hover { border-color: var(--gold); color: var(--gold); }
