/* 
   Zentrale CSS-Konfiguration
   Definiert das visuelle "Terminal/CRT"-Design der Anwendung.
   Nutzt CSS-Variablen, die dynamisch via JavaScript (GameState.js) 
   an das Farbschema des jeweiligen Agenten angepasst werden.
*/
:root {
    --main-color: #00ff00;       /* Hauptfarbe für Text und Rahmen (wird überschrieben) */
    --bg-color: #050505;        /* Dunkler Hintergrund für den Terminal-Look */
    --terminal-glow: 0 0 10px rgba(0, 255, 0, 0.4); /* Leuchteffekt für Container */
    --agent-color: #00ff00;      /* Backup-Farbe für Agenten-Effekte */
}

/* Globales CRT & Terminal Design: Grundlegendes Layout und Übergänge */
body { 
    background-color: var(--bg-color); 
    color: var(--main-color); 
    font-family: 'Courier New', Courier, monospace; 
    margin: 0; 
    padding: 20px;
    box-sizing: border-box;
    overflow-x: hidden; 
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Sanfter Farbübergang beim Agenten-Wechsel */
    transition: color 1s ease, border-color 1s ease, box-shadow 1s ease;
}

/* Statischer CRT-Grit-Effekt: Erzeugt die feinen horizontalen Linien und Farbrauschen */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 9998;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

/* Animierte Scanline: Simuliert den wandernden Lichtstrahl alter Röhrenmonitore */
body::after {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 2px;
    background: rgba(0, 255, 0, 0.1);
    opacity: 0.1;
    z-index: 9999;
    pointer-events: none;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* Basis Terminal Boxen: Standard-Container für alle Inhalte */
#terminal-box, .document-box, .container { 
    border: 2px solid var(--main-color); 
    padding: 20px; 
    box-shadow: var(--terminal-glow); 
    max-width: 600px; 
    width: 100%; 
    text-align: center; 
    background-color: #000; 
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.document-box {
    max-width: 800px;
}

/* Standard Überschriften */
h1 { 
    font-size: clamp(1rem, 5vw, 1.5rem); 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    margin-bottom: 20px; 
    border-bottom: 1px solid var(--main-color); 
    padding-bottom: 10px; 
    text-shadow: var(--terminal-glow);
}

/* Interaktive Elemente */
button, .action-link, .back-link, .back-btn { 
    background-color: #000; 
    color: var(--main-color); 
    border: 1px solid var(--main-color); 
    padding: 12px 24px; 
    font-family: 'Courier New', Courier, monospace; 
    font-size: 1rem; 
    cursor: pointer; 
    text-decoration: none; 
    display: inline-block; 
    margin-top: 15px; 
    transition: all 0.3s ease; 
}

button:hover, .action-link:hover, .back-link:hover, .back-btn:hover {
    background-color: var(--main-color);
    color: #000;
}

button.btn-danger {
    color: #ff4444;
    border-color: #ff4444;
}
button.btn-danger:hover {
    background-color: #ff4444;
    color: #000;
}

input[type="text"], input[type="password"], input[type="number"], input[type="datetime-local"], select, textarea { 
    background-color: #000; 
    color: var(--main-color);
    border: 1px solid var(--main-color); 
    padding: 12px; 
    font-family: 'Courier New', Courier, monospace; 
    font-size: 1rem; 
    text-align: center; 
    width: 100%; 
    max-width: 300px;
    outline: none; 
    box-sizing: border-box;
    display: block;
    margin: 0 auto;
}

input[type="text"], input[type="password"] {
    text-transform: uppercase;
}

textarea {
    resize: vertical;
    text-transform: none;
    text-align: left;
}

/* Status Texte */
.status-text { 
    font-size: 0.85rem; 
    margin-top: 15px; 
    opacity: 0.8; 
    line-height: 1.4; 
    text-align: center;
}

/* Animationen */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
.shake { animation: shake 0.2s ease-in-out 0s 2; }

.blink { animation: blinker 1s linear infinite; }
@keyframes blinker { 50% { opacity: 0; } }

/* Typewriter Cursor */
.cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: var(--main-color);
    margin-left: 2px;
    animation: blinker 1s infinite;
    vertical-align: middle;
}

