/* nummix online – Gestaltung nach dem nummix-Styleguide */

@font-face {
  font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/assets/fonts/atkinson-next-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/assets/fonts/atkinson-next-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/assets/fonts/atkinson-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/assets/fonts/atkinson-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --blau: #36a9e1;
  --rot: #e94e1b;
  --gelb: #f9b233;
  --schwarz: #292929;
  --navy: #11222c;

  --papier: #ffffff;
  --nebel: #f6f6f5;
  --linie: #e4e4e2;
  --text: #292929;
  --text-leise: #5b5b59;
  --tint-blau: #d9eef9;
  --tint-gelb: #fdf0d8;
  --tint-rot: #fadcd1;
  --blau-text: #1c75a6;
  --rot-text: #c63f12;
  --gelb-text: #a36800;
  --rahmen: #767674;

  --brett: #eeeeed;
  --brett-linie: rgba(41, 41, 41, .07);
  --stein: #ffffff;
  --stein-rand: #e4e4e2;
  --stein-schatten: #d4d4d1;
  --seat-schwarz: #292929;

  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 1.25rem;
  --cell: 46px;
  --rtile: 42px;

  --m-tri: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 48'><polygon points='6,6 34,24 6,42' fill='%23000' stroke='%23000' stroke-width='10' stroke-linejoin='round'/></svg>");
  --m-joker: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><g fill='%23000' stroke='%23000' stroke-width='7' stroke-linejoin='round'><polygon points='25.7,16.5 74.3,16.5 50,40.8'/><polygon points='25.7,83.5 74.3,83.5 50,59.2'/><polygon points='16.5,25.7 16.5,74.3 40.8,50'/><polygon points='83.5,25.7 83.5,74.3 59.2,50'/></g></svg>");
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --papier: #10191f; --nebel: #1b2831; --linie: #2d3b45; --text: #eeeeec; --text-leise: #b7bec3;
    --tint-blau: #15303f; --tint-gelb: #33291a; --tint-rot: #3a2219;
    --blau-text: #6cc3ec; --rot-text: #f2875f; --gelb-text: #f9b233; --rahmen: #8d989f;
    --brett: #16222a; --brett-linie: rgba(255, 255, 255, .05);
    --stein: #f4f4f2; --stein-rand: #cfcfcc; --stein-schatten: #0a1014; --seat-schwarz: #eeeeec;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --papier: #10191f; --nebel: #1b2831; --linie: #2d3b45; --text: #eeeeec; --text-leise: #b7bec3;
  --tint-blau: #15303f; --tint-gelb: #33291a; --tint-rot: #3a2219;
  --blau-text: #6cc3ec; --rot-text: #f2875f; --gelb-text: #f9b233; --rahmen: #8d989f;
  --brett: #16222a; --brett-linie: rgba(255, 255, 255, .05);
  --stein: #f4f4f2; --stein-rand: #cfcfcc; --stein-schatten: #0a1014; --seat-schwarz: #eeeeec;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--papier); color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 600; }
h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.3rem; }
p { margin: 0; }
a { color: var(--blau-text); text-underline-offset: .2em; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-leise); }
.small { font-size: .875rem; }
:focus-visible { outline: 3px solid var(--blau-text); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--text); color: var(--papier); padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 1rem; top: 1rem; }

