/* =========================================================================
   Kreisliga-Bingo – Oberfläche
   Dunkles Glas-Design, Akzente in Mint/Blau, Gold für Bingos.
   ========================================================================= */

:root {
    --bg-0: #070a12;
    --bg-1: #0d1322;
    --panel: rgba(255, 255, 255, 0.045);
    --panel-strong: rgba(255, 255, 255, 0.075);
    --line: rgba(255, 255, 255, 0.09);
    --line-soft: rgba(255, 255, 255, 0.055);
    --text: #e9eef8;
    --muted: #8e9bb8;
    --mint: #4dd4ac;
    --blue: #35b8ff;
    --gold: #ffcc4d;
    --danger: #ff5d5d;
    --radius: 16px;
    --radius-sm: 11px;
    --shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
    --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
            "Inter", "Helvetica Neue", Arial, sans-serif;
    color-scheme: dark;
}

* { box-sizing: border-box; }

/* Muss vor allen display-Regeln stehen: sonst gewinnt display:flex gegen hidden. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg-0);
    overflow: hidden;
}

/* ---------------------------------------------------------------- Hintergrund */
.aurora {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background:
        radial-gradient(1100px 620px at 15% -12%, #1b2c52 0%, transparent 60%),
        radial-gradient(900px 600px at 92% 8%, #14324a 0%, transparent 55%),
        linear-gradient(180deg, #0a0f1c 0%, var(--bg-0) 100%);
}
.blob {
    position: absolute;
    width: 46vw;
    height: 46vw;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.32;
    animation: drift 26s ease-in-out infinite alternate;
}
.b1 { background: #1f7a63; top: -14%; left: -8%; }
.b2 { background: #1b5f96; bottom: -22%; right: -10%; animation-delay: -8s; }
.b3 { background: #4a2d7a; top: 32%; left: 46%; animation-delay: -15s; opacity: 0.22; }
@keyframes drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(4vw, 5vh, 0) scale(1.16); }
}
.grid-lines {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(ellipse 80% 65% at 50% 40%, #000 30%, transparent 100%);
}

@media (prefers-reduced-motion: reduce) {
    .blob { animation: none; }
}

/* ------------------------------------------------------------------- Views */
.view { display: none; position: relative; z-index: 1; height: 100vh; }
body[data-view="login"]  .view-login,
body[data-view="lobby"]  .view-lobby,
body[data-view="editor"] .view-editor,
body[data-view="join"]   .view-join,
body[data-view="game"]   .view-game { display: flex; flex-direction: column; }

body[data-view="login"] .view-login,
body[data-view="join"] .view-join { align-items: center; justify-content: center; }

/* ------------------------------------------------------------- Grundelemente */
.btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 9px 15px;
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    background: var(--panel-strong);
    cursor: pointer;
    transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
    white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.btn-primary {
    background: linear-gradient(135deg, var(--mint), var(--blue));
    color: #04121d;
    border-color: transparent;
}
.btn-primary:hover { filter: brightness(1.09); background: linear-gradient(135deg, var(--mint), var(--blue)); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--panel-strong); }
.btn-danger { background: rgba(255, 93, 93, 0.14); border-color: rgba(255, 93, 93, 0.4); color: #ffb9b9; }
.btn-danger:hover { background: rgba(255, 93, 93, 0.24); }
.btn-block { width: 100%; display: block; }
.icon-btn { padding: 9px 12px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

input[type="text"], input[type="password"], input[type="search"], textarea, select {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(6, 10, 20, 0.6);
    color: var(--text);
    font: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}
input::placeholder, textarea::placeholder { color: #5f6c88; }
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: rgba(53, 184, 255, 0.65);
    background: rgba(6, 10, 20, 0.85);
}

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.lbl { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted);
       text-transform: uppercase; letter-spacing: 0.05em; margin: 16px 0 7px; }
.lbl:first-child { margin-top: 0; }

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}
.panel-title {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 12.5px; font-weight: 700; letter-spacing: 0.07em;
    text-transform: uppercase; color: var(--muted);
}
.panel-title input[type="search"] {
    width: 120px; padding: 5px 9px; font-size: 12px; text-transform: none; letter-spacing: 0;
}

/* Scrollbars */
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.13); border-radius: 20px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); }

/* ------------------------------------------------------------------- Login */
.login-card {
    width: min(400px, 92vw);
    padding: 38px 34px 30px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 22px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    text-align: center;
    animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.login-mark {
    width: 68px; height: 68px; margin: 0 auto 18px;
    display: grid; place-items: center;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(77, 212, 172, 0.22), rgba(53, 184, 255, 0.2));
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 32px;
}
.login-mark .ball { animation: bob 3.4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
.login-title { margin: 0 0 6px; font-size: 25px; letter-spacing: -0.02em; }
.login-sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.field { margin-bottom: 14px; }
.field input { text-align: center; font-size: 16px; }
.form-error {
    margin: 14px 0 0; padding: 9px 12px; border-radius: 10px; font-size: 13.5px;
    background: rgba(255, 93, 93, 0.13);
    border: 1px solid rgba(255, 93, 93, 0.35);
    color: #ffc0c0;
}
.view-join .btn-ghost { margin-top: 10px; }
.join-resume { margin: 0 0 18px; }
.join-resume-hint { margin: 0 0 9px; font-size: 13px; color: var(--muted); }
.join-resume .avatars { justify-content: center; }
.avatar-btn { font-family: inherit; cursor: pointer; color: var(--text); transition: border-color 0.15s ease, background 0.15s ease; }
.avatar-btn:hover:not([disabled]) { background: rgba(255, 255, 255, 0.12); border-color: rgba(53, 184, 255, 0.5); }
.avatar-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.avatar-score { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ Topbar */
.topbar {
    flex: 0 0 auto;
    display: flex; align-items: center; gap: 16px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(8, 12, 22, 0.55);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; }
.brand-dot {
    width: 11px; height: 11px; border-radius: 50%;
    background: linear-gradient(135deg, var(--mint), var(--blue));
    box-shadow: 0 0 14px rgba(77, 212, 172, 0.7);
}
.brand-name { font-size: 16px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.tabs { display: flex; gap: 4px; background: rgba(255, 255, 255, 0.05); padding: 4px; border-radius: 12px; }
.tab {
    border: 0; background: transparent; color: var(--muted);
    font: inherit; font-weight: 600; font-size: 14px;
    padding: 7px 16px; border-radius: 9px; cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: rgba(255, 255, 255, 0.1); color: var(--text); }

/* ------------------------------------------------------------------- Lobby */
.lobby-main { flex: 1 1 auto; overflow-y: auto; padding: 26px 24px 60px; }
.lobby-panel { max-width: 1180px; margin: 0 auto; }
.panel-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 20px; flex-wrap: wrap; margin-bottom: 20px;
}
.panel-head h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.02em; }
.panel-head p { margin: 0; font-size: 14px; }
.panel-actions { display: flex; align-items: center; gap: 10px; }
.join-inline { display: flex; gap: 6px; }
.join-inline input {
    width: 108px; text-transform: uppercase; letter-spacing: 0.16em;
    font-weight: 700; text-align: center; padding: 9px 10px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
}
.card {
    position: relative;
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
    display: flex; flex-direction: column; gap: 12px;
}
.card:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.2); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.card-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card-actions { display: flex; gap: 8px; margin-top: auto; }
.card-actions .btn { flex: 1; text-align: center; }
.card-empty {
    grid-column: 1 / -1; padding: 44px 20px; text-align: center;
    border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted);
}