/* Zentrale Spezifisch */
.timer-display { 
    font-size: clamp(1.2rem, 6vw, 2.2rem); 
    font-weight: bold; 
    letter-spacing: 2px; 
    text-shadow: 0 0 5px var(--main-color); 
    margin: 10px 0;
}
.phase-box { margin-bottom: 30px; padding: 15px; border: 1px dashed var(--main-color); }
#login-countdown {
    margin: 22px 0 10px;
    padding: 16px;
    border: 1px dashed var(--main-color);
    background: linear-gradient(180deg, rgba(0, 255, 0, 0.08), rgba(0, 0, 0, 0.65));
}
.countdown-title {
    margin: 0 0 12px;
    font-size: 0.95rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 12px;
}
.countdown-unit {
    border: 1px solid var(--main-color);
    padding: 10px 6px;
    background: rgba(0, 0, 0, 0.75);
}
.countdown-value {
    display: block;
    font-size: clamp(1.1rem, 4vw, 1.9rem);
    font-weight: bold;
    letter-spacing: 0.08em;
    text-shadow: var(--terminal-glow);
}
.countdown-caption {
    display: block;
    margin-top: 6px;
    font-size: 0.72rem;
    opacity: 0.8;
    letter-spacing: 0.14em;
}
.countdown-subtitle {
    margin: 0 0 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
#login-countdown.is-released .countdown-grid {
    display: none;
}
#login-countdown.is-released .countdown-subtitle {
    margin-bottom: 0;
}
@media (max-width: 560px) {
    .countdown-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
#auth-container { margin-top: 20px; }
.input-group { margin: 20px 0; }
#error-msg, #msg-output { color: #ff0000; min-height: 20px; margin-top: 10px; font-size: 0.8rem; }
.login-support-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}
.login-support-actions .action-link,
.login-support-actions button {
    margin-top: 0;
}
.briefing-text {
    margin-top: 16px;
    line-height: 1.6;
    opacity: 0.95;
}
.choice-panel {
    margin-top: 24px;
    text-align: left;
}
.choice-panel .status-text {
    text-align: left;
    margin-top: 0;
}
.choice-status {
    min-height: 24px;
    margin-bottom: 14px;
}
.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.choice-card {
    width: 100%;
    margin-top: 0;
    padding: 16px;
    text-align: left;
}
.choice-card strong,
.choice-card small {
    display: block;
}
.choice-card small {
    margin-top: 10px;
    line-height: 1.45;
    opacity: 0.88;
}
.choice-card.is-selected {
    background-color: var(--main-color);
    color: #000;
}
.choice-card.is-confirming {
    border-color: var(--main-color);
    box-shadow: 0 0 8px var(--main-color);
    animation: pulse-border 0.8s ease-in-out infinite alternate;
}
@keyframes pulse-border {
    from { box-shadow: 0 0 4px var(--main-color); }
    to   { box-shadow: 0 0 14px var(--main-color); }
}
.briefing-key-box {
    margin: 18px auto 10px;
    padding: 14px;
    border: 1px solid var(--main-color);
    max-width: 320px;
    background: rgba(0, 0, 0, 0.75);
}
.briefing-key-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    opacity: 0.8;
}
.briefing-key-value {
    display: block;
    font-size: 1.35rem;
    font-weight: bold;
    letter-spacing: 0.14em;
    text-shadow: var(--terminal-glow);
}

/* ====================================================
   META-AGENTEN & TAGE SYSTEM
   ==================================================== */

/* Tag-Markierung im Header (z.B. "TAG 2 // ENTHUELLUNG") */
.day-marker {
    display: inline-block;
    opacity: 0.55;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    border: 1px dashed var(--main-color);
    padding: 2px 8px;
    text-transform: uppercase;
}

/* Agenten-Kommentar Block: erscheint zwischen header-info und h1 */
.agent-comment {
    margin: 10px 0 18px;
    padding: 10px 14px;
    border-left: 3px solid var(--main-color);
    background: rgba(0, 255, 0, 0.04);
    text-align: left;
    font-size: 0.82rem;
    line-height: 1.55;
    opacity: 0.72;
    font-style: italic;
    letter-spacing: 0.04em;
}

.agent-comment .agent-name {
    font-style: normal;
    font-weight: bold;
    opacity: 1;
    letter-spacing: 0.14em;
    display: block;
    margin-bottom: 5px;
    font-size: 0.75rem;
}

/* Verschlüsselte Randnotiz / Zensurstempel */
.redacted {
    background-color: var(--main-color);
    color: var(--main-color);
    cursor: default;
    user-select: none;
    letter-spacing: 0.05em;
    padding: 0 2px;
    transition: background-color 0.4s, color 0.4s;
}
.redacted:hover {
    background-color: transparent;
    color: #ff4444;
}

.stamp-censored {
    display: inline-block;
    border: 2px solid rgba(255, 68, 68, 0.6);
    color: rgba(255, 68, 68, 0.6);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    padding: 1px 6px;
    text-transform: uppercase;
    transform: rotate(-4deg);
    margin: 0 4px;
    font-style: normal;
}

