/* ==========================================================
   Bits OBS Bingo – Admin Design
   ========================================================== */

:root {
    --bg: #0a0912;
    --surface: rgba(255, 255, 255, 0.045);
    --surface-2: rgba(255, 255, 255, 0.075);
    --surface-solid: #15131f;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text: #eeedf7;
    --muted: #a3a1bd;
    --faint: #6f6c8a;

    --violet: #8b5cf6;
    --violet-soft: rgba(139, 92, 246, 0.18);
    --cyan: #22d3ee;
    --cyan-soft: rgba(34, 211, 238, 0.16);
    --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #22d3ee 100%);
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.16);
    --danger: #f43f5e;
    --danger-soft: rgba(244, 63, 94, 0.14);
    --warning: #f59e0b;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --blur: blur(18px) saturate(140%);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    --focus: 0 0 0 3px rgba(139, 92, 246, 0.45);

    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;

    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

[hidden] { display: none !important; }

.icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-lg .icon { width: 19px; height: 19px; }
.bookmark h3 .icon { width: 18px; height: 18px; color: var(--cyan); }
.note > .icon { width: 18px; height: 18px; color: var(--warning); margin-top: 2px; }
.badge .icon { width: 12px; height: 12px; }
.toast > .icon { width: 18px; height: 18px; }
.toast-success > .icon { color: var(--success); }
.toast-error > .icon { color: var(--danger); }
.toast-info > .icon { color: var(--cyan); }
.modal-icon { display: inline-flex; }
.modal-icon .icon { width: 22px; height: 22px; }
.modal-icon-info { color: var(--cyan); }
.modal-icon-success { color: var(--success); }
.modal-icon-warning { color: var(--warning); }
.modal-icon-error { color: var(--danger); }

button, input, textarea, select { font: inherit; color: inherit; }

a { color: var(--cyan); }

::selection { background: rgba(139, 92, 246, 0.45); }

/* ---------- Aurora Hintergrund ---------- */
.aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.aurora span {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.45;
    animation: drift 26s ease-in-out infinite alternate;
}

.aurora span:nth-child(1) { width: 560px; height: 560px; background: #7c3aed; top: -180px; left: -120px; }
.aurora span:nth-child(2) { width: 480px; height: 480px; background: #0891b2; top: 30%; right: -160px; animation-delay: -8s; animation-duration: 32s; }
.aurora span:nth-child(3) { width: 420px; height: 420px; background: #4f46e5; bottom: -200px; left: 30%; animation-delay: -16s; opacity: 0.3; }

.aurora::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: linear-gradient(to bottom, black, transparent 80%);
}

@keyframes drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(80px, 60px) scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
    .aurora span { animation: none; }
    html { scroll-behavior: auto; }
}

/* ---------- Kopfleiste ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px max(16px, calc((100vw - 1200px) / 2));
    background: rgba(10, 9, 18, 0.6);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.brand-logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.brand-name span {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.code-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 12px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--muted);
}

.code-chip strong {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.06em;
}

.save-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.save-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.save-status[data-state="saving"]::before { background: var(--warning); box-shadow: 0 0 10px var(--warning); animation: pulse 0.9s ease-in-out infinite; }
.save-status[data-state="error"]::before { background: var(--danger); box-shadow: 0 0 10px var(--danger); }

@keyframes pulse { 50% { opacity: 0.3; } }

/* ---------- Layout ---------- */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 16px 80px;
}

