/* ==========================================================================
   Sky Score – Stylesheet
   Aufbau: 1) Tokens  2) Basis  3) Layout  4) Buttons  5) Screens  6) Overlays
   ========================================================================== */

/* 1) Tokens ---------------------------------------------------------------- */
:root {
  --bg: #FBF7F0;
  --card: #ffffff;
  --ink: #23212B;
  --ink-2: #4A4757;
  --muted: #5D5A69;
  --muted-2: #6C6879;
  --muted-3: #8A8695;
  --muted-4: #9A96A5;

  --teal: #14B8A6;
  --teal-d: #0F9C8E;
  --teal-dd: #0B7A70;
  --coral: #FB6B5B;
  --coral-d: #D9432F;
  --coral-dd: #B93A28;
  --violet: #8B5CF6;
  --blue: #3B82F6;
  --disabled: #C9C5D2;

  --grad: linear-gradient(135deg, #14B8A6, #3B82F6);
  --line: rgba(35, 33, 43, .07);
  --soft: rgba(35, 33, 43, .05);
  --soft-2: rgba(35, 33, 43, .1);
  --soft-3: rgba(35, 33, 43, .16);

  --display: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;
  --body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  --shell: 560px;
  --gutter: 22px;
  --bounce: cubic-bezier(.34, 1.56, .64, 1);

  /* Safe-Area (iPhone Notch / Dynamic Island / Home-Indikator) */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

/* 2) Basis ----------------------------------------------------------------- */
* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; background: var(--bg);
  /* Kein seitliches Scrollen, kein Überschwingen zur Seite – fühlt sich wie eine App an.
     `clip` statt `hidden`, damit position:sticky im Spiel-Header weiter funktioniert. */
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
}

body {
  font-family: var(--body);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  text-wrap: pretty;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100vw;
  /* Nur vertikales Scrollen zulassen: unterbindet Pinch-Zoom und Doppeltipp-Zoom,
     Runterscrollen (z. B. bei 8 Spielern) bleibt vollständig erhalten. */
  touch-action: pan-y;
}

/* Scroll-Container dürfen intern weiter frei scrollen */
.sheet, .modal { touch-action: pan-y; overscroll-behavior: contain; }

input, button, textarea { font-family: inherit; }
button { cursor: pointer; }
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

:focus-visible { outline: 3px solid rgba(20, 184, 166, .55); outline-offset: 2px; }

.display { font-family: var(--display); font-weight: 800; letter-spacing: -.025em; margin: 0; }
.display--xl { font-size: 52px; letter-spacing: -.03em; line-height: 1; }
.display--lg { font-size: 36px; }
.display--md { font-size: 30px; line-height: 1.05; }
.display--sm { font-size: 22px; letter-spacing: -.02em; }

.lead { margin: 0; font-size: 15px; font-weight: 500; color: var(--muted-2); }
.hint { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--muted-3); line-height: 1.5; }
.label {
  font-size: 12px; font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted-4); margin-bottom: 10px;
}
.legal { margin: 28px 0 0; text-align: center; font-size: 11px; line-height: 1.6; color: var(--muted-4); }

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack--xs { gap: 8px; }
.stack--sm { gap: 12px; }
.stack--md { gap: 14px; }
.stack--lg { gap: 22px; }

[hidden] { display: none !important; }