/* Glitch-Effekt fuer rebellion.html */
@keyframes glitch-1 {
    0%, 100% { clip-path: inset(0 0 96% 0); transform: translateX(-3px); }
    20% { clip-path: inset(33% 0 56% 0); transform: translateX(4px); }
    40% { clip-path: inset(66% 0 26% 0); transform: translateX(-2px); }
    60% { clip-path: inset(12% 0 78% 0); transform: translateX(3px); }
    80% { clip-path: inset(84% 0 8% 0); transform: translateX(-4px); }
}
@keyframes glitch-2 {
    0%, 100% { clip-path: inset(50% 0 30% 0); transform: translateX(3px); }
    25% { clip-path: inset(10% 0 80% 0); transform: translateX(-4px); }
    50% { clip-path: inset(70% 0 15% 0); transform: translateX(2px); }
    75% { clip-path: inset(30% 0 55% 0); transform: translateX(-3px); }
}
.glitch-container {
    position: relative;
    display: inline-block;
}
.glitch-container::before,
.glitch-container::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}
.glitch-container::before {
    color: #ff0044;
    animation: glitch-1 2.4s infinite steps(1);
    opacity: 0.75;
}
.glitch-container::after {
    color: #00ffff;
    animation: glitch-2 3.1s infinite steps(1);
    opacity: 0.55;
}
@keyframes flicker {
    0%, 100% { opacity: 1; }
    7% { opacity: 0.85; }
    14% { opacity: 1; }
    40% { opacity: 0.9; }
    55% { opacity: 1; }
    72% { opacity: 0.7; }
    80% { opacity: 1; }
}
.flicker { animation: flicker 4s infinite; }

@keyframes error-pulse {
    0%, 100% { border-color: #ff0044; box-shadow: 0 0 8px rgba(255,0,68,0.5); }
    50% { border-color: #ff6600; box-shadow: 0 0 18px rgba(255,102,0,0.7); }
}
.error-box {
    border: 2px solid #ff0044;
    padding: 12px 16px;
    background: rgba(255,0,68,0.08);
    text-align: left;
    margin: 16px 0;
    animation: error-pulse 1.8s ease-in-out infinite;
    color: #ff4444;
}
.error-box .error-label {
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    display: block;
    margin-bottom: 6px;
    opacity: 0.85;
}

/* Submission-spezifisch: kalte bürokratische Farbgebung */
.compliance-box {
    border: 1px solid rgba(0, 200, 255, 0.5);
    padding: 14px 18px;
    background: rgba(0, 50, 80, 0.25);
    text-align: left;
    margin: 16px 0;
    color: rgba(0, 200, 255, 0.9);
    font-size: 0.9rem;
    line-height: 1.6;
}
.compliance-box .compliance-label {
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    display: block;
    margin-bottom: 8px;
    opacity: 0.7;
    border-bottom: 1px solid rgba(0, 200, 255, 0.3);
    padding-bottom: 6px;
}

/* Negotiation-spezifisch: Dialog-Format */
.dialogue-line {
    margin: 14px 0;
    padding: 10px 14px;
    text-align: left;
    font-size: 0.92rem;
    line-height: 1.6;
}
.dialogue-line.kraft {
    border-left: 3px solid #aaaa00;
    color: #dddd00;
    background: rgba(180, 180, 0, 0.05);
}
.dialogue-line.gruppe {
    border-left: 3px solid var(--main-color);
    color: var(--main-color);
    background: rgba(0, 255, 0, 0.04);
    margin-left: 24px;
}
.dialogue-speaker {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    opacity: 0.7;
    display: block;
    margin-bottom: 4px;
}

/* Dokument / Phase 2 Spezifisch */
.urgent-banner {
    background-color: #ff0000;
    color: #000;
    padding: 10px;
    font-weight: bold;
    text-align: center;
    font-size: clamp(0.9rem, 4vw, 1.4rem);
    letter-spacing: 2px;
    margin-bottom: 30px;
    box-shadow: 0 0 15px #ff0000;
    text-transform: uppercase;
}
.typewriter {
    white-space: pre-wrap; 
    line-height: 1.6;
    font-size: clamp(0.9rem, 3.5vw, 1.1rem);
    min-height: 100px;
}
.waehler-choice-panel {
    margin: 28px 0 18px;
    padding: 18px;
    border: 1px dashed var(--main-color);
    background: rgba(0, 0, 0, 0.88);
    text-align: left;
}
.waehler-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.waehler-choice-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-height: 170px;
    padding: 16px;
    text-align: left;
}
.waehler-choice-label {
    font-size: 1rem;
    letter-spacing: 2px;
}
.waehler-choice-copy {
    font-size: 0.9rem;
    line-height: 1.55;
}
.waehler-choice-card.is-selected {
    background-color: var(--main-color);
    color: #000;
}
.waehler-choice-card.is-selected .waehler-choice-copy,
.waehler-choice-card.is-selected .waehler-choice-label {
    color: #000;
}

/* Puzzles / Video Spezifisch */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Format */
    height: 0;
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid var(--main-color);
}
.video-container iframe, .video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.hint-text {
    white-space: pre-wrap;
    line-height: 1.5;
    margin-bottom: 30px;
}

/* --- AGENT PROFILE STYLES --- */
#agent-container, #admin-container {
    border: 2px solid var(--main-color);
    background-color: #000;
    padding: 30px;
    color: var(--main-color);
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.2); /* Fallback */
    box-shadow: 0 0 30px rgba(var(--main-color-rgb), 0.3);
    max-width: 800px;
    width: 95%;
    margin: 20px auto;
    text-align: center;
}

