/* ==========================================================================
   TIDEFALL - MAIN STYLESHEET
   Die visuelle Grundbasis für das Bruchwatt
   ========================================================================== */

/* --- Farbpalette (Das Nordsee-Theme) --- */
:root {
    --color-bg-dark: #0f1115;       /* Tiefe See / Nacht */
    --color-text-main: #e2e8f0;     /* Heller Nebel */
    --color-primary: #d97736;       /* Rost / Bernstein */
    --color-primary-hover: #b85e26; /* Dunkler Rost */
    --color-secondary: #2c3e50;     /* Stahl / Sturmblau */
    --color-secondary-hover: #1a252f;
    --color-health: #e74c3c;        /* Lebenspunkte */
    --color-armor: #f1c40f;         /* Friesennerz-Gelb */
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* --- Basis-Reset & App-Feeling --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    /* Verhindert versehentliches Markieren von Text beim Klicken/Tippen */
    user-select: none; 
    -webkit-user-select: none;
    /* Verhindert das blaue Aufleuchten beim Tippen auf Smartphones */
    -webkit-tap-highlight-color: transparent; 
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden; /* Kein Scrollen erlaubt! */
    background-color: var(--color-bg-dark);
    color: var(--color-text-main);
    font-family: var(--font-main);
}

/* --- Die Layer-Architektur --- */

/* Hier läuft später die 3D/2D Engine */
#game-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Unterste Ebene */
    background: radial-gradient(circle, #2c3e50 0%, #0f1115 100%); /* Platzhalter-Hintergrund */
}

/* Das UI-Overlay (Menüs, HUD) */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10; /* Über dem Spiel */
    pointer-events: none; /* Klicks gehen durchs UI hindurch ins Spiel... */
}

/* ...außer bei aktiven UI-Screens, hier fangen wir die Klicks ab */
.ui-screen {
    pointer-events: auto; 
    display: none; /* Standardmäßig ausgeblendet */
    width: 100%;
    height: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Aktiv-Klasse zum Einblenden von Menüs */
.ui-screen.active {
    display: flex;
}

/* --- Hauptmenü Styling --- */
#main-menu {
    background: rgba(15, 17, 21, 0.85); /* Leicht transparenter Nebel */
    backdrop-filter: blur(5px); /* Eleganter Unschärfe-Effekt */
}

#main-menu h1 {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 0.2rem;
    color: var(--color-text-main);
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

#main-menu .subtitle {
    font-size: 1.2rem;
    color: var(--color-primary);
    letter-spacing: 0.1rem;
    margin-bottom: 3rem;
    text-transform: uppercase;
}

/* --- Maritime Buttons --- */
.menu-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 300px;
}

button {
    font-family: var(--font-main);
    font-size: 1.2rem;
    font-weight: bold;
    padding: 1rem 2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.1s ease-in-out;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Der gewaltige DROP-Button */
.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
    font-size: 1.5rem;
    border-bottom: 4px solid var(--color-primary-hover);
}

.btn-primary:active {
    transform: translateY(4px);
    border-bottom: 0px solid var(--color-primary-hover);
}

/* Der Perspektiven-Toggle */
.btn-secondary {
    background-color: var(--color-secondary);
    color: #fff;
    border-bottom: 4px solid var(--color-secondary-hover);
}

.btn-secondary:active {
    transform: translateY(4px);
    border-bottom: 0px solid var(--color-secondary-hover);
}

/* ==========================================================================
   IN-GAME HUD (Heads-Up Display)
   ========================================================================== */

#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none; /* Wird erst aktiv, wenn das Spiel startet */
    pointer-events: none; /* Klicks gehen durch ins Spiel */
    padding: 20px;
}

#hud.active {
    display: flex;
    justify-content: space-between;
    flex-direction: column;
}

/* NEU: Das Fadenkreuz (Zentriert) */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Exakte Zentrierung */
    width: 6px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%; /* Runder Punkt */
    border: 1px solid rgba(0, 0, 0, 0.5); /* Leichter Kontur-Rand für Sichtbarkeit auf hellen Texturen */
    z-index: 50; /* Ganz vorne */
}

/* Ein kleiner Schweifeffekt um das Fadenkreuz */
#crosshair::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 12px;
    height: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

/* Obere Leiste (Naturgewalten & Radar) */
.hud-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.compass-container {
    background: rgba(15, 17, 21, 0.7);
    padding: 10px 20px;
    border-radius: 4px;
    border-top: 2px solid var(--color-secondary);
    font-weight: bold;
    letter-spacing: 0.1rem;
}

.minimap {
    width: 150px;
    height: 150px;
    background: rgba(15, 17, 21, 0.7);
    border-radius: 50%; /* Runde Minimap */
    border: 2px solid var(--color-secondary);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

/* Untere Leiste (Überleben & Arsenal) */
.hud-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
}

/* Überlebens-Anzeige (Links) */
.survival-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 250px;
}

.stat-bar-container {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #333;
    border-radius: 4px;
    height: 25px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.stat-bar {
    height: 100%;
    width: 100%; /* Später dynamisch per JS */
    transition: width 0.2s ease-out;
}

.health-bar { background-color: var(--color-health); }
.armor-bar { background-color: var(--color-armor); width: 50%; /* Start-Wert */ }

.stat-label {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    text-shadow: 1px 1px 2px #000;
}

/* Waffen-Arsenal (Rechts) */
.weapon-slots {
    display: flex;
    gap: 10px;
}

.weapon-slot {
    width: 60px;
    height: 60px;
    background: rgba(15, 17, 21, 0.8);
    border: 2px solid #333;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    transition: all 0.1s;
}

.weapon-slot.active {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary);
    transform: translateY(-5px);
}