/* Wer bin ich? Farben, Schriften und Formen nach design/README.md */
:root {
  --ink: #1E1B2E;
  --bg: #F5EEE2;
  --red: #D93A28;
  --red2: #C4321F;
  --red3: #B52C1B;
  --red-l: #FBE3DF;
  --warn: #8E2414;
  --blue: #2F5FD9;
  --blue-l: #E1E8FB;
  --yel: #FFC93C;
  --yel-l: #FFF6D6;
  --yel-b: #C9A227;
  --green: #1F8F5A;
  --mut: #5E5870;
  --dis: #8C8598;
  --dis-b: rgba(30, 27, 46, .2);
  --display: 'Bricolage Grotesque', sans-serif;
  --text: 'Figtree', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

html, body { margin: 0; padding: 0; background: var(--bg); -webkit-tap-highlight-color: transparent; }
* { box-sizing: border-box; }
body.locked { overflow: hidden; }
button { font-family: inherit; color: inherit; }
input { font-family: inherit; color: var(--ink); }
input::placeholder { color: var(--dis); }
a { color: var(--blue); }
[hidden] { display: none !important; }

.page {
  min-height: 100dvh;
  background: var(--bg) radial-gradient(rgba(30, 27, 46, .06) 1.2px, transparent 1.4px);
  background-size: 18px 18px;
  font-family: var(--text);
  color: var(--ink);
}
#app { max-width: 820px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; position: relative; }
.loading { padding: 24px; font-weight: 700; }
.screen { min-height: 100dvh; display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.display { font-family: var(--display); font-weight: 800; }
.eyebrow { font-size: 13px; font-weight: 800; color: var(--mut); letter-spacing: .04em; text-transform: uppercase; }
.muted { color: var(--mut); }
.pretty { text-wrap: pretty; }

@keyframes wbDot { 0%, 80%, 100% { transform: scale(.5); opacity: .35 } 40% { transform: scale(1); opacity: 1 } }
.dots { display: inline-flex; gap: 4px; margin-left: 4px; vertical-align: middle; }
.dots i { width: 7px; height: 7px; border-radius: 7px; background: var(--ink); animation: wbDot 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
.dots.blue i { background: var(--blue); }
.dots.light i { background: var(--yel); }

/* Knöpfe: harter Brettspiel-Schatten, beim Drücken sinkt der Knopf ein */
.btn {
  border: 3px solid var(--ink); border-radius: 18px; background: #fff; color: var(--ink);
  box-shadow: 0 5px 0 var(--ink); cursor: pointer; font-weight: 800; font-size: 17px;
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 16px; width: 100%;
  text-decoration: none;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn.sm { box-shadow: 0 4px 0 var(--ink); border-radius: 16px; }
.btn.sm:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.d { font-family: var(--display); font-weight: 800; }
.btn.red { background: var(--red); color: #fff; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.yel { background: var(--yel); }
.btn.green { background: var(--green); color: #fff; }
.btn.ink { background: var(--ink); color: #fff; box-shadow: 0 4px 0 rgba(30, 27, 46, .4); }
.btn.ink:active { transform: translateY(3px); }
.btn.flat { box-shadow: none; border-width: 2.5px; border-radius: 14px; }
.btn.flat:active { transform: none; }
.btn.dashed { background: transparent; border-style: dashed; box-shadow: none; border-radius: 16px; }
.btn.dashed:active { transform: none; }
.off {
  width: 100%; border-radius: 18px; border: 3px solid var(--dis-b); color: var(--dis);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; text-align: center; padding: 0 12px;
}
.h44 { height: 44px; } .h48 { height: 48px; } .h50 { height: 50px; } .h52 { height: 52px; } .h54 { height: 54px; }
.h56 { height: 56px; } .h58 { height: 58px; } .h60 { height: 60px; } .h62 { height: 62px; } .h64 { height: 64px; }
.h66 { height: 66px; } .h68 { height: 68px; } .h72 { height: 72px; } .h76 { height: 76px; }

.back {
  width: 48px; height: 48px; flex: none; border-radius: 14px; background: #fff; border: 2.5px solid var(--ink);
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 16px 6px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 6px; }
.steps i { height: 6px; border-radius: 3px; background: rgba(30, 27, 46, .15); }
.steps i.on { background: var(--red); }

/* Untere Leiste in Daumenreichweite */
.dock {
  position: sticky; bottom: 0; padding: 14px 16px calc(14px + var(--safe-b));
  background: linear-gradient(rgba(245, 238, 226, 0), var(--bg) 30%); display: flex; gap: 10px; z-index: 4;
}
.dock.narrow { max-width: 480px; width: 100%; margin: 0 auto; background: none; }

.field {
  height: 54px; border-radius: 14px; border: 2.5px solid var(--ink); background: #fff; padding: 0 14px;
  font-size: 17px; font-weight: 700; outline: none; width: 100%;
}
.note-err {
  padding: 10px 12px; border-radius: 14px; background: var(--red-l); border: 2.5px solid var(--red);
  font-size: 15px; font-weight: 700; color: var(--warn); text-wrap: pretty;
}

/* Gesichter: Foto-Ausschnitt über einer neutralen Kachel, falls das Bild fehlt */
.ph {
  position: relative; overflow: hidden; aspect-ratio: 1; border-radius: 5px;
  background: radial-gradient(ellipse 19% 19% at 50% 40%, rgba(40, 34, 58, .3) 0 97%, transparent 100%),
    radial-gradient(ellipse 42% 30% at 50% 100%, rgba(40, 34, 58, .3) 0 97%, transparent 100%), #E4DCCF;
}
.ph > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; -webkit-user-drag: none; }

/* Sheets von unten und Modale */
.overlay {
  position: fixed; inset: 0; background: rgba(30, 27, 46, .55); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 560px; background: var(--bg); border: 3px solid var(--ink); border-bottom: none;
  border-radius: 28px 28px 0 0; padding: 12px 18px calc(22px + var(--safe-b));
  display: flex; flex-direction: column; gap: 14px; max-height: 85dvh; overflow: auto;
}
.sheet.white { background: #fff; }
.grip { width: 44px; height: 5px; border-radius: 3px; background: var(--ink); opacity: .25; margin: 0 auto; flex: none; }
.sheet-title { font-family: var(--display); font-weight: 800; font-size: 26px; }
.modal {
  position: fixed; inset: 0; z-index: 60; background: rgba(30, 27, 46, .7);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.card {
  width: 100%; background: var(--bg); border: 3px solid var(--ink); border-radius: 26px; box-shadow: 0 6px 0 var(--ink);
  padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
}

/* 1 Start */
.start { min-height: 100dvh; display: flex; flex-direction: column; padding: 28px 22px calc(28px + var(--safe-b)); }
.start .hero { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 28px; padding: 24px 0; }
.logo { display: flex; align-items: flex-end; justify-content: center; }
.logo .lc { width: 92px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 5px; box-shadow: 0 5px 0 var(--ink); }
.logo .lc .ph { border-radius: 9px; }
.logo .lc span { display: block; font-size: 12px; font-weight: 800; text-align: center; padding-top: 4px; }
.logo .l0 { transform: rotate(-9deg) translateY(6px); margin-right: -10px; }
.logo .l2 { transform: rotate(10deg) translateY(8px); margin-left: -10px; }
.logo .l1 { width: 104px; position: relative; z-index: 2; background: var(--red); transform: rotate(2deg); }
.logo .l1 span { color: #fff; }
.flapq {
  aspect-ratio: 1; border-radius: 9px; border: 2px solid var(--ink);
  background: repeating-linear-gradient(45deg, var(--red2) 0 7px, var(--red) 7px 14px);
  display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 56px; color: var(--yel);
}
.ph.tone1 { background-color: #D3E2EA; }
.title-xl { font-family: var(--display); font-weight: 800; font-size: 56px; line-height: .92; letter-spacing: -.02em; }
.start .claim { font-size: 17px; color: var(--mut); text-wrap: pretty; max-width: 300px; margin: 0 auto; }
.start .menu { width: 100%; max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.start .menu .btn { justify-content: space-between; padding: 0 20px; text-align: left; }
.start .menu .big { font-family: var(--display); font-weight: 800; font-size: 23px; }
.start .menu .sub { font-size: 14px; font-weight: 600; opacity: .95; }
.start .menu .lbl { font-family: var(--display); font-weight: 800; font-size: 21px; }
.badge {
  min-width: 32px; height: 32px; padding: 0 6px; border-radius: 10px; background: var(--yel); border: 2.5px solid var(--ink);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
}

/* Sheet Meine Tableaus */
.tlist { display: flex; flex-direction: column; gap: 10px; }
.trow { display: flex; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 4px 0 var(--ink); overflow: hidden; }
.trow .play {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: transparent;
  border: none; cursor: pointer; text-align: left; min-height: 76px;
}
.trow .play:active { background: var(--bg); }
.minis { display: flex; flex: none; }
.minis .ph { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--ink); }
.minis .ph + .ph { margin-left: -14px; }
.trow .name { font-weight: 800; font-size: 17px; overflow-wrap: anywhere; }
.trow .meta { font-size: 14px; color: var(--mut); font-weight: 600; }
.trow .go { font-weight: 800; font-size: 15px; color: var(--red); }
.trow .edit {
  width: 60px; flex: none; border: none; border-left: 2.5px solid var(--ink); background: var(--bg); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 800;
}
.trow .edit:active { background: var(--yel); }

/* Sheet Spiel beitreten */
.or { display: flex; align-items: center; gap: 12px; color: var(--mut); font-weight: 700; font-size: 14px; }
.or::before, .or::after { content: ''; flex: 1; height: 2px; background: var(--ink); opacity: .15; }
.codein {
  height: 72px; border: 3px solid var(--ink); border-radius: 18px; background: #fff; text-align: center;
  font-family: var(--display); font-weight: 800; font-size: 36px; letter-spacing: .35em; padding-left: .35em;
  text-transform: uppercase; outline: none; width: 100%;
}
.btn.join { background: var(--ink); color: #fff; box-shadow: none; font-family: var(--display); font-size: 20px; height: 60px; }
.btn.join:active { transform: none; }
.off.h60 { font-size: 17px; }
.sheet.gap16 { gap: 16px; }

/* 2 Foto wählen */
.intro { padding: 18px 20px 0; display: flex; flex-direction: column; gap: 8px; }
.h34 { font-size: 34px; line-height: 1; }
.lead { font-size: 16px; color: var(--mut); text-wrap: pretty; }
.pick { padding: 22px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.pickcard {
  min-height: 150px; border-radius: 22px; background: #fff; border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink);
  padding: 20px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; cursor: pointer; text-align: left;
}
.pickcard:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.pickcard.yel { background: var(--yel); }
.pickcard .pi { width: 52px; height: 52px; border-radius: 14px; background: #fff; border: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.pickcard .pi.blue { background: var(--blue); }
.pickcard .ps { font-size: 15px; font-weight: 600; }
.tip { margin: 0 20px; padding: 16px 18px; border-radius: 18px; border: 2.5px dashed var(--ink); display: flex; gap: 14px; align-items: flex-start; font-size: 15px; line-height: 1.4; text-wrap: pretty; }
.tip .tag { flex: none; padding: 3px 9px; border-radius: 8px; background: var(--ink); color: var(--yel); font-weight: 800; font-size: 13px; line-height: 1.4; }
.modal.scan { background: rgba(30, 27, 46, .8); padding: 24px; }
.scan-card { max-width: 420px; padding: 18px; gap: 14px; box-shadow: none; }
.scan-photo { width: 100%; aspect-ratio: 4 / 3; border-radius: 16px; border: 3px solid var(--ink); overflow: hidden; background: linear-gradient(#DCD4C6 0 52%, #C3B9A6 52%); }
.scan-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 3 Gesichter prüfen */
.count-row { padding: 14px 16px 10px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.unsure { padding: 5px 10px; border-radius: 10px; background: var(--yel); border: 2px solid var(--ink); font-size: 13px; font-weight: 800; }
.vp {
  aspect-ratio: 4 / 3; width: 100%; border-radius: 18px; border: 3px solid var(--ink); position: relative; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; background: #B9AF9C;
}
.vp.adding { cursor: crosshair; }
.vp .layer { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform-origin: 0 0; }
.vp .photo { position: absolute; }
.vp .photo > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; -webkit-user-drag: none; }
.vp .frame { position: absolute; aspect-ratio: 1; border-radius: 18%; }
.vp-note { position: absolute; left: 10px; right: 10px; top: 10px; padding: 8px 12px; border-radius: 12px; background: var(--ink); color: var(--yel); font-weight: 800; font-size: 14px; text-align: center; pointer-events: none; }
.zoomrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.zoom { display: flex; align-items: center; background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; overflow: hidden; }
.zoom button { width: 48px; height: 48px; border: none; background: transparent; cursor: pointer; font-size: 24px; font-weight: 800; }
.zoom div { min-width: 56px; text-align: center; font-weight: 800; font-size: 14px; }
.addbtn { flex: 1; min-width: 170px; height: 52px; border-radius: 14px; border: 2.5px solid var(--ink); background: #fff; font-weight: 800; font-size: 15px; cursor: pointer; }
.addbtn.on { background: var(--yel); }
.hint { font-size: 14px; color: var(--mut); padding-top: 10px; text-wrap: pretty; }
.selbox { background: #fff; border: 2.5px solid var(--ink); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.row-sb { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mini { height: 36px; padding: 0 12px; border-radius: 10px; border: 2px solid var(--ink); background: var(--bg); font-weight: 800; cursor: pointer; }
.selbtns { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; }
.tool { height: 48px; border-radius: 12px; border: 2.5px solid var(--ink); background: var(--bg); font-weight: 800; font-size: 15px; cursor: pointer; }
.tool.red { background: var(--red); color: #fff; }

/* 4 Namen vergeben */
.stickyhead { position: sticky; top: 0; z-index: 5; background: var(--bg); padding-bottom: 10px; border-bottom: 2px solid rgba(30, 27, 46, .1); }
.bar { height: 12px; border-radius: 6px; border: 2px solid var(--ink); background: #fff; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); transition: width .3s; }
.ngrid { padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 12px; }
.nitem { display: flex; flex-direction: column; gap: 6px; }
.ntile { position: relative; border-radius: 14px; border: 2.5px solid var(--ink); overflow: hidden; }
.ntile .ph { border-radius: 0; }
.ntile .num {
  position: absolute; left: 6px; top: 6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 7px; background: #fff;
  border: 2px solid var(--ink); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.nin { height: 44px; width: 100%; border-radius: 11px; border: 2.5px solid var(--ink); background: #fff; text-align: center; font-size: 16px; font-weight: 700; outline: none; padding: 0 6px; }
.nin.empty { border-color: var(--yel-b); background: var(--yel-l); }

/* 5 Raster wählen */
.gopts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gopt {
  border-radius: 18px; border: 3px solid var(--ink); background: #fff; color: var(--ink); box-shadow: 0 3px 0 var(--ink);
  padding: 14px 6px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer;
}
.gopt.on { background: var(--red); color: #fff; box-shadow: 0 5px 0 var(--ink); }
.gopt.dis { opacity: .4; box-shadow: none; cursor: not-allowed; }
.dotgrid { width: 44px; height: 44px; background-image: radial-gradient(circle, var(--ink) 38%, transparent 42%); }
.gopt.on .dotgrid { background-image: radial-gradient(circle, #fff 38%, transparent 42%); }
.gnote { padding: 12px 14px; border-radius: 14px; border: 2.5px dashed var(--ink); font-size: 14px; font-weight: 600; line-height: 1.4; }
.selbadge { padding: 4px 10px; border-radius: 10px; border: 2px solid var(--ink); background: var(--yel); font-weight: 800; font-size: 14px; }
.selbadge.ok { background: var(--green); color: #fff; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.pk { padding: 0; border: none; background: transparent; cursor: pointer; display: flex; flex-direction: column; gap: 3px; opacity: .45; min-width: 0; }
.pk.sel { opacity: 1; }
.pk .ph { width: 100%; border-radius: 11px; border: 2px dashed var(--ink); overflow: visible; }
.pk .ph > img { border-radius: 9px; }
.pk.sel .ph { border: 2.5px solid var(--ink); }
.tick { position: absolute; right: -5px; top: -5px; width: 22px; height: 22px; border-radius: 50%; background: var(--green); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.pkname { font-size: 11px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gmsg { padding: 10px 12px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; }
.preview { width: 100%; max-width: 340px; margin: 0 auto; background: var(--red); border: 3px solid var(--ink); border-radius: 18px; padding: 7px; box-shadow: 0 5px 0 var(--ink); display: grid; gap: 4px; }
.pv { background: #fff; border: 1.5px solid var(--ink); border-radius: 6px; padding: 2px; }
.pv .ph { border-radius: 4px; }
.pv.empty .ph { background: rgba(255, 255, 255, .35); }
.tname { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 14px; }

/* 6 Lobby */
.ttl { font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lobby { padding: 14px 16px 0; display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; max-width: 480px; margin: 0 auto; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode {
  text-align: left; padding: 12px; border-radius: 16px; border: 3px solid var(--ink); background: #fff; color: var(--ink);
  cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-height: 84px;
}
.mode.on { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--ink); }
.mode:disabled { cursor: default; }
.mode .msub { font-size: 13px; font-weight: 600; line-height: 1.3; }
.qrcard { background: #fff; border: 3px solid var(--ink); border-radius: 24px; box-shadow: 0 5px 0 var(--ink); padding: 18px; width: 100%; max-width: 280px; }
.qrcard svg { display: block; width: 100%; height: auto; }
.codechars { display: flex; gap: 6px; }
.codechars div { width: 50px; height: 60px; border-radius: 12px; background: var(--yel); border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 32px; }
.linkrow { width: 100%; display: flex; gap: 8px; }
.linkfield { flex: 1; min-width: 0; height: 52px; border-radius: 14px; border: 2.5px solid var(--ink); background: #fff; padding: 0 12px; font-weight: 700; font-size: 15px; text-overflow: ellipsis; outline: none; }
.copybtn { height: 52px; padding: 0 14px; border-radius: 14px; border: 2.5px solid var(--ink); background: #fff; font-weight: 800; font-size: 15px; cursor: pointer; }
.copybtn.ok { background: var(--green); }
.sharebtn { width: 52px; height: 52px; flex: none; border-radius: 14px; border: 2.5px solid var(--ink); background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.waitcard { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; border: 2.5px dashed var(--ink); }
.waitcard .wbox { width: 48px; height: 48px; border-radius: 14px; border: 2.5px dashed var(--ink); flex: none; }
.joinedcard { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; border: 3px solid var(--ink); background: #fff; }
.avatar { width: 48px; height: 48px; border-radius: 14px; border: 2.5px solid var(--ink); flex: none; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 22px; }
.avatar.red { background: var(--red); }
.okdot { width: 30px; height: 30px; border-radius: 50%; background: var(--green); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; flex: none; }
.dashbox { width: 100%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; border-radius: 16px; border: 2.5px dashed var(--ink); text-align: center; }

/* 7 Geheime Person */
.sechead { padding: 22px 20px 0; display: flex; flex-direction: column; gap: 8px; text-align: center; align-items: center; }
.pill { padding: 4px 12px; border-radius: 10px; background: var(--ink); color: var(--yel); font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.sgrid { max-width: 560px; margin: 0 auto; display: grid; gap: 6px; }
.spick { padding: 2px; border-radius: 10px; border: 2px solid rgba(30, 27, 46, .25); background: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; color: var(--ink); }
.spick .ph { border-radius: 7px; }
.spick.sel { border: 3px solid var(--ink); background: var(--red); color: #fff; }
.sname { font-size: 11px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph.gem { width: 130px; border-radius: 18px; border: 3px solid var(--red); outline: 3px solid var(--ink); }

/* Startwurf und Spielende */
.endlike { padding: 28px 20px calc(20px + var(--safe-b)); }
.endmid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; width: 100%; max-width: 480px; margin: 0 auto; }
.endbtns { width: 100%; max-width: 480px; margin: 24px auto 0; display: flex; flex-direction: column; gap: 10px; }
.rollpair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; max-width: 360px; }
.rollcard { border: 3px solid var(--ink); border-radius: 20px; padding: 10px 10px 14px; box-shadow: 0 5px 0 var(--ink); color: #fff; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rollcard.red { background: var(--red); transform: rotate(-2deg); }
.rollcard.blue { background: var(--blue); transform: rotate(2deg); }
.rlabel { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.die {
  width: 96px; height: 96px; border-radius: 18px; background: #fff; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink);
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 12px; gap: 4px;
}
.die i { border-radius: 50%; }
.die i.on { background: var(--ink); }
.die.empty { display: flex; align-items: center; justify-content: center; background: var(--yel-l); border-style: dashed; box-shadow: none; }
.die.empty span { font-family: var(--display); font-weight: 800; font-size: 44px; color: var(--yel-b); }
.banner { padding: 12px 26px; border-radius: 20px; background: var(--yel); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink); transform: rotate(-3deg); }
.banner.blue { background: var(--blue); color: #fff; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; width: 100%; }
.secretcard { border: 3px solid var(--ink); border-radius: 20px; padding: 8px; box-shadow: 0 5px 0 var(--ink); color: #fff; }
.secretcard .eyebrow { color: #fff; font-size: 12px; padding: 2px 0 6px; }
.secretcard .ph { border-radius: 13px; border: 2.5px solid var(--ink); }
.secretcard.red { background: var(--red); transform: rotate(-2deg); }
.secretcard.blue { background: var(--blue); transform: rotate(2deg); }
.stat { background: #fff; border: 2.5px solid var(--ink); border-radius: 16px; padding: 10px 4px; }

/* 8 Spielfeld */
.ghead { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px; }
.mysecret { display: flex; align-items: center; gap: 7px; padding: 3px 9px 3px 3px; background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 0 3px 0 var(--ink); cursor: pointer; flex: none; max-width: 40%; }
.mysecret .ph { width: 40px; height: 40px; border-radius: 10px; border: 2.5px solid var(--red); flex: none; }
.mysecret > div:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gmid { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.turnpill { padding: 7px 14px; border-radius: 12px; background: var(--red); color: #fff; border: 2.5px solid var(--ink); font-family: var(--display); font-weight: 800; font-size: 17px; white-space: nowrap; }
.turnpill.blue { background: var(--blue); }
.gleft { text-align: right; line-height: 1; flex: none; min-width: 62px; }
.board { max-width: 640px; margin: 0 auto; background: var(--red); border: 3px solid var(--ink); border-radius: 20px; box-shadow: 0 5px 0 var(--ink); display: grid; }
.tile { perspective: 500px; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; min-width: 0; border-radius: 9px; outline: 0 solid transparent; outline-offset: 1px; }
.tile.guessable { outline: 3px solid var(--yel); }
.tile .flip { position: relative; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.34, 1.45, .55, 1); }
.tile.flipped .flip { transform: rotateX(180deg); }
.tile .front { backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #fff; border: 2px solid var(--ink); border-radius: 8px; padding: 2px; }
.tile .fname { font-weight: 800; text-align: center; padding: 2px 1px 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }
.tile .rev {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; transform: rotateX(180deg);
  border: 2px solid var(--ink); border-radius: 8px; background: repeating-linear-gradient(45deg, var(--red3) 0 6px, var(--red2) 6px 12px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.tile .rev .q { font-family: var(--display); font-weight: 800; color: var(--yel); line-height: 1; }
.tile .rev .bname { font-weight: 700; color: rgba(255, 255, 255, .8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 2px; }
.panel {
  flex: 1; width: 100%; max-width: 640px; margin: 0 auto; background: #fff; border: 3px solid var(--ink); border-bottom: none;
  border-radius: 24px 24px 0 0; padding: 16px 16px calc(16px + var(--safe-b)); display: flex; flex-direction: column; gap: 12px;
}
.modal.z70 { z-index: 70; padding: 24px; }
.modal.z80 { z-index: 80; background: rgba(30, 27, 46, .75); }
.modal.bottom { align-items: flex-end; padding: 16px 16px calc(16px + var(--safe-b)); }
.card.white { background: #fff; }
.pv-card { max-width: 340px; padding: 12px; }
.ph.big { width: 100%; border-radius: 18px; border: 2.5px solid var(--ink); }
.redcard { max-width: 320px; background: var(--red); color: #fff; padding: 12px; gap: 8px; }
.ph.gem2 { width: 150px; border-radius: 18px; border: 3px solid var(--ink); }
.warnbox { width: 100%; padding: 10px 12px; border-radius: 14px; background: var(--red-l); border: 2.5px solid var(--red); font-size: 15px; font-weight: 700; color: var(--warn); }
.holdbtn {
  position: relative; width: 100%; height: 68px; border-radius: 18px; background: #fff; border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink);
  overflow: hidden; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; padding: 0;
}
.holdbtn .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--yel); }
.holdbtn .hl { position: relative; font-size: 19px; }
.ghost { height: 50px; border-radius: 14px; border: 2.5px solid var(--ink); background: transparent; font-weight: 800; font-size: 15px; cursor: pointer; }

/* 8 Spielfeld, Getrennt */
.qin { flex: 1; min-width: 0; height: 54px; border: 2.5px solid var(--ink); border-radius: 14px; padding: 0 14px; font-size: 16px; font-weight: 600; background: var(--bg); outline: none; }
.sendbtn { width: 54px; height: 54px; flex: none; border-radius: 14px; background: var(--dis); color: #fff; border: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sendbtn.on { background: var(--red); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 38px; padding: 0 13px; border-radius: 19px; border: 2px solid var(--ink); background: #fff; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
.qbox { padding: 14px; border-radius: 16px; background: var(--red-l); border: 2.5px solid var(--ink); }
.qlabel { font-size: 12px; font-weight: 800; color: var(--red3); text-transform: uppercase; letter-spacing: .04em; }
.qlabel.blue { color: var(--blue); }
.abox { width: 92px; flex: none; border-radius: 16px; border: 3px solid var(--ink); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.abox.yes { background: var(--green); }
.abox.no { background: var(--red); }
.oppq { flex: 1; padding: 12px 14px; border-radius: 16px; background: var(--blue-l); border: 2.5px solid var(--ink); }
.ph.mine64 { width: 64px; border-radius: 14px; border: 3px solid var(--red); }
.hist { border-top: 2px solid rgba(30, 27, 46, .12); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.morebtn { height: 32px; padding: 0 10px; border: none; background: transparent; font-weight: 800; font-size: 14px; color: var(--blue); cursor: pointer; }
.hrow { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.hini { flex: none; width: 22px; height: 22px; border-radius: 7px; background: var(--red); color: #fff; border: 1.5px solid var(--ink); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.hini.blue { background: var(--blue); }
.hq { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ha { flex: none; font-weight: 800; }
.ha.yes { color: var(--green); }
.ha.no { color: var(--red); }
.hrow.big { gap: 10px; padding: 10px 0; border-bottom: 2px solid rgba(30, 27, 46, .08); }
.hrow.big .hini { width: 28px; height: 28px; border-radius: 8px; border-width: 2px; font-size: 13px; }
.hrow.big .hq { white-space: normal; font-size: 15px; }
.hrow.big .ha { font-size: 16px; }
.overlay.z70 { z-index: 70; }

/* 10 Tableau bearbeiten */
.edhead { padding: 6px 16px 0; display: flex; flex-direction: column; gap: 10px; max-width: 640px; margin: 0 auto; }
.eg { height: 46px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 17px; cursor: pointer; }
.eg.on { background: var(--red); color: #fff; }
.enote { padding: 9px 12px; border-radius: 12px; border: 2px solid var(--ink); background: var(--yel); font-weight: 700; font-size: 14px; }
.enote.ok { background: var(--green); color: #fff; }
.edbody { padding: 16px; display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 640px; margin: 0 auto; }
.eslot { position: relative; min-width: 0; display: flex; flex-direction: column; }
.eface { flex: 1; background: #fff; border: 2px solid var(--ink); border-radius: 8px; padding: 2px; cursor: grab; user-select: none; -webkit-user-select: none; outline: 0 solid transparent; outline-offset: 1px; }
.eface.target { cursor: pointer; outline: 3px solid var(--yel); }
.eface.fresh { background: var(--yel-l); }
.ebtns { position: absolute; left: 0; right: 0; bottom: 0; height: 60%; display: grid; grid-template-columns: 1fr 1fr; }
.ebtns button { border: none; background: transparent; display: flex; align-items: flex-end; justify-content: center; cursor: pointer; padding: 0; }
.ecirc { border-radius: 50%; border: 2px solid var(--ink); background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 0 var(--ink); }
.ecirc.yel { background: var(--yel); }
.ename { font-weight: 800; text-align: center; padding: 2px 1px 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; pointer-events: none; }
.ename.missing, .bname.missing { color: var(--red3); }
.eempty {
  flex: 1; width: 100%; min-height: 100%; aspect-ratio: 1 / 1.22; padding: 0; border: 2.5px dashed #fff; border-radius: 8px;
  background: rgba(255, 255, 255, .14); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; font-family: var(--display); font-weight: 800;
}
.eempty.sel { background: rgba(255, 201, 60, .55); }
.benchbox { margin-top: 8px; padding: 12px; border-radius: 18px; border: 2.5px dashed var(--ink); background: rgba(255, 255, 255, .5); display: flex; flex-direction: column; gap: 10px; }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; }
.bslot { position: relative; min-width: 0; }
.bface { background: #fff; border: 2.5px solid var(--ink); border-radius: 10px; padding: 2px; cursor: grab; user-select: none; -webkit-user-select: none; box-shadow: 0 3px 0 var(--ink); }
.bface .ph { border-radius: 7px; }
.bface.sel { border-width: 3px; box-shadow: 0 0 0 4px var(--yel); }
.bname { font-size: 12px; font-weight: 800; text-align: center; padding: 2px 1px 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.btrash { position: absolute; right: -5px; top: -5px; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid var(--ink); background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 0 var(--ink); }
.bconfirm { position: absolute; inset: 0; border-radius: 10px; border: 2.5px solid var(--ink); background: var(--red); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 4px; text-align: center; }
.bdel { height: 30px; width: 100%; border-radius: 8px; border: 2px solid var(--ink); background: #fff; color: var(--red); font-weight: 800; font-size: 13px; cursor: pointer; }
.bkeep { height: 24px; border: none; background: transparent; color: #fff; font-weight: 800; font-size: 12px; cursor: pointer; text-decoration: underline; }
.newp { min-height: 96px; border-radius: 10px; border: 2.5px dashed var(--ink); background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; font-weight: 800; font-size: 12px; }
.delbtn { margin-top: 12px; height: 50px; border-radius: 14px; border: 2.5px solid var(--red); background: transparent; color: var(--red); font-weight: 800; font-size: 15px; cursor: pointer; }
.delbtn.on { background: var(--red); color: #fff; }
.ph.bigp { width: 150px; border-radius: 20px; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); overflow: hidden; }
.pname { width: 100%; height: 58px; border-radius: 16px; border: 3px solid var(--ink); background: #fff; text-align: center; font-family: var(--display); font-size: 24px; font-weight: 800; outline: none; }
.bpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.bp { padding: 2px; border: 2.5px solid var(--ink); border-radius: 10px; background: #fff; cursor: pointer; min-width: 0; box-shadow: 0 3px 0 var(--ink); }
.bp .ph { border-radius: 7px; }
label.btn { cursor: pointer; }
.eboard { width: 100%; }
.eface .ph { overflow: visible; }
.eface .ph > img { border-radius: 5px; }
.dock.narrow .off { background: var(--bg); }
