/* ============ Grundlagen ============ */
:root {
    --deep: #08386b;
    --sea: #0b5394;
    --sea-2: #1c7ed6;
    --water: #a5d8ff;
    --water-2: #74c0fc;
    --foam: #e7f5ff;
    --card: #ffffff;
    --ink: #10324f;
    --muted: #5c7a95;
    --sun: #ffd43b;
    --coral: #ff6b6b;
    --hull: #495867;
    --hull-2: #6c7a89;
    --sunk: #862e2e;
    --ok: #40c057;
    --bad: #fa5252;
    --cell: clamp(26px, 3.4vw, 44px);
    --radius: 20px;
    color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "Fredoka", "Segoe UI Rounded", "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
    background: var(--deep);
    -webkit-tap-highlight-color: transparent;
}

h1, h2 { margin: 0; font-weight: 700; }
h1:focus { outline: none; }

button { font: inherit; color: inherit; }

.sea {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--deep) 0%, var(--sea) 30%, var(--sea-2) 100%);
    position: relative;
    overflow-x: hidden;
}

.waves {
    position: fixed;
    inset: auto 0 0 0;
    height: 120px;
    background:
        radial-gradient(60px 22px at 30px 0, transparent 98%, rgba(255,255,255,.08) 100%) repeat-x;
    background-size: 120px 60px;
    pointer-events: none;
    animation: drift 12s linear infinite;
}

@keyframes drift { to { background-position: 120px 0; } }

.page {
    position: relative;
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px 16px 48px;
}

/* ============ Knöpfe ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4em;
    border: 0;
    border-radius: 14px;
    padding: .7em 1.1em;
    background: var(--foam);
    color: var(--ink);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 3px 0 rgba(16, 50, 79, .25);
    transition: transform .08s ease, box-shadow .08s ease, opacity .2s;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(16, 50, 79, .25); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn small { font-weight: 400; opacity: .7; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 2px #c5dcf0; }
.btn.go { background: var(--sun); box-shadow: 0 4px 0 #e0a800; }
.btn.big { font-size: 1.3rem; padding: .8em 1.4em; border-radius: 18px; }

/* ============ Startseite ============ */
.home { display: grid; gap: 22px; justify-items: center; text-align: center; color: white; }

.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); letter-spacing: .5px; text-shadow: 0 4px 0 rgba(0,0,0,.18); }
.hero-ship { font-size: 4rem; animation: bob 3s ease-in-out infinite; }
.tagline { margin: 6px 0 0; font-size: 1.2rem; opacity: .9; }

@keyframes bob {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-8px) rotate(3deg); }
}

.name-box { display: grid; gap: 8px; }
.name-box label { font-size: 1.1rem; }
.name-box input {
    font: inherit;
    font-size: 1.3rem;
    text-align: center;
    padding: .55em 1em;
    border-radius: 16px;
    border: 3px solid transparent;
    width: min(320px, 85vw);
    color: var(--ink);
}
.name-box input:focus { outline: none; border-color: var(--sun); }

.section-title { font-size: 1.4rem; margin-top: 6px; }

.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    width: 100%;
}