.code-badge {
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 15px; font-weight: 700; letter-spacing: 0.18em;
    padding: 5px 10px; border-radius: 9px;
    background: rgba(53, 184, 255, 0.13);
    border: 1px solid rgba(53, 184, 255, 0.32);
    color: #a9dcff;
}
.avatars { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px 4px 6px; border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    font-size: 12.5px; font-weight: 600;
}
.avatar .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.avatar.is-offline { opacity: 0.42; }
.tag {
    display: inline-block; padding: 3px 9px; border-radius: 8px; font-size: 12px;
    background: rgba(255, 255, 255, 0.07); color: var(--muted);
}
.tag.warn { background: rgba(255, 204, 77, 0.14); color: var(--gold); }

/* ------------------------------------------------------------------ Editor */
.editor-main {
    flex: 1 1 auto; overflow: hidden;
    display: grid; grid-template-columns: 340px 1fr; gap: 18px;
    padding: 20px 24px 24px; max-width: 1180px; width: 100%; margin: 0 auto;
}
.editor-meta, .editor-items { padding: 20px; overflow-y: auto; }
.editor-items { display: flex; flex-direction: column; }
.editor-items textarea {
    flex: 1 1 auto; resize: none; min-height: 320px; line-height: 1.85;
    font-family: "Cascadia Code", Consolas, monospace; font-size: 13.5px;
}
.editor-stats { display: flex; gap: 12px; margin-top: 22px; }
.stat {
    flex: 1; padding: 14px; border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
    text-align: center;
}
.stat-num { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.stat-lbl { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.stat.is-bad .stat-num { color: var(--danger); }
.stat.is-good .stat-num { color: var(--mint); }
.editor-hint { font-size: 13px; color: var(--muted); margin: 14px 0 0; }
#editor-delete { margin-top: 20px; }

/* -------------------------------------------------------------------- Spiel */
.game-topbar { gap: 14px; }
.game-ident { display: flex; align-items: center; gap: 10px; min-width: 0; }
.game-name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.code-chip {
    font-family: "Cascadia Code", Consolas, monospace; font-weight: 700;
    letter-spacing: 0.16em; font-size: 13px; padding: 5px 10px; border-radius: 9px;
    background: rgba(53, 184, 255, 0.13); border: 1px solid rgba(53, 184, 255, 0.3);
    color: #a9dcff; cursor: pointer;
}
.code-chip:hover { background: rgba(53, 184, 255, 0.22); }
.list-chip { font-size: 12.5px; color: var(--muted); }
.player-strip { display: flex; gap: 6px; overflow: hidden; flex: 1 1 auto; justify-content: flex-end; }

.game-main {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 400px minmax(0, 1fr) 330px;
    gap: 16px;
    padding: 16px 18px 18px;
    overflow: hidden;
}
/* Video im externen Fenster: schmale Spalte, mehr Platz fürs Spielfeld. */
.game-main.video-out { grid-template-columns: 250px minmax(0, 1fr) 330px; }
.game-main.video-out .video-url { display: none; }

/* Video-Spalte */
.col-video { display: flex; flex-direction: column; overflow: hidden; }
.sync-badge {
    text-transform: none; letter-spacing: 0; font-size: 11.5px; font-weight: 700;
    padding: 3px 9px; border-radius: 20px;
    background: rgba(77, 212, 172, 0.16); color: var(--mint);
    border: 1px solid rgba(77, 212, 172, 0.3);
}
.sync-badge.is-syncing { background: rgba(255, 204, 77, 0.16); color: var(--gold); border-color: rgba(255, 204, 77, 0.32); }
.video-shell { position: relative; padding: 12px 12px 0; }
.video-frame {
    position: relative; width: 100%; aspect-ratio: 16 / 9;
    background: #000; border-radius: 12px; overflow: hidden;
    border: 1px solid var(--line);
}
.video-frame iframe { width: 100%; height: 100%; display: block; border: 0; }
.video-overlay {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 10px;
    background: rgba(4, 8, 16, 0.82); backdrop-filter: blur(4px); text-align: center; padding: 16px;
}
.video-empty, .video-popped {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 12px; text-align: center; padding: 26px 18px;
    border: 1px dashed var(--line); border-radius: 12px; min-height: 150px;
}
.video-popped p { margin: 0; font-weight: 600; }
.video-controls { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.video-url { display: flex; gap: 8px; }
.video-buttons { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.video-status { margin: 0; min-height: 17px; }
.video-status.is-error { color: #ffb9b9; font-weight: 600; }

.feed {
    flex: 1 1 auto; overflow-y: auto; padding: 4px 14px 14px;
    display: flex; flex-direction: column; gap: 7px; min-height: 0;
}
.feed-row {
    display: flex; align-items: center; gap: 8px; font-size: 13px;
    padding: 7px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.035);
    animation: slide-in 0.35s ease;
}
@keyframes slide-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.feed-row .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.feed-row .who { font-weight: 700; }
.feed-row .what { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Bingofeld */
.col-board { display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 12px; }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.board-progress { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.bingo-count {
    padding: 3px 10px; border-radius: 20px; font-size: 12.5px; font-weight: 800;
    background: rgba(255, 204, 77, 0.16); color: var(--gold);
    border: 1px solid rgba(255, 204, 77, 0.34);
}
.board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    /* minmax(0,1fr) statt 1fr: sonst wachsen Zeilen mit langen Begriffen
       ueber das Quadrat hinaus und die untere Reihe rutscht aus dem Bild. */
    grid-auto-rows: minmax(0, 1fr);
    gap: 9px;
    /* Quadratisch und immer vollstaendig sichtbar: begrenzt durch Spaltenbreite
       ODER durch die Fensterhoehe abzueglich Kopfzeilen. */
    width: min(100%, calc(100vh - 165px), 780px);
    aspect-ratio: 1;
    margin: 0 auto;
    min-height: 0;
}
.cell {
    position: relative;
    display: flex; align-items: center; justify-content: center; text-align: center;
    padding: 8px 7px;
    border-radius: 13px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
    font: inherit; font-weight: 600; font-size: 14px; line-height: 1.22;
    cursor: pointer;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
    hyphens: auto;
    transition: transform 0.13s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.cell:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); }
.cell:active { transform: scale(0.97); }
.cell.len-m { font-size: 12.5px; }
.cell.len-l { font-size: 11px; letter-spacing: -0.01em; }
.cell.is-marked {
    background: color-mix(in srgb, var(--own) 26%, transparent);
    border-color: color-mix(in srgb, var(--own) 65%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--own) 25%, transparent),
                0 6px 18px color-mix(in srgb, var(--own) 18%, transparent);
    animation: pop 0.32s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.07); } 100% { transform: scale(1); } }
.cell.is-marked::after {
    content: "✓";
    position: absolute; top: 5px; right: 7px;
    font-size: 12px; font-weight: 800; color: var(--own); opacity: 0.85;
}
.cell.is-joker {
    background: linear-gradient(135deg, rgba(255, 204, 77, 0.2), rgba(255, 138, 77, 0.14));
    border-color: rgba(255, 204, 77, 0.42);
    color: var(--gold); font-weight: 800; letter-spacing: 0.08em; cursor: default;
}
.cell.is-joker::after { content: none; }
.cell.is-joker:hover { transform: none; }
.cell.in-bingo {
    border-color: rgba(255, 204, 77, 0.85);
    box-shadow: 0 0 0 1px rgba(255, 204, 77, 0.5), 0 0 24px rgba(255, 204, 77, 0.35);
    animation: glow 1.9s ease-in-out infinite;
}
@keyframes glow {
    0%, 100% { box-shadow: 0 0 0 1px rgba(255, 204, 77, 0.45), 0 0 16px rgba(255, 204, 77, 0.24); }
    50%      { box-shadow: 0 0 0 1px rgba(255, 204, 77, 0.75), 0 0 30px rgba(255, 204, 77, 0.45); }
}
.cell .others {
    position: absolute; bottom: 5px; left: 0; right: 0;
    display: flex; justify-content: center; gap: 3px;
}
.cell .others i { width: 5px; height: 5px; border-radius: 50%; display: block; }

/* Scoreboard + Begriffe */
.col-side { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 16px; overflow: hidden; }
.side-scores, .side-items { display: flex; flex-direction: column; overflow: hidden; }
.scoreboard { list-style: none; margin: 0; padding: 8px; overflow-y: auto; max-height: 40vh; }
.score-row {
    display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 9px;
    padding: 8px 9px; border-radius: 11px;
    transition: background 0.15s ease;
}
.score-row + .score-row { margin-top: 2px; }
.score-row:hover { background: rgba(255, 255, 255, 0.05); }
.score-row.is-me { background: rgba(53, 184, 255, 0.09); box-shadow: inset 0 0 0 1px rgba(53, 184, 255, 0.22); }
.rank { font-size: 13px; font-weight: 800; color: var(--muted); text-align: center; }
.score-row:nth-child(1) .rank { color: var(--gold); }
.score-row:nth-child(2) .rank { color: #cfd8ea; }
.score-row:nth-child(3) .rank { color: #d09a6a; }
.score-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.score-name .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.score-name .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-name .off { width: 6px; height: 6px; border-radius: 50%; background: #4a5772; }
.score-stats { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.score-stats .b {
    font-weight: 800; color: var(--gold);
    background: rgba(255, 204, 77, 0.14); border-radius: 7px; padding: 1px 7px; font-size: 12px;
}
.score-stats .m { color: var(--muted); font-variant-numeric: tabular-nums; }

.item-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1 1 auto; }
.item-row {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; border-radius: 10px; font-size: 13.5px;
    transition: background 0.15s ease;
}
.item-row:hover { background: rgba(255, 255, 255, 0.05); }
.item-row.on-board { box-shadow: inset 2px 0 0 var(--blue); }
.item-row.is-mine { background: rgba(77, 212, 172, 0.09); }
.item-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-row.is-done .item-text { color: var(--muted); }
.item-marks { display: flex; gap: 3px; flex: 0 0 auto; }
.item-marks i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.item-count { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Bingo-Feuerwerk */
.bingo-flash {
    position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
    pointer-events: none; background: radial-gradient(circle at 50% 45%, rgba(255, 204, 77, 0.16), transparent 62%);
    animation: flash-in 0.4s ease;
}
@keyframes flash-in { from { opacity: 0; } to { opacity: 1; } }
.bingo-flash-inner { text-align: center; }
.bingo-word {
    display: block;
    font-size: clamp(56px, 12vw, 150px); font-weight: 900; letter-spacing: -0.04em;
    background: linear-gradient(135deg, #fff2c4, var(--gold), #ff8a4d);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: 0 12px 60px rgba(255, 204, 77, 0.4);
    animation: bingo-pop 0.65s cubic-bezier(0.2, 1.5, 0.4, 1);
}
@keyframes bingo-pop {
    0% { transform: scale(0.5) rotate(-4deg); opacity: 0; }
    60% { transform: scale(1.1) rotate(1.5deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); }
}
.bingo-sub { display: block; margin-top: 6px; font-size: 19px; font-weight: 700; color: #ffe9b0; }
.confetti { position: fixed; inset: 0; z-index: 59; pointer-events: none; }

/* Toasts */
.toasts {
    position: fixed; right: 18px; bottom: 18px; z-index: 70;
    display: flex; flex-direction: column; gap: 9px; align-items: flex-end;
}
.toast {
    display: flex; align-items: center; gap: 9px;
    padding: 11px 15px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
    background: rgba(16, 22, 36, 0.94);
    border: 1px solid var(--line);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    animation: toast-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
    max-width: 340px;
}
.toast.is-out { animation: toast-out 0.25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }
.toast .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.toast.ok { border-color: rgba(77, 212, 172, 0.4); }
.toast.err { border-color: rgba(255, 93, 93, 0.45); color: #ffc4c4; }
.toast.gold { border-color: rgba(255, 204, 77, 0.45); color: #ffe9b0; }

/* Modal */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
    background: rgba(4, 7, 14, 0.72); backdrop-filter: blur(6px);
    animation: flash-in 0.2s ease;
}
.modal {
    width: min(440px, 92vw); padding: 24px;
    background: #101728; border: 1px solid var(--line); border-radius: 18px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
    animation: rise 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.modal-title { margin: 0 0 16px; font-size: 19px; letter-spacing: -0.02em; }
.modal-body { display: flex; flex-direction: column; gap: 4px; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions .btn { flex: 1; }
.switch { display: flex; align-items: center; gap: 10px; margin-top: 16px; cursor: pointer; font-size: 14px; }
.switch input { width: auto; }

/* Kleinere Desktops */
@media (max-width: 1420px) {
    .game-main { grid-template-columns: 340px minmax(0, 1fr) 300px; gap: 13px; }
}
@media (max-width: 1180px) {
    .game-main { grid-template-columns: 300px minmax(0, 1fr) 270px; padding: 12px; }
    .board { gap: 7px; }
    .cell { font-size: 12.5px; border-radius: 11px; }
}
@media (max-width: 940px) {
    body { overflow: auto; }
    .view { height: auto; min-height: 100vh; }
    .game-main { grid-template-columns: 1fr; overflow: visible; }
    .col-side { grid-template-rows: auto auto; }
    .scoreboard { max-height: none; }
    .editor-main { grid-template-columns: 1fr; }
    .player-strip { display: none; }
}