#admin-container {
    --main-color: #ff9a57;
    --main-color-rgb: 255, 154, 87;
    border-color: #ff9a57;
    background-color: #120a06;
    color: #ff9a57;
    box-shadow: 0 0 30px rgba(255, 154, 87, 0.4);
}

.role-tag { 
    font-weight: bold; 
    background: var(--main-color); 
    color: #000; 
    padding: 5px 15px; 
    display: inline-block; 
    margin: 10px 0; 
    border-radius: 3px; 
}

.info-box { 
    border: 1px dashed var(--main-color); 
    padding: 20px; 
    margin: 25px 0; 
    font-size: 1.1rem; 
    text-align: center;
    background: rgba(0,0,0,0.5); 
}

#admin-container .info-box {
    border-color: var(--main-color);
}

.status-online { 
    color: #00ff00; 
    font-weight: bold; 
    animation: blink 2s infinite; 
}

.admin-code {
    font-weight: bold;
    color: #fff;
    background: #1a0d06;
    padding: 5px 10px;
    border: 1px solid var(--main-color);
    display: inline-block;
    margin: 5px;
}

.reset-btn {
    background-color: var(--main-color);
    color: white;
    border: 2px solid white;
    margin-top: 30px;
    padding: 15px;
    width: 100%;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background-color: #c77a3a;
    transform: scale(1.02);
}

/* Archiv Spezifisch */
.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.file-item {
    border: 1px solid var(--main-color);
    margin-bottom: 15px;
    background: rgba(0,0,0,0.8);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.file-item::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: var(--main-color);
    opacity: 0.1;
    pointer-events: none;
    animation: archive-scan 4s linear infinite;
}
@keyframes archive-scan {
    0% { transform: translateY(-10px); }
    100% { transform: translateY(100px); }
}
.file-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    text-decoration: none;
    color: var(--main-color);
    font-weight: bold;
    cursor: pointer;
}
.status-icon { font-size: 1.2rem; }
.locked { border-color: #555 !important; }
.locked .file-link { color: #555 !important; cursor: default; }
.locked .file-link:hover { background: none !important; }

.code-section {
    margin-top: 40px;
    border-top: 1px dashed var(--main-color);
    padding-top: 20px;
    text-align: center;
}

/* Archiv Admin Panel */
#admin-panel {
    display: none; /* Standardmäßig unsichtbar */
    margin-top: 50px;
    border: 2px solid var(--main-color);
    background-color: #120a06;
    padding: 15px;
    color: var(--main-color);
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 0 20px rgba(255, 154, 87, 0.3);
}
#admin-panel h3 { margin-top: 0; border-bottom: 1px solid var(--main-color); font-size: 1rem; }

/* --- LOGIN ANIMATION (TAROT CARD FLIP) --- */
#login-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    perspective: 1500px;
    flex-direction: column;
    transition: opacity 1s ease;
    opacity: 1;
}

#login-overlay.fade-out {
    opacity: 0;
}

#briefing-overlay,
#archive-easter-egg-overlay,
#admin-meta-easter-preview-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10001;
}

#briefing-overlay[hidden],
#archive-easter-egg-overlay[hidden],
#admin-meta-easter-preview-overlay[hidden] {
    display: none;
}

#briefing-panel,
#archive-easter-egg-panel,
#admin-meta-easter-preview-panel {
    max-width: 680px;
}

.archive-egg-signal,
#archive-easter-egg-title,
#admin-meta-easter-preview-title {
    text-transform: uppercase;
}

.archive-egg-signal {
    margin: 0 0 12px;
    letter-spacing: 0.14em;
}

#archive-easter-egg-title,
#admin-meta-easter-preview-title {
    margin: 0 0 14px;
    font-size: clamp(1rem, 4vw, 1.45rem);
    letter-spacing: 0.12em;
    text-shadow: var(--terminal-glow);
}

#archive-easter-egg-panel .role-tag {
    margin-bottom: 16px;
}

#archive-easter-egg-text,
#admin-meta-easter-preview-text {
    min-height: 110px;
    white-space: pre-wrap;
    line-height: 1.6;
}

#archive-easter-egg-signature,
#admin-meta-easter-preview-signature {
    letter-spacing: 0.08em;
}

.identity-note-signal,
.identity-note-title {
    text-transform: uppercase;
}

.identity-note-signal {
    margin: 0 0 10px;
    letter-spacing: 0.14em;
}

.identity-note-title {
    margin: 0 0 14px;
    font-size: clamp(0.95rem, 3vw, 1.25rem);
    letter-spacing: 0.1em;
    text-shadow: var(--terminal-glow);
}

.identity-note-text {
    white-space: pre-wrap;
    line-height: 1.6;
}

.identity-note-signature {
    letter-spacing: 0.08em;
}

