:root {
    --bg: #0b141a;
    --bg-2: #101c26;
    --panel: #16222e;
    --panel-2: #1b2c39;
    --border: #2a475e;
    --border-soft: #22384a;
    --text: #d7e2ea;
    --muted: #8299ab;
    --accent: #66c0f4;
    --green: #2e9e4f;
    --yellow: #c9a227;
    --red: #b3362f;
    --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background:
        radial-gradient(1200px 500px at 50% -10%, #1e3d52 0%, var(--bg) 55%),
        linear-gradient(180deg, #0b141a 0%, #060c12 100%);
    background-attachment: fixed;
    color: var(--text);
    font-family: "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
    min-height: 100vh;
}

header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 32px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(20,40,55,0.95) 0%, rgba(11,20,26,0.95) 100%);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(6px);
}

.logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #fff;
    text-transform: uppercase;
    background: linear-gradient(90deg, var(--accent), #8ab4ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav {
    display: flex;
    gap: 6px;
    flex: 1;
}

nav a {
    color: var(--muted);
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 14px;
    transition: all .15s;
}

nav a:hover { color: var(--text); background: var(--panel-2); }
nav a.active {
    color: #fff;
    background: rgba(102, 192, 244, 0.12);
    border-color: rgba(102, 192, 244, 0.4);
    box-shadow: 0 0 0 1px rgba(102,192,244,0.1) inset;
}

.player-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 14px;
}
#player-name { font-weight: 700; }
#streak-label { color: var(--muted); font-size: 12px; }

main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 32px 64px;
}

#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
#mode-title {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
}
#attempts-info { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

/* Suche */
#search-wrapper { position: relative; margin-bottom: 24px; }

#search-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
#search-input::placeholder { color: var(--muted); }
#search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(102,192,244,0.18);
}

.autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 340px;
    overflow-y: auto;
    z-index: 20;
    display: none;
}
.autocomplete.open { display: block; }
.autocomplete-item {
    padding: 10px 18px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    border-left: 3px solid transparent;
}
.autocomplete-item:hover, .autocomplete-item.selected {
    background: rgba(102,192,244,0.1);
    border-left-color: var(--accent);
}
.autocomplete-item .year { color: var(--muted); font-size: 13px; }

/* Brett */
#board-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
}

table#board {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

#board th {
    padding: 12px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
    font-weight: 600;
}

#board td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--panel);
    min-width: 96px;
    font-size: 13px;
    vertical-align: middle;
    word-break: break-word;
    line-height: 1.5;
}

#board tr:last-child td { border-bottom: none; }

#board td.title-cell {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    font-weight: 700;
    min-width: 170px;
    color: #fff;
    border-right: 1px solid var(--border-soft);
}

/* Status-Zellen */
.cell { border-radius: 6px; }
#board td.cell.green, td.cell.green { background: linear-gradient(180deg, #34b25a, var(--green)); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); }
#board td.cell.yellow, td.cell.yellow { background: linear-gradient(180deg, #dfb43a, var(--yellow)); color: #17190d; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2); }
#board td.cell.red, td.cell.red { background: linear-gradient(180deg, #cf453c, var(--red)); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); }

.cell.green .dir-pill, .cell.red .dir-pill { background: rgba(0,0,0,0.25); color: #fff; }
.cell.yellow .dir-pill { background: rgba(0,0,0,0.18); color: #17190d; }
.cell.green .badge, .cell.red .badge { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.25); }
.cell.yellow .badge { background: rgba(255,255,255,0.35); border-color: rgba(0,0,0,0.15); }

/* Badges (Icon + Label) */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    margin: 1px 3px 1px 0;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border-soft);
    white-space: nowrap;
}
.badge .bicon { font-size: 13px; line-height: 1; }

/* Zahlen (Jahr/Budget) */
.num { font-weight: 700; font-size: 14px; margin-right: 6px; }

/* Pfeil-Kapsel mit Zahl */
.dir-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: rgba(0,0,0,0.25);
    color: #fff;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.dir-pill.up { background: #216e37; color: #b8f5c6; }
.dir-pill.down { background: #8f2f29; color: #ffd0ca; }
.dir-pill.far { background: #b3362f; color: #ffd6c6; }

/* FSK Badge */
.fsk {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 22px;
    padding: 0 6px;
    border-radius: 5px;
    font-weight: 800;
    font-size: 13px;
    background: rgba(0,0,0,0.35);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
}
.fsk-0 { background: #2e7d32; }
.fsk-6 { background: #2f6fbe; }
.fsk-12 { background: #f9a825; color: #201a03; }
.fsk-16 { background: #ef6c00; }
.fsk-18 { background: #b71c1c; }

.director { font-weight: 600; }
.none { color: rgba(255,255,255,0.55); }

/* Ergebnis */
#result-box {
    margin-top: 24px;
    padding: 22px 26px;
    border-radius: var(--radius);
    background: var(--panel-2);
    border: 1px solid var(--border);
    font-size: 16px;
}
#result-box.won { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
#result-box.lost { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
#result-box .target-title { font-size: 20px; font-weight: 700; margin: 6px 0; color: #fff; }

#result-box button {
    margin-top: 14px;
    padding: 11px 22px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(180deg, #7bd0f8, var(--accent));
    color: #062030;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102,192,244,0.3);
    transition: filter .15s;
}
#result-box button:hover { filter: brightness(1.08); }

.hidden { display: none !important; }

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(4, 10, 15, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}
.modal-content {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 30px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.modal-content h2 { margin-bottom: 8px; color: #fff; }
.modal-content p { color: var(--muted); margin-bottom: 18px; line-height: 1.5; }
.modal-content input {
    width: 100%;
    padding: 13px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-2);
    color: var(--text);
    font-size: 15px;
    margin-bottom: 14px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.modal-content input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(102,192,244,0.18); }
.modal-content button {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(180deg, #7bd0f8, var(--accent));
    color: #062030;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102,192,244,0.3);
    transition: filter .15s;
}

