/* ============================================================
   YATZY · Tactical Dice Duels — stylesheet
   Built on the Yatzy design system. Warm ivory boardgame palette,
   soft-UI elevation, coral = player, cyan = opponent & dice.
   Tokens are inlined here (no build step / external imports).
   ============================================================ */

/* —— Brand font, bundled locally ————————————————————————
   Plus Jakarta Sans is shipped with the app (assets/fonts) instead of
   loaded from Google Fonts, so the native bundle looks identical OFFLINE.
   Variable font: one woff2 per subset carries the whole 400–800 weight
   axis. We ship latin (covers DE umlauts ä/ö/ü/ß, U+0000–00FF) + latin-ext
   for accented player names. unicode-range lets the browser fetch latin-ext
   only when a glyph actually needs it. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../assets/fonts/PlusJakartaSans-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: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../assets/fonts/PlusJakartaSans-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;
}

/* —— Design tokens ———————————————————————————————— */
:root {
  /* system safe-area insets — env() on iOS/browser; on Android (targetSdk 35
     forces edge-to-edge and env() reports 0 for the system bars) MainActivity
     injects the real inset px onto <html>, overriding these defaults. */
  --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);

  /* surfaces */
  --bg: #f4efe7;
  --surface: #fbf7ef;
  --surface-soft: #f8f1e8;
  --surface-sunken: #efe7da;

  /* lines & text */
  --line: rgba(70, 60, 50, 0.16);
  --line-soft: rgba(70, 60, 50, 0.08);
  --text: #3d3a36;
  --text-strong: #2c2a27;
  --muted: #8f8980;
  --muted-soft: #b4aea4;

  /* coral — player / primary action */
  --coral: #e96f5f;
  --coral-deep: #d8584a;
  --coral-bright: #f0826f;
  --coral-soft: #f7d6cd;
  --coral-wash: #fbe8e2;
  --coral-ink: #c44a3c;

  /* sky blue — opponent / dice */
  --blue: #20a8d4;
  --blue-deep: #118bb4;
  --blue-bright: #58c4e6;
  --blue-soft: #d9eef4;
  --blue-wash: #eaf6fa;
  --blue-ink: #0f7da1;

  /* dice body */
  --dice: #2ba6d6;
  --dice-deep: #1582ad;
  --dice-shadow-edge: #0e6a90;
  --dice-gloss: #aee4f4;
  --pip: #fcfdfd;

  /* semantic */
  --gold: #e0a23c;
  --success: #46b07a;

  /* shadow — warm brown, never neutral grey */
  --shadow: rgba(70, 52, 35, 0.16);
  --shadow-soft: rgba(70, 52, 35, 0.08);
  --shadow-deep: rgba(70, 52, 35, 0.24);
  --highlight: rgba(255, 255, 255, 0.9);

  /* type */
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;

  /* motion */
  --ease-soft: cubic-bezier(0.34, 1.4, 0.5, 1);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  /* App canvas only — no darker "device on a desk" surround. */
  background: radial-gradient(135% 100% at 50% 0%, #faf3ea 0%, #f5ece0 48%, #f1e7da 100%);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 0; color: var(--text);
}
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }

/* —— App surface ————————————————————————————————
   The app fills the viewport. On a wide desktop window we cap it to a
   phone-width column for preview, but it shares the page background so it
   never reads as a framed device floating on a different canvas. */
.phone {
  position: relative; width: 100%; max-width: 412px; height: 100vh; height: 100dvh;
  overflow: hidden;
  background: radial-gradient(135% 100% at 50% 0%, #faf3ea 0%, #f5ece0 48%, #f1e7da 100%);
}
@media (min-width: 440px) {
  /* gentle desktop preview column — hairline only, no heavy shadow/contrast */
  body { padding: 0; }
  .phone { max-width: 412px; box-shadow: 0 0 0 1px rgba(120,100,78,.07); }
}
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }
.screen[hidden] { display: none; }

/* —— Shared bits ————————————————————————————————— */
.diamond { width: 6px; height: 6px; border-radius: 1px; transform: rotate(45deg); display: inline-block; }
.dim-coral { background: var(--coral); }
.dim-blue { background: var(--blue-bright); }

.label { font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

/* =====================================================================
   HOME SCREEN
   ===================================================================== */
.home { padding: 0; }
.home__top { display: flex; align-items: center; justify-content: space-between; padding: calc(20px + var(--sat)) 22px 4px; flex: none; }
.profile { display: flex; align-items: center; gap: 11px; padding: 0; }
.profile__meta { display: flex; flex-direction: column; text-align: left; line-height: 1.1; }
.profile__name { font-weight: 700; font-size: 14px; letter-spacing: .02em; color: var(--text-strong); }
.profile__edit { font-weight: 600; font-size: 8px; letter-spacing: .14em; color: var(--muted-soft); margin-top: 2px; }

/* name-edit / local-duel setup modal */
.name-card { width: 300px; }
.name-fields { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 20px; }
.name-field { text-align: left; }
.name-field label { display: block; font-weight: 600; font-size: 9.5px; letter-spacing: .14em; color: var(--muted); margin-bottom: 6px; }
.name-field input {
  width: 100%; box-sizing: border-box; font-family: var(--font); font-weight: 600; font-size: 16px; color: var(--text-strong);
  padding: 12px 14px; border-radius: 13px; border: none; background: rgba(255,255,255,.6);
  box-shadow: var(--inset); outline: none;
}
.name-field input:focus { box-shadow: var(--inset), 0 0 0 2px var(--coral); }
.name-field--p1 input:focus { box-shadow: var(--inset), 0 0 0 2px var(--coral); }
.name-field--p2 input:focus { box-shadow: var(--inset), 0 0 0 2px var(--blue); }
.home__scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; -webkit-overflow-scrolling: touch; }
.home__scroll::-webkit-scrollbar { width: 0; }
.home__section-label { font-weight: 600; font-size: 11px; letter-spacing: .2em; color: var(--muted); text-align: center; margin: 6px 0 12px; }
.home__pad { height: calc(18px + var(--sab)); flex: none; }