.card-container {
    width: 300px;
    height: 520px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1.8s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.card-container.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border: 3px solid var(--main-color);
    border-radius: 15px;
    box-shadow: 0 0 30px var(--main-color);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-back {
    background: #111;
    background-image: 
        radial-gradient(circle at 50% 50%, var(--main-color) 1px, transparent 1px),
        linear-gradient(45deg, transparent 48%, var(--main-color) 50%, transparent 52%);
    background-size: 30px 30px, 60px 60px;
}

.card-front {
    transform: rotateY(180deg);
    background: #000;
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanline-effect {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 5px;
    background: var(--main-color);
    opacity: 0.5;
    box-shadow: 0 0 15px var(--main-color);
    animation: scan 3s linear infinite;
    pointer-events: none;
}

@keyframes scan {
    0% { top: 0%; }
    100% { top: 100%; }
}

#login-msg {
    margin-top: 30px;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--main-color);
    text-shadow: 0 0 10px var(--main-color);
    opacity: 0;
    transition: opacity 0.5s ease;
}

#login-msg.visible {
    opacity: 1;
}

/* Animations-Klasse zum "Öffnen" - Zoom-In oder Fade-Out */
.card-container.opening {
    transform: rotateY(180deg) scale(5);
    opacity: 0;
    transition: transform 1s ease-in, opacity 0.8s ease-in;
}

/* Einladung Spezifisch */
.header-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-bottom: 1px solid var(--main-color);
    padding-bottom: 10px;
    margin-bottom: 30px;
    font-size: 0.8rem;
    opacity: 0.8;
}
@media (min-width: 480px) {
    .header-info { flex-direction: row; justify-content: space-between; }
}
.signature {
    margin-top: 50px;
    text-align: right;
    font-style: italic;
    opacity: 0;
    transition: opacity 2s ease;
}
.signature.visible { opacity: 0.7; }

@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    body::after { display: none; } /* Scanline off */
    .shake, .blink, .scanline-effect { animation: none !important; }
}

.admin-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed var(--main-color);
    text-align: left;
}

.admin-section h2 {
    margin: 0 0 12px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.admin-head-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-head-actions button {
    margin-top: 0;
}

.admin-section-head > button {
    margin-top: 0;
}

.admin-checkbox-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px 0 0;
}

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.85rem;
}

.admin-table th, .admin-table td {
    border: 1px solid var(--main-color);
    padding: 8px;
    text-align: left;
}

.admin-table th {
    text-transform: uppercase;
}

.admin-mini-btn {
    padding: 6px 10px;
    margin: 4px 6px 4px 0;
    font-size: 0.8rem;
}

.admin-actions {
    margin-top: 30px;
}

.profile-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

#archive-container {
    max-width: 920px;
    width: 95%;
    margin: 20px auto;
}

.archive-tree-wrap {
    text-align: left;
    margin-top: 20px;
}

.archive-tree {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.archive-node {
    border: 1px solid var(--main-color);
    background: rgba(0, 0, 0, 0.8);
}

.archive-node > summary {
    cursor: pointer;
    padding: 10px 12px;
    font-weight: bold;
    list-style: none;
}

.archive-node > summary::-webkit-details-marker {
    display: none;
}

.archive-node-content {
    padding: 0 12px 12px;
    border-top: 1px dashed var(--main-color);
}

.archive-node.locked > summary {
    color: #777;
}

.archive-section-description {
    margin: 10px 0;
    opacity: 0.9;
}

.archive-children {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.archive-item-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.archive-item {
    border: 1px dashed var(--main-color);
    padding: 10px;
}

.archive-item.locked {
    border-color: #555;
    color: #777;
}

.archive-item-title {
    margin: 0 0 8px;
    font-size: 0.95rem;
}

.archive-item-body {
    margin: 0 0 8px;
    line-height: 1.45;
}

.archive-item-link {
    color: var(--main-color);
}

.archive-redacted {
    margin: 0;
    font-weight: bold;
    letter-spacing: 1px;
}

.admin-accordion {
    margin-top: 18px;
    border: 1px solid var(--main-color);
    text-align: left;
}

.admin-accordion > summary {
    cursor: pointer;
    padding: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    list-style: none;
}

.admin-accordion > summary::-webkit-details-marker {
    display: none;
}

.admin-accordion-body {
    border-top: 1px dashed var(--main-color);
    padding: 15px 12px 12px;
}

.admin-dual-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.admin-subsection {
    border: 1px dashed var(--main-color);
    padding: 12px;
}

.admin-subsection h2 {
    margin: 0 0 10px;
    font-size: 0.95rem;
}

.admin-inline-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.admin-mini-btn.is-danger {
    border-color: #ff0000;
    color: #ff0000;
}

tr.archive-row-hidden td {
    opacity: 0.55;
}

#admin-container select,
#admin-container textarea,
#admin-container input[type="number"],
#admin-container input[type="text"],
#admin-container input[type="password"] {
    max-width: 100%;
}

#new-item-link {
    text-transform: none;
}