.mode-card {
    display: grid;
    gap: 4px;
    justify-items: center;
    padding: 22px 16px;
    border: 0;
    border-radius: var(--radius);
    background: var(--card);
    color: var(--ink);
    box-shadow: 0 6px 0 rgba(0,0,0,.18);
    cursor: pointer;
    transition: transform .12s ease;
}
.mode-card:hover { transform: translateY(-4px) rotate(-1deg); }
.mode-card.dolphin { background: linear-gradient(180deg, #e7f5ff, #d0ebff); }
.mode-card.shark { background: linear-gradient(180deg, #f1f3f5, #dee2e6); }
.mode-card.soon { opacity: .6; cursor: default; background: rgba(255,255,255,.7); }
.mode-card.soon:hover { transform: none; }
.mode-emoji { font-size: 3.2rem; line-height: 1.1; }
.mode-name { font-size: 1.5rem; font-weight: 700; }
.mode-level { font-size: .95rem; color: var(--muted); }
.mode-desc { font-size: .95rem; }

.rules {
    background: rgba(255,255,255,.12);
    border-radius: var(--radius);
    padding: 12px 20px;
    text-align: left;
    width: min(680px, 100%);
}
.rules summary { cursor: pointer; font-size: 1.15rem; font-weight: 600; }
.rules li { margin: 6px 0; line-height: 1.4; }

/* ============ Spielseite ============ */
.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
    margin-bottom: 14px;
}
.topbar h1 { font-size: clamp(1.2rem, 3vw, 1.8rem); }
.topbar .vs { font-weight: 400; opacity: .7; font-size: .8em; }
.back {
    color: white;
    text-decoration: none;
    background: rgba(255,255,255,.15);
    padding: .4em .9em;
    border-radius: 12px;
    white-space: nowrap;
}

.banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 20px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px 20px;
    margin-bottom: 18px;
    box-shadow: 0 5px 0 rgba(0,0,0,.15);
    min-height: 64px;
}
.banner-main { font-size: clamp(1.05rem, 2.4vw, 1.35rem); font-weight: 500; }
.banner-turn {
    font-weight: 700;
    padding: .35em .9em;
    border-radius: 999px;
    background: var(--foam);
    white-space: nowrap;
}
.banner.my-turn .banner-turn { background: var(--sun); animation: pulse 1.4s ease-in-out infinite; }

@keyframes pulse { 50% { transform: scale(1.06); } }

/* ---------- Platzieren ---------- */
.placement {
    display: grid;
    grid-template-columns: auto minmax(260px, 340px);
    gap: 20px;
    align-items: start;
    justify-content: center;
}

.shipyard {
    background: var(--card);
    border-radius: var(--radius);
    padding: 18px;
    display: grid;
    gap: 16px;
    box-shadow: 0 5px 0 rgba(0,0,0,.15);
}
.shipyard h2 { font-size: 1.25rem; }

.yard-list { display: grid; gap: 6px; }

.yard-ship {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid transparent;
    background: var(--foam);
    border-radius: 12px;
    padding: 6px 10px;
    cursor: pointer;
    text-align: left;
}
.yard-ship.selected { border-color: var(--sea-2); background: #d0ebff; }
.yard-ship.placed { opacity: .5; cursor: default; }
.yard-name { flex: 1; }
.tick { color: var(--ok); font-weight: 700; }

.yard-actions { display: grid; gap: 8px; }

/* Mini-Schiffe (Werft + Flottenanzeige) */
.mini-ship { display: inline-flex; gap: 2px; }
.mini-ship i {
    width: 12px;
    height: 12px;
    background: var(--hull);
    border-radius: 2px;
}
.mini-ship i:first-child { border-radius: 8px 2px 2px 8px; }
.mini-ship i:last-child { border-radius: 2px 8px 8px 2px; }

/* ---------- Schlacht ---------- */
.battle {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    justify-content: center;
    align-items: flex-start;
}
.battle-side { display: grid; gap: 10px; grid-template-columns: min-content; }

@media (max-width: 760px) {
    :root { --cell: clamp(22px, 7.2vw, 40px); }
    .board-card { padding: 10px 10px 12px; }
    .placement { grid-template-columns: 1fr; justify-items: center; }
    .shipyard { width: 100%; }
    .battle-side.theirs { order: -1; } /* Auf dem Handy: Gegner-Meer zuerst */
}

.fleet-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.9);
    border-radius: 14px;
    padding: 8px 14px;
}
.fleet-label { font-weight: 600; white-space: nowrap; }
.fleet-ships { display: flex; flex-wrap: wrap; gap: 6px 10px; flex: 1; }
.fleet-count { font-weight: 700; color: var(--muted); }
.mini-ship.gone i { background: var(--sunk); opacity: .35; }
.mini-ship.gone { position: relative; }
.mini-ship.gone::after {
    content: "";
    position: absolute;
    left: -2px; right: -2px; top: 50%;
    height: 2px;
    background: var(--sunk);
}

/* ============ Spielbrett ============ */
.board-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 12px 14px 14px;
    box-shadow: 0 5px 0 rgba(0,0,0,.15);
    transition: box-shadow .3s, transform .3s;
}
.board-card.active { box-shadow: 0 0 0 4px var(--sun), 0 5px 0 rgba(0,0,0,.15); }

.board-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.board-emoji { font-size: 1.4rem; }
.board-hint { font-size: .9rem; font-weight: 400; color: var(--muted); }

.board {
    display: grid;
    grid-template-columns: calc(var(--cell) * .8) repeat(var(--n), var(--cell));
    grid-auto-rows: var(--cell);
    gap: 2px;
}

.label {
    display: grid;
    place-items: center;
    font-weight: 600;
    color: var(--muted);
    font-size: calc(var(--cell) * .42);
}
.label.col { align-self: end; }

.cell {
    position: relative;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: var(--water);
    font-size: calc(var(--cell) * .55);
    line-height: 1;
    transition: background .15s, transform .1s;
}
.cell:disabled { cursor: default; }
.interactive .cell:not(:disabled) { cursor: pointer; }
.interactive .cell:not(:disabled):hover { background: var(--water-2); transform: scale(1.08); z-index: 1; }

/* Felder unter einem Schiff (die Grafik liegt darüber) */
.cell.ship { background: var(--water-2); }
.cell.ship.hit { background: #ffc078; }
.cell.sunk { background: #9fb3c4; }
.interactive .cell.ship:hover { background: var(--water-2); }

/* Treffer auf noch unbekanntem Schiff */
.cell.hit { background: #ffa94d; }

/* Schiffsgrafik */
.ship-overlay {
    pointer-events: none;
    z-index: 1;
    display: grid;
    place-items: center;
    padding: 2px;
    animation: pop .35s ease-out;
}
.ship-svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 2px 1px rgba(16, 50, 79, .25)); }
.ship-overlay.sunk .ship-svg { filter: grayscale(1) brightness(.8) contrast(.9); opacity: .9; }
.ship-overlay.sunk { animation: sink .9s ease-out; }

@keyframes sink {
    0% { transform: translateY(-6px) rotate(-2deg); filter: none; }
    40% { transform: translateY(3px) rotate(2deg); }
    100% { transform: none; }
}

.mark { position: relative; z-index: 2; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); animation: pop .45s cubic-bezier(.2, 1.6, .5, 1); }

