/* Kuckuck! – Look „Schwarzwälder Kuckucksuhr trifft Laubenkolonie“:
   geschnitzte Holzschilder (Nussbraun), Zifferblatt-Creme, Tannengrün, Kuckucksrot, Messing.
   Hell = Sonntagnachmittag, Dunkel = Geisterstunde. Schriften: Grenze Gotisch + Alegreya Sans. */

@font-face { font-family: 'Grenze Gotisch'; font-weight: 700; font-display: swap; src: url('../fonts/grenze/grenze-gotisch-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Grenze Gotisch'; font-weight: 900; font-display: swap; src: url('../fonts/grenze/grenze-gotisch-latin-900-normal.woff2') format('woff2'); }
@font-face { font-family: 'Alegreya Sans'; font-weight: 400; font-display: swap; src: url('../fonts/alegreya/alegreya-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Alegreya Sans'; font-weight: 500; font-display: swap; src: url('../fonts/alegreya/alegreya-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Alegreya Sans'; font-weight: 700; font-display: swap; src: url('../fonts/alegreya/alegreya-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Alegreya Sans'; font-weight: 800; font-display: swap; src: url('../fonts/alegreya/alegreya-sans-latin-800-normal.woff2') format('woff2'); }

:root {
  --bg: #e6dbbd;
  --bg-mark: #d8caa4;
  --paper: #f6efdc;
  --paper-2: #ebdfc0;
  --ink: #2b1a10;
  --ink-2: #5f4a37;
  --wood: #6b4226;
  --wood-2: #8a5a34;
  --wood-dark: #3b2416;
  --on-wood: #f6efdc;
  --pine: #2f5a3a;
  --red: #c8412d;
  --red-dark: #9a2f20;
  --brass: #c99a2e;
  --leaf: #4f7a35;
  --shadow: rgba(43, 26, 16, 0.25);
  --hud-bg: #3b2416;
  --hud-ink: #f6efdc;
  --font: 'Alegreya Sans', 'Trebuchet MS', system-ui, sans-serif;
  --display: 'Grenze Gotisch', 'Georgia', serif;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #17110d;
  --bg-mark: #221912;
  --paper: #2a2019;
  --paper-2: #33271e;
  --ink: #f1e4c8;
  --ink-2: #c8b494;
  --wood: #4a2e1b;
  --wood-2: #5d3a22;
  --wood-dark: #0f0a07;
  --on-wood: #f1e4c8;
  --pine: #6fa77a;
  --red: #e2604a;
  --red-dark: #b4432f;
  --brass: #d8b04a;
  --leaf: #6f9a4f;
  --shadow: rgba(0, 0, 0, 0.5);
  --hud-bg: #1d140e;
  --hud-ink: #f1e4c8;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.4;
  color: var(--ink);
  background-color: var(--bg);
  /* Tapete wie in der Laube: Tannenzweig-Rapport */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23000' stroke-opacity='.07' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 10v26M18 16l-6-5M18 16l6-5M18 23l-7-5M18 23l7-5M18 30l-6-4M18 30l6-4'/%3E%3Cpath d='M54 46v20M54 51l-5-4M54 51l5-4M54 57l-6-4M54 57l6-4'/%3E%3C/g%3E%3Ccircle cx='54' cy='18' r='2' fill='%23000' fill-opacity='.06'/%3E%3Ccircle cx='18' cy='56' r='2' fill='%23000' fill-opacity='.06'/%3E%3C/svg%3E");
}
:root[data-theme='dark'] body { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.05' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 10v26M18 16l-6-5M18 16l6-5M18 23l-7-5M18 23l7-5M18 30l-6-4M18 30l6-4'/%3E%3Cpath d='M54 46v20M54 51l-5-4M54 51l5-4M54 57l-6-4M54 57l6-4'/%3E%3C/g%3E%3Ccircle cx='54' cy='18' r='2' fill='%23fff' fill-opacity='.05'/%3E%3C/svg%3E"); }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
a { color: inherit; }

/* ---------- Kuckucksuhr (SVG) ---------- */
.cc-roof { fill: var(--wood-dark); }
.cc-trim { fill: none; stroke: var(--brass); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.cc-leaves { fill: var(--leaf); }
.cc-house { fill: var(--wood); stroke: var(--wood-dark); stroke-width: 4; }
.cc-door { fill: var(--wood-dark); }
.cc-bird { fill: #8a6a3a; transform-origin: 110px 133px; animation: cc-pop 9s ease-in-out infinite; }
.cc-beak { fill: #e0a020; }
.cc-eye { fill: #1f1410; }
.cc-wing { fill: #6b4f2a; }
.cc-face { fill: #f6efdc; stroke: var(--brass); stroke-width: 5; }
.cc-ticks { stroke: #3b2416; stroke-width: 3; stroke-linecap: round; }
.cc-hand { stroke: #3b2416; stroke-width: 4; stroke-linecap: round; }
.cc-hand-min { transform-origin: 110px 190px; animation: cc-spin 60s linear infinite; }
.cc-pin { fill: var(--red); }
.cc-rod { stroke: var(--wood-dark); stroke-width: 4; }
.cc-bob { fill: var(--brass); stroke: var(--wood-dark); stroke-width: 3; }
.cc-pendulum { transform-origin: 110px 238px; animation: cc-swing 1.6s ease-in-out infinite alternate; }
.cc-chain { stroke: var(--brass); stroke-width: 2; stroke-dasharray: 3 3; fill: none; }
.cc-cone { fill: #7a5232; stroke: var(--wood-dark); stroke-width: 3; }
@keyframes cc-swing { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
@keyframes cc-spin { to { transform: rotate(360deg); } }
@keyframes cc-pop {
  0%, 82%, 100% { transform: translateY(0) scale(0.2); opacity: 0; }
  85%, 93% { transform: translateY(-2px) translateX(-22px) scale(1.15); opacity: 1; }
  87%, 91% { transform: translateY(-4px) translateX(-24px) scale(1.15) rotate(-10deg); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .cc-bird, .cc-pendulum, .cc-hand-min { animation: none; }
  .cc-bird { opacity: 0; }
}

/* ---------- Start ---------- */
.start { max-width: 1180px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px 40px; }
.hero { display: grid; grid-template-columns: 170px 1fr; gap: 28px; align-items: center; padding: 18px 4px 22px; }
.clock-hero { width: 100%; height: auto; filter: drop-shadow(0 6px 0 var(--shadow)); }
.club { margin: 0; font-weight: 700; letter-spacing: 0.04em; color: var(--ink-2); font-size: 0.92rem; text-transform: uppercase; }
.logo {
  margin: 0; font-family: var(--display); font-weight: 900; font-size: clamp(4rem, 12vw, 7.6rem); line-height: 0.92;
  color: var(--wood-dark); letter-spacing: 0.01em;
}
:root[data-theme='dark'] .logo { color: var(--ink); }
.logo span { color: var(--red); }
.tagline { margin: 10px 0 0; font-size: 1.22rem; max-width: 36em; color: var(--ink); }

.boards { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 22px; align-items: start; }

/* Holzschild: geschnitztes Brett mit Messingschrauben, Inhalt auf Creme */
.plank {
  position: relative;
  background: var(--paper);
  border: 10px solid var(--wood);
  border-radius: 10px;
  box-shadow: 0 0 0 2px var(--wood-dark), 0 7px 0 2px var(--wood-dark), 0 14px 24px var(--shadow);
  outline: 2px dashed color-mix(in srgb, var(--wood-2) 70%, transparent);
  outline-offset: -6px;
}
.plank::before, .plank::after {
  content: ''; position: absolute; top: -7px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brass); box-shadow: inset -1px -1px 0 rgba(0,0,0,.35);
}
.plank::before { left: -7px; }
.plank::after { right: -7px; }
.plate {
  margin: 0; padding: 10px 18px 8px; font-family: var(--display); font-weight: 700; font-size: 1.85rem; line-height: 1.05;
  color: var(--on-wood); background: var(--wood); letter-spacing: 0.02em;
}
.plate-row { display: flex; align-items: center; justify-content: space-between; background: var(--wood); padding-right: 14px; }
.plate-row .link { color: var(--on-wood); }
.plank-body { padding: 14px 18px; }
.plank-body + .plank-body { padding-top: 0; }

.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field-label { font-weight: 800; font-size: 0.92rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); padding: 0; }
input[type='text'], input:not([type]), input[type='number'] {
  border: 2px solid var(--wood-dark); border-radius: 8px; background: var(--paper-2); padding: 9px 12px; min-height: 44px;
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
fieldset { border: 0; margin: 0 0 12px; padding: 0; }
.inks { display: flex; flex-wrap: wrap; gap: 8px; }
.inks legend, .hats legend { margin-bottom: 6px; }
.ink { position: relative; cursor: pointer; }
.ink input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.ink i { display: block; width: 36px; height: 36px; border-radius: 50% 50% 46% 46%; background: var(--c); border: 3px solid var(--wood-dark); }
.ink input:checked + i { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--red); }
.ink input:focus-visible + i { outline: 3px solid var(--red); outline-offset: 4px; }
.hats { display: flex; flex-wrap: wrap; gap: 6px; }
.hat { position: relative; }
.hat input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.hat span { display: block; padding: 6px 11px; border: 2px solid var(--wood-dark); border-radius: 999px; font-weight: 700; font-size: 0.95rem; background: var(--paper-2); }
.hat input:checked + span { background: var(--pine); color: #f6efdc; border-color: var(--pine); }
.hat input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 2px; }

.account { display: flex; gap: 12px; align-items: center; padding: 10px 12px; margin-bottom: 12px; border: 2px dashed var(--wood-2); border-radius: 10px; }
.account img { border-radius: 50%; background: var(--paper-2); }
.account small { display: block; font-size: 0.92rem; color: var(--ink-2); }
.account span { display: grid; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 8px 18px;
  border: 3px solid var(--wood-dark); border-radius: 10px; background: var(--paper-2); color: var(--ink);
  font-weight: 800; font-size: 1.05rem; cursor: pointer; text-decoration: none; box-shadow: 0 4px 0 var(--wood-dark);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--wood-dark); }
.btn-main { background: var(--red); color: #fbf3df; border-color: var(--red-dark); box-shadow: 0 4px 0 var(--red-dark); }
.btn-main:active { box-shadow: 0 1px 0 var(--red-dark); }
.btn-quiet { background: transparent; box-shadow: none; border-style: dashed; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.link { background: none; border: 0; padding: 4px 2px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; color: var(--ink); }
.actions { display: grid; gap: 12px; }
.actions .btn-main { width: 100%; font-size: 1.2rem; }
.join { display: flex; gap: 8px; }
.code-input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 0.3em; font-weight: 800; text-align: center; }

.room-list { list-style: none; margin: 0; display: grid; gap: 8px; }
.room-list .empty { color: var(--ink-2); font-style: italic; }
.room-btn {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; text-align: left;
  padding: 10px 12px; border: 2px solid var(--wood-dark); border-radius: 10px; background: var(--paper-2); cursor: pointer;
}
.room-btn b { font-family: var(--display); font-size: 1.5rem; letter-spacing: 0.05em; color: var(--red); }
.room-btn small { color: var(--ink-2); }
.room-btn .fill { font-weight: 800; }

.rules { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 9px; }
.rules b { color: var(--red); font-family: var(--display); font-size: 1.15rem; margin-right: 4px; }
.foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 4px; border-top: 2px dashed var(--paper-2); margin: 0 18px; padding-left: 0; padding-right: 0; padding-bottom: 12px; }

/* ---------- Spiel ---------- */
.play { position: fixed; inset: 0; overflow: hidden; background: #1a1410; }
.view { position: absolute; inset: 0; }
#view { width: 100%; height: 100%; display: block; touch-action: none; }
.hud { position: absolute; inset: 0; pointer-events: none; color: var(--hud-ink); }
.hud > * { pointer-events: auto; }
.bar { position: absolute; top: max(10px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); display: flex; gap: 6px; flex-wrap: wrap; max-width: calc(50vw - 80px); }
.chip {
  border: 2px solid var(--wood-dark); background: var(--hud-bg); color: var(--hud-ink); border-radius: 8px;
  padding: 6px 11px; font-weight: 700; font-size: 0.95rem; cursor: pointer; min-height: 38px; box-shadow: 0 3px 0 rgba(0,0,0,.35);
}
.chip b { font-family: var(--display); font-size: 1.15rem; letter-spacing: 0.06em; color: var(--brass); }
.chip[aria-pressed='true'] { background: var(--red-dark); }

/* Uhr oben in der Mitte */
.hclock { position: absolute; top: max(6px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; pointer-events: none; }
.hclock-svg { width: 92px; height: auto; filter: drop-shadow(0 3px 0 rgba(0,0,0,.4)); }
.hc-roof { fill: #3b2416; }
.hc-trim { fill: none; stroke: #c99a2e; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.hc-house { fill: #6b4226; stroke: #2b1a10; stroke-width: 3; }
.hc-door { fill: #2b1a10; }
.hc-bird { fill: #8a6a3a; transform-origin: 60px 30px; transform: scale(0); transition: transform 0.15s; }
.hc-bird.pop { transform: translateY(-9px) scale(1.25); }
.hc-beak { fill: #e0a020; }
.hc-eye { fill: #1f1410; }
.hc-face { fill: #f6efdc; stroke: #c99a2e; stroke-width: 3; }
.hc-wedge { fill: #c8412d; opacity: 0.85; }
.hc-wedge.seek { fill: #2f5a3a; }
.hc-ticks { stroke: #3b2416; stroke-width: 2.5; stroke-linecap: round; }
.hc-hand { stroke: #2b1a10; stroke-width: 3; stroke-linecap: round; }
.hc-pin { fill: #2b1a10; }
.hclock-text { display: grid; background: var(--hud-bg); border: 2px solid var(--wood-dark); border-radius: 8px; padding: 4px 12px 5px; box-shadow: 0 3px 0 rgba(0,0,0,.35); min-width: 112px; }
.hclock-text b { font-family: var(--display); font-size: 1.35rem; line-height: 1; color: var(--brass); }
.hclock-text span { font-weight: 800; font-size: 1.3rem; font-variant-numeric: tabular-nums; line-height: 1.1; }

.roster {
  position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); margin: 0; padding: 6px 8px;
  list-style: none; background: var(--hud-bg); border: 2px solid var(--wood-dark); border-radius: 8px; max-width: 220px;
  font-size: 0.92rem; box-shadow: 0 3px 0 rgba(0,0,0,.35); pointer-events: none;
}
.roster li { display: flex; align-items: center; gap: 6px; padding: 1px 0; white-space: nowrap; }
.roster li span { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.roster li em { font-style: normal; font-weight: 800; color: var(--brass); font-variant-numeric: tabular-nums; }
.roster .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 2px solid #f6efdc; flex: none; }
.roster .role { font-size: 0.8rem; padding: 0 5px; border-radius: 4px; background: #c8412d; color: #f6efdc; font-weight: 800; }
.roster .found span { text-decoration: line-through; opacity: 0.65; }
.roster .off span { opacity: 0.5; }
.roster .me span { font-weight: 800; }

.feed { position: absolute; left: max(10px, env(safe-area-inset-left)); bottom: max(64px, env(safe-area-inset-bottom)); margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; max-width: min(340px, 46vw); pointer-events: none; }
.feed li {
  background: var(--hud-bg); border-left: 5px solid var(--brass); padding: 5px 10px; border-radius: 0 8px 8px 0; font-size: 0.95rem;
  box-shadow: 0 2px 0 rgba(0,0,0,.35); animation: feed-in 0.25s ease-out; transition: opacity 0.6s;
}
.feed li.found { border-left-color: var(--red); }
.feed li.whistle { border-left-color: var(--pine); }
.feed li.old { opacity: 0; }
@keyframes feed-in { from { transform: translateX(-16px); opacity: 0; } }

.cross { position: absolute; left: 50%; top: 45%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2px solid rgba(246,239,220,.8); box-shadow: 0 0 0 1px rgba(0,0,0,.5); pointer-events: none; }
.cross.hot { border-color: #c8412d; transform: scale(1.3); }
.hint {
  position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); margin: 0;
  background: var(--hud-bg); border: 2px solid var(--wood-dark); border-radius: 8px; padding: 6px 14px; font-weight: 700;
  max-width: min(560px, 70vw); text-align: center; box-shadow: 0 3px 0 rgba(0,0,0,.35); pointer-events: none;
}
.hint:empty { display: none; }
.radar {
  position: absolute; left: 50%; top: 22%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  background: var(--hud-bg); border: 2px solid var(--brass); border-radius: 999px; padding: 6px 16px 6px 8px; pointer-events: none;
  animation: feed-in 0.25s;
}
.radar i { width: 34px; height: 34px; border-radius: 50%; background: #f6efdc; position: relative; }
.radar i::after { content: ''; position: absolute; left: 50%; top: 4px; margin-left: -6px; border: 6px solid transparent; border-bottom: 14px solid #c8412d; border-top: 0; }
.radar b { font-family: var(--display); font-size: 1.6rem; color: var(--brass); }
.radar.heiß b { color: #ff7a5c; }

.keys { position: absolute; left: max(10px, env(safe-area-inset-left)); bottom: max(10px, env(safe-area-inset-bottom)); margin: 0; font-size: 0.85rem; background: rgba(29,20,14,.72); color: #f1e4c8; padding: 4px 10px; border-radius: 6px; pointer-events: none; max-width: 46vw; }

/* Aktionsknöpfe (am Handy groß, am Rechner kleiner rechts unten) */
.actions-pad {
  position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom));
  display: grid; grid-template-areas: 'prop alt' 'crouch main' 'jump main'; gap: 10px; align-items: end; justify-items: end;
}
#b-main { grid-area: main; }
#b-alt { grid-area: alt; }
#b-prop { grid-area: prop; }
#b-jump { grid-area: jump; }
#b-crouch { grid-area: crouch; }
.act[aria-pressed='true'] { background: var(--pine); border-color: #173022; }
.act {
  position: relative; width: 70px; height: 70px; border-radius: 50%; border: 3px solid var(--wood-dark); background: var(--hud-bg); color: var(--hud-ink);
  font-weight: 800; font-size: 0.86rem; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.45); touch-action: manipulation; overflow: hidden; padding: 0;
}
.act span { position: relative; z-index: 1; }
.act:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.45); }
.act-main { width: 96px; height: 96px; background: #c8412d; color: #fbf3df; font-family: var(--display); font-size: 1.35rem; border-color: #6b1f14; align-self: center; }
.act-main.hider { background: #2f5a3a; border-color: #173022; }
.act[disabled] { opacity: 0.45; }
.act .cd { position: absolute; inset: 0; background: rgba(0,0,0,.55); transform-origin: bottom; transform: scaleY(0); }
.joy { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 3px solid rgba(246,239,220,.55); background: rgba(29,20,14,.25); pointer-events: none; }
.joy i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: #c99a2e; border: 3px solid #3b2416; }
@media (pointer: fine) {
  .hint { bottom: max(52px, env(safe-area-inset-bottom)); }
  .act-jump, .act-crouch { display: none; }
  .act { width: 62px; height: 62px; font-size: 0.8rem; }
  .act-main { width: 84px; height: 84px; }
}
@media (pointer: coarse) {
  .keys { display: none; }
  .cross { display: none; }
}

/* Augen zu! */
.blind { position: absolute; inset: 0; display: grid; place-items: center; background: #1d140e; color: #f1e4c8; z-index: 5; padding: 16px; }
.blind-card { position: relative; text-align: center; max-width: 520px; }
.hands { width: min(240px, 60vw); }
.hand { fill: #e0a982; stroke: #3b2416; stroke-width: 3; stroke-linejoin: round; }
.finger { stroke: #3b2416; stroke-width: 2.5; stroke-linecap: round; fill: none; }
.hd-head { fill: #f2c7a5; stroke: #3b2416; stroke-width: 3; }
.hd-cap { fill: #6f6352; stroke: #3b2416; stroke-width: 3; stroke-linejoin: round; }
.hd-shirt { fill: #c8412d; }
.hd-mouth { fill: none; stroke: #3b2416; stroke-width: 3; stroke-linecap: round; }
.blind-title { font-family: var(--display); font-size: clamp(2rem, 7vw, 3.4rem); margin: 8px 0 0; color: #c99a2e; }
.blind-count { font-family: var(--display); font-weight: 900; font-size: clamp(5rem, 22vw, 10rem); line-height: 1; margin: 0; color: #f6efdc; }
.blind-count.go { color: #e2604a; }
.blind-sub { color: #c8b494; }

/* Tafel */
.panel { position: absolute; left: max(10px, env(safe-area-inset-left)); top: 64px; width: min(340px, calc(100vw - 20px)); z-index: 3; }
.panel-toggle { display: none; }
.panel-body {
  background: var(--paper); color: var(--ink); border: 8px solid var(--wood); border-radius: 10px;
  box-shadow: 0 0 0 2px var(--wood-dark), 0 6px 0 2px var(--wood-dark), 0 12px 20px rgba(0,0,0,.35);
  max-height: calc(100vh - 90px); overflow: auto;
}
.panel-body .plate { font-size: 1.6rem; }
.panel-body > :not(.plate) { margin-left: 14px; margin-right: 14px; }
.lead { margin: 10px 0; }
.lead.small { font-size: 0.92rem; color: var(--ink-2); }
.setup { margin: 6px 0; font-size: 0.95rem; color: var(--ink-2); }
.members { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
.members li { display: flex; align-items: center; gap: 8px; }
.members .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 2px solid var(--wood-dark); flex: none; }
.members li span { flex: 1; }
.members small { color: var(--ink-2); }
.members .kick { font-size: 0.85rem; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(23, 17, 13, 0.55); z-index: 6; padding: 16px; overflow: auto; }
.overlay.soft { background: rgba(23, 17, 13, 0.3); pointer-events: none; }
.overlay.soft .card { pointer-events: auto; }
.card { width: min(520px, 100%); color: var(--ink); }
.card .plank-body { padding-top: 12px; }
.card > :not(.plate):not(.plank-body) { margin-left: 18px; margin-right: 18px; }
.between-list { list-style: none; padding: 0; margin: 10px 18px 14px; display: grid; gap: 4px; }
.between-list li { display: grid; grid-template-columns: 26px 16px 1fr auto auto; gap: 8px; align-items: center; }
.between-list .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 2px solid var(--wood-dark); }
.between-list em { font-style: normal; font-weight: 800; color: var(--pine); font-variant-numeric: tabular-nums; }
.between-list em.neg { color: var(--red); }
.between-list b { font-variant-numeric: tabular-nums; }
.between-list small { color: var(--ink-2); }
.between-list .me { font-weight: 800; }

.certificate {
  width: min(560px, 100%); background: var(--paper); color: var(--ink); text-align: center; padding: 22px 22px 18px;
  border: 12px solid var(--wood); outline: 3px solid var(--brass); outline-offset: -20px; border-radius: 12px;
  box-shadow: 0 0 0 2px var(--wood-dark), 0 18px 40px rgba(0,0,0,.5);
}
.cert-club { margin: 6px 0 0; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; font-size: 0.85rem; color: var(--ink-2); }
.cert-title { font-family: var(--display); font-weight: 900; font-size: 3.4rem; margin: 0; color: var(--red); line-height: 1; }
.cert-text { margin: 4px 0; }
.cert-name { font-family: var(--display); font-size: 2.4rem; margin: 2px 0; line-height: 1.05; }
.cert-clock { width: 74px; height: auto; }
.ranking { list-style: none; padding: 0; margin: 8px auto 14px; max-width: 380px; text-align: left; display: grid; gap: 3px; }
.ranking li { display: grid; grid-template-columns: 30px 16px 1fr auto; gap: 8px; align-items: center; }
.ranking .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 2px solid var(--wood-dark); }
.ranking em { font-style: normal; font-weight: 800; font-variant-numeric: tabular-nums; }
.ranking .me { font-weight: 800; }
.certificate .row { justify-content: center; }

.card-sub { margin: 0 0 10px; color: var(--ink-2); }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.set { display: grid; gap: 4px; font-weight: 700; font-size: 0.95rem; }
.set.wide { grid-column: 1 / -1; }
.set legend { font-weight: 800; font-size: 0.9rem; margin-bottom: 4px; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg legend { width: 100%; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; padding: 5px 10px; border: 2px solid var(--wood-dark); border-radius: 8px; background: var(--paper-2); font-weight: 700; cursor: pointer; }
.seg input:checked + span { background: var(--pine); color: #f6efdc; border-color: var(--pine); }
.seg input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--pine); flex: none; }
.check small { display: block; font-weight: 400; color: var(--ink-2); }
.note { font-size: 0.88rem; color: var(--ink-2); }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; padding-bottom: 6px; }

.loading { position: absolute; inset: 0; display: grid; place-items: center; background: #1d140e; color: #f1e4c8; font-family: var(--display); font-size: 2rem; z-index: 9; }

.toasts { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 20; pointer-events: none; width: min(460px, calc(100vw - 32px)); }
.toast { background: var(--wood-dark); color: #f6efdc; border-radius: 8px; padding: 9px 14px; font-weight: 700; text-align: center; box-shadow: 0 4px 0 rgba(0,0,0,.35); animation: feed-in 0.2s; }
.toast.error { background: var(--red-dark); }

/* ---------- schmal ---------- */
@media (max-width: 960px) {
  .keys { display: none; }
  .boards { grid-template-columns: 1fr 1fr; }
  .plank-rules { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .hero { grid-template-columns: 92px 1fr; gap: 14px; padding-top: 8px; }
  .tagline { font-size: 1.05rem; }
  .boards { grid-template-columns: 1fr; gap: 26px; }
  .bar { max-width: calc(100vw - 150px); }
  .chip { font-size: 0.82rem; padding: 4px 8px; min-height: 34px; }
  #btn-settings, #btn-sound { display: none; }
  .hclock { top: auto; bottom: auto; left: auto; right: max(8px, env(safe-area-inset-right)); top: max(6px, env(safe-area-inset-top)); transform: none; }
  .hclock-svg { width: 62px; }
  .hclock-text { min-width: 86px; padding: 3px 8px; }
  .hclock-text b { font-size: 1.05rem; }
  .hclock-text span { font-size: 1.1rem; }
  .roster { top: 86px; font-size: 0.82rem; max-width: 150px; padding: 4px 6px; }
  .feed { top: auto; bottom: 236px; max-width: 64vw; }
  .feed li { font-size: 0.85rem; }
  .panel { top: 52px; }
  .panel-toggle { display: block; margin-bottom: 6px; }
  .panel.closed .panel-body { display: none; }
  .set-grid { grid-template-columns: 1fr; }
  .hint { bottom: 132px; max-width: 86vw; font-size: 0.92rem; }
  .radar { top: 30%; }
}
@media (max-height: 520px) {
  .roster { display: none; }
  .hclock-svg { width: 54px; }
  .hint { bottom: 10px; }
}