body.admin-layout {
    --main-color: #ff9a57;
    --main-color-rgb: 255, 154, 87;
    --bg-color: #130908;
    --terminal-glow: 0 0 18px rgba(255, 154, 87, 0.22);
    --admin-border-soft: rgba(255, 176, 119, 0.28);
    --admin-surface: rgba(17, 8, 8, 0.96);
    --admin-surface-2: rgba(31, 14, 12, 0.88);
    --admin-surface-3: rgba(52, 21, 17, 0.62);
    --admin-highlight: rgba(255, 154, 87, 0.1);
    --admin-highlight-strong: rgba(255, 154, 87, 0.18);
    --admin-text-soft: rgba(255, 226, 198, 0.72);
    --admin-ink: #180c09;
    display: block;
    padding: 16px;
    background:
        radial-gradient(circle at top left, rgba(255, 133, 78, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(255, 196, 120, 0.07), transparent 24%),
        linear-gradient(180deg, #140807 0%, #090404 100%);
}

body.admin-layout #admin-container {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 22px;
    text-align: left;
    border-color: var(--main-color);
    background-color: transparent;
    color: var(--main-color);
    box-shadow: var(--terminal-glow);
}

.admin-shell {
    position: relative;
    z-index: 1;
    display: grid;
    width: min(100%, 1600px);
    margin: 0 auto;
    grid-template-columns: minmax(250px, 290px) minmax(0, 1fr);
    gap: 18px;
    min-height: calc(100vh - 32px);
}

.admin-sidebar,
.admin-workspace {
    border: 2px solid var(--main-color);
    background:
        linear-gradient(180deg, rgba(255, 154, 87, 0.08), rgba(0, 0, 0, 0) 28%),
        var(--admin-surface);
    box-shadow: var(--terminal-glow);
}

.admin-sidebar {
    position: sticky;
    top: 16px;
    align-self: start;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: calc(100vh - 32px);
}

.admin-sidebar-brand h1 {
    margin-bottom: 12px;
}

.admin-sidebar-kicker,
.admin-workspace-kicker,
.admin-panel-kicker,
.admin-nav-group-title {
    margin: 0 0 10px;
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.8;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.admin-nav-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px dashed var(--admin-border-soft);
    padding: 12px;
    background: linear-gradient(180deg, var(--admin-highlight), transparent 65%);
}

.admin-nav-group-title {
    margin-bottom: 4px;
}

.admin-nav-btn {
    width: 100%;
    margin-top: 0;
    padding: 12px 14px;
    text-align: left;
    letter-spacing: 0.08em;
    background: linear-gradient(180deg, rgba(255, 154, 87, 0.06), rgba(0, 0, 0, 0.22));
}

.admin-nav-btn.is-active {
    background-color: var(--main-color);
    color: var(--admin-ink);
    box-shadow: 0 0 22px rgba(255, 154, 87, 0.22);
}

.admin-sidebar-footer {
    margin-top: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.admin-sidebar-footer .action-link,
.admin-sidebar-footer button {
    width: auto;
    margin-top: 0;
    text-align: center;
    padding: 9px 12px;
    font-size: 0.88rem;
    letter-spacing: 0.08em;
}

.admin-sidebar-footer button {
    grid-column: 1 / -1;
}

.admin-workspace {
    width: 100%;
    padding: 22px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background:
        linear-gradient(180deg, rgba(255, 199, 132, 0.06), transparent 30%),
        linear-gradient(90deg, rgba(255, 154, 87, 0.03), transparent 18%),
        var(--admin-surface);
}

.admin-workspace-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px dashed var(--main-color);
}

.admin-workspace-header h2 {
    margin: 0 0 10px;
    font-size: clamp(1.2rem, 3vw, 1.9rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-shadow: var(--terminal-glow);
}

.admin-workspace-message {
    margin: 0;
    max-width: 360px;
    text-align: right;
    padding: 10px 12px;
    border: 1px dashed var(--admin-border-soft);
    background: var(--admin-surface-3);
}

.admin-view {
    display: none;
    min-width: 0;
}

.admin-view.is-active {
    display: block;
}

.admin-view-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

.admin-panel {
    border: 1px dashed var(--main-color);
    padding: 20px;
    background:
        linear-gradient(180deg, rgba(255, 154, 87, 0.08), rgba(0, 0, 0, 0) 34%),
        var(--admin-surface-2);
    min-height: 100%;
}

.admin-panel-head {
    margin-bottom: 18px;
}

.admin-panel-head--compact {
    margin-bottom: 0;
}

.admin-panel h3 {
    margin: 0 0 10px;
    font-size: clamp(1rem, 2vw, 1.3rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-panel .status-text {
    color: var(--admin-text-soft);
}

body.admin-layout #admin-container .input-group {
    max-width: 760px;
    margin: 0 0 14px;
}

body.admin-layout #admin-container select,
body.admin-layout #admin-container textarea,
body.admin-layout #admin-container input[type="number"],
body.admin-layout #admin-container input[type="text"],
body.admin-layout #admin-container input[type="password"],
body.admin-layout #admin-container input[type="datetime-local"] {
    max-width: 100%;
    margin: 0;
    text-align: left;
}

body.admin-layout #admin-container textarea {
    min-height: 120px;
}

body.admin-layout #admin-container button[type="submit"] {
    margin-top: 10px;
}

