/* Siebhirn – „Kaffeekränzchen im Seniorentreff“: Wachstuchdecke mit 70er-Blumen, Tischsets mit Streifen,
   Karten wie aus der Spieleschachtel von 1974. Nachts „Fernsehabend“ in Nussbaum. */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/fraunces/fraunces-latin-full-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Atkinson';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('../fonts/atkinson/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Atkinson';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('../fonts/atkinson/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2');
}

:root {
  --table: #f1e3c4;
  --ink: #2e1c12;
  --ink-soft: #6b5240;
  --panel: #fbf3df;
  --panel-line: #2e1c12;
  --shadow: #6a3f22;
  --brown: #6a3f22;
  --orange: #e0712b;
  --mustard: #d9a521;
  --olive: #8a8f3c;
  --red: #b8392a;
  --good: #4f7a2a;
  --face: #fffaf0;
  --back: #6a3f22;
  --field: #fffdf6;
  --chip: #fbf3df;
  --sieb: #c9cfd4;
  --sieb-in: #9aa3aa;
  --qm: #e0712b;
  --display: 'Fraunces', 'Cooper Black', Georgia, serif;
  --text: 'Atkinson', 'Verdana', system-ui, sans-serif;
  --oil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg transform='translate(40 42)'%3E%3Cg fill='%23edb98a'%3E%3Cellipse rx='9' ry='17' cy='-17'/%3E%3Cellipse rx='9' ry='17' cy='-17' transform='rotate(60)'/%3E%3Cellipse rx='9' ry='17' cy='-17' transform='rotate(120)'/%3E%3Cellipse rx='9' ry='17' cy='-17' transform='rotate(180)'/%3E%3Cellipse rx='9' ry='17' cy='-17' transform='rotate(240)'/%3E%3Cellipse rx='9' ry='17' cy='-17' transform='rotate(300)'/%3E%3C/g%3E%3Ccircle r='9' fill='%23c4936a'/%3E%3Ccircle r='4' fill='%23e3c58e'/%3E%3C/g%3E%3Cg transform='translate(120 118)'%3E%3Cg fill='%23ebd295'%3E%3Ccircle r='8' cy='-12'/%3E%3Ccircle r='8' cy='-12' transform='rotate(72)'/%3E%3Ccircle r='8' cy='-12' transform='rotate(144)'/%3E%3Ccircle r='8' cy='-12' transform='rotate(216)'/%3E%3Ccircle r='8' cy='-12' transform='rotate(288)'/%3E%3C/g%3E%3Ccircle r='6' fill='%23edb98a'/%3E%3C/g%3E%3Cg fill='%23c9cc9e'%3E%3Cellipse cx='96' cy='34' rx='11' ry='5' transform='rotate(-30 96 34)'/%3E%3Cellipse cx='30' cy='120' rx='11' ry='5' transform='rotate(35 30 120)'/%3E%3C/g%3E%3Cg fill='%23d9b98a'%3E%3Ccircle cx='80' cy='80' r='3'/%3E%3Ccircle cx='150' cy='60' r='3'/%3E%3Ccircle cx='70' cy='150' r='3'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
}
[data-theme='dark'] {
  --table: #2a1d15;
  --ink: #f3e4c4;
  --ink-soft: #c7ad86;
  --panel: #3a2a1e;
  --panel-line: #e7cfa2;
  --shadow: #120b07;
  --red: #f0806a;
  --good: #a9cf6e;
  --face: #f4ead2;
  --back: #5a3218;
  --field: #2e2118;
  --chip: #3a2a1e;
  --sieb: #8f979e;
  --sieb-in: #646c73;
  --qm: #f0a35a;
  --oil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg transform='translate(40 42)'%3E%3Cg fill='%233b2a1d'%3E%3Cellipse rx='9' ry='17' cy='-17'/%3E%3Cellipse rx='9' ry='17' cy='-17' transform='rotate(60)'/%3E%3Cellipse rx='9' ry='17' cy='-17' transform='rotate(120)'/%3E%3Cellipse rx='9' ry='17' cy='-17' transform='rotate(180)'/%3E%3Cellipse rx='9' ry='17' cy='-17' transform='rotate(240)'/%3E%3Cellipse rx='9' ry='17' cy='-17' transform='rotate(300)'/%3E%3C/g%3E%3Ccircle r='9' fill='%23332318'/%3E%3C/g%3E%3Cg transform='translate(120 118)'%3E%3Cg fill='%2336281a'%3E%3Ccircle r='8' cy='-12'/%3E%3Ccircle r='8' cy='-12' transform='rotate(72)'/%3E%3Ccircle r='8' cy='-12' transform='rotate(144)'/%3E%3Ccircle r='8' cy='-12' transform='rotate(216)'/%3E%3Ccircle r='8' cy='-12' transform='rotate(288)'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--table) var(--oil);
  background-size: 160px 160px;
  color: var(--ink);
  font: 400 17px/1.45 var(--text);
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Bausteine ---------- */
.panel {
  position: relative;
  background: var(--panel);
  border: 3px solid var(--panel-line);
  border-radius: 18px;
  box-shadow: 6px 6px 0 var(--shadow);
  padding: 18px 20px 20px;
}
.h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font: 800 1.35rem/1.1 var(--display);
  font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 48;
  letter-spacing: -0.01em;
}
.stripe {
  flex: none;
  width: 28px;
  height: 20px;
  border-radius: 5px;
  background: linear-gradient(var(--brown) 0 25%, var(--orange) 25% 50%, var(--mustard) 50% 75%, var(--olive) 75%);
  border: 2px solid var(--panel-line);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 8px 18px;
  border: 3px solid var(--panel-line);
  border-radius: 999px;
  background: var(--field);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--shadow);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }
