/* Background & layout */
:root{
    --bg:#050714;
    --panel:#071225;
    --neon-green:#39ff14;
    --teal:#00f5d4;
    --muted:#6b7785;
    --accent:#7c5cff;
}
html,body{height:100%;margin:0;background:
        linear-gradient(180deg,#050714 0%, #03040a 100%);
    color:var(--neon-green);font-family: "Courier New", monospace;
    -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
}

/* Container: left content + right map */
.wrap{
    display:flex;height:100vh;padding:28px;gap:20px;align-items:flex-start;
    box-sizing:border-box;
}

/* Left panel (game text + controls) */
.panel{
    flex:1;min-width:360px;max-width:980px;box-sizing:border-box;background:linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
    border:1px solid rgba(57,255,20,0.06);box-shadow:0 6px 30px rgba(7,18,37,0.6);
    padding:22px;border-radius:10px;backdrop-filter: blur(6px);

    display:flex;
    flex-direction:column;
    height:100%;
    min-height:0;
}
/* Add this inside the .panel definition (or after it) */
.panel {
    display: flex;
    flex-direction: column;
    /* keep existing rules … */
}


/* Keep the controls fixed to the bottom of the panel */
.controls {
    flex-shrink: 0;          /* never collapse */
    position: sticky;
    bottom: 0;
    background: var(--bg);   /* optional – give it the same background as the panel */
    padding-top: 8px;            /* a little breathing room */
}
header{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.logo {
    width:46px;height:46px;border-radius:8px;
    background:linear-gradient(135deg,var(--accent),var(--teal));
    display:flex;align-items:center;justify-content:center;font-weight:700;color:#021;
    box-shadow:0 6px 18px rgba(124,92,255,0.12), inset 0 -2px 6px rgba(0,0,0,0.3);
}
h1{font-size:18px;margin:0;color:var(--teal);letter-spacing:1px}

/* Terminal output */
#gameOutput{
    flex:1;
    min-height:0;
    overflow:auto;
    background:linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.15));
    border-radius:8px;padding:16px 18px;font-size:13.5px;
    line-height:1.35;border:1px dashed rgba(57,255,20,0.06);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
    white-space:pre-wrap;font-family:inherit;
}

/* Small status line */
.status{
    display:flex;gap:12px;margin:8px 0 10px;font-size:13px;color:var(--muted);
}
.dot{width:10px;height:10px;border-radius:50%;background:var(--neon-green);box-shadow:0 0 8px rgba(57,255,20,0.12)}

/* Controls */
.controls{display:flex;gap:8px;align-items:center;margin-top:0}
input{
    flex:1;padding:10px 12px;border-radius:8px;border:1px solid rgba(255,255,255,0.04);
    background:transparent;color:var(--neon-green);outline:none;font-family:inherit;
    box-shadow: inset 0 -6px 18px rgba(0,0,0,0.4);
}
button{
    background:linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    color:var(--teal);border:1px solid rgba(0,245,212,0.06);padding:10px 14px;border-radius:8px;
    cursor:pointer;font-weight:700;letter-spacing:0.6px;
}
button:active{transform:translateY(1px)}
#restartButton{background:rgba(255,255,255,0.02);color:#ff7b7b;border:1px solid rgba(255,123,123,0.06)}

/* Right panel (map) */
.mapPanel{
    width:380px;min-width:300px;max-height:86vh;padding:14px;border-radius:10px;
    background:linear-gradient(180deg, rgba(7,18,37,0.6), rgba(4,6,12,0.6));
    border:1px solid rgba(0,245,212,0.04);box-shadow:0 14px 60px rgba(3,6,12,0.6);
    position:relative;overflow:hidden;
}

.mapHeader{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;color:var(--muted);font-size:13px}
#gameMap{
    width:100%;height:calc(86vh - 110px);overflow:auto;font-family:inherit;
    white-space:pre;font-size:24px;line-height:1.05;color:var(--teal);padding:8px;border-radius:6px;
    background:linear-gradient(180deg, rgba(0,0,0,0.14), rgba(0,0,0,0.03));
    border:1px dashed rgba(0,245,212,0.03);
}

/* Fancy grid overlay to feel "spacy" */
.mapPanel::before{
    content:"";position:absolute;inset:0;background-image:
        radial-gradient(rgba(124,92,255,0.02) 1px, transparent 1px);
    background-size:28px 28px;opacity:0.4;pointer-events:none;
}

/* small footer / tips */
.footer{margin-top:12px;color:var(--muted);font-size:12px}