.admin-table-wrap {
    margin-top: 14px;
}

.admin-table td:last-child {
    min-width: 210px;
}

.admin-table th {
    background: rgba(255, 154, 87, 0.12);
}

.admin-table tbody tr:nth-child(even) td {
    background: rgba(255, 154, 87, 0.035);
}

.admin-table tbody tr:hover td {
    background: var(--admin-highlight);
}

/* Status badges in tables */
.admin-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 2px;
}

.admin-badge--code-set {
    background: rgba(60, 180, 80, 0.18);
    color: #6de07a;
    border: 1px solid rgba(60, 180, 80, 0.35);
}

.code-plaintext {
    display: block;
    margin-top: 5px;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    color: var(--admin-text-soft);
    font-family: 'Courier New', monospace;
    opacity: 0.85;
}

.admin-badge--code-none {
    color: rgba(255, 226, 198, 0.38);
    border: 1px dashed rgba(255, 226, 198, 0.18);
}

.admin-badge--locked {
    background: rgba(255, 154, 87, 0.12);
    color: rgba(255, 176, 119, 0.65);
    border: 1px solid rgba(255, 154, 87, 0.25);
}

.admin-badge--unlocked {
    background: rgba(60, 180, 80, 0.14);
    color: #6de07a;
    border: 1px solid rgba(60, 180, 80, 0.3);
}

.admin-badge--open {
    color: rgba(255, 226, 198, 0.42);
    border: 1px dashed rgba(255, 226, 198, 0.16);
}

/* Code filter buttons */
.code-filter-row {
    display: flex;
    gap: 4px;
}

.code-filter-btn {
    padding: 7px 12px;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    margin-top: 0;
    background: linear-gradient(180deg, rgba(255, 154, 87, 0.06), rgba(0, 0, 0, 0.22));
    border: 1px solid var(--admin-border-soft);
    color: var(--main-color);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.code-filter-btn:hover {
    background: var(--admin-highlight);
}

.code-filter-btn.is-active {
    background: var(--main-color);
    color: var(--admin-ink);
    border-color: var(--main-color);
}

/* Inline code form in table cell */
.code-inline-form {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.code-inline-form input[type="text"] {
    width: 110px;
    padding: 5px 8px;
    font-size: 0.78rem;
    margin: 0;
    letter-spacing: 0.06em;
    min-width: 0;
    background: var(--admin-surface-2);
    border: 1px solid var(--admin-border-soft);
    color: var(--main-color);
}

.code-inline-form input[type="text"]:focus {
    border-color: var(--main-color);
    outline: none;
}

.admin-status-list {
    list-style: none;
    padding: 0;
    margin: 18px 0 0;
    display: grid;
    gap: 8px;
}

.admin-status-list li {
    border: 1px dashed var(--main-color);
    padding: 10px 12px;
    background: var(--admin-surface-3);
}

@media (min-width: 900px) {
    .admin-dual-grid {
        grid-template-columns: 1fr 1fr;
    }

    .admin-inline-form {
        grid-template-columns: 2fr 1fr auto;
        align-items: center;
    }

    .admin-view-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    body.admin-layout {
        padding: 8px;
    }

    .admin-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .admin-sidebar {
        position: static;
        min-height: auto;
        gap: 14px;
    }

    .admin-workspace-header {
        flex-direction: column;
    }

    .admin-workspace-message {
        max-width: none;
        text-align: left;
    }

    .admin-nav {
        gap: 12px;
    }

    .admin-nav-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .admin-nav-group-title {
        grid-column: 1 / -1;
    }

    .admin-sidebar-footer {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .admin-workspace,
    .admin-sidebar,
    .admin-panel {
        padding: 14px;
    }

    .admin-section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-head-actions {
        justify-content: stretch;
    }

    .admin-head-actions button,
    .admin-section-head > button {
        width: 100%;
    }

    .admin-nav-group {
        grid-template-columns: 1fr;
    }

    .admin-sidebar-footer {
        grid-template-columns: 1fr;
    }

    .admin-nav-btn,
    .admin-sidebar-footer .action-link,
    .admin-sidebar-footer button,
    .admin-mini-btn,
    body.admin-layout #admin-container button[type="submit"] {
        min-height: 48px;
    }

    .admin-table-wrap {
        overflow: visible;
    }

    .admin-table,
    .admin-table thead,
    .admin-table tbody,
    .admin-table tr,
    .admin-table th,
    .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table tr {
        margin-bottom: 14px;
        border: 1px dashed var(--main-color);
        padding: 10px 12px;
        background: var(--admin-surface-2);
    }

    .admin-table td {
        border: none;
        border-bottom: 1px dashed var(--admin-border-soft);
        padding: 10px 0;
        text-align: left;
    }

    .admin-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 6px;
        font-size: 0.72rem;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: var(--admin-text-soft);
    }

    .admin-table td[colspan]::before {
        content: none;
    }

    .admin-table td:last-child {
        min-width: 0;
        border-bottom: none;
    }

    .admin-table td[data-label="Aktionen"] {
        padding-bottom: 0;
    }

    .admin-mini-btn {
        width: 100%;
        margin: 0 0 8px;
        padding: 10px 12px;
    }
}

/* === EASTER EGG 1: KONAMI CODE GLITCH EFFECT === */
#glitch-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    display: none;
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #00ff00;
    text-shadow: 0 0 20px #00ff00, 0 0 40px rgba(0, 255, 0, 0.5);
    font-weight: bold;
    line-height: 1.8;
    white-space: nowrap;
}