.splash { position: relative; z-index: 2;
    width: 40%;
    height: 40%;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.95);
    animation: ripple .6s ease-out;
}
.cell.miss { background: #8fc9f5; }

.dot {
    width: 18%;
    height: 18%;
    border-radius: 50%;
    background: rgba(16, 50, 79, .25);
}
.cell.water { background: #c9e7fd; }

.cell.last { box-shadow: 0 0 0 3px var(--sun); z-index: 3; }

/* Vorschau beim Platzieren */
.cell.preview-ok { background: var(--ok) !important; }
.cell.preview-bad { background: var(--bad) !important; }

@keyframes pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}
@keyframes ripple {
    0% { transform: scale(.2); opacity: 0; }
    60% { opacity: 1; }
    100% { transform: scale(1); }
}

/* ============ Legende ============ */
.legend {
    background: rgba(255,255,255,.95);
    border-radius: var(--radius);
    padding: 12px 16px;
    color: var(--ink);
    text-align: left;
    max-width: 1000px;
    margin: 18px auto 0;
}
.legend h3 { margin: 0 0 8px; font-size: 1.1rem; }
.legend ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 8px 18px;
}
.legend li { display: flex; align-items: center; gap: 10px; line-height: 1.3; }
.legend-cell {
    flex: none;
    width: 36px;
    height: 36px;
    font-size: 20px;
    --cell: 36px;
}
.legend-cell.wide { width: 76px; display: grid; background: var(--water-2); border-radius: 6px; }
.legend-cell.cell.last { background: var(--water); }
.rules .legend { background: transparent; color: white; padding: 6px 0 0; margin: 0; }
.rules .legend li strong { color: var(--sun); }

/* Ton an/aus */
.sound-toggle {
    margin-left: auto;
    background: rgba(255,255,255,.15);
    border: 0;
    color: white;
    font-size: 1.3rem;
    border-radius: 12px;
    padding: .25em .55em;
    cursor: pointer;
}

/* ============ Spielende ============ */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 56, 107, .55);
    display: grid;
    place-items: center;
    padding: 16px;
    z-index: 50;
    animation: fade .3s ease;
}
@keyframes fade { from { opacity: 0; } }