.card {
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.card + .card { margin-top: 20px; }

.card-title {
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.card-sub {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 14px;
}

.eyebrow {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
}

.muted { color: var(--muted); }

kbd {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.18s, border-color 0.18s, transform 0.18s, box-shadow 0.18s, opacity 0.18s;
}

.btn:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
    background: var(--grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover { background: var(--grad); filter: brightness(1.1); border-color: transparent; box-shadow: 0 8px 30px rgba(124, 58, 237, 0.5); }

.btn-danger { color: #fda4af; background: var(--danger-soft); border-color: rgba(244, 63, 94, 0.3); }
.btn-danger:hover { background: rgba(244, 63, 94, 0.24); border-color: rgba(244, 63, 94, 0.5); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }

.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-block { width: 100%; }

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    flex-shrink: 0;
}

.btn-group { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Eingaben ---------- */
.input, .textarea {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.28);
    color: var(--text);
    font-size: 14px;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .textarea:focus { outline: none; border-color: var(--violet); box-shadow: var(--focus); background: rgba(0, 0, 0, 0.4); }
.input-mono { font-family: var(--font-mono); font-size: 13px; color: var(--cyan); }
.textarea { resize: vertical; min-height: 90px; }

.field-row { display: flex; gap: 8px; }
.field-row .input { flex: 1; min-width: 0; }

.check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    user-select: none;
}

.check input { position: absolute; opacity: 0; pointer-events: none; }

.switch {
    position: relative;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--border);
    transition: background 0.2s;
}

.switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
}

.check input:checked + .switch { background: var(--violet); border-color: transparent; }
.check input:checked + .switch::after { transform: translateX(16px); }
.check input:focus-visible + .switch { box-shadow: var(--focus); }

/* ---------- Startseite ---------- */
.hero {
    text-align: center;
    margin: 24px auto 40px;
    max-width: 720px;
}

.hero-logo { width: 72px; height: 72px; margin-bottom: 18px; filter: drop-shadow(0 10px 30px rgba(124, 58, 237, 0.5)); }

.hero h1 {
    margin: 0 0 12px;
    font-family: var(--font-display);
    font-size: clamp(36px, 6vw, 56px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.hero h1 span {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p { margin: 0; color: var(--muted); font-size: 17px; }

.start-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.start-grid .card + .card { margin-top: 0; }

.type-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.type-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.type-card:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-2px); }
.type-card:focus-visible { outline: none; box-shadow: var(--focus); }

.type-card.active {
    border-color: rgba(139, 92, 246, 0.7);
    background: linear-gradient(160deg, rgba(139, 92, 246, 0.2), rgba(34, 211, 238, 0.08));
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.4), 0 10px 30px rgba(124, 58, 237, 0.25);
}

.type-card.active::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat, var(--grad);
}

.type-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px;
    margin-bottom: 6px;
    border-radius: 12px;
    background: var(--violet-soft);
    color: #c4b5fd;
    white-space: nowrap;
}

.type-icon .icon { width: 22px; height: 22px; }
.type-card.active .type-icon { background: var(--grad); color: #fff; }
.type-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.type-desc { font-size: 13px; color: var(--muted); line-height: 1.4; }

.size-picker { margin-bottom: 22px; }

.size-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.size-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 8px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    font-weight: 700;
    font-family: var(--font-display);
    transition: border-color 0.2s, background 0.2s;
}

.size-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.size-card:focus-visible { outline: none; box-shadow: var(--focus); }
.size-card.active { border-color: rgba(34, 211, 238, 0.7); background: var(--cyan-soft); color: #a5f3fc; }

.mini-grid {
    display: grid;
    gap: 2px;
    width: 44px;
    height: 44px;
}

.mini-grid i {
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.18);
}

.size-card.active .mini-grid i { background: rgba(34, 211, 238, 0.55); }

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

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.2s, background 0.2s;
}

.recent-item:hover { border-color: var(--border-strong); background: var(--surface-2); }

.recent-link {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text);
}

.recent-code { font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.05em; }
.recent-meta { font-size: 12px; color: var(--faint); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: var(--violet-soft);
    color: #c4b5fd;
    white-space: nowrap;
}