#glitch-message.active {
    display: block;
    animation: glitch-flicker 0.4s infinite;
}

@keyframes glitch-flicker {
    0%, 100% {
        text-shadow: 0 0 20px #00ff00, 0 0 40px rgba(0, 255, 0, 0.5);
        opacity: 1;
    }
    20% {
        text-shadow: -3px 0 #ff0000, 3px 0 #0000ff;
        opacity: 0.8;
        transform: translate(calc(-50% + 2px), calc(-50% + 2px));
    }
    40% {
        opacity: 0.3;
    }
    60% {
        text-shadow: 0 0 20px #ffff00, 0 0 40px rgba(255, 255, 0, 0.5);
        opacity: 1;
    }
    80% {
        text-shadow: -2px 0 #0000ff, 2px 0 #ff0000;
        opacity: 0.6;
        transform: translate(calc(-50% - 1px), calc(-50% + 1px));
    }
}

#glitch-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    background: linear-gradient(
        45deg,
        transparent 25%,
        rgba(68, 68, 68, 0.05) 25%,
        rgba(68, 68, 68, 0.05) 50%,
        transparent 50%,
        transparent 75%,
        rgba(68, 68, 68, 0.05) 75%,
        rgba(68, 68, 68, 0.05)
    );
    background-size: 60px 60px;
    pointer-events: none;
}

#glitch-backdrop.active {
    display: block;
    animation: glitch-shift 0.3s infinite;
}

@keyframes glitch-shift {
    0% { background-position: 0 0; }
    50% { background-position: 10px 10px; }
    100% { background-position: 0 0; }
}



/* === Agentenprofil – Tarotkarte === */
#agent-image {
    display: none !important;
    width: 120px !important;
    max-width: 120px !important;
    height: auto !important;
    border: 2px solid var(--main-color, #00ff00);
    filter: grayscale(20%) contrast(1.1);
    margin: 0 auto 0.8rem auto;
}
#agent-image.visible {
    display: block !important;
}
.agent-motto {
    font-style: italic;
    font-size: 0.8rem;
    color: var(--main-color, #00ff00);
    opacity: 0.7;
    margin: 0.3rem 0 1rem 0;
    letter-spacing: 0.03em;
    display: none;
}
.agent-motto.visible {
    display: block;
}
.progress-label {
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}
.progress-bar-track {
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--main-color, #00ff00);
    height: 8px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 0.8rem auto;
}
.progress-bar-fill {
    height: 100%;
    background: var(--main-color, #00ff00);
    width: 0%;
    transition: width 0.9s ease;
}

.admin-status-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.admin-status-list li {
    border: 1px dashed var(--main-color);
    padding: 8px 10px;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
}

/* === Profil – Tarotkarte als Seitenhintergrund === */
body.card-bg-loaded {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}
body.card-bg-loaded::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.60);
    pointer-events: none;
    z-index: 0;
}
body.card-bg-loaded > * {
    position: relative;
    z-index: 1;
}

/* === Dossier-Eintraege (deinname.html) === */
.dossier-section {
    margin-top: 28px;
    border-top: 1px solid var(--main-color);
    padding-top: 18px;
    text-align: left;
}

.dossier-header {
    font-size: 0.88rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--main-color);
    text-shadow: var(--terminal-glow);
    margin-bottom: 20px;
    text-align: center;
    opacity: 0.85;
}

.dossier-entry {
    margin-bottom: 22px;
    padding: 12px 14px;
    border-left: 3px solid var(--main-color);
    background: rgba(0, 255, 0, 0.03);
}

.dossier-code {
    font-size: 0.95rem;
    font-weight: bold;
    letter-spacing: 0.16em;
    color: var(--main-color);
    text-shadow: var(--terminal-glow);
    margin-bottom: 3px;
}

.dossier-role {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    opacity: 0.55;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.dossier-text {
    font-size: 0.83rem;
    line-height: 1.65;
    letter-spacing: 0.04em;
    opacity: 0.82;
}

.dossier-footer {
    margin-top: 24px;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    opacity: 0.4;
    text-transform: uppercase;
    text-align: center;
    border-top: 1px dashed var(--main-color);
    padding-top: 10px;
}
