:root {
  --bg: #f2ebdd;
  --bg-2: #e9dfcc;
  --ink: #241b12;
  --ink-2: #6b5d4c;
  --ink-3: #9a8b77;
  --line: #ddd0b8;
  --card: #fffaf0;
  --accent: #a8321f;
  --accent-ink: #fff;
  --brass: #a87518;
  --brass-soft: #f0e0b8;
  --good: #2f7d4f;
  --wood-1: #e6c493; --wood-2: #c4914f; --wood-edge: #8a5a2b;
  --shadow: 0 1px 2px rgb(40 25 10 / .08), 0 10px 30px rgb(40 25 10 / .10);
  --radius: 16px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16120e; --bg-2: #1d1812; --ink: #efe6d6; --ink-2: #b5a68f; --ink-3: #7c6f5d;
    --line: #362c21; --card: #211b15; --accent: #ff7a5c; --accent-ink: #1b0d08; --brass: #e2b257; --brass-soft: #3b2f17;
    --good: #6fd39a; --wood-1: #6e4626; --wood-2: #3f2613; --wood-edge: #2a190c;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 12px 34px rgb(0 0 0 / .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16120e; --bg-2: #1d1812; --ink: #efe6d6; --ink-2: #b5a68f; --ink-3: #7c6f5d;
  --line: #362c21; --card: #211b15; --accent: #ff7a5c; --accent-ink: #1b0d08; --brass: #e2b257; --brass-soft: #3b2f17;
  --good: #6fd39a; --wood-1: #6e4626; --wood-2: #3f2613; --wood-edge: #2a190c;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 12px 34px rgb(0 0 0 / .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--brass) 10%, transparent), transparent 60%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }

/* ---------- Kopf ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; max-width: 1180px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand img { display: block; }
.brand span { font: italic 700 1.55rem/1 var(--serif); letter-spacing: .01em; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.code-badge {
  font: 700 .95rem/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .18em;
  padding: 8px 10px 8px 12px; border-radius: 999px; background: var(--brass-soft); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--brass) 45%, transparent); cursor: pointer;
}
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; padding: 0; }
.icon-btn svg { width: 18px; height: 18px; }
main { max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; }

/* ---------- Buttons & Felder ---------- */
.btn {
  appearance: none; border-radius: 12px; padding: 11px 18px; cursor: pointer; font-weight: 650;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; text-decoration: none;
  transition: transform .08s, background .2s, opacity .2s, border-color .2s;
}
.btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.brass { background: var(--brass); color: #1b1407; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.sm { min-height: 38px; padding: 7px 12px; font-size: .9rem; }
.btn svg { width: 18px; height: 18px; flex: none; }
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: .82rem; color: var(--ink-2); font-weight: 650; letter-spacing: .01em; }
.input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); min-height: 46px; }
.input:focus-visible, .btn:focus-visible, .seg button:focus-visible, .icon-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--brass) 60%, transparent); outline-offset: 2px; }
.input.code { text-transform: uppercase; letter-spacing: .4em; font: 700 1.4rem/1 ui-monospace, Menlo, monospace; text-align: center; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.err { color: var(--accent); font-size: .9rem; min-height: 1.2em; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 8px 6px; cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.chk { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: .92rem; }
.chk input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.chk small { display: block; color: var(--ink-2); font-size: .8rem; }


/* ---------- Startseite ---------- */
.hero { display: grid; gap: 34px; padding: 14px 0 6px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; }
.hero h1 { font: italic 800 clamp(2.5rem, 6.4vw, 4.4rem)/.98 var(--serif); margin: 0 0 16px; letter-spacing: -.01em; }
.hero h1 em { color: var(--accent); }
.hero .lead { font-size: 1.08rem; color: var(--ink-2); max-width: 31rem; margin: 0 0 22px; }
.hero-board { max-width: 460px; }
.hero-board .board { filter: drop-shadow(0 18px 30px rgb(10 30 40 / .28)); transform: rotate(-2deg); }
.modes { display: grid; gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 4px; font: italic 700 1.35rem/1.2 var(--serif); display: flex; align-items: center; gap: 10px; }
.card h2 .num { font: 700 .72rem/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .08em; color: var(--brass); font-style: normal; border: 1px solid color-mix(in srgb, var(--brass) 50%, transparent); border-radius: 999px; padding: 4px 7px; }
.card > p { margin: 0 0 14px; }
.card form, .stack { display: grid; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stats { display: flex; gap: 14px; font-size: .85rem; color: var(--ink-2); flex-wrap: wrap; }
.stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; margin: 4px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.join-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.rules { margin-top: 26px; }
.rules summary { cursor: pointer; font: italic 700 1.2rem/1.3 var(--serif); list-style: none; display: flex; align-items: center; gap: 8px; }
.rules summary::-webkit-details-marker { display: none; }
.rules summary::before { content: "›"; transition: transform .2s; display: inline-block; color: var(--brass); font-style: normal; }
.rules[open] summary::before { transform: rotate(90deg); }
.rules ol { margin: 12px 0 0; padding-left: 1.3em; color: var(--ink-2); display: grid; gap: 6px; max-width: 60rem; }
.rules ol b { color: var(--ink); }

/* ---------- Spiel ---------- */
.play { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr) minmax(290px, 360px); align-items: start; padding-top: 4px; }
.board-col { display: grid; gap: 12px; justify-items: center; }
.banner {
  width: 100%; max-width: 640px; display: flex; align-items: center; gap: 12px; min-height: 58px;
  padding: 10px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.banner .who { width: 26px; height: 26px; }
.banner strong { font: italic 700 1.18rem/1.2 var(--serif); display: block; }
.banner .hint { font-size: .86rem; color: var(--ink-2); }
.banner.alert { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.banner.alert strong { color: var(--accent); }
.banner.win { border-color: color-mix(in srgb, var(--brass) 60%, var(--line)); background: color-mix(in srgb, var(--brass) 10%, var(--card)); }
.banner .spacer { flex: 1; }
.thinking i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-left: 3px; animation: blink 1s infinite; opacity: .3; }
.thinking i:nth-child(2) { animation-delay: .15s; } .thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 40% { opacity: 1; } }
.board-wrap { width: 100%; max-width: min(600px, max(300px, calc((100dvh - 170px) * 100 / 92))); }

.panel { display: grid; gap: 14px; position: sticky; top: 10px; }
.players { display: grid; gap: 8px; }
.pl {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center;
  padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); position: relative;
  transition: border-color .25s, box-shadow .25s;
}
.pl.cur { border-color: color-mix(in srgb, var(--brass) 70%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass) 18%, transparent); }
.pl.cur::after { content: "am Zug"; position: absolute; right: 12px; top: -9px; font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--brass); color: #1b1407; padding: 2px 7px; border-radius: 999px; }
.pl .mini { width: 26px; height: 26px; grid-row: span 2; }
.pl .nm { font-weight: 700; display: flex; gap: 6px; align-items: center; min-width: 0; }
.pl .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl .sub { font-size: .8rem; color: var(--ink-2); grid-column: 2; }
.pl .score { grid-row: span 2; font: 800 1.5rem/1 var(--serif); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.pl .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.pl .dot.on { background: #3ccf6e; }
.actions { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.actions .wide { grid-column: 1 / -1; }
.moves { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; max-height: 240px; overflow: auto; font-size: .86rem; }
.moves h3 { margin: 0 0 6px; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.moves ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; counter-reset: mv; }
.moves li { display: grid; grid-template-columns: 2.2em 1fr 1fr; gap: 6px; font-variant-numeric: tabular-nums; padding: 2px 4px; border-radius: 6px; }
.moves li:last-child { background: var(--bg); }
.moves li .n { color: var(--ink-3); }
.moves li .x { color: var(--accent); font-weight: 700; }
.log { display: grid; gap: 4px; }
.log div { display: flex; gap: 8px; color: var(--ink-2); }
.log div:first-child { color: var(--ink); font-weight: 600; }
.log time { opacity: .6; font-variant-numeric: tabular-nums; flex: none; }
.legend { font-size: .78rem; color: var(--ink-3); text-align: center; }

/* ---------- Ende ---------- */
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
.over {
  position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--bg) 66%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade .35s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.over-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow);
  padding: 28px 24px 22px; width: min(420px, 100%); text-align: center; animation: pop .45s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes pop { from { transform: translateY(16px) scale(.95); opacity: 0; } }
.over-card .medal { width: 120px; height: 120px; margin: -2px auto 6px; display: block; }
.over-card h2 { font: italic 800 2rem/1.1 var(--serif); margin: 0 0 6px; }
.over-card p { margin: 0 0 16px; color: var(--ink-2); }
.over-card .tally { display: flex; justify-content: center; gap: 18px; margin: 0 0 18px; font-size: .9rem; color: var(--ink-2); }
.over-card .tally b { display: block; font: 800 1.6rem/1.1 var(--serif); color: var(--ink); }
.over-card .btns { display: grid; gap: 8px; }

/* ---------- Lobby ---------- */
.lobby { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; padding-top: 6px; }
.share-code { font: 800 clamp(2.8rem, 12vw, 4.4rem)/1 ui-monospace, Menlo, monospace; letter-spacing: .22em; text-align: center; padding: 18px 0 14px; }
.seats { display: grid; gap: 8px; margin: 10px 0 14px; }
.seat { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--bg); border: 1px dashed var(--line); }
.seat.full { border-style: solid; }
.seat .mini { width: 22px; height: 22px; }
.tag { font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--brass-soft); color: var(--ink); }
.spacer { flex: 1; }
.link-btn { background: none; border: 0; color: var(--ink-2); cursor: pointer; text-decoration: underline; padding: 4px; }
.reclaim-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.reclaim-list { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; z-index: 70;
  box-shadow: var(--shadow); max-width: calc(100% - 32px); font-weight: 600; text-align: center;
}

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 18px; }
  .hero-board { max-width: 360px; margin: 0 auto; order: -1; }
  .play { grid-template-columns: 1fr; gap: 14px; }
  .panel { position: static; }
  .lobby { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  main { padding: 0 10px 40px; }
  .banner { padding: 8px 12px; min-height: 52px; }
  .banner strong { font-size: 1.05rem; }
  .players { grid-template-columns: 1fr 1fr; }
  .pl { padding: 10px; gap: 2px 8px; }
  .pl .mini { width: 20px; height: 20px; }
  .pl .score { font-size: 1.2rem; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ================= Mastermind ================= */
:root {
  --c0a: #ff8a6e; --c0b: #c42a1c; --c0e: #7d1610;
  --c1a: #fff09a; --c1b: #e6a817; --c1e: #946507;
  --c2a: #9de8a4; --c2b: #2e8c45; --c2e: #1b5a2b;
  --c3a: #9ccbff; --c3b: #2c5fc4; --c3e: #173a7d;
  --c4a: #ffc489; --c4b: #e06d18; --c4e: #8c3f08;
  --c5a: #dcb2ff; --c5b: #7b3dc6; --c5e: #49207d;
  --c6a: #98f1e7; --c6b: #138f88; --c6e: #0a5955;
  --c7a: #ffc8e1; --c7b: #dd5596; --c7e: #8b285a;
  --tray-1: #d9b27c; --tray-2: #b98a4c; --tray-edge: #7d5226; --pit: #6d4a25; --pit-2: #4a3016;
  --flap-1: #8a5a2b; --flap-2: #5e3a19;
  --peg: clamp(26px, 7.4vw, 34px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --tray-1: #6a4626; --tray-2: #452b15; --tray-edge: #24160a; --pit: #22160b; --pit-2: #130c05; --flap-1: #5a3a1c; --flap-2: #36210d; }
}
:root[data-theme="dark"] { --tray-1: #6a4626; --tray-2: #452b15; --tray-edge: #24160a; --pit: #22160b; --pit-2: #130c05; --flap-1: #5a3a1c; --flap-2: #36210d; }

/* Stecker */
.peg, .hole {
  width: var(--peg); height: var(--peg); border-radius: 50%; display: inline-block; flex: none; position: relative;
}
.hole { background: radial-gradient(circle at 50% 38%, var(--pit-2), var(--pit) 70%); box-shadow: inset 0 2px 3px rgb(0 0 0 / .45), 0 1px 0 rgb(255 255 255 / .18); transform: scale(.62); }
.peg {
  background: radial-gradient(circle at 34% 28%, #fff9 0 7%, transparent 18%), radial-gradient(circle at 38% 32%, var(--a), var(--b) 74%);
  box-shadow: inset 0 0 0 1px var(--e), inset 0 -3px 5px rgb(0 0 0 / .22), 0 2px 3px rgb(0 0 0 / .35);
}
.c0 { --a: var(--c0a); --b: var(--c0b); --e: var(--c0e); }
.c1 { --a: var(--c1a); --b: var(--c1b); --e: var(--c1e); }
.c2 { --a: var(--c2a); --b: var(--c2b); --e: var(--c2e); }
.c3 { --a: var(--c3a); --b: var(--c3b); --e: var(--c3e); }
.c4 { --a: var(--c4a); --b: var(--c4b); --e: var(--c4e); }
.c5 { --a: var(--c5a); --b: var(--c5b); --e: var(--c5e); }
.c6 { --a: var(--c6a); --b: var(--c6b); --e: var(--c6e); }
.c7 { --a: var(--c7a); --b: var(--c7b); --e: var(--c7e); }
.peg.pop { animation: pegpop .28s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pegpop { from { transform: scale(.4) translateY(-6px); opacity: .3; } }
.mini { width: 16px; height: 16px; border-radius: 50%; display: inline-block; flex: none; vertical-align: -3px; --peg: 16px; }
.mini.peg { box-shadow: inset 0 0 0 1px var(--e), 0 1px 2px rgb(0 0 0 / .3); }
.mini.cpu { background: conic-gradient(var(--c0b) 0 25%, var(--c1b) 0 50%, var(--c2b) 0 75%, var(--c3b) 0); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .3); }
.mini.you { background: radial-gradient(circle at 38% 32%, var(--brass-soft), var(--brass) 80%); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brass) 60%, #000); }

/* Bewertungsstifte */
.keys { display: grid; grid-template-columns: repeat(2, calc(var(--peg) * .34)); gap: calc(var(--peg) * .1); padding: calc(var(--peg) * .06); align-content: center; justify-content: center; width: calc(var(--peg) * 1.05); }
.keys.k5 { grid-template-columns: repeat(3, calc(var(--peg) * .3)); width: calc(var(--peg) * 1.25); gap: calc(var(--peg) * .07); }
.key { width: 100%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 50% 40%, var(--pit-2), var(--pit) 75%); box-shadow: inset 0 1px 2px rgb(0 0 0 / .5); transform: scale(.7); }
.key.kb { background: radial-gradient(circle at 35% 30%, #6a6460, #141110 70%); box-shadow: 0 1px 2px rgb(0 0 0 / .5); transform: none; }
.key.kw { background: radial-gradient(circle at 35% 30%, #fff, #d8d2c8 75%); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .25), 0 1px 2px rgb(0 0 0 / .4); transform: none; }
.r.fresh .key.kb, .r.fresh .key.kw { animation: keyin .35s cubic-bezier(.2, 1.6, .4, 1) backwards; animation-delay: calc(var(--i) * 110ms + 120ms); }
@keyframes keyin { from { transform: scale(0); opacity: 0; } }

/* Tablett */
.tray {
  --gap: calc(var(--peg) * .2);
  background: linear-gradient(170deg, var(--tray-1), var(--tray-2));
  border-radius: 18px; padding: 10px 10px 12px; box-shadow: inset 0 0 0 1px var(--tray-edge), inset 0 2px 0 rgb(255 255 255 / .2), var(--shadow);
  display: grid; gap: 4px; width: max-content; max-width: 100%; position: relative;
}
.tray-label { font: italic 700 1.02rem/1.2 var(--serif); color: var(--ink); display: flex; align-items: center; gap: 8px; margin: 0 4px 2px; justify-content: space-between; }
.tray-label small { font: 600 .78rem/1 ui-sans-serif, system-ui, sans-serif; color: var(--ink-2); font-style: normal; }
.rows { display: flex; flex-direction: column-reverse; gap: 2px; }
.r { display: grid; grid-template-columns: 1.6em auto auto; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 12px; transition: background .2s; }
.r .n { font: 700 .72rem/1 ui-sans-serif, system-ui, sans-serif; color: color-mix(in srgb, var(--ink) 55%, transparent); text-align: right; font-variant-numeric: tabular-nums; }
.pegs { display: flex; gap: var(--gap); }
.r.cur { background: color-mix(in srgb, var(--brass) 26%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--brass) 70%, transparent); }
.r.past .n { color: var(--ink); }
.r.win { background: color-mix(in srgb, var(--good) 22%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--good) 60%, transparent); }
.slot { appearance: none; border: 0; padding: 0; background: none; border-radius: 50%; cursor: pointer; position: relative; display: grid; place-items: center; }
.slot.sel::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2.5px solid var(--ink); opacity: .85; animation: selp 1.2s ease-in-out infinite; pointer-events: none; }
@keyframes selp { 50% { opacity: .35; } }
.slot:focus-visible { outline: 3px solid color-mix(in srgb, var(--brass) 70%, transparent); outline-offset: 3px; }

/* Geheimfach */
.secret { display: grid; grid-template-columns: 1.6em auto auto; gap: 8px; align-items: center; padding: 6px 6px 8px; margin-bottom: 4px; border-bottom: 2px solid color-mix(in srgb, var(--tray-edge) 70%, transparent); position: relative; }
.secret .lock { font-size: .8rem; text-align: right; opacity: .7; }
.secret .cover {
  position: absolute; left: calc(1.6em + 10px); top: 2px; bottom: 6px; border-radius: 12px;
  width: calc(var(--np, 4) * var(--peg) + (var(--np, 4) - 1) * var(--gap) + 8px);
  background: repeating-linear-gradient(90deg, rgb(0 0 0 / .06) 0 2px, transparent 2px 9px), linear-gradient(180deg, var(--flap-1), var(--flap-2));
  box-shadow: inset 0 0 0 1px var(--tray-edge), 0 3px 6px rgb(0 0 0 / .3);
  display: grid; place-items: center; color: #f3e2c4; font: italic 800 1.05rem/1 var(--serif); letter-spacing: .3em;
  transform-origin: top; transition: transform .7s cubic-bezier(.6, -0.2, .3, 1.3), opacity .7s;
}
.secret.open .cover { transform: perspective(300px) rotateX(-100deg); opacity: 0; pointer-events: none; }
.secret.mine .cover { display: none; }
.secret .tag { justify-self: start; }

/* Palette */
.palette { display: grid; gap: 10px; width: 100%; max-width: 520px; }
.colors { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.colors button { --peg: clamp(40px, 11vw, 48px); appearance: none; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; position: relative; }
.colors button .peg { transition: transform .1s; }
.colors button:active .peg { transform: scale(.9); }
.colors button:disabled { opacity: .3; cursor: not-allowed; }
.colors button kbd { position: absolute; right: -2px; bottom: -2px; font: 700 .62rem/1 ui-sans-serif, system-ui, sans-serif; background: var(--card); color: var(--ink-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px; }
@media (hover: none) { .colors button kbd { display: none; } }
.colors button:focus-visible { outline: 3px solid color-mix(in srgb, var(--brass) 70%, transparent); outline-offset: 2px; }
.pal-actions { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.pal-actions.three { grid-template-columns: auto auto 1fr; }

/* Spielfläche */
.board-col { justify-items: center; }
.trays { display: grid; gap: 18px; justify-items: center; width: 100%; grid-template-columns: 1fr; }
.trays.two { grid-template-columns: auto auto; justify-content: center; align-items: start; }
.trays .side { --peg: clamp(20px, 5.4vw, 26px); }
.tray-wrap { display: grid; gap: 6px; justify-items: center; }
.setup-card { width: 100%; max-width: 520px; text-align: center; }
.setup-card .pegs { justify-content: center; margin: 16px auto 4px; padding: 10px 14px; width: max-content; --peg: clamp(36px, 10vw, 46px); --gap: 10px;
  background: linear-gradient(170deg, var(--tray-1), var(--tray-2)); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--tray-edge), inset 0 2px 0 rgb(255 255 255 / .2); }
.setup-card .hint-line { min-height: 1.3em; }
.wait-note { text-align: center; color: var(--ink-2); padding: 8px 0; }
.pl .peg-av { grid-row: span 2; }
.pl .peg-av .mini { width: 26px; height: 26px; }
.stats .sep { opacity: .5; }

/* Startseite */
.hero-tray { display: flex; justify-content: center; }
.hero-tray .tray { --peg: clamp(22px, 5.6vw, 30px); transform: rotate(-2deg); filter: drop-shadow(0 18px 30px rgb(40 20 5 / .28)); }
.hero-colors { display: flex; gap: 6px; margin: -4px 0 20px; }
.hero-colors .peg { --peg: 22px; }
.preset-desc { font-size: .82rem; color: var(--ink-2); margin-top: -4px; }
.opt-row[hidden] { display: none; }

/* Ende */
.over-card .reveal { display: flex; justify-content: center; gap: 8px; margin: -4px 0 14px; --peg: 30px; }

@media (max-width: 900px) {
  .trays.two { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .tray { padding: 8px 6px 10px; border-radius: 16px; }
  .r { gap: 6px; padding: 2px 4px; }
  .secret { gap: 6px; }
  .pal-actions .btn { padding: 9px 12px; }
}