.btn:focus-visible, .chip:focus-visible, .link:focus-visible, .card:focus-visible, input:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.btn-main { background: var(--orange); color: #2e1c12; }
.btn-quiet { background: transparent; box-shadow: none; border-style: dashed; }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.link {
  border: 0;
  background: none;
  padding: 0;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}
.lead { margin: 0 0 10px; color: var(--ink-soft); }
.row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Startseite ---------- */
.start { max-width: 1120px; margin: 0 auto; padding: 28px 16px 48px; }
.masthead { display: flex; align-items: center; gap: 22px; margin-bottom: 28px; }
.mascot { flex: none; width: clamp(96px, 18vw, 150px); }
.mascot .falling { animation: fall 2.8s ease-in infinite; }
@keyframes fall { 0%, 40% { transform: translateY(-6px); opacity: 0; } 55% { opacity: 1; } 100% { transform: translateY(10px); opacity: 0; } }
.mast-text { min-width: 0; }
.kicker {
  display: inline-block;
  margin: 0 0 6px;
  padding: 3px 12px;
  border: 2px solid var(--panel-line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 0.85rem;
  font-weight: 700;
}
.logo {
  margin: 0;
  font: 900 clamp(3.2rem, 11vw, 6.6rem)/0.9 var(--display);
  font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 144;
  letter-spacing: -0.03em;
  color: var(--orange);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--brown);
}
[data-theme='dark'] .logo { -webkit-text-stroke-color: #2e1c12; text-shadow: 5px 5px 0 #120b07; }
.tagline { max-width: 40em; margin: 10px 0 0; font-size: 1.05rem; background: var(--panel); border-radius: 10px; padding: 6px 10px; border: 2px solid var(--panel-line); }

.tables { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; align-items: start; }
.panel-a { transform: rotate(-0.6deg); }
.panel-c { transform: rotate(0.5deg); }
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; margin-bottom: 4px; font-weight: 700; }
input:not([type='radio']):not([type='checkbox']) {
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  border: 3px solid var(--panel-line);
  border-radius: 12px;
  background: var(--field);
}
.inks { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; border: 0; }
.inks legend { padding: 0; }
.ink { position: relative; cursor: pointer; }
.ink input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ink i {
  display: block;
  width: 38px;
  height: 30px;
  border-radius: 6px;
  border: 3px solid var(--panel-line);
  background: var(--c);
  box-shadow: 2px 2px 0 var(--shadow);
}
.ink input:checked + i { outline: 3px solid var(--panel-line); outline-offset: 3px; transform: rotate(-6deg); }
.ink input:focus-visible + i { outline: 3px solid var(--orange); outline-offset: 3px; }
.account { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 10px; border: 2px dashed var(--panel-line); border-radius: 12px; }
.account img { border-radius: 50%; border: 2px solid var(--panel-line); background: #fff; }
.account small { display: block; }
.actions { display: grid; gap: 12px; }
.join { display: flex; gap: 8px; }
.code-input { text-transform: uppercase; letter-spacing: 0.2em; font-weight: 700; max-width: 9em; }
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.room-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.room-list .empty { color: var(--ink-soft); }
.room-btn {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  border: 2px solid var(--panel-line);
  border-radius: 12px;
  background: var(--field);
  cursor: pointer;
}
.room-btn b { font: 800 1.1rem var(--display); letter-spacing: 0.06em; }
.room-btn small { color: var(--ink-soft); }
.room-btn .fill { font-weight: 700; }
.rules { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 8px; }
.rules b { font-family: var(--display); color: var(--orange); }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.credit { margin: 12px 0 0; font-size: 0.8rem; color: var(--ink-soft); }

/* ---------- Spiel ---------- */
.play { max-width: 1280px; margin: 0 auto; padding: 12px 16px 32px; }
.bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  min-height: 40px;
  padding: 4px 14px;
  border: 2px solid var(--panel-line);
  border-radius: 999px;
  background: var(--chip);
  font-weight: 700;
  cursor: pointer;
}
.chip b { letter-spacing: 0.12em; }
.chip:disabled { cursor: default; opacity: 0.8; }
.bar-info { margin: 0 0 0 auto; padding: 2px 12px; border-radius: 999px; background: var(--panel); border: 2px solid var(--panel-line); font-weight: 700; }

.room { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.board-wrap { min-width: 0; }
.hud { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; min-height: 44px; }
.hud-me { margin: 0; padding: 6px 14px; border-radius: 12px; background: var(--panel); border: 2px solid var(--panel-line); font-weight: 700; }
.hud-me:empty { visibility: hidden; }
.timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 3px solid var(--panel-line);
  background: var(--mustard);
  color: #2e1c12;
  font: 800 1.2rem var(--display);
  font-variant-numeric: tabular-nums;
}
.timer svg { width: 22px; height: 22px; }
.timer.hurry { background: var(--red); color: #fff; animation: wobble 0.5s ease-in-out infinite alternate; }
@keyframes wobble { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }

.table-top {
  position: relative;
  padding: clamp(10px, 2vw, 22px);
  border: 3px solid var(--panel-line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 6px 6px 0 var(--shadow);
}
.board {
  --cols: 5;
  --rows: 4;
  --gap: clamp(5px, 1.2vw, 12px);
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: var(--gap);
  width: min(100%, calc((100dvh - 210px) * var(--cols) / var(--rows) * 0.75));
  margin: 0 auto;
}
.card {
  position: relative;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 0;
  background: none;
  perspective: 600px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.card:disabled { cursor: default; }
.card-in {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.32s cubic-bezier(0.3, 1.4, 0.6, 1);
}
.card.up .card-in { transform: rotateY(180deg); }
.face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 2.5px solid var(--panel-line);
  border-radius: clamp(6px, 1vw, 10px);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}
.face.back { background: var(--back); box-shadow: 2px 3px 0 var(--shadow); }
.face.back svg { width: 100%; height: 100%; display: block; }
.face.front { transform: rotateY(180deg); background: var(--face); box-shadow: 2px 3px 0 var(--shadow); }
.face.front img { width: 84%; height: auto; user-select: none; -webkit-user-drag: none; filter: drop-shadow(0 2px 0 rgb(46 28 18 / 0.18)); }
.card:not(:disabled):hover .face.back { transform: translateY(-2px); }
.card.found .face.front::after {
  content: '';
  position: absolute;
  right: 5%;
  top: 4%;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid #2e1c12;
  background: var(--c, #4f7a2a) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 6.5' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat;
}
.card.dim .face.front img { opacity: 0.45; }
.card.dim .face.front { background: #efe5cc; }
.card.match .card-in { animation: pop 0.45s ease-out 0.2s; }
.card.miss .card-in { animation: shake 0.4s ease-in-out 0.25s; }
@keyframes pop { 50% { transform: rotateY(180deg) scale(1.1); } }
@keyframes shake { 25% { transform: rotateY(180deg) rotate(-5deg); } 75% { transform: rotateY(180deg) rotate(5deg); } }
.board.reveal .card:not(.found) .face.front { background: #f3e9cf; }
.board.reveal .card.mine .face.front { background: var(--face); }
.board.waiting .card { pointer-events: none; }
.board.blocked .card { cursor: not-allowed; }

.countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  pointer-events: none;
}
.countdown b {
  display: grid;
  place-items: center;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid var(--panel-line);
  background: var(--mustard);
  color: #2e1c12;
  font: 900 5.2rem/1 var(--display);
  font-variation-settings: 'SOFT' 100, 'WONK' 1;
  box-shadow: 6px 6px 0 var(--shadow);
  animation: tick 1s ease-out infinite;
}
.countdown span { padding: 4px 14px; border-radius: 999px; background: var(--panel); border: 2px solid var(--panel-line); font-weight: 700; }
@keyframes tick { from { transform: scale(1.12) rotate(-4deg); } to { transform: scale(1) rotate(0); } }

.lobby-board { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 16px 0 8px; }
.lobby-sign { margin: 0; font: 900 clamp(1.8rem, 5vw, 3rem)/1 var(--display); font-variation-settings: 'SOFT' 100, 'WONK' 1; color: var(--orange); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
[data-theme='dark'] .lobby-sign { -webkit-text-stroke-color: #2e1c12; }
.lobby-sub { margin: 0 0 8px; color: var(--ink-soft); max-width: 34em; }
.practice { display: grid; grid-template-columns: repeat(3, 84px); gap: 10px; }
.lobby-note { margin: 4px 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.turn-line { margin: 12px 0 0; padding: 8px 14px; border-radius: 12px; background: var(--panel); border: 2px solid var(--panel-line); font-weight: 700; display: flex; align-items: center; gap: 10px; }
.turn-line .bar-t { flex: 1; height: 10px; border-radius: 999px; border: 2px solid var(--panel-line); overflow: hidden; background: var(--field); }
.turn-line .bar-t i { display: block; height: 100%; background: var(--orange); transform-origin: left; }
.turn-line.mine { background: var(--mustard); color: #2e1c12; }

.rivals { display: none; }
.side { display: grid; gap: 18px; }
.setup { margin: 0 0 12px; font-weight: 700; }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.people li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px 10px;
  padding: 6px 8px;
  border-radius: 10px;
}
.people li.me { background: var(--field); outline: 2px dashed var(--panel-line); }
.people li.turn { background: var(--mustard); color: #2e1c12; }
.people li.off { opacity: 0.55; }
.tag {
  width: 28px;
  height: 22px;
  border-radius: 5px;
  border: 2px solid #2e1c12;
  background: var(--c);
}
.people .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.people .who small { font-weight: 400; color: inherit; opacity: 0.75; }
.people .val { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.pips { grid-column: 2 / 4; display: flex; gap: 2px; height: 8px; }
.pips i { flex: 1; border-radius: 2px; background: var(--table); border: 1px solid var(--ink-soft); }
.pips i.on { background: var(--c); border-color: #2e1c12; }
.people .done { color: var(--good); }
.people li.turn .done { color: #2e1c12; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 260px; overflow: auto; font-size: 0.95rem; }
.log li { padding-left: 14px; position: relative; }
.log li::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.log .empty { color: var(--ink-soft); }
.log .empty::before { display: none; }

/* ---------- Overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(46 28 18 / 0.55);
  overflow: auto;
}
.certificate {
  position: relative;
  width: min(560px, 100%);
  padding: 46px 28px 24px;
  border: 4px solid #2e1c12;
  border-radius: 22px;
  background: #fbf3df;
  color: #2e1c12;
  text-align: center;
  box-shadow: 8px 8px 0 #120b07;
  overflow: hidden;
}
.cert-stripes { position: absolute; left: 0; right: 0; top: 0; height: 26px; background: linear-gradient(#6a3f22 0 25%, #e0712b 25% 50%, #d9a521 50% 75%, #8a8f3c 75%); border-bottom: 3px solid #2e1c12; }
.cert-club { margin: 0; font-weight: 700; letter-spacing: 0.04em; }
.cert-title { margin: 2px 0 8px; font: 900 3.2rem/1 var(--display); font-variation-settings: 'SOFT' 100, 'WONK' 1; color: #e0712b; -webkit-text-stroke: 2px #2e1c12; paint-order: stroke fill; }
.cert-text { margin: 0; }
.cert-name { margin: 6px 0; font: 800 2rem/1.1 var(--display); font-variation-settings: 'SOFT' 100; }
.cert-sieve { margin: 14px auto 0; padding: 8px 12px; max-width: 30em; border: 2px dashed #2e1c12; border-radius: 12px; background: #eef0f2; }
.ranking { list-style: none; margin: 18px 0; padding: 0; display: grid; gap: 6px; text-align: left; }
.ranking li { display: grid; grid-template-columns: 2.2em auto 1fr auto; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; background: #fffaf0; border: 2px solid #2e1c12; }
.ranking li.me { background: #f6dfa4; }
.ranking .rk { font: 800 1.1rem var(--display); }
.ranking em { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.ranking small { opacity: 0.75; }
.certificate .row { justify-content: center; }
.certificate .btn { background: #fffdf6; color: #2e1c12; border-color: #2e1c12; box-shadow: 3px 3px 0 #6a3f22; }
.certificate .btn-main { background: #e0712b; }
.certificate .lead { color: #6b5240; margin-top: 10px; }

.dialog { width: min(640px, 100%); max-height: calc(100dvh - 32px); overflow: auto; }
.dialog-sub { margin: -6px 0 12px; color: var(--ink-soft); }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.set { display: grid; gap: 4px; margin: 0; padding: 0; border: 0; min-width: 0; }
.set > span, .set legend { font-weight: 700; padding: 0; }
.set.wide { grid-column: 1 / -1; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg legend { width: 100%; margin-bottom: 4px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: inline-block;
  padding: 6px 12px;
  border: 2px solid var(--panel-line);
  border-radius: 10px;
  background: var(--field);
  font-weight: 700;
  cursor: pointer;
}
.seg span small { display: block; font-weight: 400; font-size: 0.8rem; color: var(--ink-soft); }
.seg input:checked + span { background: var(--orange); color: #2e1c12; }
.seg input:checked + span small { color: #2e1c12; }
.seg input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }
.set.check { display: flex; align-items: flex-start; gap: 10px; }
.set.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--orange); flex: none; }
.set.check span { font-weight: 700; }
.set.check small { font-weight: 400; color: var(--ink-soft); }
.set-grid [disabled] + span { opacity: 0.5; }
.note { color: var(--ink-soft); margin: 12px 0; font-size: 0.9rem; }
.members { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.members li { display: flex; align-items: center; gap: 8px; }
.members li span { flex: 1; }
.members .chip { min-height: 32px; padding: 2px 10px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.toasts { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 40; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { padding: 10px 16px; border-radius: 12px; border: 3px solid #2e1c12; background: #fbf3df; color: #2e1c12; font-weight: 700; box-shadow: 4px 4px 0 #6a3f22; animation: toast-in 0.2s ease-out; }
.toast.error { background: #f6c9b4; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Schmal ---------- */
@media (max-width: 960px) {
  .tables { grid-template-columns: 1fr 1fr; }
  .panel-c { grid-column: 1 / -1; }
  .room { grid-template-columns: 1fr; }
  /* Seitenleiste rutscht nach unten: Stand der anderen kompakt über dem Brett */
  .rivals:not(:empty) { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 10px; padding: 0; }
  .rivals li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border: 2px solid var(--panel-line); border-radius: 999px; background: var(--panel); font-size: 0.85rem; font-weight: 700; font-variant-numeric: tabular-nums; }
  .rivals li.turn { background: var(--mustard); color: #2e1c12; }
  .rivals .tag { width: 18px; height: 14px; border-width: 1.5px; border-radius: 3px; }
  .rivals .done { color: var(--good); }
  .rivals li.turn .done { color: #2e1c12; }
  .board { width: min(100%, calc((100dvh - 190px) * var(--cols) / var(--rows) * 0.75)); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .start { padding-top: 16px; }
  .masthead { gap: 12px; align-items: flex-start; }
  .tables { grid-template-columns: 1fr; gap: 20px; }
  .panel-a, .panel-c { transform: none; }
  .panel { padding: 14px 14px 16px; box-shadow: 4px 4px 0 var(--shadow); }
  .play { padding: 8px 10px 24px; }
  .bar-info { display: none; }
  .chip { min-height: 36px; padding: 2px 11px; font-size: 0.92rem; }
  .table-top { padding: 8px; border-radius: 16px; box-shadow: 4px 4px 0 var(--shadow); }
  .board { width: 100%; }
  .face { border-width: 2px; }
  .set-grid { grid-template-columns: 1fr; }
  .practice { grid-template-columns: repeat(3, 64px); }
  .countdown b { width: 110px; height: 110px; font-size: 4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .card-in { transition: none; }
  .card.match .card-in, .card.miss .card-in, .countdown b, .timer.hurry, .mascot .falling { animation: none; }
}