/* Animationen */
@keyframes drift { 0% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(6%,-4%,0) scale(1.12); } 100% { transform: translate3d(0,0,0) scale(1); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.86); } 60% { transform: scale(1.03); } 100% { opacity: 1; transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  15% { transform: translateX(-9px) rotate(-2deg); }
  30% { transform: translateX(8px) rotate(2deg); }
  45% { transform: translateX(-6px) rotate(-1.5deg); }
  60% { transform: translateX(5px) rotate(1deg); }
  80% { transform: translateX(-2px) rotate(0); }
}
@keyframes confettiFall { 0% { opacity: 0; transform: translateY(-40px) rotate(0); } 10% { opacity: 1; } 100% { opacity: 0; transform: translateY(520px) rotate(720deg); } }
@keyframes sheetUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes countPulse { 0% { transform: scale(1); } 45% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* 3) Layout ---------------------------------------------------------------- */
.bg-blobs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; display: block; }
.blob--teal {
  top: -14%; left: -18%; width: 70vw; height: 70vw; max-width: 520px; max-height: 520px;
  background: radial-gradient(circle, rgba(20,184,166,.34), rgba(20,184,166,0) 68%);
  animation: drift 17s ease-in-out infinite;
}
.blob--coral {
  top: 22%; right: -24%; width: 74vw; height: 74vw; max-width: 540px; max-height: 540px;
  background: radial-gradient(circle, rgba(251,107,91,.3), rgba(251,107,91,0) 68%);
  animation: drift 21s ease-in-out infinite reverse;
}
.blob--violet {
  bottom: -18%; left: 6%; width: 66vw; height: 66vw; max-width: 480px; max-height: 480px;
  background: radial-gradient(circle, rgba(139,92,246,.26), rgba(139,92,246,0) 68%);
  animation: drift 25s ease-in-out infinite;
}

.app { position: relative; z-index: 1; }

/* Die Einblend-Animation läuft bewusst auf den Inhalten, nicht auf `.screen`:
   ein zurückbleibender `transform` würde sonst zum Bezugsrahmen für die
   fixierten Leisten und diese aus dem sichtbaren Bereich schieben. */
.screen > .wrap,
.screen > .ghead { animation: riseIn .35s ease; }

.wrap {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 26px calc(var(--gutter) + var(--sar)) 40px calc(var(--gutter) + var(--sal));
  padding-top: calc(26px + var(--sat));
}
.wrap--center {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding-top: calc(40px + var(--sat));
  padding-bottom: calc(32px + var(--sab));
}
.wrap--pad-bottom { padding-bottom: calc(150px + var(--sab)); }
.wrap--board { padding-top: calc(34px + var(--sat)); padding-bottom: calc(40px + var(--sab)); position: relative; }

.sticky-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
  padding: 16px calc(var(--gutter) + var(--sar)) calc(22px + var(--sab)) calc(var(--gutter) + var(--sal));
  background: linear-gradient(to top, var(--bg) 62%, rgba(251, 247, 240, 0));
  pointer-events: none;
}
.sticky-bar__inner { max-width: 516px; margin: 0 auto; pointer-events: auto; }