.badge-cyan { background: var(--cyan-soft); color: #a5f3fc; }
.badge-green { background: var(--success-soft); color: #86efac; }

.empty {
    padding: 22px;
    border-radius: 12px;
    border: 1px dashed var(--border-strong);
    text-align: center;
    color: var(--faint);
    font-size: 14px;
}

.note {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: var(--radius);
    background: rgba(245, 158, 11, 0.07);
    border: 1px solid rgba(245, 158, 11, 0.22);
    color: var(--muted);
    font-size: 14px;
}

.note strong { color: #fcd34d; }

/* ---------- Code-Banner (Spielseite) ---------- */
.code-banner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.code-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(139, 92, 246, 0.16), transparent 45%, rgba(34, 211, 238, 0.1));
    pointer-events: none;
}

.code-banner > * { position: relative; }

.code-box {
    padding-right: 28px;
    border-right: 1px solid var(--border);
}

.code-value {
    display: flex;
    align-items: center;
    gap: 12px;
}

.code-value strong {
    font-family: var(--font-mono);
    font-size: clamp(30px, 5vw, 42px);
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.code-type { margin-top: 10px; }

.bookmark h3 {
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bookmark p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }

.code-banner.is-new {
    border-color: rgba(34, 211, 238, 0.6);
    animation: glow 2.2s ease-in-out 3;
}

@keyframes glow {
    50% { box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.2), 0 0 50px rgba(34, 211, 238, 0.35); }
}

.new-hint {
    display: inline-flex;
    margin-bottom: 8px;
}

/* ---------- Tabs ---------- */
.tabbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tabs {
    display: inline-flex;
    gap: 4px;
    padding: 5px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.tab:focus-visible { outline: none; box-shadow: var(--focus); }
.tab.active { background: rgba(255, 255, 255, 0.1); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.tab .badge { font-size: 10px; }

.tabbar-actions { margin-left: auto; display: flex; gap: 8px; }

.tab-panel { animation: fadeUp 0.25s ease; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Bingo ---------- */
.toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 14px 16px;
}

.progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}

.progress-label { font-size: 13px; color: var(--muted); }
.progress-label strong { color: var(--text); font-size: 15px; }

.progress-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.progress-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--success), #4ade80);
    border-radius: inherit;
    transition: width 0.35s ease;
}

.toolbar .btn-group { margin-left: auto; }

.bingo-grid {
    display: grid;
    gap: 12px;
}

.cell {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.cell:hover { border-color: var(--border-strong); }
.cell:focus-within { border-color: rgba(139, 92, 246, 0.6); }

.cell.checked {
    background: linear-gradient(160deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.06));
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 0 24px rgba(34, 197, 94, 0.15);
}

.cell-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.cell-num {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--faint);
}

.cell-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
}

.cell-check:hover { color: var(--text); border-color: var(--border-strong); }
.cell-check:focus-visible { outline: none; box-shadow: var(--focus); }

.cell-check::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid currentColor;
}

.cell.checked .cell-check { background: var(--success); border-color: var(--success); color: #052e16; }
/* Haken per CSS gezeichnet */
.cell.checked .cell-check::before {
    width: 4px;
    height: 8px;
    margin: 0 3px 2px;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    border-radius: 0;
    transform: rotate(45deg);
}

.cell textarea {
    flex: 1;
    width: 100%;
    min-height: 64px;
    resize: none;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(0, 0, 0, 0.25);
    color: var(--text);
    font-size: 14px;
    line-height: 1.35;
    transition: border-color 0.18s, background 0.18s;
}

.cell textarea:focus { outline: none; border-color: rgba(139, 92, 246, 0.6); background: rgba(0, 0, 0, 0.4); }
.cell textarea::placeholder { color: var(--faint); }

.bingo-grid.size-5 .cell textarea, .bingo-grid.size-6 .cell textarea { font-size: 13px; }
.bingo-grid.size-6 { gap: 10px; }
.bingo-grid.size-6 .cell { padding: 8px; }
.bingo-grid.size-6 .cell-check span { display: none; }

/* ---------- Glücksrad ---------- */
.wheel-layout {
    display: grid;
    grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.wheel-preview {
    position: sticky;
    top: 84px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.wheel-preview canvas { width: 100%; max-width: 380px; aspect-ratio: 1; }

.wheel-last {
    min-height: 48px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    text-align: center;
    color: var(--faint);
    font-size: 14px;
}

.wheel-last strong { display: block; color: var(--text); font-family: var(--font-display); font-size: 18px; }

.list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--muted);
}

.wheel-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 460px;
    overflow-y: auto;
    padding: 2px 4px 2px 2px;
}

.wheel-entry {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wheel-entry-num {
    width: 26px;
    flex-shrink: 0;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--faint);
}

.wheel-entry-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.wheel-entry .input { padding: 9px 12px; }

.wheel-actions { margin-top: 12px; }

details.fold {
    margin-top: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

details.fold summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::after { content: '▾'; margin-left: auto; color: var(--faint); transition: transform 0.2s; }
details.fold[open] summary::after { transform: rotate(180deg); }
details.fold .fold-body { padding: 0 16px 16px; }

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.wheel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 40px 20px;
}