.result-card {
    position: relative;
    background: var(--card);
    border-radius: 28px;
    padding: 28px 26px;
    width: min(460px, 100%);
    text-align: center;
    box-shadow: 0 10px 0 rgba(0,0,0,.2);
    animation: pop .5s cubic-bezier(.2, 1.4, .5, 1);
    z-index: 2;
}
.result-emoji { font-size: 4.5rem; }
.result-card h2 { font-size: 1.9rem; margin: 6px 0; }
.result-card p { font-size: 1.15rem; margin: 6px 0 18px; }
.result-card.won { background: linear-gradient(180deg, #fff9db, #ffffff); }

.result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.result-stats div { background: var(--foam); border-radius: 14px; padding: 10px 4px; display: grid; }
.result-stats strong { font-size: 1.6rem; }
.result-stats span { color: var(--muted); font-size: .9rem; }

.result-actions { display: grid; gap: 10px; }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.confetti i {
    position: absolute;
    top: -20px;
    left: var(--x);
    width: 12px;
    height: 18px;
    background: var(--c);
    border-radius: 3px;
    transform: rotate(var(--r));
    animation: fall 3.2s linear var(--d) infinite;
}
@keyframes fall {
    to { transform: translateY(110vh) rotate(calc(var(--r) + 720deg)); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============ Fehleranzeige (Vorlage) ============ */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
    border-radius: 12px;
}
.blazor-error-boundary::after { content: "Hoppla, da ist ein Fehler passiert."; }

.mode-card.kraken { background: linear-gradient(180deg, #f3d9fa, #e5dbff); }

/* Kleine Schiffsbilder (Werft + Flottenanzeige) */
.mini-svg { display: inline-block; width: calc(var(--len) * 17px); height: 20px; position: relative; flex: none; }
.yard-ship .mini-svg { width: calc(var(--len) * 22px); height: 26px; }
.mini-svg.gone .ship-svg { filter: grayscale(1); opacity: .35; }
.mini-svg.gone::after {
    content: "";
    position: absolute;
    left: -2px; right: -2px; top: 50%;
    height: 3px;
    border-radius: 2px;
    background: var(--coral);
    transform: rotate(-8deg);
}

@media (max-width: 760px) {
    .fleet-status { flex-wrap: wrap; }
    .fleet-ships { order: 3; flex-basis: 100%; }
    .fleet-count { margin-left: auto; }
}

/* ============ Phase 4: zu zweit & online ============ */
a.mode-card { text-decoration: none; }
.mode-grid.two { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); max-width: 640px; }
.mode-card.together { background: linear-gradient(180deg, #fff4e6, #ffe8cc); }
.mode-card.online { background: linear-gradient(180deg, #ebfbee, #d3f9d8); }

.score {
    background: var(--sun);
    color: var(--ink);
    font-weight: 700;
    border-radius: 999px;
    padding: .2em .8em;
    white-space: nowrap;
}
.presence {
    margin-left: auto;
    background: rgba(255,255,255,.15);
    border-radius: 999px;
    padding: .2em .8em;
    white-space: nowrap;
    font-size: .95rem;
}
.presence.off { opacity: .75; }
.presence + .score + .sound-toggle, .score + .sound-toggle { margin-left: 0; }
.topbar { flex-wrap: wrap; }

.setup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}
.setup-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: grid;
    gap: 12px;
    align-content: start;
    box-shadow: 0 5px 0 rgba(0,0,0,.15);
}
.setup-card.wide { margin-bottom: 18px; }
.setup-card h2 { font-size: 1.3rem; }
.setup-card p { margin: 0; color: var(--muted); }
.setup-card input {
    font: inherit;
    font-size: 1.2rem;
    padding: .5em .8em;
    border-radius: 14px;
    border: 3px solid #d0ebff;
    color: var(--ink);
    width: 100%;
}
.setup-card input:focus { outline: none; border-color: var(--sun); }
.code-input { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-weight: 700; }
.error { color: var(--bad) !important; font-weight: 600; }
.center { display: grid; justify-items: center; }
.note { color: white; text-align: center; opacity: .85; max-width: 560px; margin: 16px auto 0; }

.avatar-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar {
    width: 46px;
    height: 46px;
    font-size: 1.6rem;
    border: 3px solid transparent;
    border-radius: 14px;
    background: var(--foam);
    cursor: pointer;
    transition: transform .1s;
}
.avatar:hover { transform: scale(1.1); }
.avatar.chosen { border-color: var(--sun); background: #fff3bf; transform: scale(1.1); }

.handover {
    background: var(--card);
    border-radius: 28px;
    padding: 30px 24px;
    max-width: 560px;
    margin: 30px auto;
    text-align: center;
    display: grid;
    gap: 12px;
    justify-items: center;
    box-shadow: 0 8px 0 rgba(0,0,0,.18);
    animation: pop .4s cubic-bezier(.2, 1.4, .5, 1);
}
.handover h2 { font-size: 1.8rem; }
.handover p { margin: 0; font-size: 1.1rem; }
.handover .peek { font-weight: 600; }
.handover-avatar { font-size: 4.5rem; line-height: 1.1; }

.room-code { display: flex; gap: 10px; margin: 6px 0; }
.room-code span {
    display: grid;
    place-items: center;
    width: 64px;
    height: 76px;
    font-size: 2.6rem;
    font-weight: 700;
    border-radius: 16px;
    background: var(--sun);
    box-shadow: 0 5px 0 #e0a800;
}
.invite-link { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.invite-link code {
    background: var(--foam);
    padding: .5em .8em;
    border-radius: 10px;
    font-size: .9rem;
    word-break: break-all;
}
.waiting { color: var(--muted); animation: pulse 1.6s ease-in-out infinite; }

@media (max-width: 760px) {
    .room-code span { width: 54px; height: 64px; font-size: 2.1rem; }
}
.code-input::placeholder { letter-spacing: normal; font-weight: 400; }

/* ============ Phase 3: Profile, Logbuch, Abzeichen ============ */
.btn.danger { background: var(--bad); color: white; box-shadow: 0 3px 0 #c92a2a; }
.muted { color: var(--muted); }

.who-box { display: grid; gap: 10px; justify-items: center; width: 100%; }
.guest-name {
    font: inherit;
    font-size: 1.2rem;
    text-align: center;
    padding: .5em 1em;
    border-radius: 16px;
    border: 3px solid transparent;
    width: min(320px, 85vw);
    color: var(--ink);
}
.guest-name:focus { outline: none; border-color: var(--sun); }
.who-box .logbook-link, .logbooks { color: white; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }

.profile-picker { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.setup-card .profile-picker { justify-content: flex-start; }
.profile-chip {
    display: grid;
    justify-items: center;
    gap: 2px;
    min-width: 92px;
    padding: 10px 12px 8px;
    border: 3px solid transparent;
    border-radius: 18px;
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    box-shadow: 0 4px 0 rgba(0,0,0,.15);
    transition: transform .1s;
}
.setup-card .profile-chip { background: var(--foam); box-shadow: none; }
.profile-chip:hover { transform: translateY(-2px); }
.profile-chip.chosen { border-color: var(--sun); background: #fff3bf; transform: scale(1.05); }
.profile-chip.add, .profile-chip.guest { background: rgba(255,255,255,.75); }
.chip-avatar { font-size: 2.2rem; line-height: 1.1; }
.chip-name { font-weight: 600; }
.chip-badges { font-size: .8rem; color: var(--muted); }

.profile-new {
    display: grid;
    gap: 10px;
    background: var(--card);
    color: var(--ink);
    border-radius: 18px;
    padding: 14px;
    width: min(420px, 100%);
}
.profile-new input, .edit-card input {
    font: inherit;
    font-size: 1.15rem;
    padding: .45em .8em;
    border-radius: 12px;
    border: 3px solid #d0ebff;
}
.profile-new-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Neue Abzeichen im Ergebnis */
.new-badges {
    background: linear-gradient(180deg, #fff9db, #fff3bf);
    border-radius: 16px;
    padding: 10px 14px;
    margin-bottom: 16px;
    text-align: left;
    animation: pop .6s cubic-bezier(.2, 1.6, .5, 1) .6s both;
}
.new-badges h3 { margin: 0 0 6px; font-size: 1.1rem; text-align: center; }
.new-badge { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.new-badge .badge-emoji { font-size: 2rem; }
.new-badge small { color: var(--muted); }

/* Logbuch */
.logbook-head {
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.logbook-head h2 { font-size: 2rem; }
.logbook-head p { margin: 4px 0 0; opacity: .85; }
.logbook-head .edit-btn { margin-left: auto; color: white; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.logbook-head .edit-card { flex: 1; color: var(--ink); }
.logbook-avatar {
    font-size: 3.6rem;
    width: 88px;
    height: 88px;
    display: grid;
    place-items: center;
    background: var(--card);
    border-radius: 50%;
    box-shadow: 0 5px 0 rgba(0,0,0,.15);
    flex: none;
}
.logbook-avatar.small { font-size: 2.2rem; width: 58px; height: 58px; box-shadow: none; background: var(--foam); }

.stat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.tile {
    background: var(--card);
    border-radius: 16px;
    padding: 12px 8px;
    display: grid;
    justify-items: center;
    text-align: center;
    box-shadow: 0 4px 0 rgba(0,0,0,.12);
}
.tile strong { font-size: 1.8rem; }
.tile span { color: var(--muted); font-size: .9rem; }

.logbook-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 16px;
    box-shadow: 0 5px 0 rgba(0,0,0,.15);
}
.logbook-card h3 { margin: 0 0 12px; font-size: 1.25rem; }

.mode-rows { display: grid; gap: 8px; }
.mode-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; align-items: center; }
.mode-row-name { font-weight: 600; white-space: nowrap; }
.mode-row-count { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.bar { height: 14px; background: var(--foam); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), #94d82d); border-radius: 999px; }

.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.badge-card {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 4px;
    padding: 12px 8px;
    border-radius: 16px;
    background: var(--foam);
}
.badge-card .badge-emoji { font-size: 2.4rem; line-height: 1.1; }
.badge-card small { color: var(--muted); line-height: 1.25; }
.badge-card.earned { background: linear-gradient(180deg, #fff9db, #ffec99); box-shadow: inset 0 0 0 2px #fcc419; }
.badge-card.locked { opacity: .6; }
.badge-card.locked .badge-emoji { filter: grayscale(1); font-size: 1.8rem; }

.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.history li {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--foam);
}
.history li.won { background: #ebfbee; }
.history-result { font-size: 1.4rem; }
.history-what small { color: var(--muted); }
.history-numbers, .history-date { color: var(--muted); font-size: .9rem; white-space: nowrap; }

.logbook-list { display: grid; gap: 10px; max-width: 760px; margin: 0 auto; }
.logbook-entry {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card);
    color: var(--ink);
    text-decoration: none;
    border-radius: 18px;
    padding: 12px 16px;
    box-shadow: 0 4px 0 rgba(0,0,0,.15);
    transition: transform .1s;
}
.logbook-entry:hover { transform: translateY(-2px); }
.entry-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.entry-main strong { font-size: 1.3rem; }
.entry-badges { font-size: 1.1rem; letter-spacing: 2px; }
.entry-numbers { display: flex; gap: 14px; color: var(--muted); white-space: nowrap; }
.entry-numbers strong { color: var(--ink); }

@media (max-width: 760px) {
    .mode-row { grid-template-columns: 1fr auto; }
    .mode-row .bar { grid-column: 1 / -1; grid-row: 2; }
    .history li { grid-template-columns: auto 1fr; }
    .history-numbers, .history-date { grid-column: 2; }
    .logbook-entry { flex-wrap: wrap; }
    .entry-numbers { width: 100%; justify-content: space-around; }
}
.setup-card .profile-chip.add, .setup-card .profile-chip.guest { background: var(--foam); border: 3px dashed #c5dcf0; }
.setup-card .profile-chip.guest.chosen { border: 3px solid var(--sun); background: #fff3bf; }

/* ============ Spielkiste ============ */
.home-topbar { width: 100%; margin-bottom: -10px; }
.hub-games { max-width: 720px; }
.game-card { padding: 28px 18px; }
.game-card .mode-name { font-size: 1.8rem; }
.game-card.ships { background: linear-gradient(180deg, #e7f5ff, #a5d8ff); }
.game-card.bounce { background: linear-gradient(180deg, #fff4e6, #ffd8a8); }
.ball-emoji {
    display: inline-block;
    width: 58px;
    height: 58px;
    margin: 4px 0 6px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffd8a8 0 14%, #ff922b 15%);
    border: 3px solid #e8590c;
    position: relative;
    animation: hop 1.2s ease-in-out infinite;
}
.ball-face::before, .ball-face::after {
    content: "";
    position: absolute;
    top: 20px;
    width: 10px;
    height: 13px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 60%, #212529 0 35%, #fff 37%);
}
.ball-face::before { left: 13px; }
.ball-face::after { right: 13px; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.hub-links { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ============ Hüpfball ============ */
.bounce-page { color: var(--ink); }
.bounce-who { display: grid; gap: 8px; justify-items: center; margin-bottom: 10px; }
.bounce-total { color: white; margin: 0; font-weight: 600; }
.bounce-section { color: white; font-size: 1.4rem; margin: 20px 0 10px; }
.bounce-empty { color: white; opacity: .85; margin: 0; }

.level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.level-card {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 14px 10px 12px;
    background: var(--card);
    border-radius: 18px;
    color: var(--ink);
    text-decoration: none;
    text-align: center;
    box-shadow: 0 5px 0 rgba(0,0,0,.15);
    transition: transform .1s;
}
a.level-card:hover { transform: translateY(-3px); }
.level-card.done { background: linear-gradient(180deg, #fff9db, #ffffff); }
.level-card.locked { opacity: .55; background: rgba(255,255,255,.7); }
.level-card.family { background: linear-gradient(180deg, #fff4e6, #ffffff); }
.level-no {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #ff922b;
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
}
.level-card.family .level-no, .level-card.locked .level-no { background: var(--foam); }
.level-name { font-weight: 600; font-size: 1.05rem; line-height: 1.2; }
.level-author { font-size: .9rem; color: var(--muted); }
.level-time { font-size: .85rem; color: var(--muted); }
.new-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--coral);
    color: white;
    font-size: .75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

.stars { display: inline-flex; gap: 1px; font-size: 1.2rem; line-height: 1; }
.stars .star { color: #ced4da; }
.stars .star.on { color: #fab005; text-shadow: 0 1px 0 #e67700; }
.stars.big { font-size: 1.7rem; }

.my-levels { display: grid; gap: 8px; max-width: 640px; }
.my-levels .btn.big { justify-self: start; }
.my-level {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--card);
    color: var(--ink);
    text-decoration: none;
    border-radius: 14px;
    padding: 10px 14px;
}
.my-level-name { font-weight: 600; flex: 1; }
.my-level-state { font-size: .9rem; color: var(--muted); }
.my-level-state.shared { color: #2b8a3e; }
.my-level-state.tested { color: #e67700; }
.my-level-edit { font-size: .9rem; }

/* Spielfeld */
.bounce-wrap { width: 100%; }
.bounce-host { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: 0 6px 0 rgba(0,0,0,.18); }
.bounce-canvas { display: block; touch-action: none; outline: none; }
.bounce-pad {
    position: absolute;
    inset: auto 0 0 0;
    display: none;
    justify-content: space-between;
    align-items: flex-end;
    padding: 12px;
    pointer-events: none;
}
.bounce-pad-left { display: flex; gap: 12px; }
.bounce-pad button {
    pointer-events: auto;
    width: 72px;
    height: 72px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.55);
    color: var(--ink);
    font-size: 1.8rem;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
.bounce-pad button.on { background: rgba(255, 212, 59, .85); transform: scale(.95); }
.bounce-pad .bounce-jump { width: 88px; height: 88px; font-size: 2.2rem; }
@media (pointer: coarse) { .bounce-pad { display: flex; } }

.bounce-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 14px;
    padding: 10px 14px;
    background: rgba(255,255,255,.92);
    border-radius: 14px;
    font-size: .95rem;
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item.keys { color: var(--muted); }
@media (pointer: coarse) { .legend-item.keys { display: none; } }
.tile-icon { width: 26px; height: 26px; flex: none; border-radius: 4px; }

.leaderboard { margin-top: 14px; }
.leaderboard ol { margin: 0 0 8px; padding-left: 1.4em; }
.leaderboard li { padding: 3px 0; }
.leaderboard li span:last-child { float: right; color: var(--muted); }
.leaderboard p { margin: 0; }

.result-stats .stars { justify-content: center; }

/* Baukasten */
.editor-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.editor-name {
    font: inherit;
    font-size: 1.3rem;
    font-weight: 600;
    padding: .4em .8em;
    border-radius: 14px;
    border: 3px solid transparent;
    flex: 1;
    min-width: 220px;
    color: var(--ink);
}
.editor-name:focus { outline: none; border-color: var(--sun); }
.editor-state { color: white; font-weight: 600; }
.editor-state.dirty { color: var(--sun); }

.editor-layout { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: start; }
.editor-palette {
    display: grid;
    gap: 6px;
    background: var(--card);
    border-radius: 18px;
    padding: 10px;
    position: sticky;
    top: 10px;
}
.palette-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 3px solid transparent;
    border-radius: 12px;
    background: var(--foam);
    cursor: pointer;
    font-weight: 500;
    text-align: left;
}
.palette-btn.on { border-color: var(--sun); background: #fff3bf; }
.palette-btn .tile-icon { width: 30px; height: 30px; }

.editor-main { display: grid; gap: 10px; min-width: 0; }
.editor-board { background: var(--card); border-radius: 14px; padding: 8px; }
.editor-scroll { overflow-x: auto; overflow-y: hidden; }
.editor-canvas { display: block; touch-action: none; cursor: crosshair; border-radius: 6px; }
.editor-tools, .editor-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.editor-tools { background: rgba(255,255,255,.92); border-radius: 14px; padding: 8px 10px; }
.editor-tools .btn { padding: .4em .8em; }
.size-ctl { display: inline-flex; align-items: center; gap: 6px; }
.editor-errors {
    margin: 0;
    padding: 10px 14px 10px 32px;
    background: #fff5f5;
    border-radius: 14px;
    color: #c92a2a;
    font-weight: 500;
}
.editor-message {
    margin: 0;
    padding: 10px 14px;
    background: #ebfbee;
    border-radius: 14px;
    color: #2b8a3e;
    font-weight: 500;
}
.banner .editor-actions { justify-content: flex-end; }
.editor-help { width: 100%; }
.badge-group { margin: 14px 0 8px; font-size: 1.05rem; }
.badge-group small { color: var(--muted); font-weight: 400; }
.logbook-game { color: white; margin: 24px 0 12px; font-size: 1.5rem; }

@media (max-width: 760px) {
    .editor-layout { grid-template-columns: 1fr; }
    .editor-palette { position: static; grid-template-columns: repeat(5, 1fr); }
    .palette-btn { flex-direction: column; gap: 2px; font-size: .75rem; padding: 4px; text-align: center; }
    .level-grid { grid-template-columns: repeat(2, 1fr); }
}
.editor-board { overflow: hidden; min-width: 0; }
@media (max-width: 760px) {
    .editor-layout { grid-template-columns: minmax(0, 1fr); }
    .editor-tools { font-size: .9rem; }
}

/* ============ Zahlenduell ============ */
.hub-games { max-width: 1000px; }
.game-card.duel { background: linear-gradient(180deg, #f3f0ff, #d0bfff); }

.duel-intro { color: white; text-align: center; font-size: 1.1rem; max-width: 640px; margin: 4px auto 18px; }
.duel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.duel-card {
    display: grid;
    gap: 6px;
    justify-items: center;
    text-align: center;
    padding: 20px 16px;
    background: var(--card);
    border-radius: var(--radius);
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 6px 0 rgba(0,0,0,.15);
    transition: transform .12s;
}
.duel-card:hover { transform: translateY(-4px); }
.duel-emoji { font-size: 3rem; line-height: 1.1; }
.duel-name { font-size: 1.4rem; font-weight: 700; }
.duel-level { color: var(--muted); font-size: .9rem; }
.duel-rules { font-size: .95rem; line-height: 1.35; }
.duel-stats { font-size: .9rem; color: var(--muted); }
.owl-beaten { display: inline-block; margin-left: 6px; background: #fff3bf; color: #e67700; border-radius: 999px; padding: 1px 8px; font-weight: 600; }

.duel-setup { display: grid; gap: 10px; }
.duel-rules-box { background: var(--card); border-radius: 16px; padding: 14px 18px; margin: 0; font-size: 1.1rem; }
.opponent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.opponent-card {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 14px 10px;
    border: 3px solid transparent;
    border-radius: 18px;
    background: var(--card);
    cursor: pointer;
    box-shadow: 0 4px 0 rgba(0,0,0,.15);
}
.opponent-card.chosen { border-color: var(--sun); background: #fff9db; }
.opp-emoji { font-size: 2.6rem; line-height: 1.1; }
.opp-name { font-weight: 700; font-size: 1.15rem; }
.opp-desc { font-size: .85rem; color: var(--muted); }
.starter-row { display: flex; gap: 10px; flex-wrap: wrap; }
.duel-note { color: white; margin: 0; opacity: .9; }
.duel-start { justify-self: start; margin-top: 8px; }

.duel-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 860px) { .duel-layout { grid-template-columns: minmax(0, 1fr); } }

.duel-board {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 6px 0 rgba(0,0,0,.15);
    display: grid;
    gap: 16px;
    justify-items: center;
    min-height: 300px;
    align-content: center;
}
.move-buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.move-btn { min-width: 110px; }

/* Streichhölzer */
.duel-count { font-size: 3rem; font-weight: 700; line-height: 1; }
.matches { display: flex; flex-wrap: wrap; gap: 10px 14px; justify-content: center; max-width: 560px; }
.match {
    width: 10px;
    height: 70px;
    border-radius: 5px;
    background: linear-gradient(180deg, #e03131 0 16%, #f1c27d 16%);
    position: relative;
    transition: opacity .2s, transform .2s;
}
.match::before { content: ""; position: absolute; top: -4px; left: -2px; width: 14px; height: 16px; border-radius: 50%; background: #c92a2a; }
.match.leaving { opacity: .3; transform: translateY(-6px); }

/* Wettlauf */
.race-track { display: grid; grid-template-columns: repeat(11, 1fr); gap: 8px; width: 100%; max-width: 640px; }
.race-stone {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--foam);
    font-weight: 700;
    font-size: 1.1rem;
    border: 3px solid transparent;
}
.race-stone.past { opacity: .4; }
.race-stone.here { background: var(--sun); font-size: 1.6rem; }
.race-stone.preview { border-color: var(--sea-2); }
.race-stone.magic { box-shadow: 0 0 0 3px #be4bdb; }
.race-stone:last-child { background: #d3f9d8; }

/* Teiler */
.divisor-number {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 4rem;
    font-weight: 700;
    background: #e5dbff;
    color: #5f3dc4;
}
.divisor-info { margin: 0; color: var(--muted); text-align: center; }

/* Drei Haufen */
.heaps { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; }
.heap { display: grid; gap: 8px; justify-items: center; }
.heap-stones { display: flex; flex-direction: column-reverse; gap: 4px; min-height: 260px; justify-content: flex-start; }
.stone {
    width: 56px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ced4da, #868e96);
    cursor: pointer;
    transition: transform .1s, background .1s;
}
.stone:disabled { cursor: default; }
.stone:not(:disabled):hover, .stone:not(:disabled):hover ~ .stone { background: radial-gradient(circle at 35% 30%, #ffc9c9, #fa5252); transform: scale(1.06); }
.heap-label { font-size: .95rem; }
.heap-blocks { display: flex; gap: 4px; }
.block { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 8px; font-weight: 700; color: white; padding: 0 6px; }
.block.b4 { background: #1c7ed6; }
.block.b2 { background: #37b24d; }
.block.b1 { background: #f59f00; }
.block.empty { background: #ced4da; }
.block-count { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.block-tally { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.block-tally.even { color: #2b8a3e; }
.block-tally.odd { color: #c92a2a; }
.heap-help { margin: 0; color: var(--muted); min-height: 1.2em; }

/* Seitenleiste */
.duel-side { display: grid; gap: 12px; }
.score-box, .hint-box, .duel-log { background: var(--card); border-radius: 16px; padding: 12px 16px; }
.score-box { display: flex; justify-content: center; gap: 12px; font-size: 1.15rem; align-items: center; }
.score-box strong { font-size: 1.6rem; }
.hint-box h3, .duel-log h3 { margin: 0 0 8px; font-size: 1.05rem; }
.hint { margin: 0 0 8px; padding: 8px 10px; background: #fff9db; border-radius: 10px; line-height: 1.35; }
.toggle { display: flex; gap: 8px; align-items: center; margin-top: 8px; cursor: pointer; }
.duel-log ol { margin: 0; padding-left: 1.4em; max-height: 220px; overflow-y: auto; font-size: .95rem; }
.duel-log li { padding: 2px 0; }
@media (max-width: 560px) {
    .race-track { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
    .race-stone { font-size: .95rem; }
    .heaps { gap: 14px; }
    .stone { width: 46px; height: 28px; }
}

/* ---------- Flipper ---------- */
.game-card.pinball { background: linear-gradient(180deg, #e6fcf5, #96f2d7); }
.pinball-wrap { width: 100%; }
.pinball-host { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pinball-canvas { display: block; touch-action: none; outline: none; border-radius: 26px 26px 10px 10px; box-shadow: 0 6px 0 rgba(0,0,0,.2); user-select: none; -webkit-user-select: none; }
.pinball-canvas.editor { cursor: crosshair; }
.pinball-hud {
    display: flex; align-items: center; gap: 14px; justify-content: center;
    background: var(--deep); color: #fff; border-radius: 999px; padding: 6px 20px;
    font-weight: 600; font-variant-numeric: tabular-nums; min-width: 220px;
}
.pin-score { font-size: 1.5rem; letter-spacing: .02em; }
.pin-mult { background: var(--sun); color: var(--ink); border-radius: 999px; padding: 0 10px; font-size: 1rem; }
.pin-balls { color: var(--sun); letter-spacing: 3px; }
.pinball-thumbs { display: none; }
@media (any-pointer: coarse) { .pinball-thumbs { display: block; } }
/* Grosse Daumenflächen ganz am Bildschirmrand – vom unteren Rand bis weit hinauf */
.pin-thumb {
    position: fixed; z-index: 40;
    bottom: 0; top: max(110px, 22vh);
    width: var(--thumb-w, 140px);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    background: rgba(255, 255, 255, .16);
    border: 3px solid rgba(255, 255, 255, .35);
    color: #fff;
    touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}
.pin-thumb.left { left: 0; border-left: 0; border-radius: 0 36px 36px 0; padding-left: env(safe-area-inset-left); }
.pin-thumb.right { right: 0; border-right: 0; border-radius: 36px 0 0 36px; padding-right: env(safe-area-inset-right); }
.pin-thumb-icon {
    width: 96px; height: 96px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .85); color: var(--ink); font-size: 2.8rem;
    box-shadow: 0 5px 0 rgba(0,0,0,.2); pointer-events: none;
}
.pin-thumb small { font-weight: 600; font-size: 1rem; pointer-events: none; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.pin-thumb.on { background: rgba(255, 212, 59, .45); border-color: var(--sun); }
.pin-thumb.on .pin-thumb-icon { background: var(--sun); transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.2); }
/* Anleitung unter dem Tisch nicht unter den Daumenflächen verstecken */
@media (any-pointer: coarse) and (min-width: 700px) { .pinball-page .pinball-legend { margin-inline: var(--thumb-w, 0px); } }
@media (max-width: 600px) { .pin-thumb-icon { width: 72px; height: 72px; font-size: 2rem; } }
.legend-parts { list-style: none; padding-left: 0; display: grid; gap: 6px; }
.legend-parts li { display: flex; align-items: center; gap: 6px; }
.part-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; font-size: 1.3rem; border-radius: 6px; }
.part-icon.part-slope { background: #1c7ed6; color: #fff; font-weight: 700; font-size: 1.5rem; }
.part-icon.part-block { background: #a5d8ff; }
.palette-btn .part-icon { width: 32px; height: 32px; }
.pinball-board { display: flex; justify-content: center; min-width: 0; }
.part-count { font-weight: 600; color: var(--muted); }
.part-count.over { color: var(--bad); }
.theme-picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.theme-btn { border: 3px solid transparent; border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 600; color: #fff; cursor: pointer; }
.theme-btn.on { border-color: var(--sun); box-shadow: 0 0 0 2px var(--ink); }
.theme-ozean.theme-btn, .table-card.theme-ozean .level-no { background: linear-gradient(180deg, #0b3d5c, #1c7ed6); }
.theme-zirkus.theme-btn, .table-card.theme-zirkus .level-no { background: linear-gradient(180deg, #5c0b2e, #d6336c); }
.theme-weltall.theme-btn, .table-card.theme-weltall .level-no { background: linear-gradient(180deg, #0b0b2e, #5f3dc4); }
.theme-wald.theme-btn, .table-card.theme-wald .level-no { background: linear-gradient(180deg, #0b3d1e, #2f9e44); }
.pinball-editor-layout .editor-palette { grid-template-columns: 1fr; }
@media (max-width: 760px) {
    .pinball-editor-layout .editor-palette { grid-template-columns: repeat(5, 1fr); }
    .pin-score { font-size: 1.25rem; }
}