/* hero dice on the start screen (no reflection) */
.hero-stage { width: 320px; max-width: 86%; margin: 16px 0 8px; }
.hero-dice { width: 100%; display: block; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; padding: 2.5px; flex: none;
  background: linear-gradient(150deg, #ee8e72, #dc6347);
  box-shadow: 0 4px 11px rgba(220,99,71,.38);
}
.avatar > span {
  display: flex; width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  align-items: flex-end; justify-content: center;
  background: radial-gradient(120% 120% at 35% 25%, #f6e4d6, #e7c3ae);
}
.avatar svg { width: 100%; height: 100%; }
.avatar--blue { background: linear-gradient(150deg, #67b6e2, #3289be); box-shadow: 0 4px 10px rgba(62,155,210,.4); }
.avatar--blue > span { background: radial-gradient(120% 120% at 35% 25%, #ddebf4, #a9c7dc); }
.avatar__img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
/* —— Profilbild-Editor (im Namens-Modal) —— */
.avatar-edit { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 6px; }
.avatar--lg { width: 84px; height: 84px; padding: 3px; }
.avatar-edit__btns { display: flex; gap: 8px; }
.chip-btn {
  font-family: var(--font); font-weight: 700; font-size: 11px; letter-spacing: .06em; cursor: pointer;
  padding: 8px 14px; border-radius: 18px; border: none; color: #fff;
  background: radial-gradient(120% 120% at 35% 20%, #f0926f, #dc6044);
  box-shadow: 0 3px 8px rgba(216,95,67,.34), inset 0 1px 0 rgba(255,255,255,.4);
}
.chip-btn:active { transform: scale(.97); }
.chip-btn--ghost { color: var(--muted); background: linear-gradient(160deg, #fcf7f0, #f1e7da); box-shadow: var(--inset, inset 0 1px 0 rgba(255,255,255,.85)), 0 2px 6px rgba(120,92,66,.12); }

.icon-btn {
  width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #fcf7f0, #f1e7da);
  box-shadow: 0 6px 14px rgba(120,92,66,.16), inset 0 1px 0 rgba(255,255,255,.85);
}

/* language toggle (top-right of home) */
.lang-toggle {
  display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 22px;
  background: linear-gradient(160deg, #fcf7f0, #f1e7da);
  box-shadow: 0 6px 14px rgba(120,92,66,.16), inset 0 1px 0 rgba(255,255,255,.85);
}
.lang-opt {
  font-weight: 700; font-size: 11px; letter-spacing: .06em; color: var(--muted);
  padding: 6px 11px; border-radius: 18px; transition: color .2s, background .2s, box-shadow .2s;
}
.lang-opt--on {
  color: #fff;
  background: radial-gradient(120% 120% at 35% 20%, #f0926f, #dc6044);
  box-shadow: 0 3px 8px rgba(216,95,67,.4), inset 0 1px 0 rgba(255,255,255,.4);
}

.home__hero { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 20px 0; flex: none; }
/* Logo: STRIKE-Kicker über YATZY; Rauten symmetrisch an den Außenkanten der
   Tagline (coral linksbündig zum 'T', blue rechtsbündig zum 'S'). Die
   inline-grid-Spalte nimmt die Breite des breitesten Kindes (= Tagline) an;
   die Wortmarke streckt sich darauf und verteilt die Rauten via space-between. */
.hero-title { display: inline-grid; justify-items: stretch; }
.hero-kicker {
  font-weight: 700; font-size: 12px; letter-spacing: .46em; line-height: 1;
  color: var(--coral-ink); text-align: center; padding-left: .46em; margin-bottom: 2px;
}
.wordmark {
  font-weight: 600; font-size: 42px; letter-spacing: .32em; line-height: 1; color: #3a3633;
  display: flex; align-items: center; justify-content: space-between;
}
.wordmark__txt { margin-right: -.32em; }   /* Trailing-Letter-Spacing killen → symmetrische Raute-Abstände */
.wordmark .diamond { width: 7px; height: 7px; flex: none; }
.tagline { font-weight: 600; font-size: 12px; letter-spacing: .42em; color: var(--coral-ink); margin-top: 8px; text-align: center; }
.tagline__txt { margin-right: -.42em; }     /* Trailing-Letter-Spacing killen → Box endet exakt am 'S' */

.hero-sub { font-weight: 500; font-size: 13px; letter-spacing: .26em; color: var(--muted); margin-top: 14px; }

/* opponent selector tabs */
.opp-tabs { display: flex; gap: 8px; padding: 0 16px; margin-bottom: 8px; }
.opp-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px; border-radius: 15px;
  background: linear-gradient(160deg, #fcf7ef, #f3eadd);
  box-shadow: inset 0 0 0 1px rgba(120,100,78,.1); transition: transform .15s var(--ease-soft), box-shadow .18s;
}
.opp-tab:active { transform: scale(.97); }
.opp-tab__name { font-weight: 600; font-size: 10.5px; letter-spacing: .02em; color: var(--text); text-align: center; line-height: 1.15; }
.opp-tab__tag { font-weight: 700; font-size: 8px; letter-spacing: .1em; color: var(--muted-soft); }
.opp-tab--on { box-shadow: 0 0 0 1.8px var(--coral), 0 6px 14px rgba(216,95,67,.18); background: linear-gradient(160deg, #fdf1eb, #fae6dc); }
.opp-tab--on .opp-tab__name { color: var(--coral-ink); }
.opp-tab--on .opp-tab__tag { color: var(--coral-deep); }
.opp-tab--soon { opacity: .62; }
.opp-tab--soon.opp-tab--on { box-shadow: 0 0 0 1.8px var(--muted-soft); background: linear-gradient(160deg, #f6f1e8, #ece4d6); }
.opp-tab--soon.opp-tab--on .opp-tab__name { color: var(--muted); }

.mode-list { display: flex; flex-direction: column; gap: 11px; padding: 0 16px; }
.mode-card {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 15px; border-radius: 18px; text-align: left;
  background: linear-gradient(160deg, #fcf7ef, #f4ebdd);
  box-shadow: 0 7px 16px rgba(120,92,66,.12), inset 0 1px 0 rgba(255,255,255,.7);
  transition: transform .16s var(--ease-soft), box-shadow .18s;
}
.mode-card:active { transform: scale(.98); }
.mode-card--coral { border: 1.5px solid rgba(228,124,97,.45); }
.mode-card--blue  { border: 1px solid rgba(62,155,210,.28); }
.mode-card--gold  { border: 1px solid rgba(224,162,60,.4); }
.mode-card__icon {
  width: 50px; height: 50px; border-radius: 15px; flex: none; transform: rotate(45deg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 13px rgba(120,92,66,.25), inset 0 1px 0 rgba(255,255,255,.4);
}
.mode-card__icon svg { width: 24px; height: 24px; transform: rotate(-45deg); }
.mode-icon--coral { background: radial-gradient(120% 120% at 35% 25%, #f0926f, #da6044); box-shadow: 0 6px 13px rgba(216,95,67,.4), inset 0 1px 0 rgba(255,255,255,.4); }
.mode-icon--blue  { background: radial-gradient(120% 120% at 35% 25%, #5fb0dd, #2e86be); box-shadow: 0 6px 13px rgba(46,134,190,.4), inset 0 1px 0 rgba(255,255,255,.4); }
.mode-icon--gold  { background: radial-gradient(120% 120% at 35% 25%, #f0b65a, #e0a23c); box-shadow: 0 6px 13px rgba(200,140,40,.4), inset 0 1px 0 rgba(255,255,255,.4); }
.mode-card__body { flex: 1; min-width: 0; }
.mode-card__row { display: flex; align-items: center; gap: 8px; }
.mode-card__title { font-weight: 700; font-size: 14.5px; letter-spacing: .04em; color: var(--text-strong); }
.mode-card--coral .mode-card__title { color: var(--coral-ink); }
.mode-card__desc { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.25; }
.mode-tag { font-weight: 700; font-size: 8.5px; letter-spacing: .08em; padding: 2px 6px; border-radius: 6px; }
.mode-tag--coral { color: var(--coral-ink); background: rgba(229,121,92,.16); }
.mode-tag--blue  { color: var(--blue-ink); background: rgba(46,134,190,.14); }
.mode-tag--gold  { color: #b07e22; background: rgba(224,162,60,.18); }
.mode-card__best { flex: none; text-align: center; min-width: 40px; }
.best-num { display: block; font-weight: 700; font-size: 19px; color: var(--text-strong); line-height: 1; }
.best-lbl { display: block; font-weight: 600; font-size: 8px; letter-spacing: .12em; color: var(--muted-soft); margin-top: 3px; }

.play-btn {
  margin: 14px 16px 22px; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 15px; border-radius: 28px;
  background: radial-gradient(130% 130% at 35% 18%, #f0926f, #dc6044);
  box-shadow: 0 12px 26px rgba(216,95,67,.42), inset 0 1px 0 rgba(255,255,255,.45), inset 0 -3px 8px rgba(150,50,30,.3);
}
.play-btn:active { box-shadow: 0 4px 12px rgba(216,95,67,.4), inset 0 2px 7px rgba(140,45,30,.4); }
.play-btn__row { display: flex; align-items: center; gap: 10px; }
.play-btn__label { font-weight: 700; font-size: 16px; letter-spacing: .14em; color: #fff; }
.play-btn__sub { font-weight: 500; font-size: 9.5px; letter-spacing: .14em; color: rgba(255,255,255,.9); }

/* =====================================================================
   GAME SCREEN — header
   ===================================================================== */
.g-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(8px + var(--sat)) 14px 6px; }
.pill-player {
  display: flex; align-items: center; gap: 9px; padding: 6px 14px 6px 6px; border-radius: 26px;
  background: linear-gradient(160deg, #fcf7f0, #f3eadd);
  box-shadow: 0 6px 14px rgba(120,92,66,.16), inset 0 1px 0 rgba(255,255,255,.85);
}
.pill-player .avatar { width: 42px; height: 42px; flex-shrink: 0; }
.pill-player__name { font-weight: 600; font-size: 12px; letter-spacing: .16em; }
/* A long name must not blow the header apart. Both pills and their text column
   need min-width:0 — flex items default to min-width:auto, so the pill could
   not shrink below its content and grew until it pushed the opponent's pill
   (avatar included) off screen. The name now stays on one line and ellipsises;
   the avatar keeps its size. The pill keeps its natural width (short names stay
   tight) but is capped so one long name cannot eat the opponent's room; past
   the cap the name ellipsises. */
.pill-player { flex: 0 1 auto; max-width: 36%; }
.pill-player, .pill-player > span:not(.avatar) { min-width: 0; }
.pill-player__name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-player__score { font-weight: 700; font-size: 23px; color: #3b3835; margin-top: 3px; line-height: 1; }
.pill-player--coral .pill-player__name { color: var(--coral-deep); }
.pill-player--blue { flex-direction: row-reverse; padding: 6px 6px 6px 14px; text-align: right; }
.pill-player--blue .pill-player__name { color: var(--blue); }
/* dim the inactive player's pill so the active turn is obvious */
.pill-player { opacity: .5; transition: opacity .3s; }
.pill-player--active { opacity: 1; }

/* Shrinks ahead of the pills (shrink factor 6 vs their 1): the heat bar is
   decorative and loses nothing by being narrower, whereas a squeezed pill eats
   the opponent's name. */
.g-center { flex: 1 6 0%; max-width: 150px; min-width: 74px; text-align: center; }
.mode-chip { font-weight: 700; font-size: 9px; letter-spacing: .14em; color: var(--coral-ink); margin-bottom: 2px; }
.round-label { font-weight: 500; font-size: 9.5px; letter-spacing: .16em; color: var(--muted); }
/* Heat Bar — Tug-of-War mit atmendem Hitze-Halo, Shimmer & pulsierendem Knob
   (Animation aus Claude-Design übernommen; Farben = bestehende Projekt-Töne). */
.heatbar { position: relative; height: 24px; margin: 5px 0 4px; display: flex; align-items: center; }
.heatbar__halo { position: absolute; top: 50%; left: -4%; right: -4%; height: 26px; border-radius: 999px;
  filter: blur(11px); pointer-events: none; opacity: 0; transform: translateY(-50%);
  animation: hb-breath 2.6s ease-in-out infinite; transition: opacity .55s var(--ease-out); }
.heatbar__track { position: relative; width: 100%; height: 9px; border-radius: 999px;
  background: linear-gradient(90deg, #3e9bd2, #2e86be);
  box-shadow: inset 0 1px 2px rgba(70,52,35,.2), 0 4px 10px rgba(32,168,212,.16); }
.heatbar__shimmerclip { position: absolute; inset: 0; border-radius: 999px; overflow: hidden; }
.heatbar__shimmer { position: absolute; top: 0; bottom: 0; width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  animation: hb-shimmer 3.8s ease-in-out infinite; animation-delay: .6s; }
.heatbar__coral { position: absolute; left: 0; top: 0; bottom: 0; width: 50%; border-radius: 999px 5px 5px 999px;
  background: linear-gradient(90deg, #f0926f, #dc6044); box-shadow: inset 0 1px 0 rgba(255,255,255,.4);
  overflow: hidden; transition: width .55s var(--ease-soft); }
.heatbar__shine { position: absolute; top: 0; bottom: 0; width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: hb-shimmer 3.8s ease-in-out infinite; }
.heatbar__mid { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 2px; height: 14px; border-radius: 2px; background: rgba(70,52,35,.22); z-index: 2; }
.heatbar__knob { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 4;
  transition: left .55s var(--ease-soft); }
.heatbar__knobglow { position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; border-radius: 50%;
  background: var(--muted-soft); opacity: .5; filter: blur(4px); transform: translate(-50%,-50%);
  animation: hb-knobpulse 1.9s ease-in-out infinite; pointer-events: none; }
.heatbar__knobdot { position: relative; display: block; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--muted-soft); box-shadow: 0 2px 5px var(--shadow);
  transform: scale(1); transition: transform .22s var(--ease-soft), border-color .22s; }
.heatbar__knobdot--surge { transform: scale(1.28); }
@keyframes hb-shimmer { from { transform: translateX(-120%) skewX(-16deg); } to { transform: translateX(360%) skewX(-16deg); } }
@keyframes hb-breath { 0%,100% { transform: translateY(-50%) scale(1); } 50% { transform: translateY(-50%) scale(1.18); } }
@keyframes hb-knobpulse { 0%,100% { transform: translate(-50%,-50%) scale(1); opacity: .5; } 50% { transform: translate(-50%,-50%) scale(1.5); opacity: .12; } }
@media (prefers-reduced-motion: reduce) {
  .heatbar__halo, .heatbar__shimmer, .heatbar__shine, .heatbar__knobglow { animation: none; }
}
.turn-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 9px;
  font-weight: 600; font-size: 9px; letter-spacing: .16em; color: #fff; white-space: nowrap;
  background: linear-gradient(155deg, #ee8b6f, #da6044);
  box-shadow: 0 3px 8px rgba(216,95,67,.4), inset 0 1px 0 rgba(255,255,255,.35);
  transition: background .3s;
}
.turn-chip--ai { background: linear-gradient(155deg, #5fb0dd, #2e86be); box-shadow: 0 3px 8px rgba(46,134,190,.4), inset 0 1px 0 rgba(255,255,255,.35); }
.turn-chip__dot { width: 4px; height: 4px; background: #fff; transform: rotate(45deg); }

/* =====================================================================
   BATTLE BOARD
   ===================================================================== */
.board-wrap { flex: 1; min-height: 0; padding: 0 14px 2px; display: flex; }
.board {
  flex: 1; display: flex; flex-direction: column; border-radius: 22px; overflow: hidden;
  background: linear-gradient(165deg, #fbf6ee, #f3eadc);
  box-shadow: 0 12px 26px rgba(120,92,66,.16), inset 0 1px 0 rgba(255,255,255,.8), 0 0 0 1px rgba(120,100,78,.06);
}
.row {
  flex: 1; position: relative; min-height: 0; border-top: 1px solid rgba(120,100,78,.1);
  display: grid; grid-template-columns: 1fr 1.5fr 1fr; align-items: stretch;
}
.row:first-child { border-top: none; }

.cell { position: relative; display: flex; align-items: center; justify-content: center; }
.cell--p { background: rgba(228,124,97,.05); }
.cell--o { background: rgba(62,155,210,.055); }
.cell--mid { gap: 7px; padding: 0 4px; }

.cat-label { font-weight: 500; font-size: 10.5px; letter-spacing: .05em; color: #5c5852; text-align: center; line-height: 1.05; }
.cat-die { width: 19px; height: 19px; flex: none; filter: drop-shadow(0 1px 2px rgba(60,45,30,.12)); }

/* cell value states */
.val { font-weight: 600; font-size: 18px; line-height: 1; }
.val--p { color: var(--coral-ink); }
.val--o { color: #2e86be; }
.val--dim { font-weight: 500; font-size: 15px; opacity: .5; }
.val--p.val--dim { color: #cb9a86; }
.val--o.val--dim { color: #7fa9c4; }

/* "open & idle" marker (small dot) */
.yatzy-bonus { margin-left: 4px; font-weight: 800; font-size: 9px; letter-spacing: .02em; color: var(--gold); vertical-align: super; }
/* claimable +100 (second Yatzy) — tap the full YATZY row to bank the bonus */
.cell--bonus { position: relative; }
.yatzy-bonus--claim { font-size: 13px; vertical-align: baseline; margin-left: 6px; padding: 1px 6px; border-radius: 8px;
  background: var(--gold); color: #3a2c00; box-shadow: 0 2px 8px rgba(210,160,40,.5); animation: bonusPulse 1s ease-in-out infinite; }
@keyframes bonusPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.idle-dot { width: 7px; height: 7px; border-radius: 50%; }
.idle-dot--p { background: rgba(229,121,92,.32); }
.idle-dot--o { background: rgba(62,155,210,.3); }

/* glow on a live option this turn */
.glow {
  position: absolute; inset: 4px; border-radius: 9px; pointer-events: none;
  animation: glowPulse 1.25s ease-in-out infinite;
}
.glow--p { border: 1.6px solid var(--coral); background: rgba(229,121,92,.13);
  box-shadow: 0 0 0 3px rgba(229,121,92,.1), 0 0 11px rgba(229,121,92,.3); }
.glow--o { border: 1.6px solid var(--blue); background: rgba(62,155,210,.12);
  box-shadow: 0 0 0 3px rgba(62,155,210,.1), 0 0 11px rgba(62,155,210,.3); }
@keyframes glowPulse { 0%,100% { opacity: .42; } 50% { opacity: .95; } }

/* the strike target marker (a crossed circle) — coloured by the side it sits on */
.strike-target { position: relative; display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--blue-deep); }
.strike-target::after { content: ""; position: absolute; width: 20px; height: 2px; background: var(--blue-deep); transform: rotate(-45deg); border-radius: 2px; }
.strike-target--p { border-color: var(--coral-deep); }
.strike-target--p::after { background: var(--coral-deep); }

/* struck (crossed-out) committed state — full-cell slash + tint */
.cell--struck-p { background: rgba(216,95,67,.13); }
.cell--struck-o { background: rgba(46,134,190,.14); }
.struck-zero { font-weight: 700; font-size: 15px; opacity: .55; }
.struck-zero--p { color: var(--coral-deep); }
.struck-zero--o { color: var(--blue-deep); }
.slash { position: absolute; left: 9%; right: 9%; top: 50%; height: 3px; border-radius: 3px; transform: translateY(-50%) rotate(-16deg); }
.slash--p { background: var(--coral-deep); box-shadow: 0 0 7px rgba(216,95,67,.55), 0 1px 0 rgba(255,255,255,.4); }
.slash--o { background: var(--blue-deep); box-shadow: 0 0 7px rgba(46,134,190,.55), 0 1px 0 rgba(255,255,255,.4); }

/* flash when an action lands */
.flash { position: absolute; inset: 3px; border-radius: 9px; pointer-events: none; animation: flashPop .55s var(--ease-out); }
.flash--p { background: rgba(229,121,92,.32); box-shadow: 0 0 16px 4px rgba(229,121,92,.6); }
.flash--o { background: rgba(62,155,210,.32); box-shadow: 0 0 16px 4px rgba(62,155,210,.6); }
@keyframes flashPop { 0% { transform: scale(.55); opacity: 0; } 45% { opacity: .95; } 100% { transform: scale(1.18); opacity: 0; } }

/* clickable affordance */
.cell--click { cursor: pointer; }

/* summary / bonus / total rows */
.row--meta { background: rgba(120,100,78,.045); }
.row--total { border-top: 1px solid rgba(120,100,78,.14); }
.meta-num { font-weight: 600; font-size: 15px; }
.meta-num--p { color: #a8825f; }
.meta-num--o { color: #5f8ca5; }
.meta-label { font-weight: 600; font-size: 10px; letter-spacing: .12em; color: #8c8579; }
.meta-sub { font-weight: 500; font-size: 9px; color: var(--muted-soft); }
.total-num { font-weight: 700; font-size: 21px; }
.total-num--p { color: #c5502d; }
.total-num--o { color: #2e86be; }
.total-label { font-weight: 700; font-size: 13px; letter-spacing: .22em; color: #403c37; }
.cell--total-p { background: rgba(228,124,97,.14); }
.cell--total-o { background: rgba(62,155,210,.14); }
.bonus-got { font-weight: 700; font-size: 16px; }
.bonus-gap { font-weight: 500; font-size: 10px; }

/* Instant Street row — premium gold/cyan accent */
.row--instant { background: linear-gradient(90deg, rgba(224,162,60,.07), rgba(62,155,210,.06)); }
.instant-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 8px;
  font-weight: 700; font-size: 9px; letter-spacing: .1em; color: #fff;
  background: linear-gradient(150deg, #f0b65a, #e0a23c);
  box-shadow: 0 2px 6px rgba(200,140,40,.35), inset 0 1px 0 rgba(255,255,255,.4);
}
.instant-pts { font-weight: 700; font-size: 16px; }
.instant-pts--p { color: var(--gold); }
.instant-pts--o { color: var(--blue); }
.spark { width: 9px; height: 9px; }

/* =====================================================================
   DICE TRAY
   ===================================================================== */
.tray { position: relative; padding: 6px 14px 0; z-index: 5; }   /* above the multi-board sticky columns (z 3/4) so hold rings never clip */
.tray__glow { position: absolute; left: 18px; right: 18px; top: 26px; height: 46px;
  background: radial-gradient(60% 100% at 50% 50%, rgba(255,255,255,.8), rgba(255,255,255,0) 72%); filter: blur(3px); pointer-events: none; }
.tray__row { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 4px; }
.die-slot { flex: 1; display: flex; flex-direction: column; align-items: center; }

.die {
  position: relative; width: 58px; height: 58px; padding: 0; display: block;
  --half: 24px;                 /* ≈ half the cube face, matches photo footprint */
  perspective: 560px;           /* establishes 3D space for the rolling cube */
  transform: rotate(var(--tilt, 0deg)); transition: transform .25s var(--ease-soft);
}
.die__shadow {
  position: absolute; left: 12%; right: 12%; bottom: 1px; height: 16%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(20,90,120,.42), rgba(20,90,120,0) 75%); filter: blur(1px);
  transition: transform .25s var(--ease-soft), opacity .25s;
}
.die__img {
  position: absolute; inset: 0; background-size: contain; background-repeat: no-repeat; background-position: center;
  filter: drop-shadow(0 5px 7px rgba(20,90,120,.30)); transition: opacity .12s;
}
.die--held { transform: rotate(0deg) translateY(-4px); }
.die--held .die__img { filter: drop-shadow(0 9px 10px rgba(20,90,120,.34)); }
.die--held .die__shadow { transform: scaleX(.82); opacity: .7; }
.die--held::after {
  content: ""; position: absolute; inset: -4px; border-radius: 28%;
  box-shadow: 0 0 0 2px var(--coral), 0 0 0 5px rgba(233,111,95,.18); pointer-events: none;
}

/* —— Real 3D cube (rolling only) ———————————————————— */
.die__cube { position: absolute; inset: 8.5%; transform-style: preserve-3d; display: none; }
.die--rolling { animation: dieHop .84s cubic-bezier(.3,.7,.35,1); z-index: 5; }
.die--rolling .die__img { opacity: 0; }
.die--rolling .die__shadow { animation: rollShadow .84s cubic-bezier(.3,.7,.35,1); }
.die--rolling .die__cube { display: block; animation: cubeSpin .84s cubic-bezier(.28,.62,.4,1); }
@keyframes dieHop {
  0%   { transform: rotate(var(--tilt)) translateY(0); }
  32%  { transform: rotate(var(--tilt)) translateY(-44px); }
  56%  { transform: rotate(var(--tilt)) translateY(-50px); }
  82%  { transform: rotate(var(--tilt)) translateY(-7px); }
  100% { transform: rotate(var(--tilt)) translateY(0); }
}
@keyframes cubeSpin {
  0%   { transform: rotateX(0) rotateY(0); }
  100% { transform: rotateX(var(--rx, 1080deg)) rotateY(var(--ry, 1440deg)); }
}
@keyframes rollShadow {
  0%,100% { transform: scaleX(1); opacity: 1; }
  50%     { transform: scaleX(.5); opacity: .3; }
}
.cf {
  position: absolute; inset: 0; border-radius: 17%; overflow: hidden;
  backface-visibility: hidden;
  background-color: var(--cube-fill, #2ba6d6);   /* per-skin fill behind the photo */
  background-repeat: no-repeat; background-position: center;
  background-size: 122%;              /* zoom so the die fills the cube face */
}
.cf--front  { transform: translateZ(var(--half)); }
.cf--back   { transform: rotateY(180deg) translateZ(var(--half)); }
.cf--right  { transform: rotateY(90deg)  translateZ(var(--half)); }
.cf--left   { transform: rotateY(-90deg) translateZ(var(--half)); }
.cf--top    { transform: rotateX(90deg)  translateZ(var(--half)); }
.cf--bottom { transform: rotateX(-90deg) translateZ(var(--half)); }
.cpip { align-self: center; justify-self: center; width: 76%; aspect-ratio: 1; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle at 38% 32%, #fff, #eaf5fb 60%, #c7e0ef 100%);
  box-shadow: inset 0 -1px 2px rgba(34,86,118,.4); }
.cpip.on { opacity: 1; }

/* —— Flat CSS face (offline fallback only) ———————————— */
.die__face { display: none; }
.die--noimg .die__img { display: none; }
.die--noimg .die__face {
  display: grid; position: absolute; inset: 8.5%; border-radius: 17%;
  grid-template-columns: repeat(3,1fr); grid-template-rows: repeat(3,1fr); padding: 13%; gap: 3%;
  background: radial-gradient(125% 120% at 32% 24%, #6cc6e8 0%, #2ba6d6 46%, #1582ad 100%);
  box-shadow: 0 5px 9px rgba(14,90,120,.3), inset 0 0 0 1px rgba(255,255,255,.2), inset 7px 9px 15px rgba(255,255,255,.3), inset -9px -11px 17px rgba(13,68,103,.5);
}
.die--noimg .die__face .cpip { display: block; }

.die-hint { margin-top: 4px; height: 12px; overflow: hidden; }
.hold-tag { display: flex; align-items: center; gap: 5px; }
.hold-tag span.bar { width: 7px; height: 1.5px; background: var(--coral); border-radius: 2px; }
.hold-tag span.txt { font-weight: 600; font-size: 9.5px; letter-spacing: .12em; color: #e06e51; }
.tap-tag { font-weight: 500; font-size: 8px; letter-spacing: .05em; color: var(--muted-soft); text-align: center; line-height: 12px; white-space: nowrap; }

/* =====================================================================
   ACTION DOCK — roll button + SCORE / STRIKE cards
   ===================================================================== */
.dock { padding: 4px 16px calc(10px + var(--sab)); }
/* A single slim bar reserves a fixed height so the dice always land where
   they rest. In the decide phase it holds the compact SCORE / STRIKE chips;
   otherwise it shows the last move (incl. what the opponent just did). */
.action-cards { display: flex; gap: 8px; margin-bottom: 6px; min-height: 38px; align-items: center; }

.act-chip {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 10px; border-radius: 13px; overflow: hidden;
  transition: transform .14s var(--ease-soft);
  animation: cardIn .26s var(--ease-soft) both;
}
.act-chip:active { transform: scale(.96); }
@keyframes cardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.act-chip__ic { width: 22px; height: 22px; border-radius: 7px; flex: none; display: flex; align-items: center; justify-content: center; }
.act-chip__ic svg { width: 14px; height: 14px; }
.act-chip__lbl { font-weight: 700; font-size: 13.5px; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-chip--score {
  background: linear-gradient(160deg, #fdf1eb, #fae6dc);
  box-shadow: 0 4px 11px rgba(216,95,67,.16), inset 0 1px 0 rgba(255,255,255,.7), 0 0 0 1.3px rgba(229,121,92,.5);
}
.act-chip--score .act-chip__ic { background: radial-gradient(120% 120% at 35% 25%, #f0926f, #da6044); }
.act-chip--score .act-chip__lbl { color: var(--coral-ink); }
.act-chip--strike {
  background: linear-gradient(160deg, #eef8fc, #e1f0f7);
  box-shadow: 0 4px 11px rgba(46,134,190,.16), inset 0 1px 0 rgba(255,255,255,.7), 0 0 0 1.3px rgba(62,155,210,.55);
}
.act-chip--strike .act-chip__ic { background: radial-gradient(120% 120% at 35% 25%, #5fb0dd, #2e86be); }
.act-chip--strike .act-chip__lbl { color: var(--blue-ink); }

/* last-move line (shown when it isn't the player's decision moment) */
.last-move { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 38px; }
.last-move__label { font-weight: 700; font-size: 8.5px; letter-spacing: .16em; color: var(--muted-soft); }
.last-move__dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.last-move__dot--p { background: var(--coral); }
.last-move__dot--o { background: var(--blue); }
.last-move__txt { font-weight: 600; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dock__main { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.foot-btn { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.foot-btn span { font-weight: 500; font-size: 9px; letter-spacing: .12em; color: #8c867b; }
/* undo lives in the right footer slot: coral when available, dimmed when not */
.foot-btn--undo { color: var(--coral-ink); transition: opacity .2s; }
.foot-btn--undo span { color: var(--coral-ink); }
.foot-btn--undo.foot-btn--off { color: #b6a99a; opacity: .45; pointer-events: none; }
.foot-btn--undo.foot-btn--off span { color: #b6a99a; }
.foot-group { display: flex; gap: 20px; }

.roll-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 11px 26px; border-radius: 28px;
  background: radial-gradient(130% 130% at 35% 20%, #f0926f, #dc6044);
  box-shadow: 0 10px 22px rgba(216,95,67,.42), inset 0 1px 0 rgba(255,255,255,.45), inset 0 -3px 8px rgba(150,50,30,.3);
  transition: transform .14s var(--ease-soft), box-shadow .14s;
}
.roll-btn:active:not(:disabled) { transform: scale(.96); box-shadow: 0 4px 12px rgba(216,95,67,.4), inset 0 2px 7px rgba(140,45,30,.4); }
.roll-btn:disabled { filter: grayscale(.35) brightness(.96); opacity: .55; cursor: default; }
.roll-btn__row { display: flex; align-items: center; gap: 9px; }
.roll-btn__label { font-weight: 700; font-size: 18px; letter-spacing: .14em; color: #fff; }
.roll-btn__sub { font-weight: 500; font-size: 9.5px; letter-spacing: .14em; color: rgba(255,255,255,.9); white-space: nowrap; }

/* =====================================================================
   AI "thinking" banner + toast
   ===================================================================== */
.toast-layer { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 246px; z-index: 30; }
.toast {
  pointer-events: none; max-width: 80%; text-align: center; padding: 13px 20px; border-radius: 18px;
  background: rgba(34,30,26,.9); color: #fff; backdrop-filter: blur(6px);
  box-shadow: 0 18px 40px rgba(40,28,18,.4); animation: toastIn .4s var(--ease-soft) both;
}
.toast__title { font-weight: 700; font-size: 14px; letter-spacing: .04em; }
.toast__title--strike { color: #7fc6ec; }
.toast__title--score { color: #f6a892; }
.toast__title--gold { color: #f3c168; }
.toast__sub { font-weight: 500; font-size: 11.5px; color: rgba(255,255,255,.78); margin-top: 4px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }
.toast--out { animation: toastOut .3s var(--ease-out) both; }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px) scale(.97); } }

/* thinking dots on the opponent pill */
.thinking { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.thinking i { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); animation: tdot 1.1s ease-in-out infinite; }
.thinking i:nth-child(2) { animation-delay: .18s; }
.thinking i:nth-child(3) { animation-delay: .36s; }
@keyframes tdot { 0%,100% { opacity: .3; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }

/* =====================================================================
   END / WIN OVERLAY
   ===================================================================== */
.overlay { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 100% at 50% 0%, rgba(250,243,234,.86), rgba(241,231,218,.94));
  backdrop-filter: blur(3px); animation: fadeIn .4s ease both; }
.overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.result-card {
  width: 300px; padding: 30px 26px 24px; border-radius: 28px; text-align: center;
  background: linear-gradient(165deg, #fcf8f1, #f3eadc);
  box-shadow: 0 26px 60px rgba(120,92,66,.3), inset 0 1px 0 rgba(255,255,255,.85); animation: cardIn .5s var(--ease-soft) both;
}
.result-card__kicker { font-weight: 600; font-size: 11px; letter-spacing: .26em; color: var(--muted); }
.result-card__title { font-weight: 700; font-size: 30px; letter-spacing: .02em; margin: 8px 0 18px; }
.result-card__title--win { color: var(--coral-ink); }
.result-card__title--lose { color: var(--blue-ink); }
.result-card__title--tie { color: var(--text); }
.result-scores { display: flex; align-items: stretch; justify-content: center; gap: 14px; margin-bottom: 22px; }
.result-best { font-weight: 700; font-size: 12px; letter-spacing: .04em; color: var(--gold); margin: -8px 0 18px; }

/* online dialog */
.play-btn--blue { background: radial-gradient(130% 130% at 35% 18%, #5fb0dd, #2e86be); box-shadow: 0 10px 22px rgba(46,134,190,.4), inset 0 1px 0 rgba(255,255,255,.45), inset 0 -3px 8px rgba(30,90,130,.3); }
.online-code { font-weight: 800; font-size: 44px; letter-spacing: .22em; color: var(--coral-ink); text-align: center; margin: 18px 0 8px; padding-left: .22em; }
.online-wait { font-weight: 500; font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 4px; }
.online-code-input { width: 100%; box-sizing: border-box; font-family: var(--font); font-weight: 800; font-size: 26px; letter-spacing: .3em; text-align: center; text-transform: uppercase;
  color: var(--blue-ink); padding: 12px; border-radius: 13px; border: none; background: rgba(255,255,255,.6); box-shadow: var(--inset); outline: none; }
.online-code-input:focus { box-shadow: var(--inset), 0 0 0 2px var(--blue); }
.online-err { font-weight: 600; font-size: 11.5px; color: var(--coral-ink); text-align: center; margin-top: 10px; }
/* —— QR: Host zeigt Raum-Code, Gegner scannt —— */
.online-qr { width: 168px; height: 168px; margin: 4px auto 12px; padding: 12px; box-sizing: border-box;
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-soft, 0 6px 18px rgba(70,52,35,.12)); }
.online-qr svg { display: block; }
.online-or { display: flex; align-items: center; gap: 10px; margin: 14px 2px 12px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.online-or::before, .online-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
/* —— In-App QR-Scanner —— */
.qr-scan { position: fixed; inset: 0; z-index: 90; background: #11100e; display: flex; align-items: center; justify-content: center; animation: fadeIn .25s ease both; }
.qr-scan__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qr-scan__mask { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(closest-side at 50% 46%, rgba(0,0,0,0) 0 124px, rgba(0,0,0,.55) 180px); }
.qr-scan__frame { width: 240px; height: 240px; border-radius: 28px; box-shadow: 0 0 0 3px rgba(255,255,255,.9), inset 0 0 0 1px rgba(0,0,0,.2); }
.qr-scan__hint { position: absolute; left: 0; right: 0; bottom: 118px; text-align: center; color: #fff; font-weight: 600; font-size: 13px; letter-spacing: .02em; text-shadow: 0 1px 6px rgba(0,0,0,.6); padding: 0 24px; }
.qr-scan__cancel { position: absolute; bottom: 46px; left: 50%; transform: translateX(-50%); margin: 0; }
/* —— In-Game-Menü —— */
.menu-rows { display: flex; flex-direction: column; gap: 12px; margin: 18px 0 18px; }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.menu-row__label { font-weight: 700; font-size: 12px; letter-spacing: .1em; color: var(--text); }
.menu-switch { cursor: pointer; }
.result-scores > div { flex: 1; padding: 14px 8px; border-radius: 16px; }
.result-scores .rs-p { background: rgba(228,124,97,.12); }
.result-scores .rs-o { background: rgba(62,155,210,.12); }
.rs-name { font-weight: 600; font-size: 11px; letter-spacing: .14em; }
.rs-name--p { color: var(--coral-deep); }
.rs-name--o { color: var(--blue); }
.rs-num { font-weight: 700; font-size: 32px; color: var(--text-strong); margin-top: 4px; }
.rs-vs { align-self: center; font-weight: 700; font-size: 13px; color: var(--muted); }

/* =====================================================================
   ERFOLGE — In-Game-Erfolgsfeier (Animation aus Claude-Design; eure Farben).
   Zentrales Overlay (Strahlen, Glow, Funken, Emblem-Flip, Banner) + Zeilen-
   Glow / YATZY-Burn. Mountet auf #gameScreen, pointer-events: none.
   ===================================================================== */
.cele { position: absolute; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.cele__stage { position: absolute; left: 50%; top: 45%; transform: translate(-50%,-50%);
  display: flex; flex-direction: column; align-items: center; }
.cele__core { position: relative; display: flex; align-items: center; justify-content: center; }

.cele__rays { position: absolute; left: 50%; top: 50%; width: 300px; height: 300px; margin: -150px 0 0 -150px;
  opacity: 0; transition: opacity .7s var(--ease-out); }
.cele__rays > i { display: block; width: 100%; height: 100%; border-radius: 50%; filter: blur(3px); animation: ce-spin 19s linear infinite; }
.cele.is-in .cele__rays { opacity: .22; }
.cele.is-out .cele__rays { opacity: 0; }

.cele__glow { position: absolute; left: 50%; top: 50%; width: 158px; height: 158px; margin: -79px 0 0 -79px;
  opacity: 0; transition: opacity .6s var(--ease-out); }
.cele__glow > i { display: block; width: 100%; height: 100%; border-radius: 50%; animation: ce-breathe 2.3s ease-in-out infinite; }
.cele.is-in .cele__glow { opacity: .85; }
.cele.is-out .cele__glow { opacity: 0; }

.cele__glints { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.cele__glint { position: absolute; left: 0; top: 0; opacity: 0; transform: translate(0,0) scale(.2) rotate(45deg);
  transition: transform .58s var(--ease-soft), opacity .4s var(--ease-out); }
.cele__glint > i { display: block; width: 100%; height: 100%; animation: ce-twinkle 1s ease-in-out infinite; }
.cele.is-in .cele__glint { opacity: .95; transform: translate(var(--gx), var(--gy)) scale(1) rotate(45deg); }
.cele.is-out .cele__glint { opacity: 0; }

.cele__emblem { position: relative; perspective: 760px; z-index: 1; }
.cele__flip { transform-style: preserve-3d; }
.cele.is-in .cele__flip { animation: ce-flip .9s var(--ease-out); }
.cele__badge { width: 76px; height: 76px; border-radius: 23px; transform: rotate(45deg) scale(.35); opacity: 0;
  border: 2px solid rgba(255,255,255,.45); box-shadow: 0 12px 28px rgba(70,52,35,.3), inset 0 2px 0 rgba(255,255,255,.5);
  display: flex; align-items: center; justify-content: center;
  transition: transform .48s var(--ease-soft), opacity .38s var(--ease-out); }
.cele.is-in .cele__badge { transform: rotate(45deg) scale(1); opacity: 1; }
.cele.is-out .cele__badge { opacity: 0; transform: rotate(45deg) scale(.7); }
.cele__icon { transform: rotate(-45deg); display: flex; color: #fff; }

.cele__banner { margin-top: 26px; text-align: center; opacity: 0; transform: translateY(16px);
  transition: transform .44s var(--ease-soft), opacity .4s var(--ease-out); }
.cele.is-in .cele__banner { opacity: 1; transform: translateY(0); }
.cele.is-out .cele__banner { opacity: 0; }
.cele__label { font-weight: 800; font-size: 27px; letter-spacing: .12em;
  text-shadow: 0 1px 2px rgba(70,52,35,.22), 0 2px 12px rgba(255,255,255,.55); }
.cele__sub { margin-top: 8px; font-weight: 700; font-size: 11px; letter-spacing: .22em; opacity: .85;
  text-shadow: 0 1px 2px rgba(70,52,35,.18); }

/* Zeilen-Highlight: Glow (normale Erfolge) bzw. Flammen-Burn (YATZY) */
.cele-row { position: absolute; z-index: 58; pointer-events: none; border-radius: 11px; overflow: hidden;
  opacity: 0; transition: opacity .4s var(--ease-out); }
.cele-row.is-in { opacity: 1; }
.cele-row--glow { box-shadow: inset 0 0 0 1.5px currentColor, 0 0 16px -2px currentColor; }
.cele-row__flame { position: absolute; inset: 0; transform-origin: bottom;
  background: linear-gradient(0deg, var(--coral-deep) 0%, var(--coral) 34%, rgba(240,130,90,.32) 66%, transparent 100%);
  animation: ce-flame .5s ease-in-out infinite; }
.cele-row__flame--2 { background: linear-gradient(0deg, var(--gold) 0%, rgba(224,162,60,.4) 30%, transparent 60%);
  animation: ce-flame .33s ease-in-out infinite reverse; }
.cele-row__ember { position: absolute; bottom: 2px; width: 5px; height: 5px; border-radius: 50%;
  background: #ffe1b0; box-shadow: 0 0 7px var(--coral); animation: ce-ember 1.5s ease-out infinite; }

@keyframes ce-spin { to { transform: rotate(360deg); } }
@keyframes ce-breathe { 0%,100% { transform: scale(.92); opacity: .55; } 50% { transform: scale(1.16); opacity: 1; } }
@keyframes ce-twinkle { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .25; transform: scale(.5); } }
@keyframes ce-flip { 0% { transform: rotateY(0deg); } 100% { transform: rotateY(360deg); } }
@keyframes ce-flame { 0%,100% { opacity: .8; transform: scaleY(1); } 25% { opacity: 1; transform: scaleY(1.18); } 50% { opacity: .65; transform: scaleY(.94); } 75% { opacity: 1; transform: scaleY(1.1); } }
@keyframes ce-ember { 0% { opacity: 0; transform: translateY(7px) scale(.5); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px) scale(1.05); } }
@media (prefers-reduced-motion: reduce) {
  .cele__rays > i, .cele__glow > i, .cele__glint > i, .cele-row__flame, .cele-row__ember { animation: none; }
  .cele.is-in .cele__flip { animation: none; }
}

/* =====================================================================
   SIEG — Podest-Gewinnerseite (Animation aus Claude-Design; eure Farben).
   Vollflächig im #endOverlay: Gold-Flecken, Sieger-Titel mit Shine,
   Podium (Gewinner groß mit Krone/Halo/Funken/Bob, Verlierer klein/entsättigt),
   hochzählende Scores, Best-Pille, Revanche/Home.
   ===================================================================== */
.overlay.win { background:
    radial-gradient(120% 60% at 50% 0%, var(--win-wash, rgba(224,162,60,.16)), transparent 52%),
    radial-gradient(120% 100% at 50% 0%, rgba(250,243,234,.82), rgba(241,231,218,.92));
  backdrop-filter: blur(3px); }
.win__flecks { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .8s var(--ease-out); }
.win.is-in .win__flecks { opacity: 1; }
.win__fleck { position: absolute; top: -20px; animation: ws-fall linear infinite; }

/* Winner screen as a centered overlay card (matches the Store/Stats look). */
.win-card { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center;
  width: calc(100% - 34px); max-width: 360px; max-height: 92vh; max-height: 92dvh; overflow: visible;
  padding: 22px 22px calc(18px + var(--sab)); text-align: center; }
.win__top { display: none; }
.win__intro { font-size: 11px; font-weight: 700; letter-spacing: .2em; color: var(--muted);
  opacity: 0; transition: opacity .5s var(--ease-out); }
.win.is-in .win__intro { opacity: 1; }
.win__title { margin-top: 10px; position: relative; overflow: hidden; opacity: 0; transform: translateY(14px);
  transition: opacity .5s var(--ease-out), transform .55s var(--ease-soft); }
.win.is-in .win__title { opacity: 1; transform: translateY(0); }
.win__title span { font-size: 31px; font-weight: 800; letter-spacing: .01em; line-height: 1;
  text-shadow: 0 2px 10px var(--win-wash, transparent), 0 1px 1px rgba(0,0,0,.08); }
.win__title--p span { color: var(--coral); }
.win__title--o span { color: var(--blue); }
.win__title--tie span { color: var(--muted); }
.win__title::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay;
  background: linear-gradient(105deg, transparent 42%, rgba(255,255,255,.85) 50%, transparent 58%);
  transform: translateX(-130%); }
.win.is-in .win__title::after { animation: ws-shine 3.6s ease-in-out 1.2s infinite; }

.win__podium { margin-top: 20px; display: flex; align-items: flex-end; justify-content: center; gap: 22px; width: 100%; }
.win-player { flex: none; display: flex; flex-direction: column; align-items: center; gap: 11px;
  opacity: 0; transform: translateY(28px) scale(.85);
  transition: opacity .5s var(--ease-out), transform .6s var(--ease-soft); }
.win-player--p { --seat-col: var(--coral); --seat-ink: var(--coral-ink);
  --seat-grad: radial-gradient(circle at 35% 25%, #f0926f, #dc6044); --seat-ray: rgba(233,111,95,.85);
  --seat-soft: rgba(233,111,95,.30); --seat-shadow: rgba(216,88,74,.45); }
.win-player--o { --seat-col: var(--blue); --seat-ink: var(--blue-ink);
  --seat-grad: radial-gradient(circle at 35% 25%, #58c4e6, #2e86be); --seat-ray: rgba(32,168,212,.85);
  --seat-soft: rgba(32,168,212,.30); --seat-shadow: rgba(17,139,180,.45); }
.win-player.is-winner { transform: translateY(28px) scale(.7); }
.win.is-in .win-player { opacity: 1; transform: translateY(0) scale(1); }

.win-player__frame { position: relative; display: flex; align-items: center; justify-content: center;
  width: var(--frame-size, 108px); height: var(--frame-size, 108px);
  transition: width .5s var(--ease-soft), height .5s var(--ease-soft); }
.win-player__rays, .win-player__glow { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  opacity: 0; transition: opacity .7s var(--ease-out); z-index: 0; pointer-events: none; }
.win-player__rays { width: 210px; height: 210px; }
.win-player__rays > i { display: block; width: 100%; height: 100%; border-radius: 50%; filter: blur(2px);
  background: repeating-conic-gradient(from 0deg, var(--seat-ray, rgba(240,185,90,.9)) 0deg 2deg, transparent 2deg 16deg); animation: ce-spin 17s linear infinite; }
.win-player__glow { width: 170px; height: 170px; }
.win-player__glow > i { display: block; width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle, var(--win-wash2, rgba(240,185,90,.5)) 0%, transparent 64%); animation: ce-breathe 2.4s ease-in-out infinite; }
.win.is-in .win-player.is-winner .win-player__rays { opacity: .85; }
.win.is-in .win-player.is-winner .win-player__glow { opacity: .9; }

.win-player__bob { position: relative; z-index: 2; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.win.is-in .win-player.is-winner .win-player__bob { animation: ws-bob 3.6s ease-in-out infinite; }
.win-player__sparks { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; transition: opacity .5s var(--ease-out); }
.win.is-in .win-player.is-winner .win-player__sparks { opacity: 1; }
.win-player__spark { position: absolute; border-radius: 1.5px; transform: rotate(45deg); animation: ws-twinkle 1s ease-in-out infinite; }

.win-player__ring { width: 100%; height: 100%; border-radius: 50%; padding: 5px; background: var(--seat-col);
  box-shadow: 0 0 0 2px rgba(255,255,255,.7), 0 6px 16px var(--shadow); transition: padding .5s, box-shadow .5s; }
.win-player.is-winner .win-player__ring { padding: 6px; background: var(--seat-grad, var(--seat-col));
  box-shadow: 0 0 0 2.5px #fff, 0 12px 28px var(--seat-shadow, var(--shadow)), 0 0 0 6px var(--seat-soft, transparent); }
.win-player.is-loser { opacity: .96; }
.win-player__photo { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: var(--surface-sunken); display: block; }
.win-player__photo svg, .win-player__photo .avatar__img { width: 100%; height: 100%; object-fit: cover; display: block; }

.win-player__crown { position: absolute; top: -28px; left: 50%; z-index: 4; opacity: 0;
  transform: translateX(-50%) translateY(-44px) scale(.5);
  transition: transform .6s var(--ease-soft), opacity .4s var(--ease-out); }
.win.crown-down .win-player.is-winner .win-player__crown { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.win.crown-down .win-player.is-winner .win-player__crown > i { display: block; transform-origin: bottom center; animation: ws-crownbob 3.2s ease-in-out infinite; }

/* same guard as the header pill: a long name must not stretch the podium */
.win-player__name { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--seat-col);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-player.is-winner .win-player__name { font-size: 14px; }
.win-player__score { font-size: 28px; font-weight: 800; line-height: .9; color: var(--muted); font-variant-numeric: tabular-nums; }
.win-player.is-winner .win-player__score { font-size: 42px; color: var(--seat-ink); text-shadow: 0 2px 10px var(--win-wash, transparent); }

.win__best { margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 999px;
  background: rgba(224,162,60,.12); color: var(--gold); opacity: 0; transform: translateY(10px);
  transition: opacity .5s var(--ease-out) .15s, transform .5s var(--ease-soft) .15s; }
.win.is-in .win__best { opacity: 1; transform: translateY(0); }
.win__best span { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; }
.win__spacer { display: none; }
.win__cta, .win__home { opacity: 0; transition: opacity .5s var(--ease-out) .1s, transform var(--dur-fast, .12s); }
.win.is-in .win__cta, .win.is-in .win__home { opacity: 1; }

@keyframes ws-fall { 0% { transform: translateY(-30px) rotate(0deg); opacity: 0; } 8% { opacity: .85; } 90% { opacity: .85; } 100% { transform: translateY(820px) rotate(260deg); opacity: 0; } }
@keyframes ws-shine { 0% { transform: translateX(-130%); } 55%,100% { transform: translateX(240%); } }
@keyframes ws-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes ws-crownbob { 0%,100% { transform: rotate(-3.5deg); } 50% { transform: rotate(3.5deg); } }
@keyframes ws-twinkle { 0%,100% { opacity: 1; transform: scale(1) rotate(45deg); } 50% { opacity: .2; transform: scale(.45) rotate(45deg); } }
@media (prefers-reduced-motion: reduce) {
  .win__fleck, .win-player__rays > i, .win-player__glow > i, .win-player__spark,
  .win.is-in .win-player.is-winner .win-player__bob, .win.crown-down .win-player.is-winner .win-player__crown > i, .win.is-in .win__title::after { animation: none; }
}

/* —— Home top actions (stats + language) ———————————————— */
.home__top-actions { display: flex; align-items: center; gap: 8px; }
.stats-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0; cursor: pointer;
  border-radius: 22px; font-family: var(--font); font-weight: 700; font-size: 11px; letter-spacing: .06em;
  color: var(--coral-ink); background: linear-gradient(160deg, #fdf1eb, #f8e0d6);
  box-shadow: 0 6px 14px rgba(216,95,67,.16), inset 0 1px 0 rgba(255,255,255,.7); transition: transform .15s var(--ease-soft);
}
.stats-btn svg { width: 15px; height: 15px; color: var(--coral); }
.stats-btn:active { transform: scale(.95); }

/* —— Stats & rewards card ——————————————————————————— */
.stats-card { max-width: 380px; width: calc(100% - 36px); max-height: 86vh; max-height: 86dvh; overflow-y: auto; text-align: left; padding-bottom: calc(24px + var(--sab)); }
.stats-body { display: flex; flex-direction: column; gap: 18px; margin-top: 4px; }
.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-tile {
  background: var(--surface-soft); border-radius: 14px; padding: 11px 8px; text-align: center;
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.stat-tile__num { font-weight: 800; font-size: 21px; color: var(--text-strong); line-height: 1.1; }
.stat-tile__lbl { font-size: 9.5px; font-weight: 600; letter-spacing: .07em; color: var(--muted); text-transform: uppercase; margin-top: 3px; }
.stats-section__h { font-weight: 800; font-size: 11px; letter-spacing: .12em; color: var(--muted); margin: 2px 0 8px; }
.rec-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px; border-bottom: 1px solid var(--line-soft); }
.rec-row:last-child { border-bottom: 0; }
.rec-row__name { font-weight: 600; font-size: 13px; color: var(--text); }
.rec-row__best { font-weight: 800; font-size: 15px; color: var(--coral-ink); }
.rec-row__best.zero { color: var(--muted-soft); }

.reward-row { display: flex; align-items: center; gap: 11px; padding: 9px 2px; }
.reward-chip { width: 34px; height: 34px; border-radius: 9px; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12), 0 3px 7px var(--shadow-soft); }
.reward-row__meta { flex: 1; min-width: 0; }
.reward-row__name { font-weight: 700; font-size: 13.5px; color: var(--text); }
.reward-row__sub { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.reward-row__sub.done { color: var(--success); }
.reward-badge { font-weight: 800; font-size: 9.5px; letter-spacing: .08em; padding: 5px 9px; border-radius: 10px; border: 0; cursor: default; }
.reward-badge--locked { background: var(--surface-sunken); color: var(--muted-soft); }
.reward-badge--equip { background: linear-gradient(160deg, var(--coral-bright), var(--coral-deep)); color: #fff; cursor: pointer; box-shadow: 0 4px 10px rgba(216,95,67,.28); }
.reward-badge--equipped { background: linear-gradient(160deg, #6fce8f, var(--success)); color: #fff; }
.stats-empty { text-align: center; color: var(--muted); font-size: 12.5px; padding: 10px 0; }

/* —— AI persona chooser (SAM / NOVA) ———————————————————— */
.ai-pick { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.ai-opt {
  display: flex; align-items: center; gap: 13px; text-align: left; padding: 12px 13px; border: 0; cursor: pointer;
  border-radius: 16px; background: var(--surface-soft); box-shadow: inset 0 0 0 1px var(--line-soft);
  transition: transform .15s var(--ease-soft), box-shadow .18s;
}
.ai-opt:active { transform: scale(.98); }
.ai-opt:hover { box-shadow: inset 0 0 0 1.5px var(--ai-accent, var(--coral)); }
.ai-opt__face { width: 54px; height: 54px; flex: none; box-shadow: 0 0 0 2px var(--ai-accent, var(--blue)); border-radius: 50%; }
.ai-opt__meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ai-opt__name { font-weight: 800; font-size: 16px; color: var(--text-strong); letter-spacing: .02em; }
.ai-opt__tag { font-weight: 700; font-size: 9.5px; letter-spacing: .12em; color: var(--ai-accent, var(--muted)); text-transform: uppercase; }
.ai-opt__desc { font-size: 11.5px; color: var(--muted); line-height: 1.3; margin-top: 2px; }

/* —— Store / coins ——————————————————————————————————— */
.coin-banner { display: flex; align-items: baseline; gap: 8px; justify-content: center; padding: 6px 0 2px; }
.coin-banner__amt { font-weight: 800; font-size: 22px; color: var(--gold); letter-spacing: .01em; }
.coin-banner__lbl { font-weight: 700; font-size: 10px; letter-spacing: .14em; color: var(--muted); }
.store-h { display: flex; align-items: center; justify-content: space-between; }
.coin-bal { font-weight: 800; font-size: 12px; color: var(--gold); letter-spacing: .02em; }
.reward-badge--buy { background: linear-gradient(160deg, #f0c45f, #d89a2e); color: #4a3410; cursor: pointer; box-shadow: 0 4px 10px rgba(216,162,46,.28); }
.reward-badge--buy.reward-badge--cant { background: var(--surface-sunken); color: var(--muted-soft); box-shadow: none; }

/* —— YATZY coin currency mark ————————————————————————— */
.ycoin { width: 1.05em; height: 1.05em; vertical-align: -0.16em; flex: none; }
.coin-amt { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; white-space: nowrap; }

/* —— Home wallet + recent-form strip ————————————————— */
.home__wallet { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 22px 6px; flex: none; }
.wallet-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 7px; border: 0; cursor: pointer; border-radius: 22px;
  background: linear-gradient(160deg, #fff8ec, #f4e4c2); box-shadow: 0 6px 14px rgba(180,140,60,.18), inset 0 0 0 1px rgba(180,140,60,.2); transition: transform .15s var(--ease-soft); }
.wallet-chip:active { transform: scale(.96); }
.wallet-chip__coin .ycoin { width: 21px; height: 21px; display: block; }
.wallet-chip__amt { font-weight: 800; font-size: 14px; color: #8a5a14; }
.wallet-chip__go { font-weight: 800; font-size: 9px; letter-spacing: .12em; color: #fff; background: linear-gradient(160deg, var(--coral-bright), var(--coral-deep)); padding: 4px 8px; border-radius: 11px; }
.streak { display: inline-flex; gap: 4px; align-items: center; }
.rstreak { width: 21px; height: 21px; display: inline-block; }
.rstreak svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 3px var(--shadow-soft)); }

/* —— Store modal ————————————————————————————————————— */
.store-modal { max-width: 408px; width: calc(100% - 26px); max-height: 88vh; max-height: 88dvh; display: flex; flex-direction: column; padding: 16px 13px calc(12px + var(--sab)); text-align: left; }
.store-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; padding: 0 3px; }
.store-head__title { font-weight: 800; font-size: 16px; letter-spacing: .1em; color: var(--text-strong); }
.store-head__bal { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: 14px; color: #8a5a14;
  background: linear-gradient(160deg, #fff8ec, #f4e4c2); padding: 5px 11px; border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(180,140,60,.22); }
.store-head__bal .ycoin { width: 17px; height: 17px; }
.store-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 2px 3px 4px; }
.store-tier { display: flex; align-items: center; justify-content: space-between; margin: 15px 3px 9px; }
.store-tier:first-child { margin-top: 2px; }
.store-tier__name { font-weight: 800; font-size: 11px; letter-spacing: .18em; }
.store-tier__price { font-weight: 800; font-size: 10px; color: #fff; padding: 3px 9px; border-radius: 10px; display: inline-flex; align-items: center; }
.store-tier__price .ycoin { width: 12px; height: 12px; }
.store-tier__price .coin-amt { gap: 3px; color: #fff; }
.store-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.store-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 14px 10px 11px; border: 0; cursor: pointer;
  border-radius: 18px; background: var(--surface-soft); box-shadow: inset 0 0 0 1px var(--line-soft); transition: transform .14s var(--ease-soft), box-shadow .18s; font-family: var(--font); }
.store-card:active { transform: scale(.97); }
.store-card--on { box-shadow: 0 0 0 2px var(--coral), 0 8px 18px rgba(233,111,95,.16); background: var(--surface); }
.store-card__dice { height: 54px; width: 100%; display: flex; align-items: center; justify-content: center; }
.sd-fan { position: relative; width: 98px; height: 54px; }
.sd { position: absolute; top: 8px; width: 40px; height: 40px; filter: drop-shadow(0 4px 6px rgba(60,45,25,.28)); }
.sd--0 { left: 4px;  transform: rotate(-15deg); }
.sd--1 { left: 29px; top: 3px; transform: rotate(2deg); z-index: 2; }
.sd--2 { left: 54px; transform: rotate(15deg); }
.store-card__name { font-weight: 700; font-size: 12.5px; color: var(--text); }
.store-card__btn { font-weight: 800; font-size: 11px; letter-spacing: .04em; padding: 5px 11px; border-radius: 11px; display: inline-flex; align-items: center; }
.store-card__btn.is-on { background: linear-gradient(160deg, #6fce8f, var(--success)); color: #fff; }
.store-card__btn.is-equip { background: linear-gradient(160deg, var(--coral-bright), var(--coral-deep)); color: #fff; }
.store-card__btn.is-buy { background: linear-gradient(160deg, #f0c45f, #d89a2e); color: #4a3410; }
.store-card__btn.is-buy .coin-amt { color: #4a3410; } .store-card__btn.is-buy .ycoin { width: 14px; height: 14px; }
.store-card__btn.is-cant { background: var(--surface-sunken); color: var(--muted-soft); }
.store-card__btn.is-cant .coin-amt { color: var(--muted-soft); }

/* —— Stats: form strip + rivals + win coins —— */
.form-strip { display: flex; flex-wrap: wrap; gap: 5px; padding: 2px 0 4px; }
.form-strip .rstreak { width: 23px; height: 23px; }
.rival-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 8px; vertical-align: middle; }
.win__coins { color: var(--gold); font-weight: 800; } .win__coins .ycoin { width: 15px; height: 15px; }

/* —— Home recent-form label —— */
.streak-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.streak-wrap[hidden] { display: none; }
.streak-label { font-weight: 800; font-size: 8.5px; letter-spacing: .14em; color: var(--muted-soft); text-transform: uppercase; }

/* —— Dice Box (custom loadout composer) —————————————— */
.store-head__actions { display: flex; align-items: center; gap: 8px; }
.store-mixbtn { font-weight: 800; font-size: 10px; letter-spacing: .1em; color: #fff; border: 0; cursor: pointer;
  background: linear-gradient(160deg, var(--coral-bright), var(--coral-deep)); padding: 7px 11px; border-radius: 13px;
  box-shadow: 0 5px 12px rgba(216,95,67,.26); font-family: var(--font); transition: transform .14s var(--ease-soft); }
.store-mixbtn:active { transform: scale(.96); }

.box-modal { max-width: 392px; width: calc(100% - 28px); max-height: 90vh; max-height: 90dvh; display: flex; flex-direction: column; overflow-y: auto; padding: 16px 16px calc(14px + var(--sab)); text-align: center; }
.box-seg { display: flex; gap: 4px; background: var(--surface-sunken); border-radius: 14px; padding: 4px; margin: 8px 0 14px; }
.box-seg__opt { flex: 1; border: 0; cursor: pointer; font-family: var(--font); font-weight: 800; font-size: 11.5px; letter-spacing: .08em;
  color: var(--muted); padding: 9px; border-radius: 11px; background: transparent; transition: color .18s, background .18s, box-shadow .18s; }
.box-seg__opt.on { background: #fff; color: var(--coral-ink); box-shadow: 0 3px 8px var(--shadow-soft); }
.box-stage { background: radial-gradient(120% 130% at 50% 0%, var(--surface-soft), var(--surface-sunken)); border-radius: 18px; padding: 14px 6px; box-shadow: inset 0 0 0 1px var(--line-soft); }
.box-slots { display: flex; justify-content: space-between; gap: 4px; }
.box-slot { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; cursor: pointer;
  background: transparent; padding: 7px 2px; border-radius: 13px; transition: transform .14s var(--ease-soft), box-shadow .18s; font-family: var(--font); }
.box-slot img { width: 46px; height: 46px; filter: drop-shadow(0 4px 6px rgba(60,45,25,.25)); }
.box-slot__num { font-weight: 800; font-size: 9px; color: var(--muted-soft); }
.box-slot__name { font-weight: 700; font-size: 8.5px; color: var(--muted); max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.box-slot--sel { background: #fff; box-shadow: 0 0 0 2px var(--coral), 0 6px 14px rgba(233,111,95,.18); }
.box-slot--sel .box-slot__name { color: var(--coral-ink); }
.box-hint { font-size: 11px; color: var(--muted); margin: 12px 0 10px; line-height: 1.4; }
.box-palette { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.box-swatch { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 62px; border: 0; cursor: pointer;
  background: var(--surface-soft); border-radius: 12px; padding: 7px 4px; box-shadow: inset 0 0 0 1px var(--line-soft);
  transition: transform .12s var(--ease-soft), box-shadow .16s; font-family: var(--font); }
.box-swatch img { width: 34px; height: 34px; filter: drop-shadow(0 3px 4px rgba(60,45,25,.22)); }
.box-swatch span { font-weight: 700; font-size: 8.5px; color: var(--muted); max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.box-swatch--on { box-shadow: 0 0 0 2px var(--coral), 0 5px 12px rgba(233,111,95,.16); }
.box-swatch--on span { color: var(--coral-ink); }
.box-swatch:active { transform: scale(.94); }

/* ===================================================================
   DICE DETAIL — big swipe-rotatable 3D model (store detail page)
   =================================================================== */
.dv-overlay { position: absolute; inset: 0; z-index: 130; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(120% 90% at 50% 0%, rgba(40,36,30,.62), rgba(24,22,18,.86)); backdrop-filter: blur(8px); animation: fadeIn .22s ease both; }
.dv-overlay[hidden] { display: none; }
.dv-name { color: #fff; font-weight: 800; font-size: 21px; letter-spacing: .04em; margin-bottom: 6px; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.dv-sub { color: rgba(255,255,255,.6); font-size: 11.5px; letter-spacing: .12em; font-weight: 700; margin-bottom: 24px; }
.dv-stage { perspective: 520px; width: 135px; height: 135px; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.dv-stage:active { cursor: grabbing; }
/* --r  = rounding of the photo FACES (outer corner look).
   --rb = rounding of the solid BODY behind them (kept SHARP so it fills the
          splay at every angle — a sharp body never goes see-through). */
.dv-cube { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; will-change: transform; --r: 28%; --rb: 4%; }
.dv-cube .cf { background-size: 122%; border-radius: var(--r); box-shadow: inset 0 0 18px rgba(0,0,0,.14); }
/* Directional lighting per visible face → real 3D shading, not one flat colour. */
.dv-cube .cf::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.dv-cube .cf--top::after    { background: linear-gradient(158deg, rgba(255,255,255,.34), rgba(255,255,255,.05) 52%, rgba(0,0,0,.05)); }
.dv-cube .cf--front::after  { background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,0) 38%, rgba(0,0,0,.22)); }
.dv-cube .cf--right::after  { background: linear-gradient(102deg, rgba(255,255,255,.07), rgba(0,0,0,.06) 42%, rgba(0,0,0,.36)); }
.dv-cube .cf--left::after   { background: linear-gradient(258deg, rgba(255,255,255,.07), rgba(0,0,0,.06) 42%, rgba(0,0,0,.36)); }
.dv-cube .cf--back::after   { background: rgba(0,0,0,.32); }
.dv-cube .cf--bottom::after { background: rgba(0,0,0,.36); }
/* Solid die BODY behind the faces — die-toned, shaded per face. */
.dvcore { position: absolute; inset: 0; border-radius: var(--rb); backface-visibility: hidden;
  background:
    radial-gradient(125% 125% at 38% 28%, rgba(255,255,255,.28), rgba(255,255,255,0) 46%, rgba(0,0,0,.22) 88%),
    color-mix(in srgb, var(--cube-fill, #2ba6d6) 82%, #15151d); }
.dvcore--front  { transform: translateZ(calc(var(--half) - 1px)); filter: brightness(1.00); }
.dvcore--back   { transform: rotateY(180deg) translateZ(calc(var(--half) - 1px)); filter: brightness(.58); }
.dvcore--right  { transform: rotateY(90deg)  translateZ(calc(var(--half) - 1px)); filter: brightness(.70); }
.dvcore--left   { transform: rotateY(-90deg) translateZ(calc(var(--half) - 1px)); filter: brightness(.70); }
.dvcore--top    { transform: rotateX(90deg)  translateZ(calc(var(--half) - 1px)); filter: brightness(1.22); }
.dvcore--bottom { transform: rotateX(-90deg) translateZ(calc(var(--half) - 1px)); filter: brightness(.55); }
/* Deeper, darker shell → natural edge-contact shadow at the very corner. */
.dvcore2 { position: absolute; inset: 0; border-radius: var(--rb); backface-visibility: hidden;
  background: color-mix(in srgb, var(--cube-fill, #2ba6d6) 62%, #101018); }
.dvcore2--front  { transform: translateZ(calc(var(--half) - 3px)); }
.dvcore2--back   { transform: rotateY(180deg) translateZ(calc(var(--half) - 3px)); }
.dvcore2--right  { transform: rotateY(90deg)  translateZ(calc(var(--half) - 3px)); }
.dvcore2--left   { transform: rotateY(-90deg) translateZ(calc(var(--half) - 3px)); }
.dvcore2--top    { transform: rotateX(90deg)  translateZ(calc(var(--half) - 3px)); }
.dvcore2--bottom { transform: rotateX(-90deg) translateZ(calc(var(--half) - 3px)); }
.dv-hint { color: rgba(255,255,255,.55); font-size: 12px; margin-top: 28px; letter-spacing: .02em; }
.dv-action { margin-top: 18px; min-width: 170px; border: 0; cursor: pointer; font-family: var(--font); font-weight: 800;
  font-size: 14px; letter-spacing: .05em; color: #fff; padding: 13px 26px; border-radius: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; box-shadow: 0 8px 20px rgba(0,0,0,.3);
  transition: transform .12s var(--ease-soft); }
.dv-action:active { transform: scale(.96); }
.dv-action.is-on    { background: linear-gradient(160deg, #6fce8f, var(--success)); }
.dv-action.is-equip { background: linear-gradient(160deg, var(--coral-bright), var(--coral-deep)); }
.dv-action.is-buy   { background: linear-gradient(160deg, #f0c45f, #d89a2e); color: #4a3410; }
.dv-action.is-buy .coin-amt { color: #4a3410; } .dv-action.is-buy .ycoin { width: 16px; height: 16px; }
.dv-action.is-cant  { background: rgba(255,255,255,.14); color: rgba(255,255,255,.6); }
.dv-action.is-cant .coin-amt { color: rgba(255,255,255,.6); }
.dv-close { margin-top: 12px; border: 0; cursor: pointer; font-family: var(--font); font-weight: 800; font-size: 12px; letter-spacing: .1em;
  color: rgba(255,255,255,.85); background: rgba(255,255,255,.12); padding: 10px 22px; border-radius: 14px; }
.dv-close:active { transform: scale(.96); }

/* —— Online reconnect banner + rematch waiting state —— */
.reconn-bar { position: absolute; left: 50%; top: calc(10px + var(--sat)); transform: translateX(-50%);
  z-index: 60; background: rgba(20,24,30,.92); color: #fff; font-family: var(--font); font-weight: 700; font-size: 13px;
  letter-spacing: .02em; padding: 8px 16px; border-radius: 999px; box-shadow: 0 4px 16px rgba(0,0,0,.32); pointer-events: none;
  animation: reconnPulse 1.4s ease-in-out infinite; }
@keyframes reconnPulse { 0%,100% { opacity: .72; } 50% { opacity: 1; } }
.play-btn.is-waiting { opacity: .72; }

/* =====================================================================
   PORTRAIT LOCK
   Native apps are locked to portrait (Info.plist / AndroidManifest).
   Mobile web can't be hard-locked, so a landscape phone viewport gets a
   full-screen "rotate back" nudge instead of a cramped, unplayable board.
   Also kill double-tap-to-zoom app-wide (belt to the viewport's user-scalable=no).
   ===================================================================== */
html { touch-action: manipulation; }

.rotate-lock { display: none; }
@media (orientation: landscape) and (max-height: 560px) and (pointer: coarse) {
  .rotate-lock {
    display: flex; position: fixed; inset: 0; z-index: 200;
    flex-direction: column; align-items: center; justify-content: center; gap: 16px;
    padding: 24px calc(24px + var(--sar)) calc(24px + var(--sab)) calc(24px + var(--sal));
    text-align: center;
    background: radial-gradient(135% 120% at 50% 0%, #faf3ea 0%, #f5ece0 48%, #f1e7da 100%);
  }
  .rotate-lock__mark { display: flex; align-items: center; gap: 12px; }
  .rotate-lock__mark .diamond { width: 7px; height: 7px; }
  .rotate-lock__icon {
    width: 52px; height: 52px; color: var(--coral);
    transform-origin: 50% 50%;
    animation: rotate-nudge 2.4s cubic-bezier(.72, 0, .28, 1) infinite;
  }
  .rotate-lock__title {
    margin: 6px 0 0; font-family: var(--font); font-weight: 800; font-size: 16px;
    letter-spacing: .14em; text-transform: uppercase; color: var(--coral-ink);
  }
  .rotate-lock__body {
    margin: 0; max-width: 300px; font-family: var(--font); font-weight: 600;
    font-size: 12.5px; line-height: 1.5; color: var(--muted);
  }
}
@keyframes rotate-nudge {
  0%, 55%, 100% { transform: rotate(0deg); }
  22%, 40%      { transform: rotate(90deg); }
}
@media (prefers-reduced-motion: reduce) { .rotate-lock__icon { animation: none; } }

/* =====================================================================
   MULTI BOARD (3+ Spieler) — sticky Kategorie-Spalte + sticky eigene
   Spalte links, Gegner-Spalten rechts (horizontal scrollbar ab 4 Gegnern).
   Aktiviert über .board--multi; das 1v1-Board bleibt unangetastet.
   ===================================================================== */
.board--multi { overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth; }
.board--multi::-webkit-scrollbar { height: 0; }

.mrow {
  flex: 1; position: relative; min-height: 0; border-top: 1px solid rgba(120,100,78,.1);
  display: grid; grid-template-columns: var(--mplw, 88px) var(--mpmw, 74px) repeat(var(--mpn, 2), var(--mpow, 90px));
  align-items: stretch;
  min-width: max-content;   /* keep intrinsic width so the BOARD scrolls, not the row clips */
}
.mrow:first-child { border-top: none; }
.mrow--head { flex: none; height: 34px; border-top: none; }

.mcell { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; }

/* sticky category labels — solid bg so scrolling columns slide underneath */
.mcell--label {
  position: sticky; left: 0; z-index: 4; justify-content: flex-start; gap: 5px; padding: 0 4px 0 10px;
  background: linear-gradient(165deg, #fbf6ee, #f6eee0);
  box-shadow: 1px 0 0 rgba(120,100,78,.12);
}
.mcell--label .cat-label { text-align: left; font-size: 9.5px; }
.mcell--label .cat-die { width: 16px; height: 16px; }

/* sticky own column (coral, always visible) */
.mcell--me {
  position: sticky; left: var(--mplw, 88px); z-index: 3;
  background: linear-gradient(165deg, #fdf1ea, #f9e9dd);
  box-shadow: 2px 0 4px rgba(120,92,66,.1);
}

/* opponent columns (scrolling) */
.mcell--opp { background: rgba(62,155,210,.05); box-shadow: inset 1px 0 0 rgba(120,100,78,.05); }
.mcell--opp.is-active { background: rgba(62,155,210,.11); }

/* column heads: avatar chip + short name */
.mhead { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 100%; }
.mhead__name { font-weight: 700; font-size: 8px; letter-spacing: .06em; color: #6d675e; max-width: 92%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mhead--me .mhead__name { color: var(--coral-ink); }
.mp-ava { width: 17px; height: 17px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 8px; color: #fff; background: #9db4c4; box-shadow: 0 1px 3px rgba(60,45,30,.2); overflow: hidden; flex: none; }
.mp-ava img { width: 100%; height: 100%; object-fit: cover; }
.mp-ava--me { background: var(--coral); }
.mhead.is-active .mp-ava { box-shadow: 0 0 0 2px var(--blue), 0 0 8px rgba(32,168,212,.55); }
.mhead--me.is-active .mp-ava { box-shadow: 0 0 0 2px var(--coral), 0 0 8px rgba(233,111,95,.55); }
.mrow--head .mcell--label { align-items: flex-end; padding-bottom: 3px; }
.mrow--head .mcell--label .meta-label { font-size: 8.5px; }

/* values — slightly tighter than 1v1 */
.mcell .val { font-size: 15px; }
.mcell .val--dim { font-size: 12.5px; }
.mcell--me .glow { inset: 3px; }
.mcell .idle-dot { width: 5px; height: 5px; }
.mcell .meta-num, .mcell .bonus-got { font-size: 12px; }
.mcell .bonus-gap { font-size: 8.5px; }
.mcell .total-num { font-size: 15px; }
.mcell .instant-pts { font-size: 12px; }

/* meta/total tints per column type */
.mrow--meta .mcell--label { background: linear-gradient(165deg, #f7f0e4, #f2e9da); }
.mrow--meta .mcell--me { background: linear-gradient(165deg, #f9ecdf, #f5e4d4); }
.mrow--total { border-top: 1px solid rgba(120,100,78,.14); }
.mrow--total .mcell--me { background: linear-gradient(165deg, #f9e0d2, #f6d8c8); }
.mrow--total .mcell--opp { background: rgba(62,155,210,.13); }
.mrow--total .total-label { font-size: 10px; letter-spacing: .14em; }

/* —— header race bar (multi mode) — the N-player cousin of the 1v1 heat bar.
      Avatars sit on a track positioned by score: the GAP between dots shows
      how close you are to the player ahead. Leader on the right. —— */
.race-bar { position: relative; height: 20px; margin: 3px 4px 1px; }
.race-bar__track { position: absolute; left: 0; right: 0; top: 50%; height: 5px; transform: translateY(-50%);
  border-radius: 999px; background: linear-gradient(90deg, rgba(120,100,78,.08), rgba(120,100,78,.16));
  box-shadow: inset 0 1px 2px rgba(90,70,50,.14), inset 0 -1px 0 rgba(255,255,255,.5); }
.race-bar__finish { position: absolute; right: -1px; top: 50%; width: 6px; height: 6px; transform: translate(0,-50%) rotate(45deg);
  border-radius: 1px; background: var(--gold); box-shadow: 0 0 5px rgba(224,162,60,.55); }
.race-dot { position: absolute; top: 50%; transform: translate(-50%, -50%); transition: left .6s var(--ease-out, ease-out); }
.race-dot .mp-ava { width: 15px; height: 15px; font-size: 7px; border: 1.5px solid rgba(255,255,255,.9); box-sizing: content-box; }
.race-dot--me .mp-ava { box-shadow: 0 0 0 1.6px var(--coral), 0 1px 4px rgba(60,45,30,.25); }
.race-dot--active .mp-ava { box-shadow: 0 0 0 1.6px var(--blue), 0 0 7px rgba(32,168,212,.55); }
.race-dot--me.race-dot--active .mp-ava { box-shadow: 0 0 0 1.6px var(--coral), 0 0 7px rgba(233,111,95,.55); }

/* —— local N-player setup: player-count segment in the name modal —— */
.pcount-seg { display: flex; align-items: center; gap: 6px; margin: 2px 0 4px; }
.pcount-seg__label { font-weight: 600; font-size: 9.5px; letter-spacing: .14em; color: var(--muted); margin-right: 2px; }
.pcount-seg__opt { width: 30px; height: 30px; border: 0; border-radius: 10px; cursor: pointer;
  font-family: var(--font); font-weight: 800; font-size: 13px; color: var(--muted);
  background: rgba(255,255,255,.6); box-shadow: var(--inset); }
.pcount-seg__opt--on { background: var(--coral); color: #fff; box-shadow: 0 3px 8px rgba(216,95,67,.4); }

/* —— N-player end screen: ranked list under the winner podium —— */
.win-rank { display: flex; flex-direction: column; gap: 6px; margin: 10px auto 2px; max-width: 250px; }
.win-rank__row { display: flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 12px;
  background: rgba(255,255,255,.5); box-shadow: inset 0 0 0 1px rgba(120,100,78,.1); }
.win-rank__pos { font-weight: 800; font-size: 11px; color: var(--muted); width: 16px; text-align: right; }
.win-rank__row .mp-ava { width: 20px; height: 20px; font-size: 9px; }
.win-rank__name { flex: 1; min-width: 0; text-align: left; font-weight: 700; font-size: 12px; letter-spacing: .04em; color: var(--text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-rank__pts { font-weight: 800; font-size: 14px; color: #2e86be; font-variant-numeric: tabular-nums; }

/* —— online lobby (create/join modal) —— */
.lobby-head { display: flex; align-items: center; justify-content: space-between; margin: 14px 2px 6px;
  font-weight: 600; font-size: 9.5px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.lobby-count { font-weight: 800; color: var(--coral-ink); letter-spacing: .04em; }
.lobby-list { display: flex; flex-direction: column; gap: 6px; min-height: 44px; }
.lobby-row { display: flex; align-items: center; gap: 9px; padding: 7px 12px; border-radius: 12px;
  background: rgba(255,255,255,.55); box-shadow: inset 0 0 0 1px rgba(120,100,78,.1); }
.lobby-row--away { opacity: .45; }
.lobby-row .mp-ava { width: 22px; height: 22px; font-size: 10px; }
.lobby-row__name { flex: 1; min-width: 0; text-align: left; font-weight: 700; font-size: 13px; color: var(--text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-row__tag { font-weight: 700; font-size: 8.5px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; background: rgba(120,100,78,.09); }

/* departed player (online): grey out their column head */
.mhead--gone { opacity: .4; filter: grayscale(1); }

/* =====================================================================
   RULES / FIRST-RUN INTRO — three steps: roll, score, strike.
   Reuses the result-card overlay; the icon tile mirrors the mode cards.
   ===================================================================== */
.rules-card { max-width: 330px; text-align: center; }
.rules-step { min-height: 216px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.rules-step__icon { width: 72px; height: 72px; margin: 10px 0 14px; display: flex; align-items: center; justify-content: center;
  border-radius: 22px; transform: rotate(45deg); box-shadow: 0 10px 20px rgba(120,92,66,.22), inset 0 2px 0 rgba(255,255,255,.35); }
.rules-step__icon svg { transform: rotate(-45deg); }
.rules-step__icon--roll   { background: radial-gradient(120% 120% at 30% 20%, #58c4e6, #118bb4); }
.rules-step__icon--score  { background: radial-gradient(120% 120% at 30% 20%, #f0826f, #d8584a); }
.rules-step__icon--strike { background: radial-gradient(120% 120% at 30% 20%, #4a4643, #2c2a27); }
.rules-step__title { font-weight: 800; font-size: 19px; letter-spacing: .04em; color: var(--text-strong); margin-bottom: 8px; }
.rules-step__body { font-size: 14.5px; line-height: 1.55; color: var(--text); max-width: 270px; }
.rules-step__body strong { color: var(--text-strong); }
.rules-dots { display: flex; gap: 7px; justify-content: center; margin-top: 12px; }
.rules-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(120,100,78,.22); transition: background .2s, transform .2s; }
.rules-dot--on { background: var(--coral); transform: scale(1.25); }
/* .foot-btn sets display:flex, which beats the [hidden] UA default */
#rulesSkip[hidden] { display: none; }

/* =====================================================================
   TABLET (iPad) — proportionale Vergroesserung statt gestreckter Spalte

   Die App ist durchgehend in px gebaut (mobile-first, kein rem). Auf einem
   iPad stand die 412px-Spalte deshalb als winzige Insel in der Mitte: den
   Container einfach zu verbreitern haette das Layout gestreckt, ohne Schrift
   und Wuerfel mitwachsen zu lassen. `zoom` skaliert Layout UND Typografie im
   selben Verhaeltnis — jedes Detail bleibt exakt proportioniert wie auf dem
   iPhone, nur groesser, und Touch-Ziele werden groesser statt kleiner.

   Die Hoehe muss durch denselben Faktor geteilt werden, sonst waere .phone
   um den Zoom-Faktor hoeher als der Viewport und der Footer rutschte raus.

   Die Faktoren sind so gewaehlt, dass die verbleibende "virtuelle" Hoehe
   nicht unter die eines iPhones faellt (~810px) — das Spielbrett braucht
   diese Hoehe, sonst wird es gequetscht:
     iPad mini  1133 / 1.35 = 839    iPad 11"  1180 / 1.35 = 874
     iPad 13"   1376 / 1.55 = 888
   Greift erst ab 700px Breite; Telefone (bis 440px) sehen diese Regeln nie.
   ===================================================================== */
/* Mindest-Trefferflaeche 44pt (Apple HIG). Apple hat Build 9 abgelehnt, u.a.
   wegen "controls that are difficult to use due to size or placement".
   Nachgemessen waren diese drei Kopfzeilen-Knoepfe AUF DEM IPHONE zu klein —
   es ist also kein iPad-Problem, dort faellt es nur staerker auf:
     Wallet/Store 31pt · Stats 29pt · Sprachumschalter 33pt
   Nur die Hoehe wird angehoben; Breite, Farben und Radien bleiben unveraendert,
   das Erscheinungsbild aendert sich kaum. */
.wallet-chip,
#statsBtn,
.lang-toggle {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 700px) {
  .phone {
    --z: 1.35;
    zoom: var(--z);
    height: calc(100dvh / var(--z));
    /* 520 statt 412: Bei 412 blieb auf einem iPad Air 11" (820pt breit) links
       und rechts je ~132pt leer — die App nutzte nur 68% der Breite und wirkte
       wie eine auf das Tablet gelegte Telefon-App. Apple hat genau das
       beanstandet ("should function as expected for iPad users", 15.09.2026).
       520 x 1.35 = 702pt, also 86% der Breite. Nachgemessen: kein vertikaler
       Ueberlauf, das Brett bleibt vollstaendig sichtbar. */
    max-width: 520px;
    box-shadow: 0 0 0 1px rgba(120,100,78,.07);
  }
}
@media (min-width: 1000px) {
  .phone { --z: 1.55; max-width: 560px; }   /* 13" iPad: 560 x 1.55 = 868 von 1024pt */
}

/* Die Modal-Karten begrenzen ihre Hoehe in dvh. Diese Einheit meint immer das
   echte Fenster, nicht den .phone-Kasten — der Zoom multipliziert sie danach
   noch einmal, sodass eine 88dvh-Karte auf dem iPad 1877px hoch wird und ihre
   Kopfzeile samt Schliessen-Knopf ueber den Bildrand schiebt. Darum hier durch
   denselben Faktor teilen. --z erbt von .phone, gilt also fuer 1.35 und 1.55. */
@media (min-width: 700px) {
  .result-card { max-height: calc(92dvh / var(--z)); }
  .stats-card  { max-height: calc(86dvh / var(--z)); }
  .store-modal { max-height: calc(88dvh / var(--z)); }
  .box-modal   { max-height: calc(90dvh / var(--z)); }
}
