/* ===== Deunity – Dark & Edgy ===== */
:root {
    --bg: #0c0c0e;
    --panel: #161619;
    --panel-2: #1e1e23;
    --border: #2c2c33;
    --text: #e7e7ea;
    --muted: #8e8e98;
    --accent: #9dff00;          /* giftiges Neon-Grün */
    --accent-dim: #6fb300;
    --danger: #ff3860;
    --st-offen: #ff9500;
    --st-planung: #ffd500;
    --st-aktiv: #3dff6e;
    --st-pausiert: #b58cff;
    --st-abgeschlossen: #4da6ff;
    --st-abgebrochen: #ff3860;
    --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", system-ui, sans-serif;
    font-size: 15px;
}
a { color: inherit; text-decoration: none; }
input, select, button { font: inherit; }

/* ===== Header ===== */
#header {
    position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 100;
    display: flex; align-items: center; gap: 20px; padding: 0 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}
.logo {
    font-weight: 900; font-size: 20px; letter-spacing: 2px;
}
.logo-de { color: var(--accent); }
.logo-dot { color: var(--accent); animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.header-search { flex: 1; max-width: 480px; margin: 0 auto; position: relative; }
.header-search input {
    width: 100%; padding: 8px 14px;
    background: var(--bg); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius);
    outline: none;
}
.header-search input:focus { border-color: var(--accent); }

.header-right { display: flex; align-items: center; gap: 14px; position: relative; }
.greeting { color: var(--muted); }
.greeting b { color: var(--accent); }
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    border: 2px solid var(--accent); cursor: pointer; object-fit: cover;
    background: var(--panel-2);
}

/* ===== Dropdowns ===== */
.dropdown {
    position: absolute; top: calc(100% + 8px); right: 0; min-width: 260px;
    background: var(--panel-2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px; z-index: 200;
    box-shadow: 0 8px 30px rgba(0,0,0,.6);
}
.header-search .dropdown { left: 0; right: 0; top: calc(100% + 4px); }
.dropdown h4 { margin-bottom: 10px; color: var(--accent); }
.dropdown label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.dropdown input { width: 100%; margin-top: 4px; padding: 6px 10px; background: var(--bg);
    border: 1px solid var(--border); border-radius: 6px; color: var(--text); }
.dropdown hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.lang-select {
    width: 100%; margin-top: 4px; padding: 6px 10px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 6px; color: var(--text); cursor: pointer;
}
.hidden { display: none !important; }

.search-hit { display: flex; align-items: center; gap: 10px; padding: 6px;
    border-radius: 6px; cursor: pointer; }
.search-hit:hover { background: var(--panel); }
.search-hit img { width: 32px; height: 42px; object-fit: cover; border-radius: 4px; }
.search-add { color: var(--accent); padding: 8px 6px; cursor: pointer; font-weight: 600; }

/* ===== Layout ===== */
#layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    padding-top: 56px;
    min-height: 100vh;
}

/* ===== Linke Sidebar ===== */
#leftSidebar {
    position: fixed; top: 56px; bottom: 0; left: 0; width: 260px;
    background: var(--panel); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 14px; gap: 14px;
    overflow-y: auto;
}
#leftSidebar h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px;
    color: var(--accent); margin-bottom: 8px; }
/* Sidebar einklappbar */
.icon-btn {
    background: none; border: 1px solid var(--border); color: var(--text);
    border-radius: 8px; padding: 5px 10px; font-size: 16px; cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Rechtliches-Menü */
.legal-wrap { position: relative; }
#legalMenu { left: 0; right: auto; min-width: 200px; padding: 8px; }
#legalMenu a {
    display: block; padding: 8px 10px; border-radius: 6px; font-size: 14px;
    color: var(--text);
}
#legalMenu a:hover { background: var(--panel); color: var(--accent); }

/* Rechtsseiten */
.legal-page {
    max-width: 760px; margin: 0 auto; padding: 90px 20px 60px;
    line-height: 1.65;
}
.legal-page h1 { color: var(--accent); margin-bottom: 18px; }
.legal-page h2 { font-size: 17px; margin: 26px 0 8px; }
.legal-page p { color: var(--text); margin-bottom: 8px; }
.legal-page a { color: var(--accent); }
.legal-stand { color: var(--muted); margin-top: 30px; font-size: 13px; }

.btn-danger { margin-top: 8px; }
.btn-danger:hover { color: var(--danger); border-color: var(--danger); }
body.side-collapsed #leftSidebar { display: none; }
body.side-collapsed #layout { grid-template-columns: 0 1fr; }

/* Bibliotheksfilter */
.lib-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lib-controls input, .lib-controls select {
    background: var(--panel); color: var(--text); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 6px 10px; outline: none;
}
.lib-controls input:focus { border-color: var(--accent); }