/* Logo im dunklen Design: weiße Variante als Filter auf das farbige Logo */
/* Logo im dunklen Design: offizielle Variante mit weißer Schrift und buntem Symbol (wird per Skript getauscht) */
.brand-icon { display: block; border-radius: 50%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-icon { background: #fff; padding: 3px; } }
:root[data-theme="dark"] .brand-icon { background: #fff; padding: 3px; }
.logo-big { width: min(260px, 70vw); height: auto; }

/* ---------- Bedienelemente ---------- */
.btn {
  appearance: none; font: 500 1rem/1.2 var(--font); color: var(--text);
  background: var(--papier); border: 2px solid var(--text); border-radius: 999px;
  padding: .65rem 1.25rem; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, transform .1s;
}
.btn:hover { background: var(--nebel); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--schwarz); color: #fff; border-color: var(--schwarz); }
.btn-primary:hover { background: #000; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary { background: var(--text); color: var(--papier); border-color: var(--text); }
  :root:not([data-theme="light"]) .btn-primary:hover { background: #fff; }
}
:root[data-theme="dark"] .btn-primary { background: var(--text); color: var(--papier); border-color: var(--text); }
:root[data-theme="dark"] .btn-primary:hover { background: #fff; }
.btn-big { width: 100%; padding: .9rem 1.5rem; font-size: 1.1rem; font-weight: 600; }
.btn-small { padding: .4rem .8rem; font-size: .875rem; }
.btn-quiet { border-color: transparent; color: var(--text-leise); padding-inline: .5rem; }
.btn-quiet:hover { color: var(--text); background: transparent; text-decoration: underline; }
.btn.is-ready { background: var(--blau); border-color: var(--blau); color: #fff; }

.icon-btn {
  appearance: none; width: 2.5rem; height: 2.5rem; border-radius: 999px; border: 1px solid var(--linie);
  background: var(--papier); color: var(--text); font: 600 1.15rem/1 var(--font); cursor: pointer;
  display: inline-grid; place-items: center;
}
.icon-btn:hover { background: var(--nebel); }

.input {
  font: 400 1rem/1.4 var(--font); color: var(--text); background: var(--papier);
  border: 2px solid var(--rahmen); border-radius: .75rem; padding: .6rem .9rem; min-width: 0; width: 100%;
}
.input:focus { outline: 3px solid var(--blau-text); outline-offset: 1px; }
label { font-weight: 500; font-size: .95rem; display: block; margin-bottom: .35rem; }
.join-row { display: flex; gap: .5rem; }
.error { color: var(--rot-text); min-height: 1.4em; font-weight: 500; }

.h-tri { display: flex; align-items: center; gap: .7rem; }
.h-tri::before {
  content: ""; flex: none; width: .9rem; height: 1.1rem; background: var(--tri, var(--blau));
  -webkit-mask: var(--m-tri) center / contain no-repeat; mask: var(--m-tri) center / contain no-repeat;
}
.tri-gelb { --tri: var(--gelb); } .tri-rot { --tri: var(--rot); } .tri-schwarz { --tri: var(--text); }

.segmented { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--nebel); border: 1px solid var(--linie); border-radius: 999px; padding: .25rem; gap: .25rem; }
.segmented button {
  appearance: none; border: 0; background: transparent; color: var(--text); font: 500 .95rem/1.2 var(--font);
  padding: .55rem .25rem; border-radius: 999px; cursor: pointer;
}
.segmented button[aria-checked="true"] { background: var(--schwarz); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .segmented button[aria-checked="true"] { background: var(--text); color: var(--papier); } }
:root[data-theme="dark"] .segmented button[aria-checked="true"] { background: var(--text); color: var(--papier); }
.segmented button:disabled { cursor: default; }
#turn-time { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.seg-custom { display: flex; align-items: center; justify-content: center; gap: .15rem; margin: 0; border-radius: 999px; padding: 0 .5rem; font-weight: 500; }
.seg-custom input {
  width: 100%; min-width: 0; border: 0; background: transparent; color: inherit; font: 500 .95rem/1.2 var(--font);
  text-align: right; padding: .55rem 0; -moz-appearance: textfield;
}
.seg-custom input::-webkit-outer-spin-button, .seg-custom input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.seg-custom input::placeholder { color: var(--text-leise); text-align: center; }
.seg-custom input:placeholder-shown + span { display: none; }
.seg-custom:focus-within { outline: 3px solid var(--blau-text); outline-offset: -3px; }
.seg-custom.active { background: var(--schwarz); color: #fff; }
.seg-custom.active input::placeholder { color: #ccc; }
.seg-custom:has(input:disabled) { opacity: .55; }
.seg-custom.active:has(input:disabled) { opacity: 1; }
@media (max-width: 520px) { #turn-time { grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: 1.25rem; } }
.segmented button:disabled:not([aria-checked="true"]) { opacity: .55; }

/* ---------- Steine ---------- */
.tile {
  --c: var(--schwarz);
  position: relative; display: inline-grid; place-items: center;
  width: 46px; height: 46px; flex: none;
  background: var(--stein); color: var(--c);
  border: 1px solid var(--stein-rand); border-radius: 18%;
  box-shadow: 0 2px 0 var(--stein-schatten), 0 4px 10px rgba(41, 41, 41, .1);
  font: 800 1.2rem/1 var(--font); font-variant-numeric: tabular-nums;
  user-select: none; -webkit-user-select: none; touch-action: none;
}
.tile.c-s { --c: #292929; } .tile.c-b { --c: var(--blau); } .tile.c-g { --c: var(--gelb); } .tile.c-r { --c: var(--rot); }
.tile.joker::before {
  content: ""; position: absolute; inset: 6%;
  background: conic-gradient(from -45deg, var(--a) 0 25%, var(--z) 0 50%, var(--a) 0 75%, var(--z) 0);
  -webkit-mask: var(--m-joker) center / 100% 100% no-repeat; mask: var(--m-joker) center / 100% 100% no-repeat;
}
.tile .jv {
  position: absolute; right: -6px; bottom: -6px; min-width: 1.35em; height: 1.35em; padding: 0 .25em;
  border-radius: 999px; background: var(--papier); border: 1.5px solid var(--jc, var(--text));
  color: var(--jc, var(--text)); font: 700 .55em/1.2 var(--mono); display: grid; place-items: center;
}
.tile.back { background: var(--navy); border-color: var(--navy); }
.tile.back::before {
  content: ""; position: absolute; inset: 28%;
  background: url("/assets/logo/nummix_logo_fc_icon.svg") center / contain no-repeat; filter: brightness(0) invert(1); opacity: .7;
}

/* ---------- Startseite ---------- */
.screen { min-height: 100%; }
.center { display: grid; place-content: center; justify-items: center; gap: 1rem; min-height: 100vh; }


.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.btn-row .btn-big { padding-inline: .75rem; font-size: 1rem; }
.btn-learn { border-color: var(--blau); background: var(--tint-blau); }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.kpi { background: var(--papier); border: 1px solid var(--linie); border-radius: 1rem; padding: .65rem .75rem; display: grid; gap: .1rem; }
.kpi-v { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.kpi-k { font-size: .78rem; color: var(--text-leise); line-height: 1.25; }
.kpi:nth-child(1) .kpi-v { color: var(--blau-text); }
.kpi:nth-child(4) .kpi-v { color: var(--rot-text); }
.live-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.live-list:empty::before { content: "Gerade läuft keine öffentliche Partie. Starte eine und schalte sie in der Lobby auf „live“!"; color: var(--text-leise); font-size: .9rem; }
.live-item { background: var(--papier); border: 1px solid var(--linie); border-radius: 1rem; padding: .7rem .85rem; display: grid; gap: .45rem; }
.live-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.live-meta { font-size: .8rem; color: var(--text-leise); }
.live-players { display: flex; flex-wrap: wrap; gap: .3rem .7rem; font-size: .88rem; }
/* #309: nicht für das Profilbild – sonst verliert .avatar sein Zentrieren (inline-grid) und die Initiale rutscht nach links */
.live-players span:not(.avatar) { display: inline-flex; align-items: center; gap: .3rem; }
.live-players .turn { font-weight: 700; }
.live-players .cnt { font-family: var(--mono); font-size: .78rem; color: var(--text-leise); }
.home-foot { position: relative; z-index: 1; text-align: center; }
.home-foot a { color: inherit; }

.flag { width: 1.15em; height: .86em; border-radius: 2px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); vertical-align: -.05em; }
.toggles { display: grid; gap: .5rem; }
.toggle { display: flex; gap: .6rem; align-items: center; font-weight: 400; margin: 0; cursor: pointer; }
.toggle input { width: 1.15rem; height: 1.15rem; accent-color: var(--blau-text); flex: none; }
.toggle:has(input:disabled) { cursor: default; opacity: .7; }
.chat .guest .who { color: var(--text-leise); font-weight: 600; }


.lead { font-size: 1.1rem; color: var(--text-leise); }
.or { display: grid; grid-template-columns: 1fr auto 1fr; gap: .75rem; align-items: center; color: var(--text-leise); font-size: .9rem; }
.or::before, .or::after { content: ""; height: 1px; background: var(--linie); }
.join-form { text-align: left; }
.code-input { text-transform: uppercase; letter-spacing: .2em; font-weight: 600; }
.deko { position: absolute; pointer-events: none; }



/* ---------- Lobby ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: .9rem 16px; max-width: 64rem; margin: 0 auto; }
.brand { display: inline-flex; }
.conn { font-size: .85rem; color: var(--text-leise); display: inline-flex; align-items: center; gap: .4rem; }
.conn::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--blau); }
.conn.off::before { background: var(--rot); }
.lobby-wrap {
  max-width: 64rem; margin: 0 auto; padding: .5rem 16px 3rem;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem;
}
.panel { background: var(--nebel); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 1.75rem); display: grid; gap: 1rem; align-content: start; }
.code-box { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.code-big { font-size: clamp(2rem, 7vw, 2.75rem); font-weight: 700; letter-spacing: .15em; }
#lobby-link { word-break: break-all; }
.player-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.player-list li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .75rem; align-items: center;
  background: var(--papier); border: 1px solid var(--linie); border-radius: 1rem; padding: .65rem .9rem;
}
.player-list li.empty { background: transparent; border-style: dashed; color: var(--text-leise); grid-template-columns: auto 1fr; }
.seat { width: .9rem; height: 1.1rem; background: var(--seat); -webkit-mask: var(--m-tri) center / contain no-repeat; mask: var(--m-tri) center / contain no-repeat; }
.empty .seat { background: var(--linie); }
.p-who { display: flex; align-items: center; gap: .15rem; min-width: 0; }
.p-who > .avatar-xs, .chip > .avatar-xs { flex: none; margin: 0 .2rem 0 .1rem; }
.chip > .avatar-supporter { box-shadow: 0 0 0 1.5px #f6a21a, 0 0 0 2.5px #e94e1b, 0 0 3px 1px rgba(233, 78, 27, .45); }
.p-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-meta { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.badge { font-size: .78rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; background: var(--linie); color: var(--text); white-space: nowrap; }
.badge.ok { background: var(--tint-blau); color: var(--blau-text); }
/* Kontrast ≥ 4,5:1 für die kleine Schrift im hellen Design (#170, axe) */
:root:not([data-theme="dark"]) .badge.ok { color: #145d87; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.ok { color: var(--blau-text); } }
.badge.off { background: var(--tint-rot); color: var(--rot-text); }
.badge.host { background: var(--tint-gelb); color: var(--gelb-text); }
.kick { appearance: none; border: 0; background: none; color: var(--text-leise); cursor: pointer; font-size: 1.1rem; padding: 0 .25rem; }
.kick:hover { color: var(--rot-text); }
.add-bot { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.badge.bot { background: var(--navy); color: #fff; }
.chat-panel { grid-column: 1 / -1; }
.chat-panel .chat { max-height: 14rem; min-height: 5rem; background: var(--papier); border: 1px solid var(--linie); border-radius: 1rem; padding: .75rem 1rem; }
.chat { list-style: none; margin: 0; overflow-y: auto; display: grid; gap: .45rem; align-content: start; font-size: .925rem; overflow-wrap: anywhere; }
.chat:empty::before { content: "Noch keine Nachrichten. Sag Hallo!"; color: var(--text-leise); }
.chat .who { font-weight: 700; color: var(--seat-text, var(--text)); margin-right: .35rem; }
.chat time { font-family: var(--mono); font-size: .72rem; color: var(--text-leise); margin-right: .35rem; }
.chat-form { display: flex; gap: .5rem; }
.chat-form .input { padding-block: .5rem; }
.chat-form .btn { padding-inline: 1rem; }
.rules-short summary { cursor: pointer; font-weight: 500; }
.rules-short ul { padding-left: 1.2rem; margin: .5rem 0; display: grid; gap: .3rem; font-size: .925rem; }
.rules-short li::marker { color: var(--rot); }
@media (max-width: 760px) { .lobby-wrap { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Spiel ---------- */
.game { height: 100vh; height: var(--app-h, 100dvh); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
.g-top {
  display: flex; align-items: center; gap: .75rem; padding: .5rem 16px;
  border-bottom: 1px solid var(--linie); background: var(--papier); min-width: 0;
}
.chips { list-style: none; margin: 0; padding: 0; display: flex; gap: .4rem; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.chip {
  display: flex; align-items: center; gap: .45rem; padding: .3rem .75rem .3rem .55rem; border-radius: 999px;
  background: var(--nebel); border: 2px solid transparent; white-space: nowrap; font-size: .9rem;
}
.chip.active { border-color: var(--seat); background: var(--papier); box-shadow: 0 0 0 3px color-mix(in srgb, var(--seat) 25%, transparent); }
.chip .p-name { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }
.chip .you { font-size: .72em; font-weight: 700; color: var(--text-leise); flex: none; }
.chip .cnt { font-family: var(--mono); font-weight: 700; font-size: .85rem; background: var(--papier); border-radius: 999px; padding: 0 .45rem; }
.chip.active .cnt { background: var(--nebel); }
.chip.off { opacity: .55; }
.chip .rank { font-weight: 700; color: var(--gelb-text); }
.g-stats { display: flex; align-items: center; gap: .9rem; flex: none; }
.stat { display: grid; justify-items: center; line-height: 1.1; }
.stat-k { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-leise); }
.stat-v { font-size: 1.15rem; font-weight: 700; }
.timer.low .stat-v { color: var(--rot-text); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

.g-main { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; min-height: 0; }
.board-area { position: relative; min-width: 0; min-height: 0; }
.board-scroll { position: absolute; inset: 0; overflow: auto; background: var(--nebel); overscroll-behavior: contain; }
.board {
  position: relative; margin: 24px;
  /* Brett kleiner als das Feld (sehr große Monitore): mittig statt links (#405) */
  margin-left: max(24px, calc((100% - var(--w, 40) * var(--cell)) / 2));
  width: calc(var(--w, 40) * var(--cell)); height: calc(var(--h, 28) * var(--cell));
  background-color: var(--brett);
  background-image:
    linear-gradient(to right, var(--brett-linie) 1px, transparent 1px),
    linear-gradient(to bottom, var(--brett-linie) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  border-radius: 12px;
  outline: 1px solid var(--linie);
}
.board .tile {
  position: absolute; left: 0; top: 0;
  width: calc(var(--cell) - 4px); height: calc(var(--cell) - 4px);
  font-size: calc(var(--cell) * .42);
  transform: translate(calc(var(--x) * var(--cell) + 2px), calc(var(--y) * var(--cell) + 2px));
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), box-shadow .15s;
}
.board .tile.movable { cursor: grab; }
.board .tile.draft { box-shadow: 0 0 0 3px var(--draft, var(--blau)), 0 2px 0 var(--stein-schatten); }
.board .tile.bad { box-shadow: 0 0 0 3px var(--rot), 0 0 0 6px color-mix(in srgb, var(--rot) 25%, transparent); }
.board .tile.pop { animation: pop .35s ease-out; }
@keyframes pop { from { scale: .6; opacity: 0; } }
.tile.selected { outline: 3px solid var(--blau-text); outline-offset: 2px; }
.tile.dragging, .tile.remote-drag { opacity: .25; }
.hover-cell {
  position: absolute; left: 0; top: 0; width: var(--cell); height: var(--cell); border-radius: 10px;
  transform: translate(calc(var(--x) * var(--cell)), calc(var(--y) * var(--cell)));
  background: color-mix(in srgb, var(--blau) 22%, transparent); outline: 2px dashed var(--blau); outline-offset: -2px;
  pointer-events: none; display: none;
}
.hover-cell.on { display: block; }
.cursor {
  position: absolute; left: 0; top: 0; pointer-events: none; z-index: 5;
  transform: translate(calc(var(--x) * var(--cell) - var(--cell) / 2), calc(var(--y) * var(--cell) - var(--cell) / 2));
  transition: transform .08s linear;
}
.cursor .tile { position: relative; transform: rotate(-4deg); width: calc(var(--cell) - 4px); height: calc(var(--cell) - 4px); font-size: calc(var(--cell) * .42); box-shadow: 0 10px 22px rgba(0, 0, 0, .25); transition: none; }
.cursor .who {
  position: absolute; left: 70%; top: 85%; background: var(--seat); color: #fff; font-size: .75rem; font-weight: 600;
  border-radius: 999px; padding: .05rem .5rem; white-space: nowrap;
}
.cursor .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--seat); margin: calc(var(--cell) / 2 - 7px); }
.ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; transform: rotate(-4deg) scale(1.08); box-shadow: 0 14px 28px rgba(0, 0, 0, .28); }

.zoom { position: absolute; right: 12px; bottom: 12px; display: flex; gap: .35rem; z-index: 6; }
.board-status {
  position: absolute; left: 12px; bottom: 12px; z-index: 6; max-width: calc(100% - 11rem);
  background: var(--papier); border: 1px solid var(--linie); border-radius: 999px; padding: .4rem .9rem;
  font-size: .875rem; font-weight: 500; box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
}
.board-status:empty { display: none; }
.board-status.bad { color: var(--rot-text); border-color: var(--rot); border-radius: 1rem; }
.board-status.ok { color: var(--blau-text); }

.g-side { border-left: 1px solid var(--linie); display: flex; flex-direction: column; min-height: 0; background: var(--papier); }
.tabs { display: flex; gap: .25rem; padding: .5rem .75rem 0; border-bottom: 1px solid var(--linie); align-items: center; }
.tabs [role="tab"] {
  appearance: none; border: 0; background: none; color: var(--text-leise); font: 600 .9rem/1 var(--font);
  padding: .6rem .6rem .7rem; cursor: pointer; border-bottom: 3px solid transparent; display: inline-flex; gap: .35rem; align-items: center;
}
.tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--blau); }
.side-close { margin-left: auto; display: none; width: 2rem; height: 2rem; }
.tab-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.tab-panel .chat { flex: 1; padding: .75rem 1rem; }
.tab-panel .chat-form { padding: .6rem .75rem .75rem; border-top: 1px solid var(--linie); }
.tab-panel .chat-form .btn { padding-inline: .8rem; }
.unread { background: var(--rot); color: #fff; font: 700 .7rem/1 var(--mono); border-radius: 999px; padding: .2rem .4rem; }
.unread:empty { display: none; }
.chat-btn { position: relative; display: none; }
.chat-btn .unread { position: absolute; top: -4px; right: -4px; }
.log { list-style: none; margin: 0; padding: .25rem 1rem 1rem; overflow-y: auto; flex: 1; display: grid; gap: .35rem; align-content: start; font-size: .875rem; }
.log li { color: var(--text-leise); }
.log li:last-child { color: var(--text); font-weight: 500; }
.log time { font-family: var(--mono); font-size: .75rem; margin-right: .4rem; opacity: .7; }

.g-bottom { border-top: 1px solid var(--linie); background: var(--papier); padding: .5rem 16px calc(.6rem + env(safe-area-inset-bottom)); display: grid; gap: .45rem; }
.turn-msg { font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.turn-msg::before { content: ""; width: .8rem; height: 1rem; background: var(--seat, var(--blau)); -webkit-mask: var(--m-tri) center / contain no-repeat; mask: var(--m-tri) center / contain no-repeat; }
.banners { display: flex; gap: .5rem; flex-wrap: wrap; flex: 1; }
.banner { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .3rem .4rem .3rem .9rem; border-radius: 999px; font-size: .9rem; background: var(--tint-gelb); }
.banner.blue { background: var(--tint-blau); }
.bank { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: end; }

/* Die Spielbank: dunkel wie die Hinweisboxen des Styleguides, damit sie sich vom hellen Brett abhebt */
.bank-board {
  position: relative; display: flex; gap: 14px; align-items: stretch; min-width: 0;
  background: linear-gradient(180deg, #1a3242 0%, var(--navy) 100%);
  border-radius: 16px; padding: 10px 12px 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 6px 0 #0a151c, 0 10px 24px rgba(0, 0, 0, .18);
}
.bank-board::after { /* „Beinchen“ der Bank */
  content: ""; position: absolute; left: 8%; right: 8%; bottom: -12px; height: 6px;
  background: radial-gradient(circle at 6px 3px, #0a151c 5px, transparent 6px) 0 0 / calc(100% / 4) 6px repeat-x;
}
.rack-scroll { overflow-x: auto; flex: 1; min-width: 0; scrollbar-color: #36505f transparent; }
.rack {
  display: grid; grid-template-rows: repeat(var(--rows, 4), var(--rtile)); grid-auto-flow: column; grid-auto-columns: var(--rtile);
  gap: 5px; width: max-content;
  padding: 6px 6px 4px; /* Platz für den versetzten Zwilling-Stapel oben und den Leuchtring am Rand (#317); rackFit() zieht ihn ab */
}
.prep-label { font: 600 .68rem/1 var(--font); text-transform: uppercase; letter-spacing: .08em; color: rgba(255, 255, 255, .6); }
.prep { display: grid; grid-template-rows: repeat(var(--rows, 4), var(--rtile)); grid-auto-flow: column; grid-auto-columns: var(--rtile); gap: 5px; }
.prep .slot { background: rgba(249, 178, 51, .1); outline: 1px dashed rgba(249, 178, 51, .35); outline-offset: -1px; }
.bank-logo { position: absolute; right: 16px; bottom: 6px; height: 12px; opacity: .5; filter: brightness(0) invert(1); pointer-events: none; }
.slot { width: var(--rtile); height: var(--rtile); border-radius: 18%; background: rgba(255, 255, 255, .06); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .35); }
.slot.hover { background: color-mix(in srgb, var(--blau) 45%, transparent); outline: 2px dashed var(--blau); }
.slot.no { background: color-mix(in srgb, var(--rot) 40%, transparent); }
.slot .tile { width: 100%; height: 100%; font-size: calc(var(--rtile) * .42); cursor: grab; }
.slot .tile.must { box-shadow: 0 0 0 3px var(--gelb), 0 2px 0 var(--stein-schatten); animation: pulse 1.4s infinite; }
.actions { display: grid; gap: .45rem; justify-items: stretch; }
.sort { display: flex; gap: .35rem; }
.sort .btn { flex: 1; }
.rack-readonly .slot .tile { cursor: default; }
/* Auswahl unabhängig von der Spielerfarbe (#162): kräftiger Rahmen mit Abstand + leicht angehoben –
   Gelb/Orange als eigene Farbe bleiben so von der Auswahl unterscheidbar (auch ohne Farbsehen) */
.slot .tile.selected { outline: 3px solid #fff; outline-offset: 2px; translate: 0 -3px; }
.board .tile.selected { outline: 3px solid var(--text); outline-offset: 2px; translate: 0 -2px; box-shadow: 0 8px 16px rgba(0, 0, 0, .28); }
.marquee { position: fixed; z-index: 90; pointer-events: none; border: 2px dashed var(--blau); background: color-mix(in srgb, var(--blau) 15%, transparent); border-radius: 6px; }
.ghost-group { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; }
.ghost-group .tile { position: absolute; box-shadow: 0 14px 28px rgba(0, 0, 0, .28); transform: rotate(-3deg); }
.hover-cell.no { background: color-mix(in srgb, var(--rot) 22%, transparent); outline-color: var(--rot); }
.help-hint {
  position: absolute; top: 12px; left: 50%; translate: -50% 0; z-index: 6; font-size: .8rem; color: var(--text-leise);
  background: var(--papier); border: 1px solid var(--linie); border-radius: 999px; padding: .3rem .8rem; white-space: nowrap;
  pointer-events: none; transition: opacity .4s;
}
.help-hint.off { opacity: 0; }
@media (hover: none), (pointer: coarse) { .help-hint { display: none; } } /* #256: Samsung-Handys melden „hover“ */

/* Punkte */
.chip .pts { font-family: var(--mono); font-weight: 700; font-size: .78rem; color: var(--gelb-text); }
.score-pop {
  position: absolute; left: 0; top: 0; z-index: 7; pointer-events: none;
  transform: translate(calc(var(--x) * var(--cell)), calc(var(--y) * var(--cell))) translate(-50%, -100%);
  background: var(--navy); color: #fff; border-radius: 14px; padding: .45rem .8rem; text-align: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25); animation: score-pop 3.2s ease-out forwards; white-space: nowrap;
}
.score-pop b { display: block; font: 800 1.5rem/1.1 var(--font); color: var(--gelb); }
.score-pop span { font-size: .75rem; color: #d6d6d4; }
@keyframes score-pop {
  0% { opacity: 0; translate: 0 10px; scale: .7; }
  10% { opacity: 1; translate: 0 0; scale: 1.05; }
  15% { scale: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; translate: 0 -30px; }
}
.creative { font-size: .95rem; color: var(--text-leise); }
.creative strong { color: var(--text); }

/* Branding im Spiel */
.game-brand { align-items: center; gap: .5rem; flex: none; }
.brand-word { height: 30px; width: auto; }
.game-brand .brand-icon { display: none; }
.board::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("/assets/logo/nummix_logo_fc_icon.svg") center / min(38%, 340px) no-repeat; opacity: .07;
}






.overlay { position: fixed; inset: 0; background: rgba(17, 34, 44, .55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.dialog { position: relative; background: var(--papier); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.25rem); width: min(28rem, 100%); display: grid; gap: 1.25rem; }
/* #394: hohe Dialoge (Einstellungen) nie höher als der Bildschirm – sie scrollen, „Schließen“ bleibt am unteren Rand sichtbar */
.overlay > .dialog { max-height: calc(var(--app-h, 100dvh) - 32px); overflow-y: auto; overscroll-behavior: contain; }
#settings .dialog-actions { position: sticky; bottom: calc(-1 * clamp(1.5rem, 4vw, 2.25rem)); margin-bottom: calc(-1 * clamp(1.5rem, 4vw, 2.25rem)); padding: .6rem 0 clamp(1rem, 3vw, 1.5rem); background: var(--papier); }
.deko-dialog { width: 4.5rem; top: -1.6rem; right: -1rem; }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.results li { display: grid; grid-template-columns: 2.5rem 1fr auto auto; align-items: center; gap: .5rem; padding: .6rem .9rem; border-radius: 1rem; background: var(--nebel); }
.results li:first-child { background: var(--tint-gelb); }
.results .r-rank { font: 700 1.3rem/1 var(--mono); }
.dialog-actions { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }

.toasts { position: fixed; top: 1rem; left: 50%; translate: -50% 0; z-index: 200; display: grid; gap: .5rem; width: min(30rem, calc(100% - 32px)); pointer-events: none; }
.toast { background: var(--navy); color: #fff; padding: .7rem 1rem; border-radius: 1rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); font-weight: 500; animation: toast-in .2s ease-out; }
.toast.error { background: var(--rot-text); }
@keyframes toast-in { from { opacity: 0; translate: 0 -8px; } }

@media (max-width: 900px) {
  .g-main { grid-template-columns: minmax(0, 1fr); }
  .g-side { display: none; }
  .g-side.open {
    display: flex; position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(24rem, 100%);
    box-shadow: -12px 0 32px rgba(0, 0, 0, .2); border-left: 1px solid var(--linie);
  }
  .side-close, .chat-btn { display: inline-grid; }
}
@media (max-width: 1100px) { .brand-word { display: none; } .game-brand .brand-icon { display: block; } }
@media (max-width: 640px) {
  :root { --rtile: 32px; }
  .bank-board { gap: 8px; padding: 8px; }
  .bank { grid-template-columns: minmax(0, 1fr); }
  
  .stat-k { display: none; }
  .g-top { gap: .5rem; padding-inline: 12px; }
  .g-stats { gap: .6rem; }
  .chip { padding: .2rem .55rem .2rem .45rem; font-size: .85rem; }
  .chip .p-name { max-width: 4.5rem; }
  .icon-btn#btn-theme { width: 2.1rem; height: 2.1rem; }
  .banner { font-size: .85rem; border-radius: 1rem; }
  .board-status { max-width: calc(100% - 24px); bottom: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Tutorial ---------- */
.tutorial { min-height: 100vh; }
.tut-top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem; padding: .75rem 16px;
  background: var(--papier); border-bottom: 1px solid var(--linie);
}
.tut-progress { list-style: none; margin: 0 auto; padding: 0; display: flex; gap: .35rem; flex-wrap: wrap; justify-content: center; }
.tut-progress button {
  appearance: none; border: 1px solid var(--linie); background: var(--nebel); color: var(--text-leise);
  font: 600 .85rem/1 var(--font); padding: .45rem .8rem; border-radius: 999px; cursor: pointer;
}
.tut-progress button.done { color: var(--blau-text); background: var(--tint-blau); border-color: transparent; }
.tut-progress button.active { background: var(--schwarz); color: #fff; border-color: var(--schwarz); }
#tut-skip { flex: none; }
.tut-wrap { max-width: 46rem; margin: 0 auto; padding: 1.5rem 16px 3rem; display: grid; gap: .75rem; }
.tut-count { color: var(--text-leise); font-size: .85rem; }
.tut-card { background: var(--nebel); border-radius: var(--radius); padding: clamp(1.25rem, 4vw, 2.25rem); display: grid; gap: 1.1rem; }
.tut-card h2 { font-size: 1.6rem; }
.tut-text { font-size: 1.05rem; max-width: 40rem; }
.tut-board { --tc: 2.75rem; display: grid; grid-template-columns: repeat(var(--cols), var(--tc)); grid-auto-rows: var(--tc); gap: .35rem; justify-content: center; padding: 1rem; background: var(--brett); border-radius: 14px; overflow-x: auto; }
.tut-board .tile { width: var(--tc); height: var(--tc); font-size: 1.15rem; animation: pop .35s ease-out backwards; }
.tut-board.bad { position: relative; --tc: 2.2rem; justify-content: start; padding: .6rem; background: var(--tint-rot); }
.tut-board.bad .tile { box-shadow: 0 0 0 2px var(--rot); }
.tut-wrong { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; color: var(--rot-text); font-weight: 500; }
.tut-nav { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.tut-nav .btn-big { width: auto; }
.tut-puzzle { display: grid; gap: 1rem; justify-items: center; }
.tut-pboard {
  --pc: 3rem; display: grid; grid-template-columns: repeat(var(--cols), var(--pc)); grid-auto-rows: var(--pc);
  background-color: var(--brett); background-image: linear-gradient(to right, var(--brett-linie) 1px, transparent 1px), linear-gradient(to bottom, var(--brett-linie) 1px, transparent 1px);
  background-size: var(--pc) var(--pc); border-radius: 12px; outline: 1px solid var(--linie); max-width: 100%; overflow-x: auto;
}
.tcell { display: grid; place-items: center; }
.tcell .tile { width: calc(var(--pc) - 5px); height: calc(var(--pc) - 5px); font-size: 1.2rem; }
.tcell .tile.bad { box-shadow: 0 0 0 3px var(--rot); }
.tut-tile { cursor: grab; touch-action: none; }
.tut-rack { display: flex; align-items: center; gap: .9rem; background: linear-gradient(180deg, #1a3242 0%, var(--navy) 100%); border-radius: 14px; padding: .7rem .9rem; flex-wrap: wrap; }
.tut-slots { display: flex; gap: 6px; }
.tut-rack .slot { --rtile: 3rem; }
.tut-rack .slot .tile { cursor: grab; }
.tut-drop { opacity: .5; }
.tut-status { font-weight: 600; text-align: center; color: var(--text-leise); }
.tut-status.ok { color: var(--blau-text); font-size: 1.15rem; }
.tut-status.bad { color: var(--rot-text); }
.tut-tools { display: flex; gap: .5rem; justify-content: center; }
.tut-hint { background: var(--tint-gelb); border-radius: 1rem; padding: .7rem 1rem; text-align: center; }
@media (max-width: 640px) {
  .tut-top { flex-wrap: wrap; gap: .5rem; }
  .tut-progress { order: 3; width: 100%; }
  .tut-board { --tc: 2.2rem; }
  .tut-pboard { --pc: 2.6rem; }
}

/* =====================================================================
   Spieltisch – angelehnt an die Fotos auf nummix.de:
   heller Holztisch, mattweiße Steine, schwarze 3D-gedruckte Bank mit vier Stufen
   ===================================================================== */
:root {
  --tisch: #f3f3f1;
  --tisch-dunkel: #ffffff;
  --tisch-punkt: rgba(41, 41, 41, .10);
  --bank: #1f1f1f;
  --bank-kante: #0d0d0d;
  --bank-stufe: #2c2c2c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --tisch: #16222a; --tisch-dunkel: #10191f; --tisch-punkt: rgba(255, 255, 255, .07); }
}
:root[data-theme="dark"] { --tisch: #16222a; --tisch-dunkel: #10191f; --tisch-punkt: rgba(255, 255, 255, .07); }

/* Steine: matt, weiche Kante, Schatten wie auf dem Tisch; 6 und 9 mit Punkt */
.tile {
  background: linear-gradient(160deg, #ffffff 0%, var(--stein) 55%, #f1f0ec 100%);
  border: 0;
  border-radius: 16%;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 -2px 0 rgba(0, 0, 0, .06) inset, 0 2px 1px rgba(0, 0, 0, .18), 0 6px 14px rgba(0, 0, 0, .16);
}
.tile.dot::after {
  content: ""; position: absolute; left: 50%; bottom: 13%; width: 9%; aspect-ratio: 1; border-radius: 50%;
  background: currentColor; translate: -50% 0;
}

/* Kopfzeile: Logo links, Mitspielende mittig, Werte rechts */
.g-top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 1rem; }
.g-top .chips { justify-content: center; flex: none; max-width: 60vw; }
.g-top .g-stats { justify-self: end; }
.chat-btn { display: inline-grid; }
.chip { background: var(--nebel); }

/* Der Tisch */
.board-scroll { background: var(--tisch); }
.board {
  background-color: transparent;
  background-image: radial-gradient(circle at 0 0, var(--tisch-punkt) 1.1px, transparent 1.5px);
  background-size: var(--cell) var(--cell);
  outline: 0; border-radius: 0;
}
.board.show-grid { background-image: linear-gradient(to right, var(--tisch-punkt) 1px, transparent 1px), linear-gradient(to bottom, var(--tisch-punkt) 1px, transparent 1px); }
.board::before { opacity: .045; filter: grayscale(1); }
.board .tile { width: calc(var(--cell) - 3px); height: calc(var(--cell) - 3px); transform: translate(calc(var(--x) * var(--cell) + 1.5px), calc(var(--y) * var(--cell) + 1.5px)); }
.board .tile.draft { box-shadow: 0 0 0 3px var(--draft, var(--blau)), 0 6px 14px rgba(0, 0, 0, .2); }
.hover-cell { border-radius: 16%; }
.board-status, .help-hint { box-shadow: 0 6px 18px rgba(0, 0, 0, .15); border: 0; }
.zoom .icon-btn { border: 0; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
/* durchscheinend wie die Glocke (#344): Steine darunter bleiben sichtbar; das Symbol sitzt mittig (#346) */
.zoom .icon-btn { background: color-mix(in srgb, var(--papier) 72%, transparent); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: .9; }
.zoom .icon-btn:hover, .zoom .icon-btn:focus-visible { background: color-mix(in srgb, var(--nebel) 80%, transparent); opacity: 1; }
.zoom .icon-btn svg { display: block; }
.g-side { box-shadow: -1px 0 0 var(--linie); }
.g-main.side-closed { grid-template-columns: minmax(0, 1fr) 0; }
.g-main.side-closed .g-side { display: none; }

/* Unten: Zuginfo | Bank mittig vor der Person | Aktionen */
.g-bottom {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 1.25rem;
  padding: .9rem 20px calc(1.1rem + env(safe-area-inset-bottom));
  background: var(--tisch-dunkel);
  border-top: 1px solid var(--linie); box-shadow: none;
}
.g-left { display: grid; gap: .5rem; justify-items: end; text-align: right; align-content: center; min-width: 0; }
.g-left .turn-msg { font-size: 1.05rem; }
.g-left .banners { justify-content: flex-end; }
.g-left .banner { border-radius: 1rem; text-align: left; }
.g-right { display: grid; gap: .5rem; justify-items: stretch; align-content: center; grid-template-columns: minmax(0, 11.5rem); }
.g-right .btn { padding-inline: .8rem; }
.g-right .sort { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; align-items: center; }
.sort-k { grid-column: 1 / -1; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-leise); margin-top: .2rem; }
.game.spectating .bank-group, .game.spectating .g-right { display: none; }
.game.spectating .g-bottom { grid-template-columns: minmax(0, 1fr); }
.game.spectating .g-left { justify-items: center; text-align: center; }

.bank-group { display: flex; align-items: flex-end; gap: 14px; min-width: 0; max-width: 100%; }
/* Die Bank: schwarz, mit Druckschichten und vier Stufen */
.bank-board {
  position: relative; min-width: 0; display: block;
  --step: calc(var(--rtile) + 6px);
  padding: 12px 14px 22px;
  border-radius: 10px 10px 6px 6px;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(180deg, transparent 0 calc(var(--step) - 7px), var(--bank-stufe) calc(var(--step) - 7px) calc(var(--step) - 3px), var(--bank-kante) calc(var(--step) - 3px) var(--step)),
    var(--bank);
  /* #364: die Leisten sind die Auflage der Steine – Unterkante des Steins liegt auf der Leiste (Innenrand des Rahmens + Rack-Rand + 7px Leistenhöhe − Abstand) */
  background-origin: border-box, content-box, border-box;
  background-position: 0 0, 0 calc(var(--rack-pt, 6px) + 7px - 6px), 0 0;
  box-shadow: 0 2px 0 #333 inset, 0 10px 0 var(--bank-kante), 0 18px 26px rgba(0, 0, 0, .35);
}
.bank-board::after { display: none; }
.rack { gap: 6px 5px; }
.rack .slot, .prep .slot { background: transparent; box-shadow: none; border-radius: 16%; }
.rack .slot:empty:hover { background: rgba(255, 255, 255, .05); }
.slot.hover { background: color-mix(in srgb, var(--blau) 45%, transparent) !important; outline: 2px dashed var(--blau); }
.slot.no { background: color-mix(in srgb, var(--rot) 40%, transparent) !important; }
.slot .tile { box-shadow: 0 -2px 0 rgba(0, 0, 0, .08) inset, 0 3px 0 rgba(0, 0, 0, .55), 0 6px 10px rgba(0, 0, 0, .35); }
.bank-logo { right: 50%; translate: 50% 0; bottom: 5px; height: 11px; opacity: .45; }
.rack-scroll { scrollbar-color: #555 transparent; }

/* Vorbereitungsfeld: kleines, abgesetztes Tablett neben der Bank */
.prep-tray {
  flex: none; display: grid; gap: 6px; padding: 10px 10px 12px; border-radius: 10px;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 3px), #2a2a2a;
  box-shadow: 0 2px 0 #3a3a3a inset, 0 6px 0 var(--bank-kante), 0 12px 18px rgba(0, 0, 0, .3);
  border: 1px dashed rgba(249, 178, 51, .45);
}
.prep-tray .prep-label { color: var(--gelb); opacity: .85; }
.prep .slot { outline: 1px dashed rgba(255, 255, 255, .12); outline-offset: -2px; }

@media (max-width: 1360px) {
  .g-bottom { grid-template-columns: minmax(0, 1fr); gap: .7rem; padding-top: .7rem; }
  .g-left { justify-items: center; text-align: center; }
  .g-left .banners { justify-content: center; }
  .bank-group { justify-self: center; }
  .g-right { grid-template-columns: repeat(3, auto); justify-content: center; justify-items: stretch; align-items: center; }
  .g-right #btn-end { order: 3; }
  .g-right .sort { display: flex; }
  .sort-k { margin: 0 .2rem 0 0; }
}
@media (max-width: 640px) {
  .g-top { grid-template-columns: auto minmax(0, 1fr) auto; gap: .5rem; }
  .g-top .chips { justify-content: flex-start; max-width: none; }
  .bank-group { gap: 8px; }
  .bank-board { padding: 8px 8px 18px; --step: calc(var(--rtile) + 6px); }
  .prep-tray { padding: 8px 6px 10px; }
  .g-right { grid-template-columns: 1fr 1fr; width: 100%; }
  .g-right #btn-end { grid-column: 1 / -1; order: -1; }
  .g-right .sort { grid-column: 1 / -1; justify-content: center; }
}

/* ---------- Live-Partien ---------- */
.live-all { justify-self: end; font-weight: 600; text-decoration: none; }
.live-all:hover { text-decoration: underline; }
.live-page { min-height: 100vh; }
.live-title { font-size: 1.3rem; margin: 0 auto; }
.live-wrap { max-width: 72rem; margin: 0 auto; padding: 1.5rem 16px 3rem; display: grid; gap: 1.25rem; }
.live-filters { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: end; background: var(--nebel); border-radius: var(--radius); padding: 1rem 1.25rem; }
.lf { display: grid; gap: .25rem; margin: 0; font-size: .8rem; font-weight: 600; color: var(--text-leise); }
.lf .input { padding: .45rem .7rem; font-size: .95rem; min-width: 8rem; }
.lf-search { flex: 1; min-width: 12rem; }
.lf-check { align-self: center; font-size: .9rem; }
.live-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); }
.live-grid:empty::before { content: "Keine Partie passt zu diesen Filtern."; }
.live-item .badge { font-size: .72rem; }
.live-tags { display: flex; gap: .35rem; flex-wrap: wrap; }


@keyframes float { 50% { translate: 0 -10px; } }


/* ---------- Finale, Feiern ---------- */
.btn-warn { border-color: var(--rot-text); color: var(--rot-text); }
.btn-warn:hover { background: var(--tint-rot); }
.bank-group.finale .bank-board { box-shadow: 0 0 0 3px var(--blau), 0 10px 0 var(--bank-kante), 0 18px 26px rgba(0, 0, 0, .35); }
.confetti { position: fixed; inset: 0; z-index: 300; pointer-events: none; overflow: hidden; }
.confetto { position: absolute; left: 0; top: 0; will-change: transform; box-shadow: 0 6px 14px rgba(0, 0, 0, .18); }
.cheer {
  position: fixed; left: 50%; top: 38%; z-index: 301; translate: -50% -50%; pointer-events: none;
  display: grid; gap: .3rem; justify-items: center; text-align: center;
  background: var(--navy); color: #fff; border-radius: 1.5rem; padding: 1.25rem 2rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3); animation: cheer 3.6s ease-out forwards; max-width: calc(100% - 32px);
}
.cheer strong { font: 800 clamp(1.6rem, 5vw, 2.6rem)/1.1 var(--font); color: var(--gelb); }
.cheer span { color: #e5e5e3; }
@keyframes cheer {
  0% { opacity: 0; scale: .6; }
  10% { opacity: 1; scale: 1.06; }
  16% { scale: 1; }
  82% { opacity: 1; }
  100% { opacity: 0; scale: .96; }
}

/* ---------- Handy & Tablet ---------- */
.btn, .icon-btn, .segmented button, .tabs [role="tab"] { touch-action: manipulation; }
.tile { -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.prep-toggle { display: none; }

/* Tablets: Bank möglichst ohne Scrollen */
@media (min-width: 641px) and (max-width: 1100px) {
  :root { --rtile: clamp(34px, calc((100vw - 230px) / 18.6), 42px); }
}

/* Handy hochkant */
@media (max-width: 640px) {
  :root { --rtile: 34px; }
  .stat-spec { display: none; }
  .g-bottom { padding: .5rem 10px calc(.6rem + env(safe-area-inset-bottom)); gap: .5rem; }
  .g-left .turn-msg { font-size: .95rem; }
  .bank-group { width: 100%; justify-content: center; }
  .bank-board { flex: 1; padding: 8px 8px 16px; }
  .bank-logo { display: none; }
  .prep-tray { display: none; }
  body.prep-open .prep-tray { display: grid; }
  .prep-toggle { display: inline-flex; }
  .prep-toggle[aria-pressed="true"] { background: var(--gelb); border-color: var(--gelb); color: #292929; }
  .g-right { grid-template-columns: 1fr 1fr; width: 100%; gap: .4rem; }
  .g-right .sort { grid-column: 1 / -1; display: flex; justify-content: center; flex-wrap: wrap; }
  .sort-k { display: none; }
  .tut-pboard { --pc: 2.3rem; }
  .cheer { padding: 1rem 1.25rem; }
}

/* Handy quer: alles kompakt nebeneinander, damit der Tisch Platz behält */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --rtile: 28px; }
  .g-top { padding-block: .25rem; }
  .stat-k { display: none; }
  .g-bottom {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "left left" "bank actions";
    gap: .3rem .75rem; padding: .3rem 12px calc(.4rem + env(safe-area-inset-bottom));
  }
  .g-left { grid-area: left; justify-items: start; text-align: left; grid-auto-flow: column; justify-content: start; align-items: center; }
  .g-left .turn-msg { font-size: .9rem; }
  .bank-group { grid-area: bank; justify-self: stretch; width: auto; }
  .bank-board { padding: 6px 8px 12px; }
  .bank-logo { display: none; }
  .prep-tray { display: none; }
  body.prep-open .prep-tray { display: grid; }
  .prep-toggle { display: inline-flex; }
  .g-right { grid-area: actions; grid-template-columns: minmax(0, 9.5rem); width: auto; gap: .3rem; }
  .g-right .btn { padding: .45rem .6rem; font-size: .88rem; }
  .g-right .sort { display: grid; grid-template-columns: 1fr 1fr; }
  .g-right .sort .prep-toggle { grid-column: 1 / -1; }
  .sort-k { display: none; }
  .board-status { bottom: 8px; max-width: 55%; }
  .help-hint { display: none; }
}

/* Kopfzeile auf Tablets: Chips links und scrollbar, damit nichts überlappt */
@media (max-width: 1100px) {
  .g-top { grid-template-columns: auto minmax(0, 1fr) auto; }
  .g-top .chips { justify-content: flex-start; max-width: none; }
}
/* Handy quer: Hinweise einzeilig, damit der Tisch Höhe behält */
@media (orientation: landscape) and (max-height: 520px) {
  .g-left { min-width: 0; overflow: hidden; }
  .g-left .turn-msg { white-space: nowrap; }
  .g-left .banners { flex-wrap: nowrap; min-width: 0; overflow: hidden; }
  .g-left .banner { white-space: nowrap; min-width: 0; padding-block: .15rem; font-size: .8rem; }
  .g-left .banner > span { overflow: hidden; text-overflow: ellipsis; }
  .g-top { min-height: 0; }
  .g-top .brand-icon { width: 26px; height: 26px; }
  .chip { padding-block: .15rem; }
}
/* Hinweise auf dem Tisch dürfen nie Klicks oder Tipps abfangen */
.board-status, .score-pop, .help-hint { pointer-events: none; }
#tut-skip { margin-left: auto; }

/* ---------- Sprache, Pause, Einstellungen ---------- */
.lang-switch { display: inline-flex; border: 1px solid var(--linie); border-radius: 999px; padding: 2px; background: var(--papier); flex: none; }
.lang-switch button {
  appearance: none; border: 0; background: transparent; color: var(--text-leise); font: 700 .78rem/1 var(--mono);
  padding: .4rem .6rem; border-radius: 999px; cursor: pointer; touch-action: manipulation;
}
.lang-switch button[aria-pressed="true"] { background: var(--schwarz); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lang-switch button[aria-pressed="true"] { background: var(--text); color: var(--papier); } }
:root[data-theme="dark"] .lang-switch button[aria-pressed="true"] { background: var(--text); color: var(--papier); }

.topbar-right { display: flex; align-items: center; gap: .9rem; }
.settings-lang { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .5rem; border-top: 1px solid var(--linie); }
.chat:empty::before { content: attr(data-empty); }
.live-list:empty::before { content: attr(data-empty); }
.live-grid:empty::before { content: attr(data-empty); }
#btn-pause.active { background: var(--gelb); border-color: var(--gelb); color: #292929; }
.pause-veil {
  position: absolute; inset: 0; z-index: 8; display: grid; place-items: center;
  background: color-mix(in srgb, var(--tisch) 70%, transparent); backdrop-filter: blur(3px);
}
.pause-card { display: grid; justify-items: center; gap: .5rem; background: var(--navy); color: #fff; border-radius: 1.25rem; padding: 1.5rem 2rem; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); max-width: calc(100% - 32px); }
.pause-card svg { color: var(--gelb); }
.pause-card strong { font-size: 1.5rem; }
.pause-card span { color: #d6d6d4; }
.game.is-paused .bank-group { opacity: .85; }







.live-all { margin-top: auto; align-self: flex-end; }
.btn-quiz { border-color: var(--gelb); background: var(--tint-gelb); }


/* ---------- Quiz ---------- */
.quiz-score { margin: 0 auto; color: var(--text-leise); font-weight: 600; font-size: .9rem; }
.quiz-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.quiz-onto { color: var(--blau-text); font-weight: 600; align-self: center; }
.tcell.hint { background: color-mix(in srgb, var(--gelb) 35%, transparent); border-radius: 12px; outline: 2px dashed var(--gelb); outline-offset: -3px; }
.tut-tile.hint { box-shadow: 0 0 0 3px var(--gelb), 0 6px 14px rgba(0, 0, 0, .2); animation: pulse 1.2s infinite; }
@media (max-width: 640px) { .tut-top .lang-switch { order: 2; } }

/* Kopfzeile: Chips nur im freien Raum, nie über Zeit und Knöpfen */
.g-top { grid-template-columns: auto minmax(0, 1fr) auto; }
.g-top .chips { justify-content: safe center; max-width: none; min-width: 0; }
@media (max-width: 640px) {
  #btn-theme { display: none; }
  .g-stats { gap: .4rem; }
  .g-stats .icon-btn { width: 2.2rem; height: 2.2rem; }
}

/* Hell/Dunkel neben dem Sprachumschalter */

.theme-btn { width: 2.2rem; height: 2.2rem; font-size: 1rem; }

/* ---------- QR-Code ---------- */
.qr-row { display: flex; gap: 1rem; align-items: center; }
.qr { background: #fff; border-radius: 12px; padding: 6px; line-height: 0; flex: none; }
.qr svg { width: 100%; height: 100%; display: block; }
#lobby-qr { width: 132px; height: 132px; }
.qr-side { display: grid; gap: .6rem; justify-items: start; }
.qr-overlay { background: rgba(17, 34, 44, .82); }
.qr-big-card { background: #fff; color: #292929; border-radius: 1.5rem; padding: clamp(1.25rem, 4vw, 2.5rem); display: grid; justify-items: center; gap: .75rem; text-align: center; width: min(40rem, 100%); max-height: 100%; overflow: auto; }
.qr-big-card .logo { filter: none !important; }
.qr-big { width: min(70vh, 80vw, 30rem); height: min(70vh, 80vw, 30rem); padding: 0; }
.qr-big-code { font-size: clamp(2rem, 7vw, 3.5rem); font-weight: 700; letter-spacing: .2em; margin: 0; }
.qr-big-link { font-size: 1.1rem; margin: 0; color: #5b5b59; word-break: break-all; }
.qr-big-card .muted { color: #5b5b59; }
@media (max-width: 420px) { .qr-row { flex-direction: column; align-items: flex-start; } }
#turn-time button, .seg-custom input { font-size: .86rem; padding-inline: .15rem; }

/* ---------- Turnier ---------- */
.tri-blau { --tri: var(--blau); }
.seg-2 { grid-template-columns: 1fr 1fr; }
.tournament { min-height: 100vh; }
.t-wrap { max-width: 76rem; margin: 0 auto; padding: .5rem 16px 3rem; display: grid; gap: 1.25rem; }
.t-head { gap: .6rem; }
.t-title-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.t-title-row h1 { font-size: 1.8rem; }
.t-code { letter-spacing: .12em; color: var(--text-leise); font-size: 1.3rem; }
.t-badges { display: flex; gap: .4rem; flex-wrap: wrap; }
.t-status { font-size: 1.1rem; font-weight: 600; }
.t-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.t-actions:empty { display: none; }
.t-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.t-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.t-fields .input { width: 100%; }
.t-players-panel { grid-column: 1 / -1; }
.t-players { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .5rem; }
.t-player { display: flex; align-items: center; gap: .45rem; background: var(--papier); border: 1px solid var(--linie); border-radius: 999px; padding: .4rem .75rem; min-width: 0; }
.t-player .p-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.t-player.off { opacity: .5; }
.t-plan { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(16rem, 1fr); gap: 1rem; overflow-x: auto; padding-bottom: .5rem; align-items: start; }
.t-round { display: grid; gap: .75rem; align-content: start; }
.t-round > h2 { font-size: 1.1rem; position: sticky; top: 0; }
.t-round.final .t-table { border-color: var(--gelb); box-shadow: 0 0 0 2px var(--gelb); }
.t-table { background: var(--nebel); border: 1px solid var(--linie); border-radius: 1rem; padding: .8rem .9rem; display: grid; gap: .5rem; }
.t-table.mine { border-color: var(--blau); box-shadow: 0 0 0 2px var(--blau); }
.t-table.done { opacity: .92; }
.t-table-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.t-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.t-row { display: flex; align-items: center; gap: .4rem; font-size: .92rem; padding: .2rem .35rem; border-radius: .5rem; min-width: 0; }
.t-row .p-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-row .r-rank { width: 1.6rem; color: var(--text-leise); font-size: .85rem; }
.t-row .cnt { font-size: .8rem; color: var(--text-leise); }
.t-row.turn { background: var(--tint-blau); font-weight: 600; }
.t-row.me .p-name { font-weight: 700; }
.t-table .btn { justify-self: start; }
.t-podium .podium { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.place { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; border-radius: 1rem; background: var(--nebel); font-weight: 600; }
.place .place-n { font-size: 1.3rem; font-weight: 800; width: 2rem; }
.place.p1 { background: var(--tint-gelb); font-size: 1.15rem; box-shadow: 0 0 0 2px var(--gelb); }
.place.p2 { background: var(--tint-blau); }
.place.p3 { background: var(--tint-rot); }
.live-tournament { border-color: var(--gelb); box-shadow: 0 0 0 1px var(--gelb); }
@media (max-width: 760px) {
  .t-grid, .t-fields { grid-template-columns: minmax(0, 1fr); }
  .t-plan { grid-auto-columns: minmax(15rem, 85vw); }
}

/* ---------- Zeitleiste über dem Brett ---------- */
.turn-bar { position: absolute; left: 0; right: 0; top: 0; height: 6px; z-index: 7; background: color-mix(in srgb, var(--text) 8%, transparent); pointer-events: none; }
.turn-bar-fill { height: 100%; background: var(--seat, var(--blau)); transform-origin: left center; transition: transform .2s linear, background-color .3s; }
.turn-bar.mine { height: 12px; }
.turn-bar.warn .turn-bar-fill { background: var(--gelb); }
.turn-bar.alarm .turn-bar-fill { background: var(--rot); }
.turn-bar.mine.alarm { animation: pulse .8s infinite; }
.countdown {
  position: absolute; top: 22px; left: 50%; translate: -50% 0; z-index: 7; pointer-events: none;
  font: 800 clamp(3rem, 9vw, 5.5rem)/1 var(--font); color: var(--rot); text-shadow: 0 4px 18px rgba(0, 0, 0, .18);
  font-variant-numeric: tabular-nums;
}
.countdown.pulse { animation: count-pop .9s ease-out; }
@keyframes count-pop { 0% { scale: 1.35; opacity: 1; } 100% { scale: 1; opacity: .75; } }

/* ---------- Hilfe ---------- */
.help-dialog { width: min(40rem, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.help-tabs { padding: 0; }
.points-table, .keys-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.points-table th, .keys-table th { text-align: left; font-weight: 600; padding: .45rem .5rem .45rem 0; white-space: nowrap; vertical-align: top; }
.points-table td, .keys-table td { padding: .45rem .5rem; color: var(--text-leise); border-bottom: 1px solid var(--linie); }
.points-table th { border-bottom: 1px solid var(--linie); }
.keys-table th { border-bottom: 1px solid var(--linie); }
.pts-n { text-align: right; color: var(--text) !important; font-weight: 700; white-space: nowrap; }
kbd { font: 600 .82rem/1 var(--mono); background: var(--nebel); border: 1px solid var(--linie); border-bottom-width: 2px; border-radius: 6px; padding: .2rem .45rem; }
.link-btn { appearance: none; border: 0; background: none; padding: 0; color: var(--blau-text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; justify-self: start; }
.guest-name { max-width: 9rem; flex: none; }

/* Turnier: Reiter, Tabellen, Hervorhebungen */
.t-tabs { display: flex; gap: .3rem; flex-wrap: wrap; border-bottom: 1px solid var(--linie); }
.t-tabs button { appearance: none; border: 0; background: none; color: var(--text-leise); font: 600 1rem/1 var(--font); padding: .75rem 1rem; cursor: pointer; border-bottom: 3px solid transparent; }
.t-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--gelb); }
.t-view { display: grid; gap: 1.25rem; }
.t-table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: .9rem; }
.t-table-meta { display: inline-flex; align-items: center; gap: .5rem; color: var(--text-leise); }
.t-row { flex-wrap: wrap; }
.t-row .row-stats { font-size: .76rem; color: var(--text-leise); margin-left: auto; }
.t-row.winner { background: var(--tint-gelb); font-weight: 700; box-shadow: inset 3px 0 0 var(--gelb); }
.t-row.advanced { background: var(--tint-blau); box-shadow: inset 3px 0 0 var(--blau); }
.t-row.dq { opacity: .6; text-decoration: line-through; text-decoration-color: var(--rot); }
.t-row.dq .badge { text-decoration: none; }
.t-people-wrap { overflow-x: auto; }
.t-people { width: 100%; border-collapse: collapse; font-size: .92rem; }
.t-people th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-leise); padding: .5rem; border-bottom: 2px solid var(--linie); }
.t-people td { padding: .55rem .5rem; border-bottom: 1px solid var(--linie); white-space: nowrap; }
.t-people .name-cell { font-weight: 600; }
.t-people tr.champion td { background: var(--tint-gelb); font-weight: 700; }
.t-people tr.st-finalist td { background: color-mix(in srgb, var(--tint-gelb) 50%, transparent); }
.t-people tr.st-dq td { color: var(--text-leise); }
.t-people tr.me td:first-child { box-shadow: inset 3px 0 0 var(--blau); }
.t-kpis { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
.t-kpis .kpi-v { font-size: 1.15rem; }
.place .pts { margin-left: auto; font-size: .9rem; color: var(--text-leise); }
.place.p1 { background: linear-gradient(90deg, var(--tint-gelb), color-mix(in srgb, var(--gelb) 30%, var(--papier))); }

/* Einstellungen: Erklärtexte und Tooltips */
.setting { display: grid; gap: .3rem; align-content: start; }
.setting-help { font-size: .8rem; color: var(--text-leise); margin: 0; line-height: 1.4; }
.info {
  display: inline-grid; place-items: center; width: 1.05rem; height: 1.05rem; border-radius: 50%; flex: none;
  font: 700 .7rem/1 var(--font); font-style: italic; color: var(--blau-text); border: 1.5px solid currentColor;
  cursor: help; vertical-align: .1em; margin-left: .25rem;
}
.info:focus-visible { outline: 2px solid var(--blau-text); outline-offset: 2px; }
.toggle span { line-height: 1.35; }
h2 .info { font-size: .65rem; }

.tip-bubble { position: fixed; z-index: 400; background: var(--navy); color: #fff; font-size: .85rem; line-height: 1.45; padding: .65rem .8rem; border-radius: .75rem; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); }

#t-settings { grid-column: 1 / -1; }
@media (min-width: 1000px) { #t-settings .t-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); } #t-toggles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.past-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: var(--papier); border: 1px solid var(--linie); border-radius: 1rem; padding: .7rem .9rem; }
.past-item > div { display: grid; gap: .15rem; }

/* Spielziel */
.seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg-3 button { white-space: normal; line-height: 1.15; font-size: .86rem; }
.goal-extra { display: grid; gap: .3rem; }
#game-clock.low .stat-v { color: var(--rot-text); }

/* Rahmen in der Farbe der Person am Zug */
.board-area::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 6;
  box-shadow: inset 0 0 0 0 transparent; transition: box-shadow .3s;
}
.board-area.has-turn::after { box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--turn-color) 70%, transparent); }
.board-area.my-turn::after { box-shadow: inset 0 0 0 6px var(--turn-color), inset 0 0 40px color-mix(in srgb, var(--turn-color) 25%, transparent); }
/* Spielerwechsel: dezentes Aufleuchten des Rahmens (kein Blitz, keine Helligkeitssprünge) */
.board-area.turn-flash::after { animation: turn-flash 1.6s ease-out; }
@keyframes turn-flash {
  0% { box-shadow: inset 0 0 0 8px color-mix(in srgb, var(--turn-color) 45%, transparent); }
  100% { }
}
@media (prefers-reduced-motion: reduce) {
  .board-area.turn-flash::after { animation: none; }
}
.turn-bar { z-index: 8; }

/* ---------- Konten ---------- */
.account-btn { display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; color: var(--text); font-weight: 600; font-size: .9rem; padding: .3rem .75rem .3rem .35rem; border: 1px solid var(--linie); border-radius: 999px; background: var(--papier); }
.account-btn:not(.signed-in) { padding-left: .75rem; }
.account-btn:hover { background: var(--nebel); }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--tint-blau); color: var(--blau-text); font-weight: 800; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { width: 1.3rem; height: 1.3rem; font-size: .7rem; margin-right: .2rem; vertical-align: middle; }
.avatar-s { width: 1.8rem; height: 1.8rem; font-size: .85rem; }
.avatar-m { width: 2.6rem; height: 2.6rem; }
.avatar-l { width: 6rem; height: 6rem; font-size: 2.4rem; box-shadow: 0 0 0 4px var(--papier), 0 0 0 6px var(--linie); }
.account-wrap { max-width: 30rem; margin: 0 auto; padding: 2rem 16px 3rem; }
.account-card { gap: 1rem; }
.auth-form { display: grid; gap: .45rem; }
.auth-form .btn-big { margin-top: .5rem; }
.btn-passkey { border-color: var(--blau); }
.profile-wrap { max-width: 64rem; margin: 0 auto; padding: 1rem 16px 3rem; display: grid; gap: 1.25rem; }
.profile-head { display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.profile-id { display: flex; gap: 1.25rem; align-items: center; min-width: 0; }
.profile-names { display: grid; gap: .2rem; min-width: 0; }
.profile-names h1 { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; font-size: 1.8rem; }
.profile-bio { margin-top: .4rem; max-width: 38rem; white-space: pre-line; overflow-wrap: anywhere; }
.profile-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.25rem; align-items: start; }
.profile-col { display: grid; gap: 1.25rem; }
.profile-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.game-list, .friend-list, .passkey-list, .invite-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.game-item { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; gap: .6rem; align-items: center; background: var(--papier); border: 1px solid var(--linie); border-radius: .9rem; padding: .55rem .8rem; }
.game-item.won { background: var(--tint-gelb); border-color: transparent; }
.game-info { display: grid; min-width: 0; }
.game-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-rank { font-weight: 800; text-align: center; }
.friend { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.friend-link { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--text); font-weight: 600; min-width: 0; }
.online-dot { width: .55rem; height: .55rem; border-radius: 50%; background: #2e9e5b; flex: none; }
.ach { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); column-gap: .6rem; align-items: center; background: var(--papier); border: 1px solid var(--linie); border-radius: .9rem; padding: .5rem .75rem; }
.ach .ach-icon { grid-row: span 2; font-size: 1.5rem; text-align: center; }
.profile-edit { gap: .9rem; }
.profile-edit textarea { resize: vertical; font: inherit; }
.avatar-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.invite-item { display: flex; justify-content: space-between; align-items: center; gap: .75rem; background: var(--papier); border-radius: .9rem; padding: .5rem .75rem; }
.toast.actionable { pointer-events: auto; display: flex; align-items: center; gap: .6rem; }
.toast.actionable span { flex: 1; }
.toast.actionable .btn { background: #fff; color: #11222c; border-color: #fff; }
.toast-close { appearance: none; border: 0; background: none; color: #fff; font-size: 1.2rem; cursor: pointer; padding: 0 .2rem; }
.profile-link { color: inherit; text-decoration: underline; text-decoration-color: var(--linie); text-underline-offset: .2em; }
.friends-panel { grid-column: 1 / -1; }
@media (max-width: 760px) { .profile-grid { grid-template-columns: minmax(0, 1fr); } .profile-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.swatches { display: flex; gap: .5rem; flex-wrap: wrap; }
.swatch { appearance: none; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 3px solid var(--papier); background: var(--sw); box-shadow: 0 0 0 1px var(--linie); cursor: pointer; font: 700 .85rem/1 var(--font); color: var(--text-leise); }
.swatch-auto { background: repeating-conic-gradient(var(--blau) 0 25%, var(--rot) 0 50%, var(--gelb) 0 75%, var(--schwarz) 0); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 3px var(--text); }
.avatar-l { box-shadow: 0 0 0 4px var(--papier), 0 0 0 7px var(--ring, var(--linie)); }

/* Spielfeld mit der Maus verschieben */
#board-scroll.panning, #board-scroll.panning * { cursor: grabbing !important; user-select: none; }

/* Personensuche */
.profile .tut-top { gap: .6rem; }
.user-search { position: relative; flex: 1; max-width: 22rem; margin-left: auto; }
.user-search .input { width: 100%; }
.user-search-results { position: absolute; top: calc(100% + .3rem); left: 0; right: 0; z-index: 40; list-style: none; margin: 0; padding: .3rem; background: var(--papier); border: 1px solid var(--linie); border-radius: .9rem; box-shadow: 0 10px 30px rgba(0,0,0,.15); max-height: 60vh; overflow: auto; }
.user-hit { display: flex; align-items: center; gap: .6rem; padding: .45rem .55rem; border-radius: .6rem; cursor: pointer; }
.user-hit[data-username]:hover, .user-hit:focus { background: var(--nebel); outline: none; }
.user-hit:focus-visible { box-shadow: inset 0 0 0 2px var(--blau); }
.user-hit-names { display: grid; min-width: 0; flex: 1; }
.user-hit-names strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .profile .tut-top { flex-wrap: wrap; } .user-search { order: 5; flex-basis: 100%; max-width: none; } }


/* Bestenliste */
.board-filters { display: flex; flex-wrap: wrap; gap: .6rem; margin: .8rem 0 1rem; }
.board-filters .seg-4 { flex: 2 1 22rem; }
.board-filters .seg-2 { flex: 1 1 14rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.table-scroll { overflow-x: auto; }
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table caption { caption-side: bottom; text-align: left; padding-top: .6rem; }
.lb-table th, .lb-table td { padding: .55rem .6rem; border-bottom: 1px solid var(--linie); text-align: left; }
.lb-table th { font-size: .8rem; color: var(--text-leise); font-weight: 600; }
.lb-table .num { text-align: right; white-space: nowrap; }
.lb-table .strong { font-weight: 800; }
.lb-table tr.self td { background: var(--tint-blau); }
.lb-table tr.gap td { text-align: center; border: 0; }
.lb-rank { font-weight: 800; min-width: 2rem; }
.mini-board { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .35rem; }
.mini-board li { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; align-items: center; gap: .5rem; }
.mini-board li.self { font-weight: 700; }
.mini-board .pts { font-weight: 700; }
.mini-board .friend-link span:not(.avatar):not(.badge) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer { flex: 1; }
/* Achievements: noch offene gedimmt */
.ach-count { font-weight: 500; }

/* Tipp */
.btn-hint { border-color: var(--gelb); }
.tile .draft-mark { position: absolute; top: -.3em; left: -.3em; width: .62em; height: .62em; border-radius: 50%; background: var(--draft, var(--blau)); border: .1em solid #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .35); pointer-events: none; }
.tile .hint-mark { position: absolute; top: -.45em; right: -.35em; font-size: .7em; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); pointer-events: none; }

/* Achievements: kompakte Symbole im Profil */
.ach-badges { list-style: none; margin: 0 0 .6rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.ach-badge { appearance: none; width: 2.6rem; height: 2.6rem; border-radius: .8rem; border: 1px solid var(--linie); background: var(--papier); font-size: 1.35rem; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: transform .12s ease; }
.ach-badge:hover { transform: translateY(-2px); }
.ach-badge:focus-visible { outline: 3px solid var(--blau); outline-offset: 2px; }
.ach-badge.special { background: var(--tint-gelb); border-color: var(--gelb); }
@media (prefers-reduced-motion: reduce) { .ach-badge { transition: none; } .ach-badge:hover { transform: none; } }
.ach-dialog { border: 0; border-radius: 1.2rem; padding: 0; max-width: min(24rem, calc(100vw - 32px)); background: var(--papier); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.ach-dialog::backdrop { background: rgba(0,0,0,.35); }
.ach-dialog-body { padding: 1.5rem; display: grid; gap: .5rem; justify-items: center; text-align: center; }
.ach-big { font-size: 3.2rem; line-height: 1; }
.ach-dialog h2 { margin: 0; }
.ach-dialog-actions { display: flex; gap: .5rem; margin-top: .5rem; }
/* Übersichtsseite */
.ach-overview { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .5rem; }
.ach-row { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) minmax(7rem, 10rem); gap: .8rem; align-items: center; padding: .6rem .8rem; border: 1px solid var(--linie); border-radius: .9rem; background: var(--papier); }
.ach-row.got { border-color: var(--blau); }
.ach-row.grant { background: var(--tint-gelb); border-color: var(--gelb); }
.ach-row .ach-icon { font-size: 1.7rem; text-align: center; }
.ach-text { display: grid; gap: .1rem; min-width: 0; }
.ach-mine { color: var(--blau-text); font-weight: 600; }
.ach-side { display: grid; gap: .25rem; justify-items: end; text-align: right; }
.ach-bar { width: 100%; height: .35rem; border-radius: 999px; background: var(--nebel); overflow: hidden; position: relative; }
.ach-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--gelb); border-radius: inherit; }
.sugg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.sugg-list p { margin: .2rem 0 0; white-space: pre-line; }
#ach-suggest { max-width: 32rem; margin-bottom: 1rem; }
@media (max-width: 560px) { .ach-row { grid-template-columns: 2.2rem minmax(0, 1fr); } .ach-side { grid-column: 2; justify-items: start; text-align: left; } }

/* ---------- Heiliger nummix-Ort: Profil der Erfinderin ---------- */
.profile-inventor {
  position: relative; overflow: hidden; isolation: isolate; padding-top: 3.2rem; min-height: 15rem;
  background: radial-gradient(120% 140% at 15% 50%, color-mix(in srgb, var(--gelb) 30%, var(--papier)) 0%, var(--papier) 60%);
  border: 2px solid var(--gelb); box-shadow: 0 0 0 6px color-mix(in srgb, var(--gelb) 18%, transparent), 0 20px 50px color-mix(in srgb, var(--gelb) 25%, transparent);
}
.shrine-rays {
  position: absolute; z-index: -1; left: 4.5rem; top: 50%; width: 140%; aspect-ratio: 1; translate: -50% -50%;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--gelb) 22%, transparent) 0 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 0 25%, transparent 62%); mask: radial-gradient(circle, #000 0 25%, transparent 62%);
  animation: shrine-spin 90s linear infinite;
}
@keyframes shrine-spin { to { rotate: 360deg; } }
.shrine-banner {
  position: absolute; top: .8rem; left: 0; right: 0; margin: 0; text-align: center;
  font: 800 .85rem/1 var(--font); letter-spacing: .25em; text-transform: uppercase; color: var(--gelb-text, #a36800);
}
.inventor-title {
  display: inline-flex; align-items: center; gap: .35rem; width: fit-content; padding: .25rem .7rem; border-radius: 999px;
  background: linear-gradient(90deg, var(--blau), var(--rot), var(--gelb)); color: #fff; font-weight: 800; font-size: .85rem;
  text-shadow: 0 1px 2px rgba(0,0,0,.35); box-shadow: 0 4px 14px color-mix(in srgb, var(--rot) 30%, transparent);
}
.avatar.halo { box-shadow: 0 0 0 4px var(--papier), 0 0 0 8px var(--gelb), 0 0 30px 10px color-mix(in srgb, var(--gelb) 55%, transparent); animation: halo 4s ease-in-out infinite; }
@keyframes halo { 50% { box-shadow: 0 0 0 4px var(--papier), 0 0 0 8px var(--gelb), 0 0 46px 16px color-mix(in srgb, var(--gelb) 70%, transparent); } }
.shrine-tiles { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.shrine-tiles .tile { position: absolute; width: 2.6rem; height: 2.6rem; font-size: 1.05rem; opacity: .9; animation: float 8s ease-in-out infinite; }
.shrine-tiles .st0 { right: 4%; top: 18%; rotate: 10deg; }
.shrine-tiles .st1 { right: 16%; bottom: 10%; rotate: -8deg; animation-delay: -2s; }
.shrine-tiles .st2 { right: 30%; top: 12%; rotate: 6deg; animation-delay: -4s; width: 2.2rem; height: 2.2rem; }
.shrine-tiles .st3 { left: 46%; bottom: 8%; rotate: -12deg; animation-delay: -1s; width: 2.2rem; height: 2.2rem; }
.shrine-tiles .st4 { right: 8%; bottom: 42%; rotate: -4deg; animation-delay: -5s; width: 2rem; height: 2rem; font-size: .9rem; }
.shrine-tiles .st5 { left: 40%; top: 58%; rotate: 14deg; animation-delay: -3s; width: 2rem; height: 2rem; font-size: .9rem; }
.profile-inventor .profile-actions { position: relative; }
.shrine-quote {
  margin: 0; text-align: center; font-size: 1.05rem; font-style: italic; line-height: 1.6;
  border: 1px solid color-mix(in srgb, var(--gelb) 60%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--gelb) 12%, var(--papier)), var(--papier));
}
.shrine-quote p { margin: 0 auto; max-width: 40rem; }
.shrine-quote::before { content: "✦ ✦ ✦"; display: block; color: var(--gelb); letter-spacing: .5em; margin-bottom: .5rem; font-style: normal; }
.profile-wrap.shrine .panel:not(.profile-inventor) { border-color: color-mix(in srgb, var(--gelb) 35%, var(--linie)); }
.inventor-star { color: var(--gelb); font-weight: 800; margin-left: .15rem; }
@media (max-width: 640px) {
  .profile-inventor { padding-top: 2.8rem; }
  .shrine-rays { left: 50%; top: 35%; width: 180%; }
  .shrine-tiles .st2, .shrine-tiles .st3, .shrine-tiles .st5 { display: none; }
  .profile-inventor .profile-id { flex-direction: column; text-align: center; }
  .profile-inventor .profile-names { justify-items: center; }
  .profile-inventor .inventor-title { margin-inline: auto; }
  .profile-inventor .profile-names h1 { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .shrine-rays, .avatar.halo, .shrine-tiles .tile { animation: none; }
}

/* ================= Mobil-Überarbeitung ================= */
/* Brett: Ein-Finger-Scrollen bleibt nativ, Zwei-Finger-Zoom übernimmt das Spiel (nicht die ganze Seite) */
.board-scroll { touch-action: pan-x pan-y; }
/* Halten auf freier Fläche (Rahmen mit Touch, #314, #315): im Spielbereich keine Textauswahl und keine Lupe, außer in Eingabefeldern */
#game { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#game input, #game textarea { -webkit-user-select: text; user-select: text; }

/* Handy hochkant: Mitspielende in eigener, scrollbarer Zeile; Bank größer; Knöpfe kompakt */
@media (max-width: 640px) {
  :root { --rtile: 38px; }
  .g-top { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "brand stats" "chips chips"; row-gap: .35rem; padding-block: .35rem; }
  .g-top .game-brand { grid-area: brand; }
  .g-top .g-stats { grid-area: stats; justify-self: end; gap: .35rem; }
  .g-top .chips {
    grid-area: chips; justify-content: flex-start; max-width: none; padding: 0 2px 2px;
    scroll-snap-type: x proximity; -webkit-mask: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
  }
  .g-top .chip { scroll-snap-align: start; flex: none; }
  .g-top .chip .p-name { max-width: 7rem; }
  .g-top .icon-btn { width: 2.25rem; height: 2.25rem; }
  .g-top #btn-theme { display: none; } /* steckt auch in den Einstellungen */
  /* Knöpfe: Zurücksetzen | Tipp | Zug beenden in einer Reihe, Sortieren klein darunter */
  /* Zurücksetzen und Tipp als Symbolknöpfe (Text bleibt für Screenreader), daneben breit „Zug beenden“ */
  .g-right { grid-template-columns: 48px 48px minmax(0, 1fr); gap: .35rem; }
  .g-right #btn-reset { grid-column: 1; order: -2; }
  .g-right #btn-hint { grid-column: 2; order: -1; }
  .g-right #btn-end { grid-column: 3; order: 0; }
  .g-right:not(.has-hint) #btn-end { grid-column: 2 / -1; }
  .g-right #btn-reset, .g-right #btn-hint { font-size: 0; padding: 0; }
  .g-right #btn-reset::before { content: "↺"; font-size: 1.45rem; line-height: 1; }
  .g-right #btn-hint::before { content: "💡"; font-size: 1.2rem; line-height: 1; }
  .g-right #btn-finish, .g-right #btn-restart { grid-column: span 3; }
  .g-right.has-finish #btn-reset { grid-column: 1 / -1; font-size: .92rem; }
  .g-right.has-finish #btn-reset::before { content: none; }
  .g-right .btn { padding: .55rem .4rem; font-size: .92rem; min-height: 44px; }
  .g-right .sort { grid-column: 1 / -1; gap: .35rem; }
  .g-right .sort .btn { min-height: 34px; padding: .3rem .7rem; font-size: .85rem; flex: 1; }
}
@media (max-width: 380px) { :root { --rtile: 34px; } }

/* Handy quer: Brett links in voller Höhe, Bank und Knöpfe rechts */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --rtile: 30px; }
  .game { grid-template-columns: minmax(0, 1fr) min(46vw, 25rem); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "top top" "main side"; }
  .game > .g-top { grid-area: top; }
  .game > .g-main { grid-area: main; }
  .game > .g-bottom {
    grid-area: side; border-top: 0; border-left: 1px solid var(--linie); overflow-y: auto; align-content: start;
    grid-template-columns: minmax(0, 1fr); grid-template-areas: none; padding: .4rem 10px calc(.4rem + env(safe-area-inset-bottom)) 10px;
  }
  .game > .g-bottom > * { grid-area: auto; }
  .g-left { grid-auto-flow: row; justify-items: start; }
  .g-left .turn-msg { white-space: normal; }
  .bank-group { width: 100%; justify-self: stretch; }
  .g-right { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: .3rem; }
  .g-right #btn-end { grid-column: 1 / -1; order: -3; }
  .g-right .sort { grid-column: 1 / -1; display: flex; gap: .3rem; }
  .g-right .sort .btn { flex: 1; }
  .g-right .sort .prep-toggle { grid-column: auto; }
  .board-status { max-width: calc(100% - 24px); }
}
@media (max-width: 640px) {
  .g-right { margin-top: .35rem; }
  /* Regelhinweis oben und klein, damit er gerade gelegte Steine nicht verdeckt */
  .board-status { top: 8px; bottom: auto; left: 8px; max-width: calc(100% - 16px); font-size: .82rem; padding: .35rem .7rem; }
}
/* Kopfzeile von Lobby/Turnier auf schmalen Handys: kompakt, nichts ragt über den Rand */
@media (max-width: 640px) {
  .topbar { gap: .5rem; padding-inline: 12px; }
  .topbar-right { gap: .4rem; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
  .topbar-right .account-btn [data-account-name] { max-width: 6.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-right .account-btn.signed-in [data-account-name] { display: none; }
  .topbar-right .account-btn.signed-in { padding: .2rem; }
  .topbar-right .conn { font-size: 0; gap: 0; }
  .topbar-right .icon-btn { width: 2.2rem; height: 2.2rem; }
}

/* Einladungen und eigene Partien auf der Startseite */
.invite-item, .mygame { align-items: center; }
.invite-text { display: grid; gap: .1rem; min-width: 0; flex: 1; }
.invite-text strong, .invite-text span { overflow: hidden; text-overflow: ellipsis; }
.invite-btns { display: flex; gap: .35rem; flex: none; }
.mygame { display: flex; gap: .75rem; background: var(--papier); border-radius: .9rem; padding: .5rem .75rem; }
.mygame.my-turn { box-shadow: inset 4px 0 0 var(--blau); }
.my-turn-text { color: var(--blau-text); font-weight: 700; }
.inv-state { color: var(--text-leise); font-weight: 500; }
.inv-state.accepted { color: var(--blau-text); font-weight: 700; }

.leave-dialog .ach-dialog-body { justify-items: stretch; text-align: left; }
.leave-actions { display: grid; gap: .5rem; margin-top: .5rem; }

/* Lokale Partie (im Browser): Einladen, Turnier, Sichtbarkeit und Chat ergeben keinen Sinn */
.local-note { display: none; margin: 0 0 .6rem; padding: .5rem .75rem; border-radius: .8rem; background: var(--tint-blau); color: var(--blau-text); }
body.local-game .local-note { display: block; }
body.local-game .lobby .panel.invite, body.local-game #lobby-friends, body.local-game #opt-toggles,
body.local-game .lobby .options > h2:first-child, body.local-game #mode-switch, body.local-game .lobby .chat-panel { display: none !important; }
/* Angemeldet auf dem Handy: Konto-Knopf nur als Avatar, Kopfzeilen ohne Umbruch und Überlappung */
@media (max-width: 640px) {
  .account-btn.signed-in [data-account-name] { display: none; }
  .account-btn.signed-in { padding: .2rem; gap: 0; }
  .account-btn:not(.signed-in) { padding: .3rem .7rem; font-size: .85rem; }
  
  .tut-top { flex-wrap: wrap; gap: .5rem; padding: .6rem 12px; }
  .tut-top .brand .logo { height: 24px; }
  .tut-top .spacer { display: none; }
  .tut-top .brand { margin-right: auto; }
  .tut-top .lang-switch { order: 0; }
  .tut-top .theme-btn { width: 2.1rem; height: 2.1rem; }
}

/* Level und nummix-Score */
.level-box { display: grid; gap: .35rem; margin-bottom: 1rem; }
.level-head { display: flex; align-items: center; gap: .6rem; }
.level-badge { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: .7rem; font: 800 1.05rem/1 var(--mono);
  background: linear-gradient(135deg, var(--blau), var(--gelb)); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.level-bar { height: .55rem; border-radius: 999px; background: var(--nebel); overflow: hidden; position: relative; }
.level-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); border-radius: inherit; background: linear-gradient(90deg, var(--blau), var(--gelb)); }
.kpi-sub { display: block; }
.game-right { display: grid; justify-items: end; gap: .1rem; }
.rating-delta.up { color: #2e9e5b; font-weight: 700; }
.rating-delta.down { color: var(--rot-text); font-weight: 700; }
.lb-level { font: 700 .72rem/1 var(--mono); padding: .15rem .35rem; border-radius: .4rem; background: var(--nebel); color: var(--text-leise); }
#lb-metric { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Replay */
.replay-dialog { width: min(980px, calc(100vw - 24px)); max-height: calc(var(--app-h, 100dvh) - 24px); border: 0; border-radius: 1.2rem; padding: 0; background: var(--papier); color: var(--text); box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.replay-dialog::backdrop { background: rgba(0,0,0,.45); }
.replay-head { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem .4rem; }
.replay-head h2 { margin: 0; font-size: 1.15rem; }
.replay-players { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem; }
.rp-player { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .7rem .3rem .45rem; border-radius: 999px; background: var(--nebel); font-size: .9rem; }
.rp-player.active { box-shadow: inset 0 0 0 2px var(--seat); background: var(--papier); }
.rp-seat { width: .7rem; height: .7rem; border-radius: 50%; background: var(--seat); }
.replay-board-wrap { margin: .7rem 1rem 0; padding: 8px; border-radius: .9rem; background: var(--tisch, var(--nebel)); overflow: auto; display: grid; place-items: center; min-height: 12rem; }
.replay-board { position: relative; }
.replay-board .tile { position: absolute; width: calc(var(--rc) - 3px); height: calc(var(--rc) - 3px); font-size: calc(var(--rc) * .42); border-radius: 16%; }
.replay-board .tile.fresh { box-shadow: 0 0 0 3px var(--gelb), 0 4px 10px rgba(0,0,0,.2); }
.replay-chat { margin: .6rem 1rem 0; }
.replay-chat summary { cursor: pointer; font-weight: 600; }
.replay-chat ol { list-style: none; margin: .4rem 0 0; padding: 0; max-height: 9rem; overflow: auto; font-size: .9rem; }
.replay-chat li { padding: .15rem 0; overflow-wrap: anywhere; }
.replay-caption { margin: .6rem 1rem 0; font-weight: 600; min-height: 1.4em; }
.replay-controls { display: flex; align-items: center; gap: .35rem; padding: .6rem 1rem 1rem; flex-wrap: wrap; }
.replay-controls input[type="range"] { flex: 1; min-width: 8rem; accent-color: var(--blau); }
.replay-btn { margin-top: .15rem; }

.push-setting { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.push-setting .setting-help { flex-basis: 100%; }
.push-hint { margin-top: .6rem; }

/* Letzter Zug: gelegte Steine mit Ring, umgebaute gestrichelt – bis die Person am Zug anfängt */
.board .tile.last-placed { box-shadow: 0 0 0 3px var(--last, var(--blau)), 0 0 14px 2px color-mix(in srgb, var(--last, var(--blau)) 45%, transparent), 0 2px 1px rgba(0,0,0,.18); }
/* Ungültig (#385): gestrichelter Rahmen, der sich auch von einer roten Spielerfarbe der „zuletzt gelegt“-Markierung unterscheidet (und ohne Farbe erkennbar bleibt) */
.board .tile.bad, .board .tile.bad.last-placed { outline: 3px dashed var(--rot); outline-offset: 3px; }
.board .tile.last-moved { outline: 3px dashed var(--last, var(--blau)); outline-offset: 1px; }
.last-move { margin: .1rem 0 0; font-size: .85rem; color: var(--text-leise); display: flex; align-items: center; gap: .4rem; justify-content: inherit; }
.last-dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--last); flex: none; }
@media (max-width: 640px) { .last-move { font-size: .8rem; justify-content: center; } }

/* ===== Hochformat auf Handy und Tablet (z. B. iPad mini): Wichtiges sichtbar, sonst Platz sparen ===== */
@media (max-width: 640px), (max-width: 1024px) and (orientation: portrait) {
  /* Kopfzeile: Logo + Werte oben, darunter alle Mitspielenden – umbrechend statt seitlich zu scrollen */
  .g-top { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "brand stats" "chips chips"; row-gap: .35rem; padding: .35rem 12px; }
  .g-top .game-brand { grid-area: brand; }
  .g-top .g-stats { grid-area: stats; justify-self: end; gap: .4rem; }
  .g-top .chips {
    grid-area: chips; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(10.5rem, 100%), 1fr)); gap: .3rem;
    overflow: visible; max-width: none; -webkit-mask: none; mask: none; padding: 0;
  }
  .g-top .chip { min-width: 0; padding: .2rem .5rem .2rem .4rem; gap: .35rem; font-size: .82rem; }
  .g-top .chip .p-name { flex: 1; min-width: 0; max-width: none; }
  .g-top .chip .flag, .g-top .chip .avatar { display: none; }
  .g-top .chip .badge.bot { font-size: .62rem; padding: .05rem .3rem; }
  .g-top .chip .cnt { font-size: .78rem; padding: 0 .35rem; }
  .g-top .chip .pts { font-size: .72rem; }
  .stat-k, .stat-spec { display: none; }
  .g-top #btn-theme { display: none; }
  .g-top .icon-btn { width: 2.2rem; height: 2.2rem; }
  /* Bank über die volle Breite, Vorbereitungsfeld nur auf Knopfdruck */
  .bank-group { width: 100%; justify-self: stretch; }
  .bank-board { flex: 1; }
  .prep-tray { display: none; }
  body.prep-open .prep-tray { display: grid; }
  .prep-toggle { display: inline-flex; }
  .bank-logo { display: none; }
}
/* Tablet hochkant: Steine passend zur Breite, damit die Bank ohne Scrollen auskommt */
@media (min-width: 641px) and (max-width: 1024px) and (orientation: portrait) {
  :root { --rtile: clamp(34px, calc((100vw - 120px) / 12), 48px); }
}
@media (min-width: 641px) and (max-width: 1024px) and (orientation: portrait) {
  .g-right { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
  .g-right #btn-end { order: -3; min-width: 14rem; }
  .g-right .sort-k { display: none; }
}

/* Feedback */
.fb-card { margin: .4rem 0 .2rem; padding: .7rem .9rem; border-radius: .9rem; background: var(--nebel); text-align: center; display: grid; gap: .3rem; justify-items: center; }
.fb-q { margin: 0; font-weight: 600; }
.fb-stars { display: flex; gap: .15rem; }
.fb-star { appearance: none; border: 0; background: none; font-size: 1.9rem; line-height: 1; padding: .1rem .15rem; cursor: pointer; color: var(--linie); transition: transform .1s; }
.fb-star.lit, .fb-star:focus-visible { color: var(--gelb); }
.fb-star:focus-visible { outline: 2px solid var(--blau); border-radius: .3rem; }
.fb-star:hover { transform: scale(1.12); }
@media (prefers-reduced-motion: reduce) { .fb-star { transition: none; } .fb-star:hover { transform: none; } }
.fb-problem { width: 100%; margin-top: .3rem; padding-top: .5rem; border-top: 1px solid var(--linie); }
.fb-problem-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .3rem .6rem; }
.fb-problem-btn { font-size: .85rem; padding: .25rem .7rem; }
.fb-problem-form { display: grid; gap: .4rem; width: 100%; }
.fb-problem-form textarea, .fb-form textarea { resize: vertical; font: inherit; }
.fb-dialog .ach-dialog-body { justify-items: stretch; text-align: left; }
.fb-dialog { max-width: min(30rem, calc(100vw - 32px)); }

/* Gäste: Punkte mit Konto behalten */
.keep-card { margin: .5rem 0 .2rem; padding: .8rem 1rem; border-radius: .9rem; background: var(--tint-gelb); border: 1px solid color-mix(in srgb, var(--gelb) 60%, transparent); display: grid; gap: .35rem; text-align: left; }
.keep-card p { margin: 0; }
.keep-title { font-weight: 800; }
.keep-actions { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; margin-top: .2rem; }
.keep-actions .btn { text-decoration: none; }

/* E-Mail bestätigen */
.verify-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .8rem; padding: .7rem .9rem; border-radius: .9rem; background: var(--tint-blau); color: var(--text); border: 1px solid color-mix(in srgb, var(--blau) 45%, transparent); font-size: .92rem; }
.verify-banner span { flex: 1 1 16rem; }


/* Chat: Senden als Symbol */
.send-btn { display: inline-grid; place-items: center; padding: .5rem .7rem; flex: none; }
/* iOS-App auf dem Home-Bildschirm: Kopfzeilen nicht unter die Statusleiste */
.g-top, .tut-top, .topbar { padding-top: max(.5rem, env(safe-area-inset-top)); }


.g-side.open { padding-top: env(safe-area-inset-top); }

/* Profil: eigenes Feedback mit Antworten */
.my-fb { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.my-fb-item { background: var(--papier); border: 1px solid var(--linie); border-radius: .9rem; padding: .6rem .8rem; display: grid; gap: .3rem; }
.my-fb-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.my-fb-reply { border-left: 3px solid var(--blau); background: var(--tint-blau); border-radius: .5rem; padding: .4rem .6rem; }
.my-fb-reply p { margin: .15rem 0 0; white-space: pre-line; }

/* Nummix Score nach der Partie */
.score-change { margin: 4px 0 0; }
.score-change strong { font-size: 1.1em; }

@media (max-width: 600px) {
  
  
  
  
  
  
  .logo-big { width: min(170px, 48vw); }
  
  
  /* „Gerade auf nummix“: nur die drei Live-Werte */
  
}

/* Reaktionen: Leiste (Zuschauende links, Spielende über den Zoom-Knöpfen) und Animation über dem Brett */
.cheer-bar {
  position: absolute; left: 12px; bottom: 60px; z-index: 8; display: flex; gap: .15rem; padding: .25rem;
  background: var(--papier); border: 1px solid var(--linie); border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.12); overflow: hidden;
}
.cheer-bar.for-player { left: auto; right: 12px; bottom: 58px; }
.cheer-bar button { font-size: 1.4rem; line-height: 1; width: 2.4rem; height: 2.4rem; border: 0; border-radius: 50%; background: transparent; cursor: pointer; transition: transform .12s; }
.cheer-bar button:hover:not(:disabled) { background: var(--nebel); transform: scale(1.18); }
.cheer-bar button:active:not(:disabled) { transform: scale(.9); }
.cheer-bar button:disabled { opacity: .35; cursor: default; }
.cheer-bar.cooling::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; background: var(--blau); width: 100%;
  animation: cheer-cool var(--cool, 8s) linear forwards;
}
@keyframes cheer-cool { from { width: 100%; } to { width: 0; } }
.cheer-toggle.on { background: var(--tint-gelb); border-color: var(--gelb); }
.cheer-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 7; }
.cheer-hero {
  position: absolute; left: var(--x); bottom: 70px; display: grid; justify-items: center; transform: translateX(-50%);
  animation: cheer-hero 2.8s cubic-bezier(.2, .8, .3, 1) forwards;
}
.cheer-emoji { font-size: var(--size, 3.2rem); line-height: 1; filter: drop-shadow(0 6px 10px rgba(0,0,0,.25)); }
.cheer-name {
  margin-top: .2rem; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700;
  background: var(--schwarz); color: #fff; white-space: nowrap; max-width: 10rem; overflow: hidden; text-overflow: ellipsis;
}
.cheer-combo {
  position: absolute; top: -.4rem; right: -1.4rem; font: 800 1.1rem/1 var(--font-mono, monospace); color: var(--rot-text);
  background: var(--papier); border: 2px solid var(--rot); border-radius: 999px; padding: .15rem .4rem; animation: cheer-pop .35s ease-out;
}
@keyframes cheer-hero {
  0% { transform: translate(-50%, 30px) scale(.2) rotate(-15deg); opacity: 0; }
  10% { transform: translate(-50%, -10px) scale(1.35) rotate(8deg); opacity: 1; }
  18% { transform: translate(-50%, -24px) scale(.95) rotate(-4deg); }
  26% { transform: translate(-50%, -34px) scale(1.08) rotate(0); }
  70% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--drift)), -48vh) scale(1); opacity: 0; }
}
@keyframes cheer-pop { 0% { transform: scale(0); } 70% { transform: scale(1.4); } 100% { transform: scale(1); } }
.cheer-spark {
  position: absolute; left: var(--x); bottom: 110px; font-size: 1.3rem; opacity: 0;
  animation: cheer-spark 1.3s cubic-bezier(.15, .7, .35, 1) forwards;
}
@keyframes cheer-spark {
  0% { transform: translate(-50%, 0) scale(.2) rotate(0); opacity: 0; }
  15% { opacity: 1; }
  70% { opacity: .9; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(var(--dy) + 60px)) scale(var(--s)) rotate(var(--rot)); opacity: 0; }
}
.board-area.cheer-glow::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 6; border-radius: inherit;
  box-shadow: inset 0 0 0 3px var(--glow), inset 0 0 60px color-mix(in srgb, var(--glow) 45%, transparent);
  animation: cheer-glow .9s ease-out forwards;
}
@keyframes cheer-glow { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .cheer-hero { animation: cheer-fade 2.2s ease-out forwards; bottom: 45%; }
  @keyframes cheer-fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
}
@media (max-width: 600px) {
  .cheer-bar { bottom: 56px; } .cheer-bar.for-player { bottom: 52px; }
  .cheer-bar button { width: 2.15rem; height: 2.15rem; font-size: 1.2rem; }
}

/* Startseite: Spielen oben, „Neu bei nummix?“ (Anleitung, Quiz, Regeln) als eigener Abschnitt */
.play-row { grid-template-columns: 1fr; }
.learn-box {
  display: grid; gap: .6rem; padding: .9rem 1rem 1rem; margin-top: .25rem;
  border: 1px dashed var(--linie); border-radius: calc(var(--radius) * .8); background: var(--papier);
}
.learn-box p { margin: 0; }
.learn-h { font-weight: 700; font-size: .95rem; color: var(--text-leise); }
.learn-row { grid-template-columns: 1fr 1fr; }
.learn-row .btn { min-height: 2.75rem; }

/* Feedback gut sichtbar: Knopf oben rechts und im Seitenbereich */
.fb-top {
  display: inline-flex; align-items: center; gap: .35rem; height: 2.4rem; padding: 0 .85rem; border-radius: 999px;
  border: 1.5px solid var(--gelb); background: var(--tint-gelb); color: var(--text); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer;
}
.fb-top:hover { filter: brightness(.97); }
@media (max-width: 340px) { .fb-top { padding: 0 .65rem; } .fb-top-label { display: none; } }

/* Profil: „Dein Feedback“ einklappbar */
.my-fb-details > summary { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; cursor: pointer; list-style: none; }
.my-fb-details > summary::-webkit-details-marker { display: none; }
.my-fb-details > summary h2 { margin: 0; }
.my-fb-details > summary::after { content: "▸"; margin-left: auto; color: var(--text-leise); transition: transform .15s; }
.my-fb-details[open] > summary::after { transform: rotate(90deg); }
.my-fb-details[open] > summary { margin-bottom: .75rem; }

/* Konto-Knopf: Avatar-Hülle ohne Zeilenhöhe, damit der Knopf mit Bild kreisrund bleibt (sonst oval auf dem Handy) */
.account-avatar { display: inline-flex; line-height: 0; }
.account-avatar:empty { display: none; }
@media (max-width: 640px) {
  .account-btn.signed-in { aspect-ratio: 1; justify-content: center; border-radius: 50%; line-height: 0; }
}

/* Moderation: Melden-Knopf, Melde-Dialog, Hinweis des Auto-Moderators */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.report-btn {
  border: 0; background: transparent; color: var(--text-leise); cursor: pointer; font-size: .85rem; line-height: 1;
  padding: .15rem .3rem; margin-left: .35rem; border-radius: .4rem; opacity: 0; transition: opacity .12s;
}
li:hover > .report-btn, li:focus-within > .report-btn, .p-meta .report-btn, .report-btn:focus-visible { opacity: .7; }
.report-btn:hover { opacity: 1; color: var(--rot-text); background: var(--nebel); }
@media (hover: none) { .report-btn { opacity: .55; } }
.report-reasons { display: grid; gap: .35rem; border: 0; padding: 0; margin: .25rem 0 .5rem; }
.report-reason { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border: 1px solid var(--linie); border-radius: .6rem; cursor: pointer; }
.report-reason:has(input:checked) { border-color: var(--blau); background: var(--tint-blau); }
.btn-report { color: var(--text-leise); }
.mod-dialog h2 { color: var(--rot-text); }
.mod-count { font-weight: 700; margin: 0 0 .35rem; }
.mod-progress { height: 8px; border-radius: 4px; background: var(--nebel); overflow: hidden; margin-bottom: .75rem; }
.mod-progress::before { content: ""; display: block; height: 100%; width: var(--p); background: linear-gradient(90deg, var(--gelb), var(--rot)); }

/* Handy: geöffneter Chat gewinnt immer – „Seitenleiste zu“ gilt nur für breite Bildschirme (Fehler: Chat ging mobil nicht auf) */
@media (max-width: 900px) { .g-main.side-closed .g-side.open { display: flex; } }
/* Handy: Feedback steht schon als Knopf über der Fußzeile */
@media (max-width: 600px) { .home-foot .foot-fb { display: none; } }

/* Profil: Übungsspiele (gegen den Computer) eingeklappt unter den gewerteten Partien */
.practice-games { margin-top: 1rem; border-top: 1px solid var(--linie); padding-top: .75rem; }
.practice-games > summary { display: flex; align-items: baseline; gap: .6rem; cursor: pointer; list-style: none; }
.practice-games > summary::-webkit-details-marker { display: none; }
.practice-games > summary h3 { margin: 0; font-size: 1rem; }
.practice-games > summary::after { content: "▸"; margin-left: auto; color: var(--text-leise); transition: transform .15s; }
.practice-games[open] > summary::after { transform: rotate(90deg); }
.practice-games .game-list { opacity: .85; }

/* Öffentliche Partien (Matchmaking) */
.open-list { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .5rem; }
.open-list:empty::before { content: attr(data-empty); color: var(--text-leise); font-size: .9rem; }
.open-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who btn" "meta btn"; gap: .1rem .75rem; align-items: center;
  padding: .55rem .7rem; border: 1px solid var(--linie); border-radius: .8rem; background: var(--papier); }
.open-who { grid-area: who; display: flex; flex-wrap: wrap; align-items: center; gap: .15rem; font-weight: 600; min-width: 0; }
.open-item > .small { grid-area: meta; }
.open-item > .btn { grid-area: btn; }
.open-free { display: inline-block; width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 1.5px dashed var(--linie); margin-left: .15rem; }
.open-start { display: grid; gap: .4rem; }
.open-start .segmented button { font-weight: 700; }
#home-open > p { margin: 0 0 .6rem; }
/* feste Einstellungen in öffentlichen Partien */
.mm-lobby #ready-hint { color: var(--text); font-weight: 600; background: var(--tint-blau); border-radius: .6rem; padding: .5rem .7rem; }

/* Stand einer Rückmeldung (Profil, Achievement-Vorschläge): eine farbige Plakette */
.fb-state { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 700; border: 1px solid transparent; }
.fb-state.new { color: var(--text-leise); border-color: var(--linie); }
.fb-state.seen { color: var(--blau-text); background: var(--tint-blau); }
.fb-state.building { color: #9a5200; background: color-mix(in srgb, #f39200 18%, transparent); }
.fb-state.later { color: var(--text-leise); background: var(--nebel); }
.fb-state.done { color: #1f7a45; background: color-mix(in srgb, #2e9e5b 16%, transparent); }
.fb-state.declined { color: var(--rot-text); background: color-mix(in srgb, var(--rot) 14%, transparent); }
:root[data-theme="dark"] .fb-state.building { color: #ffb45c; }
:root[data-theme="dark"] .fb-state.done { color: #6fd39a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fb-state.building { color: #ffb45c; } :root:not([data-theme="light"]) .fb-state.done { color: #6fd39a; } }

/* Wander-Erfolge: eigener Rahmen, damit sie als „vergänglich“ erkennbar sind */
.ach-badge.wander { box-shadow: 0 0 0 2px var(--rot), 0 0 12px color-mix(in srgb, var(--rot) 40%, transparent); }
/* Wander-Erfolge (#175): kein Rahmen ums Symbol – Kachel wie alle anderen, Hervorhebung nur mit Rekordhalter */

/* Mitspielende und Teams */
.team-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 999px; background: var(--tint-blau); color: var(--blau-text); font-weight: 700; font-size: .9rem; text-decoration: none; }
.team-badge:hover { filter: brightness(.96); }
.profile-names .team-badge { margin-top: .35rem; }
.players-list .friend, .team-members .friend { display: flex; align-items: center; gap: .5rem; }
.players-list .friend-link, .team-members .friend-link { flex: 1; min-width: 0; }
.players-meta { white-space: nowrap; }
.team-list { list-style: none; margin: .4rem 0; padding: 0; display: grid; gap: .4rem; }
.team-list li { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.team-list li .btn { margin-left: auto; }
.team-create summary { cursor: pointer; color: var(--blau-text); font-weight: 600; margin-top: .4rem; }
.team-form { display: grid; gap: .45rem; margin-top: .5rem; }
@media (max-width: 420px) { .players-meta { display: none; } }

/* Konto löschen */
.danger-zone details > summary { cursor: pointer; font-weight: 700; color: var(--rot-text); }
.danger-zone details[open] { display: grid; gap: .5rem; }
.btn-danger { background: var(--rot); border-color: var(--rot); color: #fff; }
.delete-banner { border-color: var(--rot); background: color-mix(in srgb, var(--rot) 10%, var(--papier)); }

/* Teams: Farbe, Symbol, Erfolge, Einstellungen */
.team-badge { background: color-mix(in srgb, var(--team, var(--blau)) 16%, var(--papier)); color: var(--text); border: 1.5px solid var(--team, var(--tint-blau)); }
.team-head { border-top: 6px solid var(--team, transparent); }
.team-ach { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.team-ach li { display: flex; gap: .7rem; align-items: center; opacity: .55; }
.team-ach li.got { opacity: 1; }
.team-ach .ach-icon { font-size: 1.5rem; width: 2.2rem; text-align: center; }
.team-ach .ach-text { display: grid; }
.team-settings summary { cursor: pointer; font-weight: 700; }
.team-settings[open] { display: grid; gap: .5rem; }
.team-icons { display: flex; flex-wrap: wrap; gap: .3rem; }
.team-sym img { width: 1.25em; height: 1.25em; border-radius: 22%; object-fit: cover; vertical-align: -.25em; }
.team-hero-icon.team-sym img, .team-box-icon.team-sym img { width: 100%; height: 100%; border-radius: inherit; }
.team-icon-free { display: flex; gap: .4rem; align-items: center; max-width: 14rem; margin-top: .3rem; }
.team-icon-free .input { width: 5rem; text-align: center; font-size: 1.2rem; }
.team-icon { font-size: 1.3rem; width: 2.4rem; height: 2.4rem; border-radius: .6rem; border: 1.5px solid var(--linie); background: var(--papier); cursor: pointer; }
.team-icon[aria-checked="true"] { border-color: var(--blau); background: var(--tint-blau); }
.t-teams { margin-bottom: 1rem; }
.forgot-link { justify-self: end; margin-top: -.4rem; }

/* Tablet hochkant (z. B. iPad mini): breitere Chips → zwei je Reihe, volle Namen statt „HAL …“ (eine Zeile mehr) */
@media (min-width: 641px) and (max-width: 1024px) and (orientation: portrait) {
  .g-top .chips { grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr)); }
  .g-top .chip { font-size: .9rem; }
  .g-top .chip .flag, .g-top .chip .avatar { display: inline-flex; }
}

/* Hilfe: Schließen-X oben rechts, bleibt beim Scrollen sichtbar (vor allem auf dem Handy) */
.dialog-x { position: sticky; top: 0; float: right; z-index: 2; margin: -.4rem -.4rem 0 .5rem; background: var(--papier); }




/* Neue Steine auf der eigenen Bank pulsieren (#79) und behalten den gelben Rand, bis man die Bank anfasst (#413) */
#rack .tile.fresh, #prep .tile.fresh { animation: tile-fresh .85s ease-in-out 3; box-shadow: 0 0 0 3px var(--gelb); position: relative; z-index: 1; }
@keyframes tile-fresh {
  0%, 100% { transform: scale(1); box-shadow: 0 2px 0 rgba(0,0,0,.15); }
  50% { transform: scale(1.14); box-shadow: 0 0 0 3px var(--gelb), 0 0 16px 4px color-mix(in srgb, var(--gelb) 60%, transparent); }
}
@media (prefers-reduced-motion: reduce) { #rack .tile.fresh, #prep .tile.fresh { animation: none; box-shadow: 0 0 0 3px var(--gelb); } }

/* Chat: Zuschauende klar abgesetzt, neue Nachrichten bei geschlossenem Chat am Brett (#80) */
.chat li.guest { background: color-mix(in srgb, var(--violett, #8e5bd6) 9%, transparent); border-radius: .5rem; padding: .15rem .4rem; font-style: italic; }
.spec-tag { display: inline-block; margin: 0 .35rem 0 .15rem; padding: 0 .4rem; border-radius: 999px; font-size: .72rem; font-style: normal; font-weight: 700; color: #6b3fb0; background: color-mix(in srgb, #8e5bd6 16%, var(--papier)); vertical-align: 1px; }
:root[data-theme="dark"] .spec-tag { color: #c9a8f5; }
.chat-pop { position: absolute; right: 12px; top: 12px; z-index: 8; display: grid; gap: .35rem; justify-items: end; max-width: min(22rem, calc(100% - 24px)); pointer-events: none; }
.chat-pop-item {
  pointer-events: auto; text-align: left; font: inherit; font-size: .88rem; line-height: 1.35; cursor: pointer;
  background: var(--papier); color: var(--text); border: 1px solid var(--linie); border-left: 4px solid var(--seat-text, var(--blau));
  border-radius: .8rem; padding: .45rem .7rem; box-shadow: 0 6px 18px rgba(0,0,0,.14); animation: pop-in .25s ease-out; transition: opacity .5s, transform .5s;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.chat-pop-item strong { color: var(--seat-text, var(--text)); }
.chat-pop-item.guest { border-left-color: #8e5bd6; font-style: italic; }
.chat-pop-item.guest strong { color: #6b3fb0; }
.chat-pop-item.out { opacity: 0; transform: translateY(-6px); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
@media (max-width: 640px) { .chat-pop { top: 8px; right: 8px; } .chat-pop-item { font-size: .82rem; } }

/* iOS-App auf dem Home-Bildschirm (#88): deckende Leiste hinter der Statusleiste. Seit iOS 26 legt das System eine
   Unschärfe („scroll edge effect“) über den oberen Rand, außer WebKit findet dort ein echtes Element (kein
   Pseudo-Element) mit position: fixed, ≥ 90 % Breite, > 10 px Höhe und deckender background-color – getestet wird
   ein Punkt 8 px unter der Oberkante (LocalFrameView::fixedContainerEdges). Dann nimmt iOS diese Farbe statt der
   Unschärfe. Weiße Statusschrift (black-translucent) auf Navy. */
.ios-statusbar { display: none; }
@media (display-mode: standalone) {
  .ios-statusbar {
    display: block; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); z-index: 2147483647;
    background-color: #11222c;
  }
}
html.ios-standalone .ios-statusbar {
  display: block; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); z-index: 2147483647;
  background-color: #11222c;
}








.games-panel .open-list { margin: 0; }
.games-panel .open-list:empty, .games-panel .live-list:empty { display: none; }
.games-empty { margin: 0; }


.mini-board li.muted { display: block; }
@media (min-width: 601px) {
  .home { align-content: start; padding-top: max(16px, env(safe-area-inset-top)); }
  
  
  
}
@media (min-width: 1100px) {
  
  
  
  .games-panel { grid-row: span 3; }
}







@media (min-width: 961px) {
  
  
  .games-panel { grid-row: auto; }
}
/* Statistik reduziert: nur die drei Live-Werte */
#st-total { display: none; }

/* Meine Partien im Kasten „Partien“ */




/* kompakte Live-Einträge */
.live-item.compact { padding: .55rem .75rem; gap: .35rem; }
.live-item.compact .live-head { align-items: center; }
.live-item.compact .live-players { flex: 1; min-width: 0; }
.live-item.compact .live-tags:empty { display: none; }
/* freie Plätze bei öffentlichen Partien */
.open-freecount { color: var(--rot-text); }
/* Gerade online */
.online-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.online-user { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .6rem .25rem .25rem; border-radius: 999px; background: var(--papier); border: 1px solid var(--linie); color: var(--text); text-decoration: none; font-size: .88rem; max-width: 14rem; }
.online-user > span:not(.avatar) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-user:hover { border-color: var(--blau); }
.online-friend { color: var(--gelb-text, #b7791f); flex: none; }
.online-playing { flex: none; font-size: .8rem; }
/* Lobby: Wer kann beitreten? */
.mm-switch { display: grid; gap: .45rem; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--linie); }
.mm-switch .segmented { grid-template-columns: 1.5fr 1.3fr 1fr 1fr; }
.mm-switch .segmented button { font-size: .85rem; padding-inline: .3rem; }
#mm-help { margin: 0; }
/* Handy: „Meine Partien“ steht im Kasten „Partien“ unter der Überschrift (nicht mehr ganz oben) */


/* Bank sortieren: automatisch nach Farbe oder selbst (#96) */
.sort .btn[aria-pressed="true"]:not(.prep-toggle) { background: var(--schwarz); border-color: var(--schwarz); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sort .btn[aria-pressed="true"]:not(.prep-toggle) { background: var(--text); border-color: var(--text); color: var(--papier); } }
:root[data-theme="dark"] .sort .btn[aria-pressed="true"]:not(.prep-toggle) { background: var(--text); border-color: var(--text); color: var(--papier); }

/* Mitspielende im Profil: lange Namen kürzen statt den Kasten zu sprengen (#92) */
.players-list .friend { min-width: 0; }
.players-list .friend-link span:not(.avatar):not(.online-dot) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.players-list .friend > .btn { flex: none; }

/* Dauer der Partie (#94): auf sehr schmalen Handys ausblenden, dort ist die Kopfzeile voll */
@media (max-width: 400px) { #played { display: none; } }

/* Partie: zu anderen eigenen Partien wechseln (#95) */
.games-switch { position: relative; }
#btn-games { position: relative; }
.games-badge { position: absolute; top: -4px; right: -4px; min-width: 1.1rem; height: 1.1rem; padding: 0 .25rem; border-radius: 999px; background: var(--rot); color: #fff; font: 700 .68rem/1.1rem var(--mono); text-align: center; }
.games-pop { position: absolute; top: calc(100% + .4rem); right: 0; z-index: 30; width: min(20rem, 85vw); background: var(--papier); border: 1px solid var(--linie); border-radius: 1rem; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); padding: .6rem; }
.games-pop-h { margin: .1rem .3rem .5rem; font-size: .78rem; font-weight: 700; color: var(--text-leise); text-transform: uppercase; letter-spacing: .05em; }
.games-pop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; max-height: 60vh; overflow: auto; }
.games-pop-item { display: grid; gap: .1rem; width: 100%; text-align: left; padding: .5rem .65rem; border-radius: .7rem; border: 1px solid var(--linie); background: var(--nebel); color: var(--text); font: inherit; cursor: pointer; }
.games-pop-item:hover { border-color: var(--blau); }
.games-pop-item.my-turn { border-left: 3px solid var(--blau); }
.games-pop-item.my-turn .small { color: var(--blau-text); font-weight: 700; }
.g-right .sort .btn { min-width: 0; padding-inline: .5rem; }

/* Jokerwert (#98, #102, #108): mittig auf dem Joker als kleiner weißer Stein mit farbigem Rand – das Symbol bleibt
   in voller Größe, die Jokerfarben außen herum sichtbar; Zahl in der Steinfarbe, auch im dunklen Design lesbar */
.tile .jv {
  right: auto; bottom: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1;
  min-width: 1.5em; height: 1.5em; padding: 0 .15em; box-sizing: border-box;
  border-radius: 999px; background: #fff; border: 2px solid var(--jc, #292929); color: var(--jc, #292929);
  font: 800 .64em/1 var(--font); font-variant-numeric: tabular-nums; box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

/* Vorbereitungsfeld auf allen Größen per Knopf ein-/ausblendbar (#100) */
.prep-toggle { display: inline-flex; }
.prep-toggle[aria-pressed="true"] { background: var(--gelb); border-color: var(--gelb); color: #292929; }
body.prep-hidden .prep-tray { display: none !important; }

.g-right .sort .prep-toggle { grid-column: 1 / -1; justify-content: center; }

/* Profil: „Feedback geben“ in der Rubrik (#104) */
.my-fb-give { margin-left: auto; }
.my-fb-details > summary { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .8rem; }
.my-fb-details > summary::after { margin-left: 0; }

/* Name mit Konto fest (#105) */
.name-locked input[readonly] { background: var(--nebel); color: var(--text-leise); cursor: default; }
.name-hint { margin: .3rem 0 0; }

/* Gerade online schlanker (#106) */
.online-panel { padding-block: 1rem; gap: .6rem; }
.online-panel h2 { font-size: 1.05rem; margin: 0; }
.online-list { gap: .3rem; }
.online-user { padding: .15rem .5rem .15rem .15rem; font-size: .82rem; }
/* Jokerwert ausgeblendet (#107): Symbol wieder in voller Größe */
body.no-jv .tile .jv { display: none; }
body.no-jv .tile.joker.has-jv::before { inset: 6%; }

/* iOS-App (#88): Die Unschärfe von iOS 26+ reicht rund 38–40 pt unter die Statusleiste und lässt sich nicht
   abschalten. In der installierten App beginnen Kopfzeilen und Inhalte deshalb erst darunter (Statusleiste + 2,5 rem).
   Nur iOS/iPadOS (-webkit-touch-callout), nicht auf Handys quer (dort blendet iOS die Statusleiste aus). */
:root { --ios-top: 0px; }
@supports (-webkit-touch-callout: none) {
  @media (display-mode: standalone) { :root { --ios-top: 2.5rem; } }
  html.ios-standalone { --ios-top: 2.5rem; }
}
@media (orientation: landscape) and (max-height: 520px) { :root, html.ios-standalone { --ios-top: 0px !important; } }
.g-top, .tut-top, .topbar { padding-top: max(.5rem, calc(env(safe-area-inset-top) + var(--ios-top))); }
.g-side.open { padding-top: calc(env(safe-area-inset-top) + var(--ios-top)); }

@media (min-width: 601px) { .home { padding-top: max(16px, calc(env(safe-area-inset-top) + var(--ios-top))); } }

/* Hilfe: Herzform als Raster (#109) */
.heart-shape { display: grid; grid-template-columns: repeat(7, 1.35rem); gap: 2px; margin-top: .45rem; }
.heart-shape span { width: 1.35rem; height: 1.35rem; }
/* Beispiel-Steine (#214): weiß mit farbiger Zahl wie auf dem Tisch */
.heart-shape span.on { display: grid; place-items: center; border-radius: .25rem; background: #fff; border: 1px solid var(--linie); font: 800 .7rem/1 var(--mono); color: var(--c, var(--text)); }
.heart-shape span.c-r { --c: var(--rot); } .heart-shape span.c-b { --c: var(--blau-text, var(--blau)); } .heart-shape span.c-g { --c: #a36800; } .heart-shape span.c-s { --c: #292929; }
.heart-note { margin: .35rem 0 0; }

/* Startseite: schlanke Statistik-Box (#111) */
.stats-mini { gap: .6rem; }
.stats-mini h2 { font-size: 1.05rem; margin: 0; }
.stats-line { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .9rem; color: var(--text-leise); }
.stats-line b { color: var(--text); font-size: 1.05rem; margin-right: .15rem; }
.stats-line span:first-child b { color: var(--blau-text); }
/* Statistik-Seite (#111) */
.stats-wrap { max-width: 64rem; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(26rem, 100%), 1fr)); gap: 1.25rem; align-items: start; }
.st-head { margin-bottom: 1.25rem; }
.st-head p { margin: 0; }
.st-split { display: grid; grid-template-columns: 1fr; gap: .9rem; }
.st-h3 { margin: 0 0 .4rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-leise); }
.st-cols { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; height: 9rem; align-items: end; padding-bottom: 1.2rem; position: relative; border-bottom: 1px solid var(--linie); }
.st-col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; }
.st-bar { display: block; width: 100%; max-width: 1.6rem; min-height: 2px; background: var(--blau); border-radius: 4px 4px 0 0; }
.st-bar.zero { background: var(--linie); }
.st-col:hover .st-bar { filter: brightness(1.12); }
.st-axis { position: absolute; bottom: -1.2rem; font-size: .68rem; color: var(--text-leise); font-family: var(--mono); }
.st-hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.st-hbars li { display: grid; grid-template-columns: minmax(6rem, 9rem) minmax(0, 1fr) auto; align-items: center; gap: .6rem; font-size: .88rem; }
.st-track { height: .7rem; background: color-mix(in srgb, var(--linie) 50%, transparent); border-radius: 999px; overflow: hidden; }
.st-fill { display: block; height: 100%; background: var(--blau); border-radius: 999px; }
.st-hval { font-size: .8rem; color: var(--text-leise); white-space: nowrap; }
.st-records { display: grid; grid-template-columns: 1fr; gap: .15rem; margin: 0; }
.st-records dt { font-size: .8rem; color: var(--text-leise); margin-top: .5rem; }
.st-records dd { margin: 0; }

/* Jokerwert-Darstellung (#112): zweistellig kompakter; „unter dem Symbol“: Symbol klein oben, Zahl frei darunter */
.tile .jv.two { font-size: .52em; letter-spacing: -.04em; min-width: 1.75em; }
body.jv-below .tile.joker.has-jv::before { inset: 6% 21% 38% 21%; }
body.jv-below .tile .jv {
  top: auto; bottom: 7%; transform: translateX(-50%); min-width: 0; height: auto; padding: 0;
  border: 0; border-radius: 0; background: none; box-shadow: none; font-size: .7em; letter-spacing: 0;
}
.settings-lang select { width: auto; padding: .35rem .6rem; }

/* Partie hochkant (#113): Mitspielende stehen in eigener Zeile – oben ist Platz für das Logo mit Schriftzug */
@media (max-width: 640px), (max-width: 1024px) and (orientation: portrait) {
  .g-top .game-brand .brand-word { display: block; height: 24px; }
  .g-top .game-brand .brand-icon { display: none; }
}
/* sehr schmale Handys: Schriftzug, Knöpfe und Abstände etwas kleiner, damit alles in eine Zeile passt */
@media (max-width: 420px) {
  .g-top .game-brand .brand-word { height: 19px; }
  .g-top .g-stats { gap: .2rem; }
  .g-top .icon-btn { width: 2rem; height: 2rem; }
  .g-top .icon-btn svg { width: 16px; height: 16px; }
}
@media (max-width: 340px) {
  .g-top .game-brand .brand-word { display: none; }
  .g-top .game-brand .brand-icon { display: block; }
}

/* Startseite: Statistik als kleiner Knopf (#114) */
.stats-btn { text-decoration: none; display: flex; align-items: center; justify-content: flex-start; gap: .45rem; flex-wrap: wrap; width: 100%; box-sizing: border-box; }
.stats-btn-live { margin-left: auto; color: var(--text-leise); font-weight: 400; }
.stats-btn-live b { color: var(--text); }
/* Statistik-Seite: Kurioses über die volle Breite */
.st-wide { grid-column: 1 / -1; }
.st-fun { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); gap: .5rem 1.25rem; }
.st-fun li { display: flex; gap: .55rem; align-items: baseline; font-size: .92rem; }
.st-fun-i { flex: none; width: 1.4rem; text-align: center; }

/* Startseite: Statistik als kompakter Kasten im Stil der anderen (#116) */
.stats-link { display: flex; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; padding: 1rem clamp(1.25rem, 3vw, 1.75rem);
  text-decoration: none; color: var(--text); transition: box-shadow .15s, transform .15s; }
.stats-link:hover, .stats-link:focus-visible { box-shadow: 0 6px 18px rgba(0, 0, 0, .08); transform: translateY(-1px); }
.stats-link-h { margin: 0; font-size: 1.05rem; font-weight: 700; }
.stats-link-live { color: var(--text-leise); }
.stats-link-live b { color: var(--text); }
.stats-link-go { margin-left: auto; color: var(--blau-text); font-weight: 700; font-size: 1.15rem; }
/* Statistik-Seite: Boxen einer Reihe gleich hoch (#115); Feedback im Kopf */
.st-grid { align-items: stretch; }
.st-grid > .panel { height: 100%; box-sizing: border-box; }
.tut-top .fb-top { flex: none; }
@media (max-width: 640px) { .tut-top .fb-top { padding: 0 .65rem; } .tut-top .fb-top-label { display: none; } }

/* Bestenliste (#117): Wertung hat drei Knöpfe – Spalten nach Inhalt, „Kreativpunkte“ passt in seinen Knopf */
.board-filters #lb-metric { flex: 1 1 20rem; grid-template-columns: auto auto auto; }
.board-filters #lb-metric button { padding-inline: .75rem; white-space: nowrap; }

/* Achievements: Fortschritt (#119) */
.ach-progress { height: .45rem; border-radius: 999px; background: color-mix(in srgb, var(--linie) 60%, transparent); overflow: hidden; margin-top: .35rem; max-width: 16rem; }
.ach-progress span { display: block; height: 100%; background: var(--blau); border-radius: 999px; }

/* Achievements mit Stufen (#124) */
.ach-level { margin-left: .35rem; font-size: .7rem; vertical-align: middle; }
.ach-row.maxed .ach-level { background: var(--tint-gelb); color: var(--gelb-text); }
.ach-pips { display: flex; gap: .25rem; margin: .25rem 0 .1rem; font-size: .95rem; }
.ach-pips span { filter: grayscale(1); opacity: .35; }
.ach-pips span.on { filter: none; opacity: 1; }
.ach-badge { position: relative; }
.ach-lv { position: absolute; right: -2px; bottom: -2px; min-width: 1rem; height: 1rem; padding: 0 .2rem; box-sizing: border-box; border-radius: 999px;
  background: var(--navy); color: #fff; font: 700 .62rem/1rem var(--mono); text-align: center; }

/* Streak (#125) */
.streak-chip { margin-left: auto; padding: .2rem .6rem; border-radius: 999px; background: var(--tint-gelb); color: var(--gelb-text); font-weight: 700; font-size: .85rem; white-space: nowrap; }
.streak-chip.at-risk { background: var(--nebel); color: var(--text-leise); }
.streak-hint { color: var(--gelb-text); font-weight: 600; }
.level-head { flex-wrap: wrap; }

/* Reaktionen (#128): weitere Emojis hinter „…“, Feuerwerk bei Serien */
.cheer-more-btn { font-weight: 800; color: var(--text-leise); }
.cheer-more {
  position: absolute; left: 12px; bottom: 112px; z-index: 8; display: flex; flex-wrap: wrap; gap: .15rem; padding: .3rem;
  max-width: min(19rem, calc(100% - 24px)); background: var(--papier); border: 1px solid var(--linie); border-radius: 1.1rem; box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.cheer-bar.for-player ~ .cheer-more { left: auto; right: 12px; bottom: 110px; }
.cheer-more[hidden] { display: none; }
.cheer-more button { font-size: 1.3rem; line-height: 1; width: 2.3rem; height: 2.3rem; border: 0; border-radius: 50%; background: transparent; cursor: pointer; transition: transform .12s; }
.cheer-more button:hover { background: var(--nebel); transform: scale(1.18); }
.cheer-firework {
  position: absolute; left: var(--x); top: var(--y); font-size: calc(1.6rem * var(--s, 1)); line-height: 1;
  animation: cheer-firework 1.6s cubic-bezier(.15, .7, .3, 1) forwards; will-change: transform, opacity;
}
@keyframes cheer-firework {
  0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; }
  12% { opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 30px)) scale(1); opacity: 0; }
}
.settings-toggles { display: flex; gap: .9rem; flex-wrap: wrap; justify-content: flex-end; }

/* Chat: Emoji-Knopf und Auswahl (#129) */
.chat-form { position: relative; }
.chat-emoji-btn { flex: none; padding: .45rem .55rem; font-size: 1.05rem; line-height: 1; }
.emoji-pop {
  position: absolute; right: 0; bottom: calc(100% + .4rem); z-index: 20; display: grid; grid-template-columns: repeat(6, 2.2rem); gap: .15rem;
  padding: .4rem; background: var(--papier); border: 1px solid var(--linie); border-radius: 1rem; box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
}
.emoji-pop button { width: 2.2rem; height: 2.2rem; border: 0; border-radius: .6rem; background: transparent; font-size: 1.25rem; cursor: pointer; }
.emoji-pop button:hover { background: var(--nebel); }

/* Gerade online schlank wie der Statistik-Kasten (#127): eine Zeile, überlappende Profilbilder */
.online-panel { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; padding: 1rem clamp(1.25rem, 3vw, 1.75rem); }
.online-panel .online-h { margin: 0; font-size: 1.05rem; }
.online-panel .online-list { flex-wrap: nowrap; gap: 0; margin-left: auto; }
.online-panel .online-list li + li { margin-left: -.45rem; }
.online-panel .online-user { padding: 0; border: 2px solid var(--nebel); border-radius: 50%; background: var(--papier); position: relative; max-width: none; }
.online-panel .online-user > span:not(.avatar):not(.online-playing):not(.online-friend) { display: none; }
.online-panel .online-user .avatar { width: 1.9rem; height: 1.9rem; font-size: .8rem; }
.online-panel .online-friend { display: none; }
.online-panel .online-playing { position: absolute; right: -.35rem; bottom: -.3rem; font-size: .7rem; }
.online-panel .online-user:hover { z-index: 1; transform: translateY(-2px); border-color: var(--blau); }
.online-panel .online-more { margin-left: .35rem; font: 700 .8rem/1 var(--mono); color: var(--text-leise); align-self: center; }
.online-panel.empty .online-list { margin-left: 0; }
/* „Vorbereitung“ nie schmaler als sein Text */
.g-right .sort .prep-toggle { flex: 0 0 auto; min-width: max-content; padding-inline: .7rem; white-space: nowrap; }
.g-right .sort .btn { flex: 0 0 auto; min-width: max-content; white-space: nowrap; }
.g-right .sort { min-width: max-content; }
/* Breite Bildschirme (#307): Knopfspalte behält ihre volle Breite (die Hinweise links geben nach),
   Sortieren und Vorbereitung untereinander, nicht breiter als die Knöpfe darüber */
@media (min-width: 1361px) {
  .g-bottom { grid-template-columns: minmax(0, 1fr) auto minmax(max-content, 1fr); }
  .g-right .sort { grid-template-columns: minmax(0, 1fr); min-width: 0; }
}

/* Mitgliederliste (#134) */
.mem-wrap { max-width: 64rem; }
.mem-search { width: 100%; margin: .6rem 0 .5rem; box-sizing: border-box; }
.mem-filters { display: flex; flex-wrap: wrap; gap: .35rem; }
.mem-filters .btn.on { background: var(--schwarz); border-color: var(--schwarz); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mem-filters .btn.on { background: var(--text); border-color: var(--text); color: var(--papier); } }
:root[data-theme="dark"] .mem-filters .btn.on { background: var(--text); border-color: var(--text); color: var(--papier); }
.mem-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); gap: .6rem; }
.mem-card { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .6rem .75rem; border-radius: 1rem; background: var(--papier); border: 1px solid var(--linie); min-width: 0; }
.mem-card.self { border-color: var(--blau); }
.mem-card.featured { flex-direction: column; align-items: stretch; background: linear-gradient(135deg, var(--papier), var(--tint-gelb)); }
.mem-link { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; color: var(--text); text-decoration: none; }
.mem-link:hover strong { text-decoration: underline; }
.mem-av { position: relative; flex: none; }
.mem-dot { position: absolute; right: -1px; bottom: -1px; width: .7rem; height: .7rem; border-radius: 50%; background: #2e9e5b; border: 2px solid var(--papier); }
.mem-dot.playing { background: var(--blau); }
.mem-text { display: grid; min-width: 0; }
.mem-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem-team { color: var(--blau-text); }
.mem-reasons { display: flex; flex-wrap: wrap; gap: .3rem; }
.mem-reason { font-size: .78rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px; background: var(--nebel); }
.mem-reason.gold { background: var(--tint-gelb); color: var(--gelb-text); }
#mem-more { margin-top: .8rem; }
/* Startseite: „Gerade online“ führt zur Mitgliederliste */
.online-link { color: inherit; text-decoration: none; }
.online-link:hover { text-decoration: underline; }
.online-go { color: var(--blau-text); font-size: .95em; }
.mem-login { display: grid; gap: .6rem; justify-items: start; }
.mem-login p { margin: 0; }

/* Lobby: offene Einladungen (#138) */
#player-list li.invited { opacity: .85; border-style: dashed; }
#player-list li.invited .seat { background: var(--linie); }

/* Zwei-Faktor-Anmeldung (#140) */
.mfa-code { font-size: 1.4rem; letter-spacing: .25em; text-align: center; max-width: 14rem; }
.mfa-dialog { max-width: min(28rem, calc(100vw - 32px)); }
.mfa-dialog .ach-dialog-body { position: relative; justify-items: stretch; text-align: left; }
.mfa-dialog #mfa-body { display: grid; gap: .7rem; justify-items: start; }
.mfa-dialog #mfa-x { position: absolute; top: .6rem; right: .6rem; }
.mfa-dialog h2 { padding-right: 2.5rem; }
.mfa-qr { width: 200px; height: 200px; background: #fff; border-radius: .6rem; padding: 6px; }
.mfa-qr svg { width: 100%; height: 100%; }
.mfa-key { word-break: break-all; }
.mfa-codes { columns: 2; padding-left: 1.4rem; margin: 0; font-size: 1rem; }
.btn-row-inline { display: flex; flex-wrap: wrap; gap: .5rem; }

/* „vs“ in der Partienübersicht: dünn und gedämpft (#133) */
.mygame-title .vs { font-weight: 400; font-size: .8em; color: var(--text-leise); letter-spacing: .02em; }

/* Partien im Profil: schlanke Zeilen statt Karten (#132, #142) */
.game-list:has(> .game-item) { gap: 0; border-top: 1px solid var(--linie); }
.game-item { grid-template-columns: 1.8rem minmax(0, 1fr) auto; gap: .55rem; background: transparent; border: 0; border-bottom: 1px solid var(--linie); border-radius: 0; padding: .45rem .3rem; }
.game-item.won { background: var(--tint-gelb); border-color: var(--linie); }
.game-info { line-height: 1.3; }
.game-info .small { font-size: .78rem; }
.game-rank { font-size: .9rem; }
.game-right { display: flex; align-items: center; gap: .55rem; justify-items: initial; }
.game-points { font-size: .9rem; }
.game-right .replay-btn { margin: 0; width: 1.9rem; height: 1.9rem; font-size: .75rem; }
.all-games-link { display: inline-block; margin-top: .6rem; }
.all-games-tabs { display: flex; gap: .4rem; margin: .3rem 0 .7rem; }
.all-games-tabs .btn.on { background: var(--schwarz); border-color: var(--schwarz); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .all-games-tabs .btn.on { background: var(--text); border-color: var(--text); color: var(--papier); } }
:root[data-theme="dark"] .all-games-tabs .btn.on { background: var(--text); border-color: var(--text); color: var(--papier); }
.all-games > .btn { margin-top: .8rem; }

/* Teams (#143, #131): Erklärung, Vorstellungstext, Team-Box im Profil im Team-Stil */
.team-what { margin-top: .6rem; }
.team-what summary { cursor: pointer; font-weight: 600; color: var(--blau-text); }
.team-why { margin: .3rem 0; padding-left: 1.2rem; display: grid; gap: .25rem; }
.team-intro { white-space: pre-line; }
.team-intro-input { resize: vertical; font: inherit; width: 100%; }
.team-intro-row { align-items: center; }
.team-styled { border: 2px solid var(--team, var(--linie)); background: var(--nebel); }
.team-styled h2 { margin-bottom: .5rem; }
.team-box-top { display: flex; align-items: center; gap: .7rem; }
.team-box-icon { font-size: 2.2rem; line-height: 1; width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: .8rem; background: var(--papier); border: 2px solid var(--team, var(--linie)); flex: none; }
.team-box-text { display: grid; gap: .2rem; justify-items: start; min-width: 0; }
.team-box-intro { margin: .6rem 0 .3rem; }
.team-box-name { font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.team-box-name:hover { text-decoration: underline; }
.team-box-actions { display: flex; justify-content: flex-start; margin-top: .5rem; }
.team-box-go { text-decoration: none; }

/* Neuigkeiten (#144) */
.news-wrap { max-width: 46rem; }
.news-list { display: grid; gap: 1rem; }
.news-entry { display: grid; gap: .5rem; }
.news-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; }
.news-h { margin: 0; font-size: 1.25rem; }
.news-fb { color: var(--text-leise); }
.news-badge { background: var(--gelb); color: #292929; font-weight: 800; text-transform: uppercase; font-size: .68rem; letter-spacing: .05em; }
.news-items { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.news-items li { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: .5rem; align-items: start; line-height: 1.45; }
.news-icon { font-size: 1.3rem; line-height: 1.2; text-align: center; }
#news-more { justify-self: start; margin-top: .5rem; }

/* Partienlisten: Computer-Symbol in Avatargröße (#148) */
.who-bot { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; font-size: .95rem; line-height: 1; vertical-align: middle; }

/* Neuigkeiten als Glocke oben auf der Startseite (#150) */
.news-bell { position: relative; text-decoration: none; }
.news-dot { position: absolute; top: .35rem; right: .35rem; width: .6rem; height: .6rem; border-radius: 50%; background: var(--rot); box-shadow: 0 0 0 2px var(--papier); }

/* Hinweis Cookies/Speicher (#151): klein, unten, blockiert nichts; in Partie, Lobby, Turnier, Anleitung ausgeblendet */
.privacy-note { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom));
  width: max-content; max-width: calc(100vw - 32px); box-sizing: border-box; display: flex; align-items: center; gap: .4rem .8rem;
  padding: .35rem .4rem .35rem .8rem; border-radius: 999px; font-size: .8rem; background: var(--papier); color: var(--text-leise); border: 1px solid var(--linie);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12); line-height: 1.4; }
.privacy-note span { flex: 1 1 auto; }
.privacy-note .btn { flex: none; margin-left: auto; min-height: 0; padding: .2rem .8rem; font-size: .8rem; }
body:has(#game:not([hidden]), #lobby:not([hidden]), #tournament:not([hidden]), #tutorial:not([hidden]), #quiz:not([hidden])) .privacy-note { display: none; }

/* Team-Seite (#149): farbiger Kopf, Mitglieder als Karten, Erfolge als Kacheln */
.team-hero { position: relative; overflow: hidden; display: grid; gap: .9rem; padding-top: 1.6rem;
  background: var(--nebel); }
.team-hero { border-top: 5px solid var(--team, var(--blau)); } /* folgt der Rundung (#170) */
/* Teamseite (#176): Kopf wieder mit zartem Pastell-Verlauf in der Teamfarbe; Leitung/Mitglieder; Suche */
#profile .team-hero { background: linear-gradient(160deg, color-mix(in srgb, var(--team, var(--blau)) 16%, var(--nebel)) 0%, var(--nebel) 65%); }
.team-what-h { font-size: 1.05rem; margin: 0 0 .3rem; display: flex; align-items: center; gap: .4rem; }
.team-sub { margin: .4rem 0 .1rem; text-transform: uppercase; letter-spacing: .04em; font-size: .75rem; }
.team-search { width: 100%; }
.team-hero-top { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.team-hero-icon { font-size: 2.8rem; line-height: 1; width: 4.4rem; height: 4.4rem; display: grid; place-items: center; flex: none;
  border-radius: 1.1rem; background: var(--papier); border: 3px solid var(--team, var(--linie)); box-shadow: 0 6px 18px rgba(0, 0, 0, .08); }
.team-hero-names { flex: 1 1 14rem; min-width: 0; }
.team-hero-names .team-title { margin: 0 0 .2rem; font-size: clamp(1.5rem, 4vw, 2.1rem); }
.team-hero-names p { margin: 0; }
.team-hero-actions { margin-left: auto; }
.team-hero-intro { margin: 0; font-size: 1.02rem; line-height: 1.5; max-width: 60ch; }
.team-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: .6rem; }
.team-stat { display: grid; gap: .1rem; padding: .6rem .8rem; border-radius: .9rem; background: var(--papier); border: 1px solid var(--linie); }
.team-stat strong { font-size: 1.35rem; }
.team-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.team-card { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .6rem .7rem; border-radius: .9rem; background: var(--papier); border: 1px solid var(--linie); }
.team-card.lead { border-color: var(--team, var(--gelb)); }
.team-card-link { display: flex; align-items: center; gap: .7rem; flex: 1 1 14rem; min-width: 0; text-decoration: none; color: var(--text); }
.team-card-av { position: relative; flex: none; }
.team-card-av .online-dot { position: absolute; right: -2px; bottom: -2px; }
.team-card-text { display: grid; gap: .15rem; min-width: 0; flex: 1; justify-items: start; }
.team-role { font-size: .7rem; }
.team-card-tools { display: flex; align-items: center; gap: .3rem; margin-left: auto; }
.team-bar { display: block; width: 100%; height: 5px; border-radius: 99px; background: var(--linie); overflow: hidden; }
.team-bar > span { display: block; height: 100%; background: var(--team, var(--blau)); border-radius: 99px; }
.team-ach-grid { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .55rem; }
.team-ach-tile { display: grid; gap: .25rem; align-content: start; padding: .7rem; border-radius: .9rem; background: var(--papier); border: 1px solid var(--linie); }
.team-ach-tile:not(.got) { opacity: .72; }
.team-ach-tile:not(.got) .team-ach-icon { filter: grayscale(1); }
.team-ach-tile.got { border-color: var(--gelb); background: var(--tint-gelb); }
.team-ach-icon { font-size: 1.7rem; line-height: 1; }
.team-ach-tile .small { line-height: 1.35; }
.team-ach-tile strong { overflow-wrap: anywhere; hyphens: auto; }
.team-grid + .panel { margin-top: 1rem; }

/* Team-Bestenliste (#152) */
#lb-metric [hidden], #lb-scope[hidden] { display: none !important; }
.lb-team-icon { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: .55rem; background: var(--papier); border: 2px solid var(--team, var(--linie)); font-size: 1.05rem; flex: none; }
.lb-team .badge { font-size: .7rem; white-space: nowrap; }

/* Profil: Feedback-Statistik (#154) */
.my-fb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); gap: .45rem; margin: .4rem 0 .7rem; }
.my-fb-stat { display: grid; gap: .05rem; padding: .45rem .6rem; border-radius: .8rem; background: var(--papier); border: 1px solid var(--linie); }
.my-fb-stat strong { font-size: 1.2rem; }
.my-fb-stat.done strong { color: #2e9e5b; }
.my-fb-stat.building strong { color: var(--blau-text); }
.my-fb-closed { margin-top: .6rem; }
.my-fb-closed summary { cursor: pointer; color: var(--blau-text); }

/* ---------- Gemeinsame Kopf- und Fußzeile (#156) ---------- */
.site-head { gap: .4rem 1rem; flex-wrap: nowrap; }
.site-head[hidden], .site-foot[hidden] { display: none !important; }
.site-head .brand { flex: none; display: flex; align-items: center; }
.site-nav { display: flex; align-items: center; gap: .15rem; min-width: 0; }
.site-nav a { padding: .45rem .7rem; border-radius: 999px; color: var(--text-leise); font-weight: 600; text-decoration: none; white-space: nowrap; font-size: .95rem; }
.site-nav a:hover { color: var(--text); background: var(--nebel); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--nebel); box-shadow: inset 0 -3px 0 var(--gelb); }
.site-head .user-search { flex: 1 1 12rem; max-width: 18rem; margin-left: auto; }
.site-tools { display: flex; align-items: center; gap: .45rem; margin-left: auto; flex: none; }
.site-head .user-search:not([hidden]) + .site-tools { margin-left: 0; }
.nav-toggle { display: none; }
.site-foot { text-align: center; padding: 1.5rem 16px calc(1.5rem + env(safe-area-inset-bottom)); line-height: 1.8; }
.site-foot a { color: inherit; }
/* Startseite: Kopfzeile ersetzt die schwebenden Knöpfe oben rechts */
body[data-screen="home"] .home { min-height: auto; padding-top: 1.5rem; }
/* schmal: Navigation hinter dem Menü-Knopf (#318: bis 1240 px passen Navigation, Suche und Werkzeuge nicht nebeneinander, sonst liegt die Suche über „Statistik“) */
@media (max-width: 1240px) {
  .site-head { position: sticky; flex-wrap: wrap; }
  .nav-toggle { display: inline-grid; place-items: center; }
  .site-nav { display: none; order: 10; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: .2rem; padding: .3rem 0 .4rem; }
  .site-head.nav-open .site-nav { display: flex; }
  .site-nav a { padding: .65rem .9rem; border-radius: .7rem; font-size: 1rem; }
  .site-nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--gelb); }
  .site-head .user-search { order: 11; flex-basis: 100%; max-width: none; }
}
@media (max-width: 420px) {
  .site-tools { gap: .3rem; }
  .site-tools .account-btn [data-account-name] { display: none; }
}
@media (max-width: 600px) {
  /* Handy: oben nur Logo, Glocke, Konto, Menü – Design, Sprache und Suche im aufgeklappten Menü */
  .site-head { flex-wrap: wrap; row-gap: .5rem; }
  .site-tools { margin-left: auto; }
  .site-head:not(.nav-open) .site-tools .theme-btn,
  .site-head:not(.nav-open) .site-tools .lang-switch,
  .site-head:not(.nav-open) .user-search { display: none; }
  .site-head.nav-open .site-tools { flex-wrap: wrap; justify-content: flex-end; }
}

/* ---------- Seiten im Stil der Team-Seite (#146, #148), ruhiger (#164): schmale Farblinie oben, keine Verläufe ---------- */
/* Farbe als echter oberer Rand der Box (#170): folgt der Rundung, statt als Streifen obendrauf zu kleben */
:is(#home, #lobby, #news, #members, #stats, #live, #profile, #leaderboard, #achievements, #account, #donate) .panel:not(.team-hero):not(.team-styled):not(.stats-link):not(.profile-inventor):not(.shrine-quote) {
  border-top: 3px solid var(--accent, var(--blau));
} /* der Kopf der Gründerin behält seinen goldenen Rahmen (#178) */
/* Farbe nach dem Dreieck der Überschrift */
.panel:has(> .h-tri.tri-rot, > * > .h-tri.tri-rot, > summary .h-tri.tri-rot) { --accent: var(--rot); }
.panel:has(> .h-tri.tri-gelb, > * > .h-tri.tri-gelb, > summary .h-tri.tri-gelb) { --accent: var(--gelb); }
.panel:has(> .h-tri.tri-blau, > * > .h-tri.tri-blau, > summary .h-tri.tri-blau) { --accent: var(--blau); }
.panel:has(> .h-tri.tri-schwarz) { --accent: var(--text); }

/* Statistik als großer Knopf (#146), ruhig (#164): kräftiger Rahmen statt Farbfläche */
#home .stats-link.panel { background: var(--papier); border: 2px solid var(--text); padding-block: 1rem; }
#home .stats-link.panel:hover, #home .stats-link.panel:focus-visible { background: var(--nebel); box-shadow: none; }

/* Lucide-Icons (#157): Strich erbt Textfarbe; Größe wie die Schrift */
.ic { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.2em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .ic { width: 1.25rem; height: 1.25rem; vertical-align: middle; }
.btn .ic { margin-right: .1em; }
.news-bell .ic { width: 1.3rem; height: 1.3rem; }
.team-role .ic, .badge .ic { width: 1em; height: 1em; }

/* Teams und Gruppen (#160), Team-Turniere (#159) */
.profile-teams { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.group-badge { border-style: dashed; }
.team-kind { font-size: .7rem; vertical-align: middle; }
.team-kind.group { background: var(--tint-gelb); }
.team-kind-switch .btn.on { background: var(--schwarz); border-color: var(--schwarz); color: #fff; }
.team-tour-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.team-tour { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .6rem .7rem; border-radius: .9rem; background: var(--papier); border: 1px solid var(--linie); }
.team-tour-info { display: grid; gap: .1rem; flex: 1 1 12rem; min-width: 0; }
.t-entries { margin-top: .6rem; }
.t-entry-list { list-style: none; margin: .3rem 0 0; padding: 0; display: grid; gap: .35rem; }
.t-entry { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* Zum Inhalt springen (#164): nur bei Tastaturfokus sichtbar */
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 1000; padding: .6rem 1rem; border-radius: .7rem; background: var(--schwarz); color: #fff; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: max(12px, env(safe-area-inset-top)); }

/* Erfolge-Seite wie die Teamseite (#166): Kacheln im Raster, gleich hoch */
#achievements .ach-overview { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .7rem; align-items: stretch; }
#achievements .ach-row { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; align-items: start; align-content: start; gap: .45rem; padding: .8rem .9rem; height: 100%; box-sizing: border-box; }
#achievements .ach-row .ach-icon { font-size: 1.8rem; text-align: left; }
#achievements .ach-row:not(.got) .ach-icon { filter: grayscale(1); opacity: .7; }
#achievements .ach-side { grid-column: 1 / -1; justify-items: start; text-align: left; border-top: 1px solid var(--linie); padding-top: .4rem; }
#achievements .ach-text strong { overflow-wrap: anywhere; }

/* Feedback in der Fußzeile (#165) */
.site-foot-fb { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem .8rem; margin: 0 0 .8rem; color: var(--text-leise); }
.site-foot-links { margin: 0; }
/* nebeneinanderstehende Boxen gleich hoch (#165): Spalten strecken, die letzte Box füllt auf */
.profile-grid { align-items: stretch; }
.profile-grid > .profile-col { display: flex; flex-direction: column; gap: 1.25rem; }
.profile-grid > .profile-col > :last-child { flex: 1 1 auto; }


/* Mitgliederseite (#167): ruhige, gleich hohe Karten, nichts abgeschnitten */
#members .mem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .6rem; align-items: stretch; }
#members .mem-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: .5rem; height: 100%; box-sizing: border-box; padding: .75rem .8rem; }
#members .mem-link { align-items: flex-start; }
#members .mem-text { gap: .1rem; }
#members .mem-text > * { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
#members .mem-card > .btn { align-self: center; }

/* Feedback-Pop-up (#163): zwei gleich breite Knöpfe, Senden rechts; leere Fehlerzeile ohne Lücke */
.fb-actions, .report-dialog .ach-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; width: 100%; margin-top: .4rem; }
.fb-dialog .error:empty, .report-dialog .error:empty { display: none; }

/* Push (#169) */
.push-turn { display: grid; gap: .5rem; justify-items: start; }
#push-ask .push-ask { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; padding: .45rem .7rem; border-radius: .8rem; background: var(--tint-blau); margin-top: .4rem; }
.settings-push #settings-push-slot { display: grid; gap: .4rem; }

/* Spenden (#174) */
.donate-wrap { max-width: 52rem; display: grid; gap: 1rem; }
.don-heart { color: var(--rot); fill: currentColor; }
.don-head p { line-height: 1.55; }
.don-progress { display: grid; gap: .45rem; }
.don-bar { height: .7rem; border-radius: 99px; background: var(--linie); overflow: hidden; }
.don-bar > span { display: block; height: 100%; background: var(--rot); border-radius: 99px; min-width: 2px; }
.don-bar.mini { width: 4.5rem; height: .4rem; display: inline-block; vertical-align: middle; }
.don-table { width: 100%; border-collapse: collapse; }
.don-table th, .don-table td { padding: .5rem .4rem; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: top; }
.don-table .num { text-align: right; white-space: nowrap; }
.don-table tfoot th, .don-table tfoot td { font-weight: 800; border-bottom: 0; }
.don-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .8rem; align-items: stretch; }
.don-way { display: grid; gap: .5rem; align-content: start; padding: .9rem; border-radius: .9rem; background: var(--papier); border: 1px solid var(--linie); }
.don-way h3 { margin: 0; display: flex; align-items: center; gap: .4rem; }
.don-way .btn { justify-self: start; text-decoration: none; }
.don-bank { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; margin: 0; }
.don-bank dd { margin: 0; overflow-wrap: anywhere; }
.don-bankbox { display: grid; gap: .5rem; justify-items: start; }
.don-hall { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.don-hall h3 { margin: 0 0 .4rem; font-size: 1rem; }
.don-names { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.don-names li { padding: .2rem .6rem; border-radius: 99px; background: var(--papier); border: 1px solid var(--linie); }
.site-foot-donate { margin: 0 0 .7rem; }
.in-app .site-foot-donate { display: none; } /* #388: keine Spenden in der App (Store-Regeln) */
.foot-donate { display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; color: var(--text); font-weight: 600; }
.foot-donate:hover .don-foot-label { text-decoration: underline; }

/* Seiten mit Kopf- und Fußzeile (#179): Fußzeile immer am unteren Rand, Seite nicht länger als nötig */
body:has(#site-foot:not([hidden])) { min-height: var(--app-h, 100dvh); display: flex; flex-direction: column; }
body:has(#site-foot:not([hidden])) > .screen:not([hidden]) { flex: 1 0 auto; min-height: 0; }
body:has(#site-foot:not([hidden])) > .site-foot { flex: none; }
body:has(#site-foot:not([hidden])) .live-page { min-height: 0; }
body:has(#site-foot:not([hidden])) .profile-wrap { padding-bottom: 1.5rem; }

/* Mitgliederseite als Liste (#180): eine Zeile je Person */
#members .mem-grid { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--linie); }
#members .mem-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; border: 0; border-bottom: 1px solid var(--linie); border-radius: 0; background: transparent; padding: .55rem .3rem; height: auto; }
#members .mem-card.self { background: var(--tint-blau); border-color: var(--linie); }
#members .mem-link { align-items: center; }
/* #356: schmal stehen Name und @Benutzername untereinander, je einzeilig mit „…“ – nie mitten im Wort umgebrochen */
#members .mem-text { display: grid; grid-template-columns: minmax(0, 1fr); align-items: baseline; gap: .1rem; }
#members .mem-text > * { grid-column: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
@media (min-width: 760px) {
  #members .mem-text { grid-template-columns: minmax(8rem, auto) auto minmax(0, 1fr) auto; gap: .1rem .6rem; }
}

/* #354: Hinweise oben im Brett (Handy): das Brett beginnt darunter; beim Ziehen blenden sie ab, damit man sieht, wo der Stein landet */
.board { margin-top: calc(24px + var(--overlay-h, 0px)); }
.g-left.on-board { transition: opacity .15s; }
body.drag-active .g-left.on-board { opacity: .35; }

/* Spendenseite (#181): einladender Kopf, Knöpfe der beiden Wege auf gleicher Höhe */
#donate .don-hero { border-top-color: var(--rot); background: linear-gradient(160deg, color-mix(in srgb, var(--rot) 13%, var(--nebel)) 0%, var(--nebel) 70%); gap: .9rem; }
.don-hero-top { display: flex; align-items: center; gap: 1rem; }
.don-hero-icon { flex: none; width: 4.2rem; height: 4.2rem; display: grid; place-items: center; border-radius: 1.1rem; background: var(--papier); border: 3px solid var(--rot); }
.don-hero-icon .ic { width: 2.3rem; height: 2.3rem; animation: don-beat 1.6s ease-in-out infinite; }
@keyframes don-beat { 0%, 100% { scale: 1; } 15% { scale: 1.15; } 30% { scale: 1; } 45% { scale: 1.1; } }
@media (prefers-reduced-motion: reduce) { .don-hero-icon .ic { animation: none; } }
.don-hero-text h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.don-tagline { margin: .2rem 0 0; color: var(--text-leise); font-weight: 600; }
.don-amount { margin: 0; }
.don-amount strong { font-size: 1.8rem; font-weight: 800; }
.don-bar.big { height: 1rem; }
.don-cta { margin-top: .2rem; }
.don-cta .btn { text-decoration: none; }
.don-way { display: flex; flex-direction: column; }
.don-way > .btn, .don-way > .don-bankbox { margin-top: auto; }
.don-way > .btn { align-self: flex-start; }
/* Profil der Gründerin (#178): keine Farblinien – die Boxen behalten den zarten goldenen Rand des besonderen Profils */
#profile .profile-wrap.shrine .panel:not(.profile-inventor):not(.team-styled) { border-top: 1px solid color-mix(in srgb, var(--gelb) 35%, var(--linie)) !important; }
.site-foot { padding-block: .9rem calc(.9rem + env(safe-area-inset-bottom)); line-height: 1.6; }
.site-foot-fb { margin-bottom: .45rem; }
.site-foot-donate { margin-bottom: .45rem; }

/* Lobby: Mitglieder suchen und einladen (#185) */
.lobby-invite-search { width: 100%; }
#lobby-invite-results { padding-bottom: .4rem; border-bottom: 1px solid var(--linie); }

/* Spendenseite (#186): Kopf mit rotem Rand; Hall of Fame in Gold */
#donate .panel.don-hero { border-top-color: var(--rot) !important; }
#donate .panel.don-hall-panel { border-top-color: var(--gelb) !important;
  background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--gelb) 22%, var(--nebel)) 0%, var(--nebel) 60%); }
.don-hall-head { display: flex; align-items: center; gap: 1rem; }
.don-hall-head h2 { margin: 0; font-size: 1.5rem; }
.don-hall-head p { margin: .15rem 0 0; color: var(--text-leise); }
.don-hall-trophy { flex: none; width: 3.6rem; height: 3.6rem; display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(145deg, #ffe08a, var(--gelb)); color: #6b4a00; box-shadow: 0 6px 18px color-mix(in srgb, var(--gelb) 45%, transparent); }
.don-hall-trophy .ic { width: 1.9rem; height: 1.9rem; }
.don-hall-col { padding: .8rem; border-radius: .9rem; background: var(--papier); border: 1px solid color-mix(in srgb, var(--gelb) 45%, var(--linie)); }
.don-hall-col h3 { display: flex; align-items: center; gap: .4rem; }
.don-hall-col.regular h3 .ic { color: var(--gelb-text, #a36800); fill: currentColor; }
.don-hall-col.once h3 .ic { color: var(--rot); fill: currentColor; }
.don-names li { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; font-weight: 600;
  background: linear-gradient(var(--papier), var(--papier)) padding-box, linear-gradient(135deg, var(--gelb), #ffe08a, var(--gelb)) border-box; border: 2px solid transparent; }
.don-names li .ic { width: .95em; height: .95em; }
.don-hall-col.regular .don-names li .ic { color: var(--gelb-text, #a36800); fill: currentColor; }
.don-hall-col.once .don-names li .ic { color: var(--rot); fill: currentColor; }

/* Auswahl als Knöpfe statt Drop-down (#187) */
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chips button { appearance: none; border: 1.5px solid var(--linie); background: var(--papier); color: var(--text); font: 600 .85rem/1 var(--font);
  padding: .45rem .75rem; border-radius: 999px; cursor: pointer; min-height: 2.1rem; }
.chips button:hover:not(:disabled) { border-color: var(--text-leise); }
.chips button[aria-checked="true"] { background: var(--schwarz); border-color: var(--schwarz); color: #fff; }
.chips button:disabled { opacity: .55; cursor: default; }
.chips button:focus-visible { outline: 3px solid var(--blau); outline-offset: 2px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chips button[aria-checked="true"] { background: var(--text); border-color: var(--text); color: var(--papier); } }
:root[data-theme="dark"] .chips button[aria-checked="true"] { background: var(--text); border-color: var(--text); color: var(--papier); }

/* Live-Seite (#187, #189): Liste statt Kacheln, Turniere eigener Bereich */
#live .live-rows { display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--linie); }
#live .live-rows > li { border: 0; border-bottom: 1px solid var(--linie); border-radius: 0; background: transparent; box-shadow: none; padding: .65rem .3rem; }
#live .live-rows .live-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem 1rem; align-items: center; }
#live .live-rows .live-item .live-head { grid-column: 2; grid-row: 1 / span 2; display: grid; justify-items: end; gap: .3rem; }
#live .live-rows .live-item .live-players, #live .live-rows .live-item .live-tags { grid-column: 1; }
/* Handy: lange Meta-Zeile („seit … min · … Steine · … Zuschauende“) drückte die Namensspalte auf null – umbrechen statt verdrängen */
@media (max-width: 600px) { #live .live-rows .live-item .live-meta { max-width: 9.5rem; text-align: right; } }
#live .live-filters .chips button { font-size: .8rem; padding: .35rem .65rem; min-height: 1.9rem; }

/* Markenhinweis (#190) */
.site-foot-legal { margin: .45rem 0 0; font-size: .78rem; color: var(--text-leise); }

/* Zufällig einladen (#192) */
.lobby-random { margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--linie); }
.lobby-random p { margin: .4rem 0 0; }

/* Unterstützer des Monats (#193): kleiner Flammenring ums Profilbild – in Listen, im Profil und am Tisch */
.avatar-supporter { box-shadow: 0 0 0 2px #f6a21a, 0 0 0 3px #e94e1b, 0 0 8px 3px rgba(233, 78, 27, .45); animation: flamme 1.8s ease-in-out infinite alternate; }
.avatar-l.avatar-supporter { box-shadow: 0 0 0 4px var(--papier), 0 0 0 7px #f6a21a, 0 0 0 9px #e94e1b, 0 0 26px 8px rgba(233, 78, 27, .45); animation-name: flamme-l; }
.avatar-xs.avatar-supporter { box-shadow: 0 0 0 1.5px #f6a21a, 0 0 0 2.5px #e94e1b, 0 0 6px 2px rgba(233, 78, 27, .45); }
@keyframes flamme { from { filter: saturate(1); } to { filter: saturate(1.25) brightness(1.04); box-shadow: 0 0 0 2px #ffc23d, 0 0 0 3px #e94e1b, 0 0 12px 4px rgba(246, 162, 26, .55); } }
@keyframes flamme-l { to { box-shadow: 0 0 0 4px var(--papier), 0 0 0 7px #ffc23d, 0 0 0 9px #e94e1b, 0 0 34px 12px rgba(246, 162, 26, .5); } }
.avatar-xs.avatar-supporter { animation: none; }
@media (prefers-reduced-motion: reduce) { .avatar-supporter { animation: none; } }
.profile-head.profile-supporter { background: linear-gradient(135deg, color-mix(in srgb, #f6a21a 12%, var(--panel, var(--papier))), var(--panel, var(--papier)) 60%); }
.supporter-banner { justify-self: start; margin: 0 0 .25rem; padding: .2rem .7rem; border-radius: 99px; font-size: .85rem; font-weight: 700;
  color: #8a3a0c; background: color-mix(in srgb, #f6a21a 22%, var(--papier)); border: 1px solid #f6a21a; }
:root[data-theme="dark"] .supporter-banner { color: #ffd9a8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .supporter-banner { color: #ffd9a8; } }
.don-name-link { display: inline-flex; align-items: center; gap: .4rem; color: inherit; text-decoration: none; }
.don-name-link:hover span:last-child, .don-name-link:focus-visible span:last-child { text-decoration: underline; }
.don-names li:has(.don-name-link) { padding-left: .35rem; }
.don-link-hint { margin-top: .9rem; }

/* Profilseite (#194): alle Boxen mit Farbrand in der Profilfarbe – auch die mit eigenem Überschrift-Dreieck */
#profile .profile-wrap.profile-colored .panel { --accent: var(--profile-accent); }

/* Live-Seite (#196): Titel mit Knopf „Partie eröffnen“, vergangene Turniere gekürzt */
.live-page-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; }
.live-page-head .live-title { margin: 0; }
/* Anlegen bestätigen (#197) */
.create-dialog .segmented { margin: .75rem 0 .5rem; }
.create-dialog #create-help { min-height: 2.6em; }

/* Gruppenseite (#199): eigener Kopf (gestrichelter Rahmen statt Farbband), Vergleich Team/Gruppe, Teams der Gruppe */
#profile .team-hero.group-hero { border: 2px dashed color-mix(in srgb, var(--team, var(--blau)) 60%, var(--linie)); background: linear-gradient(135deg, color-mix(in srgb, var(--team, var(--blau)) 10%, var(--nebel)), var(--nebel) 65%); }
.group-vs { width: 100%; border-collapse: collapse; margin: .75rem 0 1rem; }
.group-vs caption { text-align: left; font-weight: 700; padding-bottom: .4rem; }
.group-vs th, .group-vs td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
.group-vs thead th { color: var(--text-leise); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.group-vs td:last-child { font-weight: 600; }
.group-team-list { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .45rem; }
.team-card-text .team-of { justify-self: start; border-left: 4px solid var(--team, var(--linie)); font-weight: 600; }

/* Rückweg zur Website (#204) */
.site-foot-links .foot-home { font-weight: 700; }

/* Spendenseite: ohne Geld helfen, Hinweise, Offen über Geld (website#13, #14, #24) */
.don-free { margin-top: 1.25rem; }
.don-free h3 { margin: 0 0 .4rem; font-size: 1rem; }
.don-free ul { margin: 0; padding-left: 1.2rem; display: grid; gap: .3rem; }
.don-note { margin: .75rem 0 0; }
.don-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; margin: .75rem 0 1rem; }
.don-fact { display: grid; gap: .15rem; padding: .75rem .9rem; border-radius: .9rem; background: var(--papier); border: 1px solid var(--linie); }
.don-fact strong { font-size: 1.35rem; }
.don-set-costs caption { text-align: left; font-weight: 700; padding-bottom: .4rem; }
.don-set-costs tfoot th, .don-set-costs tfoot td { font-weight: 800; border-top: 2px solid var(--linie); }

/* Registrierung: freiwillig „jünger als 16“ (#201) */
.reg-young { margin: .25rem 0 .5rem; }
.reg-young-why summary { cursor: pointer; }
.reg-young-why p { margin: .4rem 0 0; }

/* Tipp über dem Spielfeld wegklickbar (#206) */
.help-hint { display: inline-flex; align-items: center; gap: .5rem; }
.help-hint[hidden] { display: none; }
.help-hint-x { pointer-events: auto; border: 0; background: none; color: inherit; font-size: 1rem; line-height: 1; padding: 0 .1rem; cursor: pointer; border-radius: 50%; }
.help-hint-x:hover, .help-hint-x:focus-visible { color: var(--text); }
.help-hint.off .help-hint-x { pointer-events: none; }
@media (hover: none), (pointer: coarse) { .help-hint { display: none; } } /* #256: Samsung-Handys melden „hover“ */
@media (orientation: landscape) and (max-height: 520px) { .help-hint { display: none; } }

/* Zufallspartie direkt starten (#210) */
.random-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem .6rem; margin-top: .9rem; }
.random-box[hidden] { display: none; }
.random-btns { display: inline-flex; gap: .35rem; }
.random-btns .btn { min-width: 2.4rem; }
#members .random-box { justify-content: flex-start; margin-top: .75rem; }

/* Team-/Gruppenseite im Farbton der gewählten Farbe (#212): Farbrand aller Boxen, Überschrift-Dreiecke, Kopf-Verlauf */
#profile .profile-wrap.team-themed .h-tri::before { background: var(--profile-accent); }
#profile .profile-wrap.team-themed .team-hero:not(.group-hero) { background: linear-gradient(135deg, color-mix(in srgb, var(--profile-accent) 16%, var(--nebel)), var(--nebel) 70%); }
#profile .profile-wrap.team-themed .team-bar > span { background: var(--profile-accent); }

/* Profil: zum Messen der natürlichen Spaltenhöhen kurz nicht strecken (#213) */
.profile-grid.measuring { align-items: start; }
.profile-grid.measuring > .profile-col > :last-child { flex: none; }

/* Gestapelte doppelte Steine auf der Bank (#216): Zwilling liegt versetzt darunter, kleine „2“ zeigt den Stapel */
.slot.has-stack { position: relative; }
.slot.has-stack > .tile { position: relative; z-index: 1; }
.slot.has-stack > .tile.stack-under { position: absolute; inset: 0; z-index: 0; transform: translate(5px, -5px); filter: brightness(.94); pointer-events: auto; }
.slot.has-stack::after { content: "2"; position: absolute; z-index: 2; right: 2px; bottom: 2px; min-width: .9rem; height: .9rem; padding: 0 .15rem; border-radius: 999px; background: var(--schwarz); color: #fff; font: 700 .55rem/.9rem var(--mono); text-align: center; pointer-events: none; }
:root[data-theme="dark"] .slot.has-stack::after { background: var(--text); color: var(--papier); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .slot.has-stack::after { background: var(--text); color: var(--papier); } }

/* Team-/Gruppennamen ändern (#217) */
.team-name-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.team-name-form .input { flex: 1 1 14rem; max-width: 22rem; }

/* Hinweis statt Fehler im Anmeldebereich (#234) */
#auth-error.auth-info { color: var(--text); }

/* „Ich bin jünger als 16“ (#239): Hinweis auf die Eltern erscheint mit dem Haken */
.reg-young:not(:has(#reg-under16:checked)) .reg-young-parents { display: none; }
.reg-young-parents { font-weight: 600; }

/* ===== Handy hochkant: Spielfeld zuerst (Feedback #214, #244) =====
   Platz geht ans Brett: Mitspielende in einer Zeile, Hinweise einzeilig und klein, Knöpfe in zwei kompakten Reihen. */
@media (max-width: 640px) and (orientation: portrait) {
  /* Mitspielende immer in einer Zeile nebeneinander – Namen werden gekürzt, Zahlen bleiben */
  .g-top .chips { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; }
  .g-top .chip { padding: .15rem .4rem .15rem .3rem; gap: .25rem; font-size: .78rem; }
  .g-top .chip .you { display: none; } /* „(du)“: die eigene Farbe und der Rahmen zeigen es schon */
  .g-top .chip .pts { font-size: .68rem; }
  /* ab vier Mitspielenden zwei Spalten, sonst wird es zu eng */
  .g-top .chips.many { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Hinweis im Brett: höchstens zwei kleine Zeilen */
  .board-status { font-size: .74rem; line-height: 1.3; padding: .25rem .6rem; max-width: calc(100% - 16px);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .board-status:empty { display: none; }
  /* Wer am Zug ist: eine kleine Zeile */
  .g-left .turn-msg { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
  .g-left { gap: .25rem; }
  /* Hinweise (Joker weitergeben, Doppelte tauschen …): eine Zeile, Knopf daneben */
  .g-left .banner { flex-wrap: nowrap; white-space: nowrap; min-width: 0; max-width: 100%; padding: .1rem .2rem .1rem .7rem; font-size: .76rem; border-radius: 999px; }
  .g-left .banner > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .g-left .banner .btn { min-height: 28px; padding: .15rem .6rem; font-size: .76rem; flex: none; }
  /* Knöpfe: ↺ 💡 [Zug beenden] – Zurücksetzen bleibt auch neben „Partie beenden“ ein Symbolknopf */
  .g-right.has-finish #btn-reset { grid-column: 1; font-size: 0; }
  .g-right.has-finish #btn-reset::before { content: "↺"; font-size: 1.45rem; line-height: 1; }
  .g-right { margin-top: .2rem; gap: .3rem; }
  .g-right .btn { min-height: 42px; }
  /* „Partie beenden“ / „Beenden vorschlagen“ klein in der letzten Reihe neben dem Sortieren */
  .g-right { grid-template-columns: 48px 48px minmax(0, 1fr) auto; }
  .g-right #btn-end { grid-column: 3 / -1; }
  .g-right:not(.has-hint) #btn-end { grid-column: 2 / -1; }
  .g-right .sort { grid-column: 1 / 4; order: 5; }
  .g-right #btn-finish, .g-right #btn-restart { grid-column: 4; order: 6; min-height: 34px; padding: .3rem .6rem; font-size: .8rem; border-width: 1px; }
  .g-right:not(.has-finish):not(.has-restart) .sort { grid-column: 1 / -1; }
  .g-right .sort .btn { min-height: 34px; }
}
@media (max-width: 640px) and (orientation: portrait) {
  .g-left { min-width: 0; max-width: 100%; grid-template-columns: minmax(0, 1fr); justify-items: stretch; }
  .g-left .turn-msg { justify-content: center; }
  .g-left .banner { width: 100%; box-sizing: border-box; justify-content: space-between; }
  .g-right .sort { min-width: 0; gap: .25rem; }
  .g-right .sort .btn { min-width: 0; padding: .25rem .45rem; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .g-right #btn-finish, .g-right #btn-restart { padding: .25rem .5rem; font-size: .78rem; white-space: nowrap; }
}

/* ===== Handy hochkant, Runde 2 (#246) ===== */
@media (max-width: 640px) and (orientation: portrait) {
  /* Kopf: Läuft die Spieluhr, nur das Logo-Symbol – sonst überdeckt der Schriftzug die Uhr */
  .g-top.timed .game-brand .brand-word { display: none; }
  .g-top.timed .game-brand .brand-icon { display: block; }
  .g-top .g-stats { min-width: 0; }

  /* Zuginfo, Regelhinweis und Hinweise als schmale Leiste oben im Brett (per app.js dorthin umgehängt) */
  .g-left.on-board {
    position: absolute; top: 6px; left: 6px; right: 6px; z-index: 7;
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px;
    pointer-events: none; text-align: left; max-width: none;
  }
  .g-left.on-board > *, .g-left.on-board .banner { pointer-events: auto; }
  .g-left.on-board .banners { pointer-events: none; flex: 0 0 100%; max-width: 100%; min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
  .g-left.on-board .banners:empty, .g-left.on-board #push-ask[hidden] { display: none; }
  .g-left.on-board .board-status { flex: 0 1 auto; min-width: 0; }
  .g-left.on-board .banner { min-height: 0; padding-block: .05rem; min-width: 0; max-width: 100%; box-sizing: border-box; overflow: hidden; }
  .g-left.on-board .banner > span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .g-left.on-board .turn-msg,
  .g-left.on-board .board-status,
  .g-left.on-board .banner { box-shadow: 0 3px 10px rgba(0, 0, 0, .18); }
  .g-left.on-board .turn-msg {
    max-width: 100%; margin: 0; padding: .15rem .7rem; border-radius: 999px; font-size: .8rem;
    background: var(--papier); border: 1px solid var(--linie);
  }
  .g-left.on-board .turn-msg:empty { display: none; }
  .g-left.on-board .board-status { position: static; max-width: 100%; margin: 0; font-size: .74rem; }
  .g-left.on-board .last-move { display: none; } /* steht auch im Verlauf */
  .g-left.on-board .banner { width: 100%; background: color-mix(in srgb, var(--tint-gelb) 94%, transparent); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
  .game.spectating .g-bottom { display: none; }

  /* Knöpfe: ↺ 💡 [Zug beenden] 🏁 in einer Reihe, darunter Auto|Manuell als Umschalter und Vorbereitung */
  .g-right { grid-template-columns: 44px 44px minmax(0, 1fr) 44px; gap: .3rem; margin-top: .3rem; }
  .g-right #btn-reset { grid-column: 1; order: -2; }
  .g-right #btn-hint { grid-column: 2; order: -1; }
  .g-right #btn-end { grid-column: 2 / 4; order: 0; }
  .g-right.has-hint #btn-end { grid-column: 3; }
  .g-right #btn-finish { grid-column: 4; order: 1; font-size: 0; padding: 0; min-height: 44px; border-width: 2px; }
  .g-right #btn-finish::before { content: "🏁"; font-size: 1.15rem; line-height: 1; }
  .g-right:not(.has-finish) #btn-end { grid-column-end: -1; }
  /* ohne Tipp-Knopf (Partien gegen Menschen): „Zug beenden“ nur bis vor die 🏁 – sonst rutscht sie in eine eigene Zeile (Rückmeldung zu #246) */
  .g-right.has-finish:not(.has-hint) #btn-end { grid-column: 2 / 4; }
  .g-right #btn-restart { grid-column: 1 / -1; font-size: .85rem; min-height: 38px; order: 1; }
  .g-right .sort { grid-column: 1 / -1; order: 5; display: flex; gap: .4rem; }
  .g-right .sort .btn { flex: 0 1 auto; min-height: 34px; padding: .25rem .8rem; font-size: .8rem; }
  /* Auto|Manuell zusammenhängend wie ein Schalter */
  .g-right .sort .prep-toggle { margin-left: auto; }
}

/* ===== Handy hochkant: Vorbereitungsfeld als Streifen über der Bank (#247) =====
   Statt eines hohen 3×4-Kastens neben der Bank (die dadurch schmal wurde): 2 Reihen × 6 Plätze, von links nach rechts.
   Die Plätze behalten ihre Nummern (data-slot) – Ablegen und Server bleiben unverändert, es ändert sich nur die Darstellung. */
@media (max-width: 1024px) and (orientation: portrait) { /* Handy und Tablet hochkant (#247, #268) */
  body:not(.prep-side) .bank-group { flex-direction: column; align-items: stretch; gap: 6px; }
  body:not(.prep-side) .bank-group .bank-board { order: 2; }
  body:not(.prep-side) .prep-tray {
    order: 1; display: none; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 8px;
    padding: 6px 8px 7px; border-radius: 10px; box-shadow: 0 2px 0 #3a3a3a inset, 0 4px 0 var(--bank-kante);
  }
  body.prep-open:not(.prep-side) .prep-tray { display: grid; }
  body:not(.prep-side) .prep-tray .prep-label { writing-mode: vertical-rl; transform: rotate(180deg); font-size: .6rem; letter-spacing: .1em; }
  body:not(.prep-side) .prep {
    grid-template-rows: none; grid-auto-flow: row; grid-auto-columns: auto;
    grid-template-columns: repeat(6, var(--rtile)); grid-auto-rows: var(--rtile);
    gap: 5px; justify-content: space-between; /* Plätze über die ganze Breite verteilt (#248) */
  }
}
/* Einstellung „Vorbereitung über/neben der Bank“ gibt es nur, wo sie wirkt (#248) */
.settings-prep-pos { display: none; }
@media (min-width: 600px) and (max-width: 1024px) and (orientation: portrait) { .settings-prep-pos { display: flex; } } /* #355: auf dem Handy quetscht die Vorbereitung daneben die Bank */

/* ===== Querformat auf Handys und Tablets (#249) =====
   Brett links in voller Höhe, rechts eine Spalte mit Bank, Vorbereitung und Knöpfen; Kopf in einer Zeile;
   Zuginfo und Hinweise schweben oben im Brett (app.js hängt sie um). Gilt für flache Handys (bis 520 px hoch)
   und für Touch-Geräte quer bis 900 px Höhe / 1400 px Breite (z. B. iPad mini, Galaxy Tab) – nicht für Laptops mit Maus. */
  :root:where(.bank-side) { --rtile: clamp(28px, calc((var(--app-h, 100dvh) - 190px) / 4.6), 46px); --side-w: clamp(17.5rem, 34vw, 27rem); }
  :where(.bank-side) .game { grid-template-columns: minmax(0, 1fr) var(--side-w); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "top top" "main side"; }
  :where(.bank-side) .game > .g-top { grid-area: top; }
  :where(.bank-side) .game > .g-main { grid-area: main; }
  :where(.bank-side) .game > .g-bottom {
    grid-area: side; display: flex; flex-direction: column; justify-content: flex-start; gap: .45rem; overflow-y: auto;
    grid-template-columns: none; border-top: 0; border-left: 1px solid var(--linie);
    padding: .5rem 10px calc(.5rem + env(safe-area-inset-bottom)) 10px;
  }
  :where(.bank-side) .game.spectating .g-bottom { display: none; }
  :where(.bank-side) .game.spectating { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }

  /* Kopf: eine Zeile – Logo-Symbol, Mitspielende (gekürzt), Werte ohne Beschriftung, kleinere Knöpfe */
  :where(.bank-side) .g-top { display: flex; grid-template-columns: none; grid-template-areas: none; gap: .5rem; padding: .3rem 10px; min-height: 0; }
  :where(.bank-side) .g-top .game-brand .brand-word { display: none; }
  :where(.bank-side) .g-top .game-brand .brand-icon { display: block; height: 26px; width: 26px; }
  :where(.bank-side) .g-top .chips { display: flex; flex: 1 1 auto; flex-wrap: nowrap; justify-content: flex-start; max-width: none; overflow-x: auto; gap: .3rem; }
  :where(.bank-side) .g-top .chip { flex: 0 1 auto; min-width: 0; padding: .1rem .45rem .1rem .3rem; gap: .3rem; font-size: .8rem; }
  :where(.bank-side) .g-top .chip .p-name { max-width: 8.5rem; }
  :where(.bank-side) .g-top .chip .you, :where(.bank-side) .g-top .chip .flag, :where(.bank-side) .g-top .chip .avatar { display: none; }
  :where(.bank-side) .g-top .g-stats { flex: none; gap: .45rem; }
  :where(.bank-side) .stat-k, :where(.bank-side) .stat-spec { display: none; }
  :where(.bank-side) .stat-v { font-size: 1rem; }
  :where(.bank-side) .g-top .icon-btn { width: 2.1rem; height: 2.1rem; }
  :where(.bank-side) .g-top #btn-theme { display: none; }

  /* Bank über die ganze Spaltenbreite, Vorbereitung als Streifen darüber (wenn eingeschaltet) */
  :where(.bank-side) .bank-group { flex-direction: column; align-items: stretch; width: 100%; gap: 6px; justify-self: stretch; }
  :where(.bank-side) .bank-group .bank-board { order: 2; flex: none; padding: 6px 6px 12px; }
  :where(.bank-side) .bank-logo { display: none; }
  :where(.bank-side) .prep-tray { order: 1; display: none; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 6px; padding: 5px 6px 6px; }
  :where(.bank-side) body.prep-open .prep-tray { display: grid; }
  :where(.bank-side) .prep-tray .prep-label { writing-mode: vertical-rl; transform: rotate(180deg); font-size: .58rem; letter-spacing: .1em; }
  :where(.bank-side) .prep { grid-template-rows: none; grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(6, var(--rtile)); grid-auto-rows: var(--rtile); gap: 4px; justify-content: space-between; }

  /* Knöpfe: ↺ 💡 [Zug beenden] 🏁, darunter Auto|Manuell und Vorbereitung */
  :where(.bank-side) .g-right { display: grid; width: 100%; grid-template-columns: 42px 42px minmax(0, 1fr) 42px; gap: .3rem; margin: 0; justify-content: stretch; }
  :where(.bank-side) .g-right .btn { min-height: 40px; padding: .35rem .5rem; font-size: .9rem; }
  :where(.bank-side) .g-right #btn-reset { grid-column: 1; order: -2; font-size: 0; padding: 0; }
  :where(.bank-side) .g-right #btn-reset::before { content: "↺"; font-size: 1.35rem; line-height: 1; }
  :where(.bank-side) .g-right #btn-hint { grid-column: 2; order: -1; font-size: 0; padding: 0; }
  :where(.bank-side) .g-right #btn-hint svg { display: none; }
  :where(.bank-side) .g-right #btn-hint::before { content: "💡"; font-size: 1.1rem; line-height: 1; }
  :where(.bank-side) .g-right #btn-end { grid-column: 2 / 4; order: 0; min-width: 0; }
  :where(.bank-side) .g-right.has-hint #btn-end { grid-column: 3; }
  :where(.bank-side) .g-right:not(.has-finish) #btn-end { grid-column-end: -1; }
  :where(.bank-side) .g-right.has-finish:not(.has-hint) #btn-end { grid-column: 2 / 4; }
  :where(.bank-side) .g-right #btn-finish { grid-column: 4; order: 1; font-size: 0; padding: 0; }
  :where(.bank-side) .g-right #btn-finish::before { content: "🏁"; font-size: 1.05rem; line-height: 1; }
  :where(.bank-side) .g-right #btn-restart, :where(.bank-side) .g-right #btn-show-results, :where(.bank-side) .g-right #btn-end-home { grid-column: 1 / -1; order: 2; }
  :where(.bank-side) .g-right .sort { grid-column: 1 / -1; order: 5; display: flex; gap: .4rem; }
  :where(.bank-side) .g-right .sort-k { display: none; }
  :where(.bank-side) .g-right .sort .btn { flex: 0 1 auto; min-height: 32px; padding: .2rem .7rem; font-size: .78rem; }
  :where(.bank-side) .g-right .sort .prep-toggle { display: inline-flex; margin-left: auto; grid-column: auto; }

  /* Zuginfo und Hinweise oben im Brett */
  :where(.bank-side) .g-left.on-board {
    position: absolute; top: 6px; left: 6px; right: 6px; z-index: 7; max-width: none;
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; pointer-events: none; text-align: left;
  }
  :where(.bank-side) .g-left.on-board > *, :where(.bank-side) .g-left.on-board .banner { pointer-events: auto; }
  :where(.bank-side) .g-left.on-board .turn-msg, :where(.bank-side) .g-left.on-board .board-status, :where(.bank-side) .g-left.on-board .banner { box-shadow: 0 3px 10px rgba(0, 0, 0, .18); }
  :where(.bank-side) .g-left.on-board .turn-msg { margin: 0; padding: .15rem .7rem; border-radius: 999px; font-size: .8rem; background: var(--papier); border: 1px solid var(--linie); white-space: nowrap; }
  :where(.bank-side) .g-left.on-board .turn-msg:empty, :where(.bank-side) .g-left.on-board .banners:empty, :where(.bank-side) .g-left.on-board .last-move { display: none; }
  :where(.bank-side) .g-left.on-board .board-status { position: static; flex: 0 1 auto; min-width: 0; max-width: 100%; margin: 0; font-size: .74rem; padding: .25rem .6rem; }
  :where(.bank-side) .g-left.on-board .banners { pointer-events: none; display: flex; flex: 0 0 100%; max-width: min(100%, 36rem); min-width: 0; margin-inline: auto; flex-direction: column; align-items: stretch; gap: 4px; }
  :where(.bank-side) .g-left.on-board .banner { flex-wrap: nowrap; white-space: nowrap; min-width: 0; max-width: 100%; box-sizing: border-box; overflow: hidden; padding: .05rem .2rem .05rem .7rem; font-size: .76rem; border-radius: 999px; }
  :where(.bank-side) .g-left.on-board .banner > span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  :where(.bank-side) .g-left.on-board .banner .btn { min-height: 26px; padding: .1rem .6rem; font-size: .74rem; flex: none; }
/* sehr flache Handys quer: noch kompakter */
@media (orientation: landscape) and (max-height: 420px) {
  :root { --rtile: clamp(26px, calc((var(--app-h, 100dvh) - 150px) / 4.7), 34px); }
  .g-top { padding-block: .15rem; }
  .g-top .icon-btn { width: 1.9rem; height: 1.9rem; }
  .g-right .btn { min-height: 36px; }
  .g-right .sort .btn { min-height: 28px; }
  .bank-group .bank-board { padding: 5px 5px 8px; } /* Reihenabstand bleibt rtile + 6px (#364) */
}

/* Zuginfo und Hinweise als Leiste oben im Brett – überall, wo app.js sie ins Brett hängt (.on-board, #246/#249) */
.g-left.on-board {
  position: absolute; top: 6px; left: 6px; right: 6px; z-index: 7; max-width: none;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; pointer-events: none; text-align: left;
}
.g-left.on-board > *, .g-left.on-board .banner { pointer-events: auto; }
.g-left.on-board .turn-msg, .g-left.on-board .board-status, .g-left.on-board .banner { box-shadow: 0 3px 10px rgba(0, 0, 0, .18); }
.g-left.on-board .turn-msg { margin: 0; padding: .15rem .7rem; border-radius: 999px; font-size: .85rem; background: var(--papier); border: 1px solid var(--linie); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.g-left.on-board .turn-msg:empty, .g-left.on-board .banners:empty, .g-left.on-board .last-move, .g-left.on-board #push-ask[hidden] { display: none; }
.g-left.on-board .board-status { position: static; flex: 0 1 auto; min-width: 0; max-width: 100%; margin: 0; font-size: .78rem; padding: .25rem .65rem; }
.g-left.on-board .banners { pointer-events: none; display: flex; flex: 0 0 100%; max-width: min(100%, 38rem); min-width: 0; margin-inline: auto; flex-direction: column; align-items: stretch; gap: 4px; }
.g-left.on-board .banner { flex-wrap: nowrap; white-space: nowrap; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; overflow: hidden; padding: .05rem .2rem .05rem .75rem; font-size: .8rem; border-radius: 999px; justify-content: space-between; }
.g-left.on-board .banner > span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.g-left.on-board .banner .btn { min-height: 28px; padding: .1rem .65rem; font-size: .78rem; flex: none; }
/* Tablet hochkant: unten bleibt nur Bank + Knöpfe */
@media (min-width: 641px) and (max-width: 1024px) and (orientation: portrait) {
  .g-bottom { padding-top: .6rem; gap: .5rem; }
}
/* flache Handys hochkant (z. B. Safari mit Leisten): Bank etwas kleiner, Brett größer */
@media (max-width: 640px) and (orientation: portrait) and (max-height: 700px) {
  :root { --rtile: 33px; }
  .g-right .btn { min-height: 38px; }
  .g-right .sort .btn { min-height: 30px; }
}
/* Querformat: Handy-Spalte etwas breiter (eine volle Farbreihe passt), Tablet-Spalte vertikal mittig */
@media (orientation: landscape) and (max-height: 520px) { :root { --side-w: clamp(18rem, 40vw, 24rem); } }
  :where(.bank-side-lg) .game > .g-bottom { justify-content: center; }
/* Handy quer: Vorbereitung als Streifen unten links im Brett (app.js hängt sie um, #249) */
.prep-tray.on-board { position: absolute; left: 6px; bottom: 6px; z-index: 6; max-width: calc(100% - 12.5rem); box-shadow: 0 6px 16px rgba(0, 0, 0, .3); }
.prep-tray.on-board .prep { grid-template-columns: repeat(6, var(--rtile)); justify-content: start; }

/* ===== iPad-Rückmeldung (#249) ===== */
/* Querformat: Kopf wieder unter der Statusleiste der installierten iOS-App beginnen lassen (#88) – die Querformat-Regel hatte den Abstand überschrieben */
  :where(.bank-side) .g-top { padding-top: max(.3rem, calc(env(safe-area-inset-top) + var(--ios-top))); }
/* Tablet quer: Bank und Knöpfe unten in der Spalte – dort, wo die Daumen sind */
  :where(.bank-side-lg) .game > .g-bottom { justify-content: flex-end; }
/* Sortieren und Vorbereitung: Text mittig, Auto|Manuell als sauberer Umschalter (Handy, Tablet) */
@media (max-width: 1024px) and (orientation: portrait) {
  .g-right .sort .btn { display: inline-flex; align-items: center; justify-content: center; line-height: 1.1; padding-block: 0; }
  .g-right .sort .btn[aria-pressed="false"]:not(.prep-toggle) { background: transparent; color: var(--text); }
}
  :where(.bank-side) .g-right .sort .btn { display: inline-flex; align-items: center; justify-content: center; line-height: 1.1; padding-block: 0; }
  :where(.bank-side) .g-right .sort .btn[aria-pressed="false"]:not(.prep-toggle) { background: transparent; color: var(--text); }
/* Tablet hochkant: eine aufgeräumte Knopfreihe in Bankbreite – ↺ Zurücksetzen · 💡 Tipp · [Zug beenden] · 🏁 Beenden,
   darunter Auto|Manuell links und Vorbereitung rechts */
@media (min-width: 641px) and (max-width: 1024px) and (orientation: portrait) {
  .g-right { display: grid; width: 100%; max-width: none; justify-self: stretch; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: .5rem; align-items: center; }
  .g-right .btn { min-height: 46px; min-width: 0; padding: .4rem 1rem; white-space: nowrap; }
  .g-right #btn-reset { grid-column: 1; order: -2; }
  .g-right #btn-hint { grid-column: 2; order: -1; }
  .g-right #btn-end { grid-column: 3; order: 0; min-width: 0; }
  .g-right:not(.has-hint) #btn-end { grid-column: 2 / 4; }
  .g-right:not(.has-finish) #btn-end { grid-column-end: -1; }
  .g-right #btn-finish { grid-column: 4; order: 1; }
  .g-right #btn-restart, .g-right #btn-show-results, .g-right #btn-end-home { grid-column: 1 / -1; order: 2; }
  .g-right .sort { grid-column: 1 / -1; order: 5; display: flex; gap: .5rem; justify-content: flex-start; }
  .g-right .sort .btn { flex: 0 0 auto; min-height: 36px; padding-inline: 1rem; font-size: .88rem; }
  .g-right .sort .prep-toggle { margin-left: auto; }
}
  :where(.bank-side) .g-right { margin-top: .4rem; }

/* Querformat: eigene Steine und Vorbereitung links, Spielfläche rechts (Wunsch von ebartz, #249) */
  :where(.bank-side) .game { grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-areas: "top top" "side main"; }
  :where(.bank-side) .game > .g-bottom { border-left: 0; border-right: 1px solid var(--linie); }
  :where(.bank-side) .game.spectating { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }

/* Partien-Umschalter in Seiten-Kopfzeilen (Feedback #215, #250) */
.site-tools .games-switch, .topbar-right .games-switch { display: flex; }
/* in Seiten-Kopfzeilen immer am rechten Bildschirmrand (#250, Gerätetest #252) – der Knopf steht oft weit links */
.site-tools .games-pop, .topbar-right .games-pop, .g-top .games-pop { position: fixed; right: 8px; left: auto; width: min(20rem, calc(100vw - 16px)); }
@media (max-width: 640px) {
  .site-tools .games-pop, .topbar-right .games-pop, .g-top .games-pop { left: 8px; right: 8px; width: auto; } /* #349: auch in der Partie-Leiste */
}
/* mehrfach erreichte Erfolge (#221) */
.ach-times { font-family: var(--mono); font-size: .72rem; background: var(--tint-gelb); color: var(--text); border-radius: 999px; padding: .05rem .4rem; vertical-align: middle; }

/* ===== Funde vom Gerätetest auf dem Galaxy S10+ (#252) ===== */
/* #254: ohne Anmeldung kein Profilbild – dann „Anmelden“ zeigen statt einer leeren Pille */
@media (max-width: 420px) {
  .site-tools .account-btn:not(.signed-in) [data-account-name] { display: inline; }
  .site-tools .account-btn:not(.signed-in) { min-height: 40px; padding-inline: .75rem; }
}
/* #258: Touch-Geräte – Tipp-Ziele mindestens ~40 px */
@media (pointer: coarse) {
  #live .live-filters .chips button { min-height: 40px; padding-inline: .8rem; }
  .lang-switch button { min-height: 36px; min-width: 40px; }
  .tut-progress button, .tut-progress a { min-height: 40px; }
  #btn-forgot, .link-btn { display: inline-block; padding-block: .55rem; }
  #game-home { padding-block: .4rem; }
  .help-hint-x { min-width: 40px; min-height: 40px; }
  details > summary { padding-block: .6rem; }
  .fb-star { min-width: 40px; min-height: 40px; }
  .segmented button { min-height: 40px; }
  .btn-small { min-height: 36px; }
}
/* #259: Leer-Hinweis der Bestenliste auf die sichtbare Breite begrenzen (Tabelle scrollt seitlich) */
.lb-empty { white-space: normal; }
.lb-empty > span { display: block; position: sticky; left: .5rem; max-width: calc(100vw - 5rem); }
/* #260: Handy quer – Suche ins Menü wie hochkant, Dialoge nie höher als der Bildschirm */
@media (orientation: landscape) and (max-height: 500px) {
  .site-head:not(.nav-open) .user-search { display: none; }
  .site-head .user-search { order: 11; flex-basis: 100%; max-width: none; }
  .overlay { align-items: start; overflow-y: auto; padding-block: 8px; }
  .overlay > .dialog { max-height: none; padding: 1rem 1.25rem; gap: .75rem; }
}
/* #261: Zugzeit-Knöpfe umbrechen statt abschneiden */
.segmented button { white-space: normal; min-width: 0; overflow-wrap: anywhere; line-height: 1.15; }
/* Hilfe auf dem Handy (#256): Tabellen umbrechen statt seitlich überstehen */
@media (max-width: 640px) {
  .points-table th, .keys-table th { white-space: normal; }
  .points-table td, .keys-table td { overflow-wrap: anywhere; }
  .help-dialog { overflow-x: hidden; }
}

/* Zu alter Browser (#266): nur die Erklärung zeigen, alles andere ausblenden */
body.alt-browser-aktiv > *:not(.alt-browser) { display: none !important; }
.alt-browser { max-width: 32rem; margin: 15vh auto; padding: 0 20px; font-family: sans-serif; line-height: 1.5; color: #292929; }
.alt-browser h1 { font-size: 1.5rem; }

/* Chat (#269): Eingabefeld nimmt den Platz, Knöpfe kompakt; auf Tablets und schmalen Fenstern als volle Ebene über der Partie */
.chat-form .input { flex: 1 1 auto; min-width: 0; }
.chat-form .btn, .chat-form .icon-btn { flex: none; }
@media (max-width: 900px) {
  .g-side.open { width: 100%; left: 0; }
}
/* Laptop mit wenig Höhe in Seitenaufteilung (#267): der Maus-Tipp hätte keinen Platz und läge über der linken Spalte */
@media (orientation: landscape) and (min-width: 900px) and (max-height: 800px) { .help-hint { display: none; } }

/* nummix night auf der Startseite (#265): nur am 1. Mittwoch, ruhig unter dem Startkasten */
.night-link { display: flex; align-items: center; gap: .75rem; padding: .85rem clamp(1.1rem, 3vw, 1.5rem); text-decoration: none; color: #fff;
  background: radial-gradient(120% 160% at 100% 0%, #24425a 0%, #11222c 65%); border: 0; }
.night-link .ic { width: 1.35rem; height: 1.35rem; color: var(--gelb); flex: none; }
.night-link-text { flex: 1; min-width: 0; font-size: .95rem; }
.night-link-go { flex: none; font-weight: 700; color: var(--gelb); white-space: nowrap; }
.night-link:hover, .night-link:focus-visible { box-shadow: 0 6px 18px rgba(0, 0, 0, .15); }

/* Kompatibilitätsmodus für ältere Browser (#266): <dialog> ohne eingebaute Unterstützung */
dialog:not([open]) { display: none; }
html.legacy dialog[open] { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow: auto; z-index: 1000; border: 0; }
html.legacy dialog.dlg-modal[open] { box-shadow: 0 0 0 100vmax rgba(17, 34, 44, .55); }

/* Lizenzen als eigene Seite (Feedback #227) */
.lizenz-seite { background: var(--nebel); }
.lizenz-wrap { max-width: 46rem; margin: 0 auto; padding: max(1.25rem, env(safe-area-inset-top)) 16px 3rem; display: grid; gap: 1rem; }
.lizenz-wrap .brand { justify-self: start; }
.lizenz-wrap .panel h2 { font-size: 1.1rem; margin: 0 0 .4rem; }
.lizenz-wrap .panel p { margin: .3rem 0; overflow-wrap: anywhere; }

/* Turnier-Urkunden (#273) */
.t-podium .cert-link { margin-left: auto; font-size: .85rem; font-weight: 700; color: var(--blau-text, #196a97); }
.t-podium .place .pts + .cert-link { margin-left: .75rem; }
.cert-mine { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 1rem 0 0; }
.cert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.cert-list li { display: flex; align-items: center; gap: .6rem; }
.cert-list .cert-stein { display: inline-grid; place-items: center; width: 2rem; height: 2rem; flex: none; border: 2px solid var(--c, #36a9e1); border-radius: .35rem; font-weight: 800; color: var(--c, #36a9e1); background: #fff; }
.cert-list .p1 { --c: #c88a00; } .cert-list .p2 { --c: #1c75a6; } .cert-list .p3 { --c: #c63f12; } .cert-list .pt { --c: #1d1d1b; }

/* Töne (#279): Lautstärke neben dem Schalter */
.settings-vol { display: inline-flex; align-items: center; }
.settings-vol input[type="range"] { width: 7rem; accent-color: var(--blau); }

/* nummix night auf /statistik (#280, #283): dunkle, hervorgehobene Kachel ganz oben */
.st-grid { align-items: stretch; }
.st-night-panel { background: radial-gradient(120% 140% at 100% 0%, #24425a 0%, #11222c 60%); color: #fff; border-color: transparent; box-shadow: 0 0 0 2px var(--gelb); }
.st-night-panel h2 { color: #fff; }
.st-night-intro { color: #c9d3da; font-size: .9rem; margin: 0; max-width: 46rem; }
.st-night { display: grid; gap: .9rem; margin-top: 1rem; }
.st-night-datum { margin: 0; font-size: 1.15rem; color: var(--gelb); }
.st-night-zahlen { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.st-night-panel .kpi { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); }
.st-night-panel .kpi-v { color: #fff; }
.st-night-panel .kpi:nth-child(1) .kpi-v { color: var(--gelb); }
.st-night-panel .kpi-k, .st-night-panel .st-records dt { color: #c9d3da; }
.st-night-aktuell .kpi-v { font-size: 2rem; }
.st-night-top { border-collapse: collapse; width: 100%; max-width: 34rem; }
.st-night-top caption { text-align: left; margin-bottom: .35rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: #c9d3da; }
.st-night-top th { text-align: left; font-size: .78rem; color: #c9d3da; font-weight: 600; padding: .2rem .5rem .2rem 0; }
.st-night-top td { padding: .35rem .5rem .35rem 0; border-top: 1px solid rgba(255, 255, 255, .14); }
.st-night-top td:nth-child(n+3), .st-night-top th:nth-child(n+3) { text-align: right; }
.st-night-panel a.profile-link { color: #fff; }
.st-night-frueher { margin-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .14); padding-top: .6rem; }
.st-night-frueher summary { cursor: pointer; color: #c9d3da; font-weight: 600; }
.st-night-frueher .st-night { padding-top: .8rem; }
@media (max-width: 640px) { .st-night-zahlen { grid-template-columns: minmax(0, 1fr); } .st-night-aktuell .kpi-v { font-size: 1.5rem; } }
.night-recap { border-color: var(--blau); }

/* Sortieren als Schalter (Feedback #232): ein Knopf mit kleinem Schiebeschalter, an = automatisch nach Farbe */
.sort-switch { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }
.sort-switch .schalter { position: relative; flex: none; width: 1.9rem; height: 1.1rem; border-radius: 999px; background: var(--linie); transition: background-color .2s ease; }
.sort-switch .schalter::after { content: ""; position: absolute; left: .15rem; top: .15rem; width: .8rem; height: .8rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .2s ease; }
.sort-switch[aria-checked="true"] .schalter { background: var(--blau); }
.sort-switch[aria-checked="true"] .schalter::after { transform: translateX(.8rem); }
@media (prefers-reduced-motion: reduce) { .sort-switch .schalter, .sort-switch .schalter::after { transition: none; } }

/* Verdrängter Joker (#303): leuchtet, bis er wieder bewegt wird */
.tile.loose { box-shadow: 0 0 0 3px #f9b233, 0 0 14px 4px rgba(249, 178, 51, .75); animation: joker-los 1.2s ease-in-out infinite alternate; z-index: 2; }
@keyframes joker-los { to { box-shadow: 0 0 0 3px #f9b233, 0 0 22px 8px rgba(249, 178, 51, .45); } }
@media (prefers-reduced-motion: reduce) { .tile.loose { animation: none; } }

/* Halloween (#331): kleiner Kürbis neben dem Logo vom 24.10. bis 2.11.; eigene Grafik, rein dekorativ (kein Text, kein Inhalt für Vorlese-Programme) */
body.halloween .site-head .brand::after, body.halloween .tut-top .brand::after {
  content: ""; display: inline-block; width: 1.6rem; height: 1.6rem; margin-left: .4rem; align-self: center;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'><path d='M20 9 Q21 4 26 3' stroke='%232e7d32' stroke-width='3' fill='none' stroke-linecap='round'/><ellipse cx='20' cy='24' rx='17' ry='14' fill='%23e8791b'/><ellipse cx='20' cy='24' rx='8' ry='14' fill='%23f39a3c'/><polygon points='11,20 15,26 7,26' fill='%23292929'/><polygon points='29,20 33,26 25,26' fill='%23292929'/><path d='M12 31 Q20 36 28 31' stroke='%23292929' stroke-width='2.5' fill='none' stroke-linecap='round'/></svg>") center / contain no-repeat;
}

/* Knopfzeile (#333, #337): ↺ · 💡 · 🏁 links, „Zug beenden“ immer ganz rechts – auf Handy und Tablet hochkant, quer und in flachen Fenstern.
   Sortieren und Vorbereitung stehen auf Touch-Geräten in den Einstellungen (Doppeltipp auf die Bank blendet die Vorbereitung ein/aus). */
@media (max-width: 1024px) and (orientation: portrait) {
  .g-right { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: .4rem; }
  .g-right #btn-reset, .g-right #btn-hint, .g-right #btn-finish { flex: 0 0 48px; width: 48px; min-width: 0; padding: 0; font-size: 0; grid-column: auto; }
  .g-right #btn-reset { order: 1; } .g-right #btn-hint { order: 2; } .g-right #btn-finish { order: 3; }
  .g-right #btn-reset::before, .g-right.has-finish #btn-reset::before { content: "↺"; font-size: 1.45rem; line-height: 1; }
  .g-right #btn-hint::before { content: "💡"; font-size: 1.2rem; line-height: 1; }
  .g-right #btn-finish::before { content: "🏁"; font-size: 1.15rem; line-height: 1; }
  .g-right #btn-end { flex: 1 1 8rem; order: 9; grid-column: auto; min-width: 0; }
  .g-right #btn-restart, .g-right #btn-show-results, .g-right #btn-end-home { flex: 1 1 100%; order: 10; grid-column: auto; }
}
  :where(.bank-side) .g-right { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: .4rem; }
  :where(.bank-side) .g-right #btn-reset, :where(.bank-side) .g-right #btn-hint, :where(.bank-side) .g-right #btn-finish { flex: 0 0 48px; width: 48px; min-width: 0; padding: 0; font-size: 0; grid-column: auto; }
  :where(.bank-side) .g-right #btn-reset { order: 1; } :where(.bank-side) .g-right #btn-hint { order: 2; } :where(.bank-side) .g-right #btn-finish { order: 3; }
  :where(.bank-side) .g-right #btn-reset::before, :where(.bank-side) .g-right.has-finish #btn-reset::before { content: "↺"; font-size: 1.45rem; line-height: 1; }
  :where(.bank-side) .g-right #btn-hint::before { content: "💡"; font-size: 1.2rem; line-height: 1; }
  :where(.bank-side) .g-right #btn-finish::before { content: "🏁"; font-size: 1.15rem; line-height: 1; }
  :where(.bank-side) .g-right #btn-end { flex: 1 1 8rem; order: 9; grid-column: auto; min-width: 0; }
  :where(.bank-side) .g-right #btn-restart, :where(.bank-side) .g-right #btn-show-results, :where(.bank-side) .g-right #btn-end-home { flex: 1 1 100%; order: 10; grid-column: auto; }
@media (max-width: 1024px) and (orientation: portrait), (pointer: coarse) and (orientation: landscape) and (max-height: 900px) {
  .g-right .sort { display: none; }
}
#bank { touch-action: manipulation; } /* Doppeltipp auf die Bank zoomt nicht, sondern blendet die Vorbereitung ein/aus (#333) */

/* Glocke mit Namen über dem Feld (#334): nur, wenn die Person am Zug gerade nicht da ist; ein Tipp erinnert sie (Ton und Benachrichtigung) */
.nudge-bell {
  position: absolute; left: .9rem; bottom: .9rem; z-index: 6; /* links unten, rechts sitzen die Zoom-Knöpfe (#336) */
  display: inline-flex; align-items: center; gap: .45rem; max-width: calc(100% - 9rem); padding: .45rem .9rem; border-radius: 999px;
  border: 1px solid var(--linie); background: color-mix(in srgb, var(--papier) 72%, transparent); color: var(--text);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); box-shadow: 0 6px 18px rgba(0, 0, 0, .15); opacity: .9; cursor: pointer; font: 600 .9rem/1.2 var(--font);
}
.nudge-bell[hidden] { display: none; }
.nudge-bell:disabled { opacity: .5; cursor: default; }
.nudge-bell #nudge-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nudge-bell .ic { width: 1.1rem; height: 1.1rem; flex: none; }
/* Wer dran ist, zeigt schon der Chip – der Text über dem Brett entfällt (bleibt für Vorlese-Programme) (#334) */
.g-left.on-board .turn-msg { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; padding: 0; border: 0; box-shadow: none; }

/* In flachen Fenstern zählt jeder Pixel Höhe: dort ohne Rand um die Bank-Steine (Leuchtring/Stapel am Rand können wieder anstoßen, #317) */
@media (max-height: 520px) { .rack { padding: 0; } .bank-board { --rack-pt: 0px; } }

/* Schwebender Feedback-Knopf (#372, #358): eine Spielstein-Kachel in Navy mit gelber Ecke, unten rechts am Fensterrand, halbtransparent */
.fb-fab {
  position: fixed; z-index: 30; right: max(1.1rem, env(safe-area-inset-right)); bottom: max(1.1rem, env(safe-area-inset-bottom));
  display: grid; place-items: center; align-content: center; gap: .15rem; width: 3.7rem; height: 3.7rem; padding: 0; overflow: hidden;
  border: 0; border-radius: 1.05rem; background: rgba(17, 34, 44, .8); color: #fff; font: 700 .6rem/1 var(--font); letter-spacing: .02em;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .28), 0 8px 18px rgba(17, 34, 44, .22); cursor: pointer; transition: background .15s, transform .15s;
}
.fb-fab::before { content: ""; position: absolute; top: 0; right: 0; width: 1.15rem; height: 1.15rem; background: var(--gelb); clip-path: polygon(0 0, 100% 0, 100% 100%); }
.fb-fab .ic { width: 1.35rem; height: 1.35rem; }
.fb-fab:hover, .fb-fab:focus-visible { background: var(--navy); transform: translateY(-2px); }
.fb-fab[hidden] { display: none; }
@media (max-width: 600px) { .fb-fab { width: 3.2rem; height: 3.2rem; right: max(.8rem, env(safe-area-inset-right)); bottom: max(.8rem, env(safe-area-inset-bottom)); } .fb-fab .ic { width: 1.15rem; height: 1.15rem; } }
@media (prefers-reduced-motion: reduce) { .fb-fab { transition: none; } }

/* ---------- Startseite (#368, #379) ----------
   Handy: eine Spalte in fester Reihenfolge (order): Meine Partien, Lernen-Banner, Einladungen, Partie starten/beitreten, Gerade online,
   Statistik, Partien. Computer: oben das schmale Lernen-Banner, darunter zwei Spalten ohne starre Zeilen (keine Lücken); beide Spalten
   enden bündig, weil die letzte Box wächst. Das alte Layout steht im Git-Tag startseite-v1. */
.home { display: block; position: relative; padding: 1rem 16px 1rem; min-height: 100vh; }
/* Startseite: schwebende Steine und Rauten in der freien Fläche links und rechts der Boxen (#408). Die Boxen sind bis 64rem breit
   und mittig; die Deko braucht auf jeder Seite ~11rem frei, darunter bleibt sie weg (kein Überdecken). */
.home .deko, .home .float-tiles { display: none; }
@media (min-width: 1400px) {
  .home .deko, .home .float-tiles { display: block; }
  .home .float-tiles { position: absolute; inset: 0; pointer-events: none; }
  .home .deko-tr { width: 8rem; top: 7rem; left: calc(50% + 34rem); }
  .home .deko-bl { width: 7rem; bottom: 5rem; right: calc(50% + 34rem); }
  .ft { position: absolute; width: 5rem; height: 5rem; font-size: 2rem; animation: float 9s ease-in-out infinite;
    box-shadow: 0 18px 40px rgba(41, 41, 41, .14), 0 4px 10px rgba(41, 41, 41, .08); }
  .ft1 { right: calc(50% + 34.5rem); top: 14rem; rotate: -10deg; }
  .ft2 { left: calc(50% + 34.5rem); top: 24rem; rotate: 8deg; width: 3.8rem; height: 3.8rem; font-size: 1.6rem; animation-delay: -3s; }
  .ft3 { right: calc(50% + 35rem); top: 34rem; rotate: -6deg; width: 3.4rem; height: 3.4rem; font-size: 1.4rem; animation-delay: -5s; }
  .ft4 { left: calc(50% + 35rem); top: 40rem; rotate: 11deg; width: 4.4rem; height: 4.4rem; animation-delay: -1.5s; }
}
@keyframes float { 50% { translate: 0 -10px; } }
@media (prefers-reduced-motion: reduce) { .ft { animation: none; } }
.hm { --hm-gap: 1.1rem; display: flex; flex-direction: column; gap: var(--hm-gap); width: min(30rem, 100%); margin: 0 auto; }
.hm-colL, .hm-colR { display: contents; }
.hm > [hidden], .hm-colL > [hidden], .hm-colR > [hidden] { display: none; }
.hm-verify { order: 0; }
.hm-mine { order: 1; }
.hm-learn { order: 2; }
.hm-inv { order: 3; }
.hm-main { order: 4; }
#home-online { order: 5; }
.hm-links { order: 6; }
.hm-open { order: 7; }
.hm .panel, .hm-links .panel { align-content: start; padding: clamp(1rem, 2.5vw, 1.35rem); }
.hm-main { gap: .9rem; }
.hm-main .start-box { display: grid; gap: .6rem; }
.hm-main .start-box .btn-big { width: 100%; }
.hm-main .random-box { margin: 0; padding-top: .9rem; border-top: 1px solid var(--linie); justify-content: flex-start; }
.hm-main .join-form { padding-top: .9rem; border-top: 1px solid var(--linie); }
.hm-main .join-form label { display: block; margin-bottom: .35rem; font-weight: 700; }
.hm-main .join-row { display: flex; gap: .6rem; }
.hm-main .join-row .code-input { flex: 1; min-width: 0; }
.hm-main #home-error:empty { display: none; }
.hm-main #home-error { margin: 0; }
/* schmales Banner „Neu bei nummix?“ */
.hm-learn { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; padding: .55rem .7rem .55rem 1.1rem; border: 1px dashed var(--linie); border-radius: 999px; background: var(--papier); }
.hm-learn[hidden] { display: none; }
.hm-learn .learn-h { margin: 0; font-weight: 700; color: var(--text-leise); }
.hm-learn .btn { min-height: 2.2rem; }
.hm-learn .learn-x { margin-left: auto; }
/* Beta-Test der Android-App (#391): wie das Lernen-Banner, aufklappbar */
.hm-beta { order: 2; position: relative; padding: .55rem 2.9rem .55rem 1.1rem; border: 1px dashed var(--linie); border-radius: 1.4rem; background: var(--papier); }
.hm-beta summary { position: relative; display: block; padding: .3rem 0 .3rem 1.3rem; cursor: pointer; list-style: none; }
.hm-beta summary::-webkit-details-marker { display: none; }
.hm-beta summary::before { content: ""; position: absolute; left: 0; top: .62rem; width: .7rem; height: .7rem; background: var(--blau); clip-path: polygon(0 0, 100% 50%, 0 100%); transition: transform .15s; }
.hm-beta .beta-h { margin-right: .6rem; }
.hm-beta details[open] summary::before { transform: rotate(90deg); }
.hm-beta .beta-h { font-weight: 700; color: var(--text-leise); }
.hm-beta .beta-more { color: var(--link, var(--blau)); text-decoration: underline; text-underline-offset: 2px; }
.hm-beta details[open] .beta-more { display: none; }
.hm-beta details > p { margin: .5rem 0 .3rem; }
.hm-beta .beta-steps { margin: .2rem 0 .3rem; padding-left: 1.3rem; display: grid; gap: .35rem; }
.hm-beta .beta-x { position: absolute; top: .45rem; right: .55rem; }
.count-badge { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .4rem; border-radius: 999px; background: var(--gelb); color: var(--schwarz); font: 700 .8rem/1 var(--mono); }
.count-badge:empty { display: none; }
.hm-links { display: grid; gap: var(--hm-gap); align-content: start; }
.hm-links > [hidden] { display: none; }
.hm-open { gap: .75rem; }
.hm-open .open-list:empty, .hm-open .live-list:empty { display: none; }
@media (min-width: 900px) {
  .hm { width: min(64rem, 100%); display: grid; grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr); align-items: stretch; }
  .hm-verify, .hm-learn, .hm-beta { grid-column: 1 / -1; }
  .hm-colL, .hm-colR { display: flex; flex-direction: column; gap: var(--hm-gap); min-width: 0; }
  .hm-verify, .hm-mine, .hm-learn, .hm-beta, .hm-inv, .hm-main, #home-online, .hm-links, .hm-open { order: 0; }
  /* „Gerade online“ links und „Partien“ rechts wachsen, damit beide Spalten bündig enden */
  .hm-colL > #home-online { flex: 1; }
  .hm-colR > .hm-open { flex: 1; }
}
/* Profil: seltener Gebrauchtes hinter „Mehr“ (#370) */
.profile-more > summary { list-style: none; cursor: pointer; }
.profile-more > summary::-webkit-details-marker { display: none; }
.profile-more > summary::after { content: " ▾"; }
.profile-more[open] > summary::after { content: " ▴"; }
.profile-more-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }

/* Zufallspartie ohne Nachfrage (#374): Hinweis mit Countdown oben in der Mitte */
.auto-join { position: fixed; z-index: 60; top: 4.5rem; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: .9rem; max-width: calc(100vw - 2rem);
  padding: .65rem .75rem .65rem 1.1rem; border-radius: 999px; background: var(--navy); color: #fff; font-weight: 700; box-shadow: 0 8px 24px rgba(17, 34, 44, .3); }
.auto-join .btn { background: #fff; color: var(--navy); }

/* Viele Gruppen im Profil (#370): Rest eingeklappt */
.groups-more > summary, .badges-more > summary { cursor: pointer; }
.badges-more { display: inline-flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.badges-more > summary { list-style: none; }
.groups-more { margin-top: .5rem; }

/* Lobby im Stil der Startseite (#382): gleiche Boxen (Farbkante oben, Innenabstand, Abstände) */
.lobby-wrap { gap: 1.1rem; }
#lobby .panel { padding: clamp(1rem, 2.5vw, 1.35rem); }

/* Halloween-Vorschau (#397): niedliche Dekoration, nur für Admins im Vorschau-Modus (#396). Alles rein dekorativ, ohne Klicks,
   außerhalb des Spielfelds; im Spiel selbst nur Feuer, Spinnen am Rand und Weben in den Ecken. */
#hw-deko .hw-weg { opacity: 0; }
#hw-deko .hw-ghost, #hw-deko .hw-spider, #hw-deko .hw-table { transition: opacity .4s; }
#hw-deko { position: fixed; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
/* Flammen um Logo und Schriftzug (#399): gestapelte Schatten in Gelb, Orange und Rot, die flackern */
body.hw-preview .brand img { animation: hw-feuer 1.1s ease-in-out infinite alternate; }
@keyframes hw-feuer {
  0% { filter: drop-shadow(0 0 1px #ffe27a) drop-shadow(0 -2px 3px #ffb300) drop-shadow(1px -4px 6px #ff6d00) drop-shadow(-1px -7px 10px #e53935); }
  35% { filter: drop-shadow(0 0 2px #ffe27a) drop-shadow(1px -3px 4px #ffb300) drop-shadow(-1px -6px 8px #ff6d00) drop-shadow(1px -9px 12px #e53935); }
  70% { filter: drop-shadow(0 0 1px #ffe27a) drop-shadow(-1px -2px 3px #ffb300) drop-shadow(1px -5px 7px #ff6d00) drop-shadow(0 -8px 9px #e53935); }
  100% { filter: drop-shadow(0 0 2px #ffe27a) drop-shadow(0 -3px 4px #ffb300) drop-shadow(-1px -6px 9px #ff6d00) drop-shadow(1px -10px 13px #e53935); }
}

.hw-web { position: absolute; bottom: 0; width: 4.5rem; height: 4.5rem; opacity: .5;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60' fill='none' stroke='%23555' stroke-width='1.2' stroke-linecap='round'><path d='M0 60 L0 0 M0 60 L60 60 M0 60 L48 8 M0 60 L22 2 M0 60 L58 38'/><path d='M0 46 Q14 46 14 60 M0 32 Q28 32 28 60 M0 18 Q42 18 42 60 M0 6 Q56 6 56 60'/></svg>") no-repeat 0 100% / contain; }
.hw-web-l { left: 0; }
.hw-web-r { right: 0; transform: scaleX(-1); }

.hw-spider { position: absolute; top: 0; display: flex; flex-direction: column; align-items: center; transform: translateX(-50%); animation: hw-seil var(--d, 8s) ease-in-out infinite alternate; }
.hw-spider b { display: block; width: 1px; height: var(--len, 5rem); background: #777; }
.hw-spider u { text-decoration: none; font-size: 1.1rem; line-height: 1; }
@keyframes hw-seil { from { transform: translate(-50%, -3rem); } to { transform: translate(-50%, 0); } }

.hw-ghost { position: absolute; left: -3rem; font-size: 1.6rem; line-height: 1; opacity: .75; animation: hw-schweben var(--d, 50s) linear infinite; }
@keyframes hw-schweben { 0% { transform: translate(0, 0); } 25% { transform: translate(28vw, -1.2rem); } 50% { transform: translate(56vw, .4rem); } 75% { transform: translate(84vw, -1rem); } 100% { transform: translate(calc(100vw + 4rem), 0); } }

.hw-table { position: absolute; right: 6.5rem; bottom: .35rem; display: flex; align-items: flex-end; gap: .25rem; padding: 0 .6rem .25rem; border-bottom: .35rem solid #8a5a2b; border-radius: .2rem; }
.hw-table s { text-decoration: none; font-size: 1.5rem; line-height: 1; animation: hw-wippen 2.4s ease-in-out infinite; }
.hw-table s:last-child { animation-delay: -1.2s; }
.hw-table em { font-style: normal; font-weight: 700; font-size: .7rem; line-height: 1; width: 1.1rem; height: 1.3rem; display: grid; place-items: center; border-radius: .2rem; background: #fff; border: 1px solid #aaa; }
.hw-table .t1 { color: var(--blau); } .hw-table .t2 { color: var(--rot); } .hw-table .t3 { color: #c98a00; }
@keyframes hw-wippen { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-.2rem) rotate(4deg); } }

/* Gespenster und Tisch nur dort, wo Platz ist: nicht im Spiel, nicht auf kleinen Bildschirmen */
body[data-screen="game"] .hw-ghost, body[data-screen="game"] .hw-table, body[data-screen="tournament"] .hw-ghost, body[data-screen="tournament"] .hw-table { display: none; }
body:not([data-screen="home"]) .hw-table { display: none; }
@media (max-width: 1100px) { .hw-table { display: none; } }
@media (max-width: 700px) { .hw-ghost, .hw-table, .hw-spider:nth-of-type(n+3) { display: none; } .hw-web { width: 3rem; height: 3rem; } }
@media (prefers-reduced-motion: reduce) {
  body.hw-preview .brand img { animation: none; filter: drop-shadow(0 0 2px #ffe27a) drop-shadow(0 -3px 4px #ffb300) drop-shadow(0 -6px 8px #ff6d00) drop-shadow(0 -9px 11px #e53935); }
  .hw-spider, .hw-ghost, .hw-table s { animation: none; }
  .hw-ghost { left: 12%; }
}

/* Hard Mode (#410): Regler in der Lobby */
.hard-row { display: flex; align-items: center; gap: .9rem; }
.hard-row input[type=range] { flex: 1; min-width: 0; accent-color: var(--gelb, #f9b233); }
.hard-row output { min-width: 8.5rem; text-align: right; font-weight: 700; }