/* Scrollbar styling */
::-webkit-scrollbar{height:10px;width:10px}
::-webkit-scrollbar-thumb{background:linear-gradient(180deg, rgba(57,255,20,0.08), rgba(0,245,212,0.06));border-radius:8px}
::-webkit-scrollbar-track{background:transparent}

/* Responsive */
@media (max-width: 920px){
    .wrap{
        flex-direction: column;
        padding: 18px;
    }

    .mapPanel{
        display: none;   /* Completely hide the system map */
    }

    /* Schmale Bildschirme: Panel darf schmaler als 360px werden, kein horizontales Scrollen */
    .panel{
        min-width: 0;
    }
}

/* Utility: hidden elements should not consume layout space */
[hidden]{ display:none !important; }

/* --- Stories page additions (reuse the same design language) --- */
.pageHeader{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    margin-bottom:12px;
}

.meta{
    color:var(--muted);
    font-size:13px;
    border:1px solid rgba(0,245,212,0.06);
    background:linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    padding:8px 10px;
    border-radius:10px;
    white-space:nowrap;
}

.card{
    width:100%;
    box-sizing:border-box;
    flex:1;
    min-height:0;
    overflow:auto;
    margin-top:8px;

    background:linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.15));
    border-radius:8px;
    padding:16px 18px;
    border:1px dashed rgba(0,245,212,0.05);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.empty{
    margin:0;
    color:var(--muted);
    font-size:13.5px;
    line-height:1.5;
}

.storyList{
    margin:0;
    padding-left:22px;
}

.storyList li{
    color:var(--neon-green);
    overflow-wrap:anywhere;   /* lange Woerter ohne Leerzeichen sprengen sonst die Seite */
    font-size:13.5px;
    line-height:1.55;
    margin:10px 0;
    padding:10px 12px;
    border-radius:10px;
    border:1px solid rgba(57,255,20,0.06);
    background:linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
}

.actions{
    display:flex;
    gap:10px;
    align-items:center;
    justify-content:space-between;
    margin-top:12px;
}

a.btnLink{
    display:inline-flex;
    align-items:center;
    gap:8px;
    text-decoration:none;
    color:var(--teal);
    font-weight:700;
    letter-spacing:0.4px;

    padding:10px 14px;
    border-radius:8px;
    border:1px solid rgba(0,245,212,0.06);
    background:linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
}

a.btnLink:active{transform:translateY(1px)}
a.btnLink:hover{filter:brightness(1.08)}

/* ... existing textarea rules continue below ... */
textarea{
    width:100%;
    box-sizing:border-box;
    min-height:140px;
    resize:vertical;
    padding:10px 12px;
    border-radius:8px;
    border:1px solid rgba(255,255,255,0.04);
    background:transparent;
    color:var(--neon-green);
    outline:none;
    font-family:inherit;
    box-shadow: inset 0 -6px 18px rgba(0,0,0,0.4);
    line-height:1.35;
}

#consent-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    background: #111827;
    color: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    max-width: 900px;
    margin: 0 auto;
    z-index: 9999;
}
#consent-banner p { margin: 0; font-size: 0.95rem; }
#consent-banner .actions { display: flex; gap: 0.5rem; }
#consent-banner button {
    border: none; padding: 0.5rem 0.75rem; border-radius: 6px; cursor: pointer;
}
#consent-banner #consent-accept { background: #10b981; color: white; }
#consent-banner #consent-decline { background: #374151; color: white; }
/* Messages inside terminal */
#gameOutput .player-message {
    margin: 8px 0 4px 0;
    padding: 6px 10px;

    color: var(--teal);
    font-weight: 600;

    border-left: 2px solid var(--teal);
    background: linear-gradient(
            90deg,
            rgba(0,245,212,0.08),
            transparent 60%
    );

    text-shadow: 0 0 6px rgba(0,245,212,0.35);
    border-radius: 4px;
}

#gameOutput .server-message {
    margin: 4px 0 8px 0;
    padding: 6px 10px;

    color: var(--neon-green);

    border-left: 2px solid rgba(57,255,20,0.35);
    background: linear-gradient(
            90deg,
            rgba(57,255,20,0.06),
            transparent 60%
    );

    border-radius: 4px;
    line-height: 1.45;
}
#info-popup {
    position: fixed;
    bottom: 20px;
    left: 20px;
    max-width: 400px;
    background: #111;
    color: #fff;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 1000;
}

#info-popup .actions {
    margin-top: 12px;
    text-align: right;
}

/* Sichtbarer Fokus (outline:none oben hatte keinen Ersatz) */
input:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible{
    outline:2px solid var(--teal);
    outline-offset:2px;
}