.buttonBox { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.switch-row { display: flex; gap: 6px; margin-bottom: 10px; }
.switch-btn {
    flex: 1; padding: 7px 0; border-radius: var(--radius); cursor: pointer;
    background: var(--panel-2); color: var(--muted); border: 1px solid var(--border);
}
.switch-btn.active { background: var(--accent); color: #000; font-weight: 700; border-color: var(--accent); }

.side-list { overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.side-item { display: flex; align-items: center; gap: 8px; padding: 5px 6px;
    border-radius: 6px; cursor: pointer; }
.side-item:hover { background: var(--panel-2); }
.side-item img { width: 30px; height: 40px; object-fit: cover; border-radius: 4px; }
.side-item .t { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-group { font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
    color: var(--muted); margin: 8px 0 2px; }

.status-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.st-offen { background: var(--st-offen); }
.st-planung { background: var(--st-planung); }
.st-aktiv { background: var(--st-aktiv); }
.st-pausiert { background: var(--st-pausiert); }
.st-abgeschlossen { background: var(--st-abgeschlossen); }
.st-abgebrochen { background: var(--st-abgebrochen); }

/* ===== Main ===== */
#mainContent { grid-column: 2; padding: 24px; }
.main-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.main-head h2 { font-size: 22px; }
.main-head select {
    background: var(--panel); color: var(--text); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 6px 10px;
}

.hero { text-align: center; padding: 120px 20px; }
.hero h1 { font-size: 56px; letter-spacing: 6px; }
.hero p { color: var(--muted); margin: 14px 0 30px; font-size: 18px; }

/* ===== Game-Cards ===== */
.game-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px;
}
.game-card {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; display: flex; transition: border-color .15s;
}
.game-card:hover { border-color: var(--accent-dim); }
.game-card img.cover { width: 90px; height: 100%; min-height: 130px; object-fit: cover; background: var(--panel-2); }
.game-card .gc-body { flex: 1; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gc-title { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-meta { font-size: 12px; color: var(--muted); }
.gc-status-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gc-status-sel, .gc-date {
    font-size: 12px; background: var(--bg); border: 1px solid var(--border);
    color: var(--text); border-radius: 999px; padding: 3px 8px; cursor: pointer;
}
.gc-date { border-radius: 8px; color-scheme: dark; }
.hit-add { margin-left: auto; color: var(--accent); font-weight: 900; font-size: 16px; }
.search-loading {
    display: block; color: var(--accent); padding: 4px 6px; font-size: 12px;
    animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }
.search-hit { position: relative; }
#headerSearchResults .side-group {
    font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
    color: var(--accent); margin: 6px 0 2px; padding: 0 6px;
}
.gc-row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }

/* Controller-Rating */
.rating { display: flex; gap: 2px; cursor: pointer; }
.rating .pad { width: 20px; height: 20px; opacity: .25; transition: opacity .1s; }
.rating .pad.on { opacity: 1; filter: drop-shadow(0 0 4px var(--accent)); }
.rating .pad svg { width: 100%; height: 100%; fill: var(--accent); }

.gc-remove { color: var(--muted); cursor: pointer; font-size: 13px; background: none; border: none; }
.gc-remove:hover { color: var(--danger); }

/* ===== Buttons ===== */
.btn {
    background: var(--accent); color: #000; font-weight: 700;
    border: none; border-radius: var(--radius); padding: 8px 18px; cursor: pointer;
    display: inline-block; text-align: center;
}
.btn:hover { filter: brightness(1.15); }
.btn-small { padding: 5px 10px; font-size: 12px; width: fit-content; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-big { font-size: 18px; padding: 12px 32px; }
.btn-full { width: 100%; }

/* ===== Modals ===== */
.modal {
    position: fixed; inset: 0; z-index: 300;
    background: transparent;            /* keine Verdunkelung, nur Blur */
    backdrop-filter: blur(14px) saturate(1.3);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    display: flex; align-items: center; justify-content: center;
}
.modal-box {
    /* Liquid Glass: halbtransparent + eigener Blur + heller Randschimmer */
    background: rgba(22, 22, 25, .68);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .08);
    border-radius: var(--radius);
    padding: 26px; width: 360px; max-width: 92vw; position: relative;
    max-height: 85vh; overflow-y: auto;
}
.modal-wide { width: 780px; max-height: 90vh; }
.modal-close {
    position: absolute; top: 8px; right: 12px; background: none; border: none;
    color: var(--muted); font-size: 26px; cursor: pointer;
}
.modal-box h3 { margin-bottom: 14px; color: var(--accent); }
.modal-box input {
    width: 100%; padding: 9px 12px; margin-bottom: 10px;
    background: var(--bg); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius); outline: none;
}
.modal-box input:focus { border-color: var(--accent); }
.modal-box small { color: var(--muted); display: block; margin: -4px 0 10px; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tab { flex: 1; padding: 8px; background: var(--panel-2); border: 1px solid var(--border);
    color: var(--muted); border-radius: var(--radius); cursor: pointer; }
.tab.active { background: var(--accent); color: #000; font-weight: 700; border-color: var(--accent); }

.oauth-row { display: flex; gap: 8px; margin-top: 16px; }
.oauth { flex: 1; color: #fff; font-size: 14px; }
.oauth.discord { background: #5865f2; }
.oauth.discord:hover { background: #6b76f5; }
.oauth.twitch { background: #9146ff; }
.oauth.twitch:hover { background: #a163ff; }

.error { color: var(--danger); margin-top: 12px; font-size: 13px; }

.link-accounts { display: flex; flex-direction: column; gap: 6px; }
.link-accounts .oauth { font-size: 13px; padding: 6px 12px; }
.linked { font-size: 13px; padding: 6px 0; }
.discord-c { color: #5865f2; }
.twitch-c { color: #9146ff; }

/* IGDB Suche im Modal */
.igdb-results { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.igdb-preview { margin-top: 14px; background: var(--panel-2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px; display: flex; gap: 14px; }
.igdb-preview img { width: 170px; border-radius: 6px; object-fit: cover; align-self: flex-start; }
.igdb-preview .p-body { flex: 1; }
.igdb-preview h4 { color: var(--accent); margin-bottom: 6px; }
.igdb-preview .p-meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.igdb-preview p.desc { font-size: 13px; max-height: 240px; overflow-y: auto; margin-bottom: 12px; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
    #leftSidebar { display: none; }
    #layout { grid-template-columns: 1fr; }
    #mainContent { grid-column: 1; }
    .greeting { display: none; }
}