.big-icon {
    display: inline-grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-bottom: 12px;
    border-radius: 20px;
    background: var(--violet-soft);
    color: #c4b5fd;
}

.big-icon .icon { width: 34px; height: 34px; }
.wheel-empty p { max-width: 460px; margin: 0 0 12px; color: var(--muted); }

/* ---------- OBS ---------- */
.obs-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
    gap: 20px;
    align-items: start;
}

.obs-layout .card + .card { margin-top: 20px; }

.steps {
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.steps li {
    counter-increment: step;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 14px;
    color: var(--muted);
}

.steps li::before {
    content: counter(step);
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--violet-soft);
    color: #c4b5fd;
    font-size: 12px;
    font-weight: 700;
}

.steps strong { color: var(--text); }

.color-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.color-row:first-of-type { border-top: none; }
.color-row .check { flex: 1; }

input[type="color"] {
    width: 44px;
    height: 34px;
    padding: 2px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

input[type="color"]:disabled { opacity: 0.35; cursor: not-allowed; }

.preview-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background-color: #1b1a26;
    background-image:
        linear-gradient(45deg, #23222f 25%, transparent 25%),
        linear-gradient(-45deg, #23222f 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #23222f 75%),
        linear-gradient(-45deg, transparent 75%, #23222f 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.preview-frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 650px;
    height: 650px;
    border: 0;
    transform-origin: top left;
    pointer-events: none;
    /* Gleiches Farbschema wie das Overlay, sonst malt der Browser einen weißen Hintergrund */
    color-scheme: normal;
}

/* ---------- Fehler-/Ladezustand ---------- */
.state-card {
    max-width: 520px;
    margin: 40px auto;
    text-align: center;
}


.loader {
    width: 36px;
    height: 36px;
    margin: 80px auto;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--violet);
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toasts ---------- */
.toasts {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(26, 24, 38, 0.85);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
    font-size: 14px;
    font-weight: 500;
    animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: opacity 0.3s, transform 0.3s;
}

.toast.out { opacity: 0; transform: translateY(8px); }
.toast-success { border-color: rgba(34, 197, 94, 0.45); }
.toast-error { border-color: rgba(244, 63, 94, 0.5); }

@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.96); } }

/* ---------- Dialog ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(5, 4, 10, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-overlay.active { opacity: 1; }

.modal-box {
    width: 100%;
    max-width: 440px;
    padding: 24px;
    border-radius: var(--radius-lg);
    background: rgba(24, 22, 36, 0.92);
    border: 1px solid var(--border-strong);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    transform: scale(0.94);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-box { transform: scale(1); }

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 700;
}

.modal-content { color: var(--muted); white-space: pre-line; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .start-grid, .obs-layout { grid-template-columns: minmax(0, 1fr); }
    .wheel-layout { grid-template-columns: minmax(0, 1fr); }
    .wheel-preview { position: static; }
}

@media (max-width: 760px) {
    main { padding-top: 20px; }
    .card { padding: 18px; border-radius: var(--radius); }
    .topbar { gap: 10px; }
    .brand-name, .save-status span { display: none; }
    .type-cards { grid-template-columns: minmax(0, 1fr); }
    .type-card { flex-direction: row; align-items: center; gap: 14px; }
    .type-icon { margin: 0; }
    .size-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .code-banner { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .code-box { padding-right: 0; padding-bottom: 18px; border-right: none; border-bottom: 1px solid var(--border); }
    .field-row { flex-wrap: wrap; }
    .field-row .btn { flex: 1; }
    .tabbar-actions { margin-left: 0; width: 100%; }
    .tabbar-actions .btn { flex: 1; }
    .tabs { width: 100%; }
    .tab { flex: 1; justify-content: center; padding: 9px 6px; font-size: 13px; white-space: nowrap; }
    .tab .badge { display: none; }
    .toolbar .btn-group { margin-left: 0; width: 100%; }
    .toolbar .btn-group .btn { flex: 1; }
    /* Bingo-Raster auf dem Handy als zweispaltige Liste */
    .bingo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .bingo-grid.size-6 .cell-check span { display: inline; }
    .settings-grid { grid-template-columns: minmax(0, 1fr); }
    .toasts { left: 16px; right: 16px; }
}