/* 4) Buttons --------------------------------------------------------------- */
.btn {
  width: 100%; border: none; border-radius: 22px; padding: 20px;
  font-size: 19px; font-weight: 800; color: #fff;
  transition: transform .16s var(--bounce), background .2s ease, opacity .2s ease, border-color .2s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { cursor: not-allowed; }

.btn--primary { background: var(--grad); box-shadow: 0 14px 30px -12px rgba(20, 184, 166, .95); }
.btn--primary:hover:not(:disabled) { transform: translateY(-2px); }
.btn--primary:disabled { background: var(--disabled); box-shadow: none; opacity: .75; }
.btn--primary:disabled:hover { transform: none; }

.btn--outline {
  border: 2px solid rgba(35, 33, 43, .12); background: var(--card); color: var(--ink);
  padding: 16px; font-size: 17px; font-weight: 700; border-radius: 22px;
}
.btn--outline:hover { border-color: rgba(35, 33, 43, .24); }

.btn--dashed {
  margin-top: 14px; border: 2px dashed var(--soft-3); background: transparent;
  color: var(--ink-2); padding: 16px; font-size: 16px; font-weight: 700; border-radius: 22px;
}
.btn--dashed:hover { border-color: rgba(20, 184, 166, .6); color: var(--teal-d); }
.btn--dashed:active { transform: scale(.98); }

.btn--quiet { background: transparent; color: var(--muted-3); font-size: 14px; font-weight: 700; padding: 14px; }
.btn--quiet:hover { color: var(--ink); }

.btn--danger {
  background: rgba(251, 107, 91, .12); color: var(--coral-dd);
  padding: 15px; font-size: 15px; font-weight: 800; border-radius: 18px; box-shadow: none;
}
.btn--danger:hover { background: rgba(251, 107, 91, .2); }

.btn--solid-danger { background: var(--coral); color: #fff; box-shadow: 0 14px 30px -14px rgba(251, 107, 91, .9); border-radius: 20px; padding: 17px; font-size: 17px; }

.btn--modal { margin-top: 18px; border-radius: 20px; padding: 18px; font-size: 17px; }
.btn--compact { width: auto; padding: 11px 16px; font-size: 14px; border-radius: 14px; margin-top: 10px; }
.btn--half { flex: 1; padding: 15px; font-size: 15px; border-radius: 20px; }
.btn-row { display: flex; gap: 10px; }

.pill {
  border: none; background: var(--soft); border-radius: 999px;
  padding: 11px 18px; font-size: 14px; font-weight: 700; color: var(--ink-2);
  transition: background .18s ease, transform .16s var(--bounce);
}
.pill:hover { background: var(--soft-2); }
.pill:active { transform: scale(.96); }
.pill--back { padding: 10px 16px; margin-bottom: 22px; }
.pill--tight { border-radius: 14px; font-size: 13px; font-weight: 800; padding: 11px 14px; }

.icon-btn {
  width: 42px; height: 42px; flex: 0 0 auto; border: none; border-radius: 14px;
  background: var(--soft); color: var(--ink-2); font-size: 17px; font-weight: 800;
  transition: background .18s ease;
}
.icon-btn:hover { background: var(--soft-2); }

/* 5) Screens --------------------------------------------------------------- */

/* 5.1 Start */
.start-stack {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  align-items: center; gap: 34px; animation: riseIn .5s ease;
}
.logo-cards { display: flex; align-items: flex-end; justify-content: center; height: 104px; }
.logo-card {
  display: grid; place-items: center; color: #fff;
  font-family: var(--display); font-weight: 800;
}
.logo-card--left {
  width: 64px; height: 88px; border-radius: 16px; background: var(--violet); font-size: 30px;
  transform: rotate(-13deg) translateX(16px); box-shadow: 0 14px 26px -14px rgba(139, 92, 246, .9);
}
.logo-card--mid {
  width: 70px; height: 98px; border-radius: 18px; background: var(--teal); font-size: 34px;
  position: relative; z-index: 2; box-shadow: 0 16px 30px -14px rgba(20, 184, 166, .95);
}
.logo-card--right {
  width: 64px; height: 88px; border-radius: 16px; background: var(--coral); font-size: 30px;
  transform: rotate(13deg) translateX(-16px); box-shadow: 0 14px 26px -14px rgba(251, 107, 91, .9);
}
.logo-card--mini { width: 44px; height: 60px; border-radius: 13px; background: var(--teal); font-size: 22px; }

.start-titles { text-align: center; display: flex; flex-direction: column; gap: 12px; }
.claim { margin: 0; font-size: 18px; font-weight: 600; color: var(--muted-2); }

.start-actions { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.resume-label { margin: 0; text-align: center; font-size: 13px; font-weight: 600; color: var(--muted-3); }
.pill-row { display: flex; gap: 10px; justify-content: center; padding-top: 6px; flex-wrap: wrap; }

/* 5.2 Setup */
.setup-rows { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.setup-row {
  display: flex; align-items: center; gap: 10px; background: var(--card);
  border-radius: 22px; border: 1px solid var(--line);
  box-shadow: 0 12px 28px -22px rgba(35, 33, 43, .9); padding: 10px 12px;
  transition: opacity .18s ease, transform .18s ease;
  animation: popIn .25s ease;
}
.setup-row--dragging { opacity: .4; }
.setup-row--over { transform: scale(1.015); border-color: rgba(20, 184, 166, .5); }

.avatar {
  width: 46px; height: 46px; flex: 0 0 auto; border-radius: 16px;
  display: grid; place-items: center; font-size: 20px; color: #fff;
}
.avatar--sm { width: 38px; height: 38px; border-radius: 13px; font-size: 16px; }
.avatar--xs { width: 34px; height: 34px; border-radius: 12px; font-size: 16px; }

.name-input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-size: 17px; font-weight: 700; color: var(--ink); padding: 12px 4px;
}
.row-btn {
  width: 36px; height: 36px; flex: 0 0 auto; border: none; border-radius: 12px;
  background: var(--soft); color: var(--ink-2); font-size: 15px; font-weight: 800;
  transition: background .18s ease;
}
.row-btn:hover { background: var(--soft-2); }
.row-btn--del { background: rgba(251, 107, 91, .12); color: var(--coral-d); }
.row-btn--del:hover { background: rgba(251, 107, 91, .22); }
.row-btn:disabled { opacity: .35; cursor: not-allowed; }

.error-box {
  margin: 16px 0 0; background: rgba(251, 107, 91, .12); border-radius: 16px;
  padding: 14px 16px; font-size: 14px; font-weight: 700; color: var(--coral-dd);
  animation: popIn .22s ease;
}

/* 5.3 Spiel */
.ghead {
  position: sticky; top: 0; z-index: 10;
  padding: calc(18px + var(--sat)) calc(var(--gutter) + var(--sar)) 14px calc(var(--gutter) + var(--sal));
  background: rgba(251, 247, 240, .88);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  max-width: var(--shell); margin: 0 auto;
}
.ghead__row { display: flex; align-items: center; gap: 12px; }
.ghead__title { flex: 1; min-width: 0; }
.ghead__sub { font-size: 13px; font-weight: 700; color: var(--muted-3); margin-top: 3px; }

.progress { margin-top: 12px; height: 6px; border-radius: 999px; background: rgba(35, 33, 43, .08); overflow: hidden; }
.progress__bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #14B8A6, #3B82F6); width: 0; transition: width .5s cubic-bezier(.34, 1.4, .64, 1); }

.standings { margin-top: 14px; display: flex; flex-direction: column; gap: 7px; animation: fadeIn .2s ease; }
.standings__row { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; }
.standings__rank { width: 18px; color: var(--muted-4); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.ellip { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { font-family: var(--display); font-weight: 800; }

.screen--game .wrap { padding-top: 18px; }

.pcard {
  background: var(--card); border-radius: 26px; border: 2px solid var(--line);
  box-shadow: 0 16px 34px -26px rgba(35, 33, 43, .95);
  padding: 16px; display: flex; flex-direction: column; gap: 13px;
  transition: border-color .2s ease, transform .2s ease;
  animation: riseIn .35s ease;
}
.pcard__head { display: flex; align-items: center; gap: 12px; }
.pcard__meta { flex: 1; min-width: 0; }
.pcard__name {
  font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pcard__total { font-size: 13px; font-weight: 700; color: var(--muted-3); }
.pcard__total .num { display: inline-block; }
.num--bump { display: inline-block; animation: countPulse .45s var(--bounce); }
.pcard__flag {
  flex: 0 0 auto; font-size: 12px; font-weight: 800; color: var(--teal-d);
  background: rgba(20, 184, 166, .12); border-radius: 999px; padding: 8px 12px;
  animation: popIn .25s ease;
}
.pcard__inputs { display: flex; gap: 10px; }
.stepper {
  width: 56px; flex: 0 0 auto; border: none; border-radius: 18px;
  background: rgba(35, 33, 43, .06); color: var(--ink);
  font-size: 24px; font-weight: 800; min-height: 56px; transition: transform .14s, background .18s;
}
.stepper:hover { background: rgba(35, 33, 43, .11); }
.stepper:active { transform: scale(.92); }
.score-input {
  flex: 1; min-width: 0; text-align: center; border: 2px solid rgba(35, 33, 43, .09);
  border-radius: 18px; outline: none; background: #FBF9F5;
  font-family: var(--display); font-size: 26px; font-weight: 800; color: var(--ink); padding: 12px;
  transition: border-color .18s ease, background .18s ease;
}
.score-input:focus { border-color: var(--teal); background: #fff; }
.pick-btn {
  width: 100%; border: 2px solid var(--soft-2); border-radius: 18px; padding: 13px;
  font-size: 14px; font-weight: 800; color: var(--muted-2); background: transparent;
  min-height: 48px; transition: transform .14s, background .2s ease, color .2s ease, border-color .2s ease;
}
.pick-btn:active { transform: scale(.98); }

/* 5.4 Scoreboard */
.board__head { text-align: center; margin-bottom: 4px; animation: riseIn .4s ease; }
.board__sub { margin: 0 0 24px; text-align: center; font-size: 15px; font-weight: 600; color: var(--muted-3); }

.winner {
  position: relative; background: var(--card); border-radius: 30px; border: 2px solid var(--teal);
  box-shadow: 0 26px 50px -30px rgba(35, 33, 43, .95);
  padding: 28px 22px; text-align: center;
  animation: popIn .45s var(--bounce);
}
.winner__crown { font-size: 26px; margin-bottom: 6px; }
.winner__avatar {
  width: 70px; height: 70px; margin: 0 auto 14px; border-radius: 24px;
  display: grid; place-items: center; font-size: 30px; color: #fff; background: var(--teal);
}
.winner__text { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -.02em; line-height: 1.2; }
.winner__score {
  margin-top: 10px; display: inline-block; font-family: var(--display); font-weight: 800;
  font-size: 15px; background: var(--soft); border-radius: 999px; padding: 8px 16px;
}

.rank-list {
  margin-top: 16px; background: var(--card); border-radius: 26px; border: 1px solid var(--line);
  box-shadow: 0 16px 34px -28px rgba(35, 33, 43, .95); padding: 8px 6px;
}
.rank-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 20px;
  animation: riseIn .35s ease;
}
.rank-row--win { background: rgba(20, 184, 166, .09); }
.rank-row__pos { width: 26px; font-family: var(--display); font-weight: 800; font-size: 17px; color: var(--muted-4); }
.rank-row__name { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row__total { font-family: var(--display); font-weight: 800; font-size: 19px; }

.section-head { margin: 30px 0 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat {
  background: var(--card); border-radius: 20px; border: 1px solid var(--line);
  padding: 14px 15px; display: flex; flex-direction: column; gap: 4px;
  animation: riseIn .3s ease;
}
.stat__label { font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted-4); }
.stat__value { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.stat__sub { font-size: 12px; font-weight: 600; color: var(--muted-3); }

.award {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border-radius: 20px; border: 1px solid var(--line); padding: 14px 15px;
  animation: riseIn .3s ease;
}
.award__title { font-size: 15px; font-weight: 800; }
.award__sub { font-size: 12.5px; font-weight: 600; color: var(--muted-3); }

.board__actions { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; }

/* 6) Overlays -------------------------------------------------------------- */
.overlay { position: fixed; inset: 0; z-index: 65; animation: fadeIn .18s ease; display: flex; }
.overlay--center {
  z-index: 70; background: rgba(35, 33, 43, .5);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
  padding: calc(20px + var(--sat)) 20px calc(20px + var(--sab));
}
.overlay--bottom {
  /* über dem Ergebnis-Pop-up, damit Sicherheitsabfragen von dort aus sichtbar sind */
  z-index: 76;
  background: rgba(35, 33, 43, .45);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  align-items: flex-end; justify-content: center;
}

.modal {
  position: relative; width: 100%; max-width: 440px; background: var(--card);
  border-radius: 30px; padding: 28px 22px 24px; max-height: 90vh; overflow: auto;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6);
  animation: popIn .35s var(--bounce);
}
.modal--shake { animation: shake .55s ease .05s, popIn .3s var(--bounce); }
.modal__head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.modal__avatar {
  width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center;
  font-size: 28px; color: #fff; background: var(--teal);
}
.modal__headline { margin: 0; font-size: 17px; font-weight: 700; color: var(--ink); }
.modal__detail { margin: 2px 0 0; font-size: 14px; font-weight: 600; color: var(--muted-3); line-height: 1.5; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 999px;
  padding: 10px 18px; font-family: var(--display); font-weight: 800; font-size: 20px;
  background: rgba(20, 184, 166, .14); color: var(--teal-dd);
}
.chip--warn { background: rgba(251, 107, 91, .14); color: var(--coral-dd); }

.result-rows {
  margin-top: 22px; border-top: 1px solid rgba(35, 33, 43, .08);
  padding-top: 14px; display: flex; flex-direction: column; gap: 2px;
}
.result-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; font-size: 15px; font-weight: 700; }
.result-row__pos { width: 22px; color: var(--muted-4); }
.mark { font-size: 12px; font-weight: 800; color: var(--coral-d); }

.sheet {
  width: 100%; max-width: var(--shell); background: var(--card);
  border-radius: 30px 30px 0 0; padding: 22px calc(var(--gutter) + var(--sar)) calc(30px + var(--sab)) calc(var(--gutter) + var(--sal));
  max-height: 88vh; max-height: 88dvh; overflow: auto;
  animation: sheetUp .26s cubic-bezier(.34, 1.4, .64, 1);
}
.sheet__handle { width: 44px; height: 5px; border-radius: 999px; background: rgba(35, 33, 43, .14); margin: 0 auto 18px; }
.sheet__sub { margin: 4px 0 18px; font-size: 14.5px; font-weight: 600; color: var(--muted-3); line-height: 1.55; }
.sheet__sub:empty { margin: 0 0 14px; }

.menu-item {
  width: 100%; text-align: left; border: none; border-radius: 18px;
  background: rgba(35, 33, 43, .04); padding: 16px 18px;
  font-size: 16px; font-weight: 700; color: var(--ink); transition: background .18s ease;
}
.menu-item:hover { background: rgba(35, 33, 43, .09); }
.menu-item--danger { color: var(--coral-dd); }

.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-btn {
  border: 2px solid var(--soft-2); background: var(--card); border-radius: 20px;
  padding: 16px 14px; text-align: left; transition: transform .14s, border-color .2s, background .2s;
  display: flex; flex-direction: column; gap: 2px;
}
.mode-btn:active { transform: scale(.98); }
.mode-btn__title { font-family: var(--display); font-weight: 800; font-size: 17px; color: var(--ink); }
.mode-btn__sub { font-size: 12.5px; font-weight: 600; color: var(--muted-3); }
.mode-btn.is-active { border-color: var(--teal); background: rgba(20, 184, 166, .1); }
.mode-btn.is-active .mode-btn__title { color: var(--teal-dd); }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn {
  border: 2px solid var(--soft-2); background: var(--card); color: var(--muted);
  border-radius: 999px; padding: 12px 20px; font-size: 15px; font-weight: 800; min-width: 60px;
  transition: border-color .2s, background .2s, color .2s, transform .14s;
}
.chip-btn:active { transform: scale(.96); }
.chip-btn.is-active { border-color: var(--teal); background: rgba(20, 184, 166, .12); color: var(--teal-dd); }

.toggle {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  border: none; border-radius: 18px; background: rgba(35, 33, 43, .04); padding: 15px 18px;
  transition: background .18s ease;
}
.toggle:hover { background: rgba(35, 33, 43, .08); }
.toggle__text { flex: 1; min-width: 0; }
.toggle__label { display: block; font-size: 15.5px; font-weight: 700; }
.toggle__sub { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted-3); }
.toggle__track {
  width: 50px; height: 30px; flex: 0 0 auto; border-radius: 999px;
  background: var(--soft-3); position: relative; transition: background .2s;
}
.toggle__knob {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
  transition: left .2s cubic-bezier(.34, 1.4, .64, 1);
}
.toggle[aria-checked="true"] .toggle__track { background: var(--teal); }
.toggle[aria-checked="true"] .toggle__knob { left: 23px; }

.hcard { border: 1px solid rgba(35, 33, 43, .08); border-radius: 22px; padding: 14px 16px; }
.hcard__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.hcard__title { flex: 1; font-family: var(--display); font-weight: 800; font-size: 17px; }
.hcard__edit {
  border: none; border-radius: 12px; background: var(--soft); color: var(--ink-2);
  font-size: 13px; font-weight: 800; padding: 9px 13px; transition: background .18s;
}
.hcard__edit:hover { background: var(--soft-2); }
.hrow { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 14.5px; font-weight: 700; }
.dot--sm { width: 9px; height: 9px; }

.edit-row {
  display: flex; align-items: center; gap: 10px; border: 2px solid rgba(35, 33, 43, .09);
  border-radius: 20px; padding: 10px 12px; transition: border-color .2s;
}
.edit-row__name { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-row__pick {
  border: 2px solid var(--soft-2); border-radius: 12px; background: transparent;
  color: var(--muted-3); font-size: 12px; font-weight: 800; padding: 9px 11px; transition: all .2s;
}
.edit-row__input {
  width: 74px; flex: 0 0 auto; text-align: center; border: 2px solid rgba(35, 33, 43, .09);
  border-radius: 14px; outline: none; background: #FBF9F5;
  font-family: var(--display); font-size: 19px; font-weight: 800; padding: 10px 6px;
}
.edit-row__input:focus { border-color: var(--teal); background: #fff; }

.text-block__head { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.text-block__body { margin: 0; font-size: 14.5px; font-weight: 500; color: var(--muted); line-height: 1.6; }

/* Install-Hinweis */
.sheet--install { max-width: 480px; }
.install__top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.install__icon { flex: 0 0 auto; }
.install__sub { margin: 4px 0 0; font-size: 14px; font-weight: 600; color: var(--muted-3); line-height: 1.5; }
.install-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.install-steps li { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.install-steps__num {
  width: 28px; height: 28px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center;
  background: rgba(20, 184, 166, .14); color: var(--teal-dd); font-size: 14px; font-weight: 800;
}
.ios-share { color: var(--blue); vertical-align: -3px; }
.install__native { margin: 0 0 14px; font-size: 15px; font-weight: 600; color: var(--muted-3); }
.install__actions { margin-top: 20px; display: flex; flex-direction: column; gap: 6px; }

/* Toast */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(96px + var(--sab)); z-index: 80;
  background: var(--ink); color: #fff; border-radius: 999px;
  padding: 13px 22px; font-size: 14.5px; font-weight: 700;
  box-shadow: 0 16px 30px -14px rgba(0, 0, 0, .7);
  animation: popIn .22s var(--bounce);
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px);
}
.toast__undo { border: none; background: rgba(255, 255, 255, .16); color: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 800; }

/* Konfetti */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 75; }
.confetti { position: absolute; top: -30px; animation: confettiFall linear both; }

/* Responsive Feinschliff */
@media (min-width: 720px) {
  .display--xl { font-size: 60px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 360px) {
  .display--xl { font-size: 44px; }
  .display--lg { font-size: 30px; }
  .pill { padding: 10px 14px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
