/* ============================================================
   Time's Up PWA — styles (v2: teams, hourglass, score drawer)
   Light theme, phone-first. One screen visible at a time.
   ============================================================ */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --ink: #1d1f24;
  --ink-soft: #6b7280;
  --line: #e7e9ee;

  --brand: #ff5a3c;
  --brand-ink: #ffffff;
  --found: #17b978;
  --danger: #e5484d;

  --team-blue: #3c7bff;
  --team-red: #ff4d4d;
  --team-green: #17b978;
  --team-purple: #a855f7;

  /* A card is a card: one neutral card-back colour, never recoloured by pile. */
  --card-back: #ff5a3c;
  --card-back-2: #ff7358;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 30px rgba(20, 22, 30, 0.08);
  --shadow-card: 0 12px 28px rgba(20, 22, 30, 0.14);
  --pad: 22px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* ---- Fully locked viewport ----
   The game must never zoom, pan, rubber-band or shift under the fingers:
   it's a tap-only board that has to stay perfectly still. */
html, body {
  height: 100%;
  overflow: hidden;                 /* no document scrolling at all */
  position: fixed;                  /* kills iOS rubber-band / address-bar shift */
  inset: 0;
  width: 100%;
  overscroll-behavior: none;        /* no pull-to-refresh, no scroll chaining */
  touch-action: manipulation;       /* no double-tap zoom, no pan gestures */
  -ms-touch-action: manipulation;
  -webkit-text-size-adjust: 100%;   /* iOS must not resize text on rotation */
  text-size-adjust: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* No text selection / callout / drag anywhere: those cause the "sliding" feel.
   Inputs stay selectable so team names remain editable. */
body, .app, .screen, .btn, .bigbtn, .chip, .card, .mini-card, .modal, .scoresheet {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
img { -webkit-user-drag: none; user-drag: none; pointer-events: none; }

:focus { outline: none; }
:focus-visible { outline: 3px solid rgba(255, 90, 60, 0.5); outline-offset: 2px; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* ============ BACKGROUND ============ */
.bg-layer { position: fixed; inset: 0; z-index: -1; background: var(--bg) center / cover no-repeat; transition: opacity 0.5s ease; }
body[data-bg="home"] .bg-layer { background-image: url("../img/bg-confetti.png"); }
body[data-bg="play"] .bg-layer { background-image: url("../img/bg-shapes.png"); }
/* Keep the ambiance visible on menus, but calm it right down during play so
   the card and buttons stay the focus. */
.bg-layer::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(244,245,247,0.18), rgba(244,245,247,0.55)); }
body[data-bg="play"] .bg-layer::after { background: linear-gradient(180deg, rgba(244,245,247,0.82), rgba(244,245,247,0.93)); }

.home__hero { width: 128px; height: 128px; object-fit: contain; margin: 0 auto 10px; display: block; }

/* ============ APP SHELL ============ */
.app { position: relative; width: 100%; height: 100%; height: 100dvh; max-width: 480px; margin: 0 auto; overflow: hidden; }
/* Only these inner panels may scroll, and they must not chain to the document. */
.lobby__body, .rules__body { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }

.netbar { position: fixed; top: 0; left: 0; right: 0; z-index: 60; background: #ffb020; color: #3a2a00; text-align: center; font-size: 13px; font-weight: 700; padding: 6px; padding-top: max(env(safe-area-inset-top), 6px); }

/* ============ SCREENS ============ */
.screen { position: absolute; inset: 0; display: none; flex-direction: column; padding: max(env(safe-area-inset-top), var(--pad)) var(--pad) max(env(safe-area-inset-bottom), var(--pad)); gap: 16px; }
.screen.is-active { display: flex; animation: screen-in 0.22s ease; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============ TOP BAR ============ */
.topbar { display: flex; align-items: center; gap: 12px; }
.topbar h2 { font-size: 20px; font-weight: 700; }
.icon-btn { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); flex: none; }

/* ============ BUTTONS ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 54px; padding: 0 22px; border-radius: var(--radius); font-size: 17px; font-weight: 700; transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease; }
.btn:active { transform: scale(0.97); }
.btn__ico { width: 22px; height: 22px; flex: none; }
.btn--lg { width: 100%; height: 58px; font-size: 18px; margin-top: auto; }
.btn--sm { height: 44px; font-size: 15px; }
.btn--primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 10px 24px rgba(255, 90, 60, 0.35); }
.btn--ghost { background: transparent; color: var(--ink-soft); box-shadow: none; }
.btn--outline { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); border: 1.5px dashed var(--line); }
.btn--danger { background: var(--danger); color: #fff; box-shadow: 0 10px 24px rgba(229,72,77,0.32); }

/* ============ HOME ============ */
.screen--home { justify-content: center; align-items: center; text-align: center; gap: 14px; }
.home__brand { margin-bottom: 20px; }
.logo { font-size: 54px; font-weight: 800; letter-spacing: -2px; line-height: 0.9; }
.logo--sm { font-size: 40px; }
.logo span { display: block; color: var(--brand); }
.tagline { margin-top: 12px; color: var(--ink-soft); font-size: 16px; }
.screen--home .btn--lg { margin-top: 0; }

/* ============ LOBBY ============ */
.lobby__body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 10px; }
.field > label { font-size: 14px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.4px; }
.field__hint { font-size: 13px; color: var(--ink-soft); line-height: 1.4; }

.stepper { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); }
.stepper__btn { flex: 0 0 auto; width: 46px; height: 46px; min-width: 46px; max-width: 46px; padding: 12px; border-radius: 12px; background: var(--bg); color: var(--ink); }
.stepper__btn svg { display: block; width: 22px; height: 22px; }
.stepper__value { font-size: 24px; font-weight: 800; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { height: 46px; padding: 0 16px; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); font-size: 15px; font-weight: 600; color: var(--ink); }
.chip.is-selected { background: var(--brand); color: #fff; box-shadow: 0 8px 18px rgba(255, 90, 60, 0.32); }
.chip:disabled { opacity: 0.35; }

.team-name-row { display: flex; align-items: center; gap: 10px; }
.team-name-row .dot { flex: none; width: 16px; height: 16px; border-radius: 50%; }
.team-name-input { flex: 1; height: 46px; padding: 0 14px; font-size: 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }

/* ============ QR ============ */
.qr__body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.qr__hint { color: var(--ink-soft); font-size: 15px; max-width: 300px; }
.qr__frame { background: #fff; padding: 16px; border-radius: 22px; box-shadow: var(--shadow-card); }
.qr__frame img { display: block; width: 250px; height: 250px; }
.qr__url { font-size: 13px; color: var(--ink-soft); word-break: break-all; max-width: 320px; }

/* ============ JOIN / ROOTPICK ============ */
.screen--join, .screen--rootpick { justify-content: center; align-items: center; text-align: center; gap: 18px; }
.join__brand { margin-bottom: 4px; }
.join__hint { color: var(--ink-soft); font-size: 16px; max-width: 300px; }
.pick2 { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.pick2__opt { display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-card); text-align: center; }
.pick2__big { font-size: 22px; font-weight: 800; }
.pick2__sub { font-size: 14px; color: var(--ink-soft); }
.join__teams { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.team-pick { display: flex; align-items: center; justify-content: center; gap: 12px; height: 66px; border-radius: var(--radius); font-size: 20px; font-weight: 800; color: #fff; box-shadow: var(--shadow-card); }
.team-pick--blue { background: var(--team-blue); }
.team-pick--red { background: var(--team-red); }
.team-pick--green { background: var(--team-green); }
.team-pick--purple { background: var(--team-purple); }

/* ============ DECK VISUAL (reused ready + play) ============ */
.deck-visual { position: relative; width: 76px; height: 96px; margin: 0 auto; }
.mini-card { position: absolute; left: 50%; top: 50%; width: 54px; height: 74px; margin: -37px 0 0 -27px; border-radius: 8px; border: 2px solid #fff;
  background: repeating-linear-gradient(45deg, var(--card-back) 0 7px, var(--card-back-2) 7px 14px); box-shadow: 0 2px 4px rgba(0,0,0,0.16); }

/* ============ READY ============ */
.screen--ready { justify-content: center; align-items: center; text-align: center; gap: 14px; }

/* The round + its rule must be impossible to miss: changing round changes the
   way you are allowed to give clues. */
.roundcard {
  width: 100%; background: var(--surface); border-radius: 22px; padding: 20px 18px;
  box-shadow: var(--shadow-card); border: 3px solid var(--brand);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.roundcard__badge {
  display: inline-block; background: var(--brand); color: #fff;
  font-size: 14px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 6px 16px; border-radius: 999px;
}
.roundcard__mode { font-size: 28px; font-weight: 800; line-height: 1.1; }
.roundcard__rule { font-size: 15px; color: var(--ink-soft); line-height: 1.45; }
.ready__deck { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 4px 0; }
.ready__deckcount { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.ready__deckcount span { color: var(--ink); }
.ready__team { display: flex; align-items: center; gap: 12px; }
.ready__team .dot { width: 26px; height: 26px; border-radius: 50%; }
.ready__team h2 { font-size: 32px; font-weight: 800; }
.ready__hint { color: var(--ink-soft); font-size: 15px; max-width: 260px; }
.ready__wait { color: var(--ink-soft); font-size: 15px; font-style: italic; margin-top: auto; }

/* ============ PLAY ============ */
.screen--play { justify-content: flex-start; gap: 12px; }
/* Leave room on the right for the fixed menu button so the timer never sits under it. */
.play__hud { display: flex; align-items: center; justify-content: space-between; padding-right: 46px; }
.play__turnteam { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.play__turnteam .dot { width: 14px; height: 14px; border-radius: 50%; }

/* Modern time meter: thick-stroke capsule with a diagonally striped fill
   that drains left to right. Built in CSS so it stays crisp at any size. */
.meter {
  position: relative; width: 100%; height: 30px; flex: none;
  border: 3px solid var(--ink); border-radius: 999px;
  background: var(--surface); overflow: hidden;
}
.meter__fill {
  position: absolute; inset: 0; width: 100%; transform-origin: left center;
  background-color: var(--brand);
  /* thick diagonal stripes */
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255,255,255,0.38) 0 10px,
    rgba(255,255,255,0) 10px 22px
  );
  background-size: 31px 100%;
  animation: meter-stripes 0.9s linear infinite;
  transition: background-color 0.3s ease;
}
@keyframes meter-stripes { to { background-position: 31px 0; } }
.meter.is-low .meter__fill { background-color: var(--danger); }
.meter.is-low { animation: meter-pulse 0.9s ease-in-out infinite; }
@keyframes meter-pulse { 50% { transform: scale(1.02); } }

.meter__num { display: flex; align-items: baseline; gap: 2px; font-size: 30px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; transition: color 0.3s ease; }
.meter__unit { font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.screen--play.is-lowtime .meter__num { color: var(--danger); }

/* Pile bar: draw pile + THIS turn's collected pile only */
.play__pilebar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; height: 84px; }
.pile { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pile__stack { position: relative; width: 58px; height: 60px; }
.pile__stack .mini-card { width: 42px; height: 56px; margin: 0; left: 50%; top: auto; bottom: 0; margin-left: -21px; }
.pile__stack.is-low .mini-card { animation: wobble 0.9s ease-in-out infinite; }
@keyframes wobble { 50% { transform: translateY(-2px) rotate(2deg); } }
.pile__count { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.pile__count span { color: var(--ink); }

/* Active card (smaller now that buttons are bigger) */
.card { flex: 1; min-height: 0; margin: 2px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-card); padding: 22px; text-align: center; }
.card.is-swap { animation: card-swap 0.28s ease; }
@keyframes card-swap { from { opacity: 0; transform: scale(0.9) rotate(-1deg); } to { opacity: 1; transform: scale(1); } }
.card__cat { font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--brand); }
.card__label { font-size: 30px; font-weight: 800; line-height: 1.12; }

/* Flying card animation (card moves from centre to the turn pile) */
.flying-card { position: absolute; width: 60px; height: 82px; border-radius: 8px; border: 2px solid #fff; z-index: 40; pointer-events: none;
  background: repeating-linear-gradient(45deg, var(--card-back) 0 7px, var(--card-back-2) 7px 14px); box-shadow: var(--shadow-card); }

/* Pass animation: the card slides off the top of the draw pile and tucks in
   underneath it, so it reads as "it goes back to the bottom of the deck". */
.flying-card.is-tucking { z-index: 5; }
.card.is-passing { animation: card-pass-out 0.42s cubic-bezier(.4,.1,.2,1); }
@keyframes card-pass-out {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-14px) scale(0.94); }
}

/* Waiting/watch */
.watch { flex: 1; min-height: 0; margin: 2px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-card); padding: 22px; text-align: center; }
.watch__pulse { display: flex; gap: 8px; }
.watch__pulse span { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); animation: bounce 1.2s infinite; }
.watch__pulse span:nth-child(2) { animation-delay: 0.2s; }
.watch__pulse span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-8px); opacity: 1; } }
.watch__title { font-size: 24px; font-weight: 800; }
.watch__sub { font-size: 15px; color: var(--ink-soft); max-width: 240px; }
.watch__flash { margin-top: 10px; padding: 10px 16px; border-radius: 14px; background: rgba(23,185,120,0.12); color: var(--found); font-size: 17px; }
.watch__flash.is-in { animation: flash-in 0.3s ease; }
@keyframes flash-in { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
.watch__flash-label { color: var(--ink-soft); font-weight: 600; margin-right: 4px; }

/* Action zone: ONE dominant "Trouvé" button, plus a discreet pass caption.
   Passing by reflex instead of validating costs the team a card, so the pass
   affordance is deliberately NOT button-shaped. */
.play__actions { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: auto; }
.bigbtn { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 104px; border-radius: 22px; font-size: 19px; font-weight: 800; color: #fff; transition: transform 0.08s ease; }
.bigbtn:active { transform: scale(0.96); }
.bigbtn svg { width: 34px; height: 34px; stroke-width: 2.6; }
.bigbtn--found { background: var(--found); box-shadow: 0 10px 24px rgba(23,185,120,0.32); }

/* Pass = small red text caption: no fill, no border, no shadow. */
.passlink {
  background: none; box-shadow: none;
  color: var(--danger); font-size: 13px; font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px;
  padding: 6px 12px; opacity: 0.9;
}
.passlink:active { opacity: 1; }
.passlink:disabled { color: var(--ink-soft); text-decoration: none; opacity: 0.55; }

/* ============ END SCREENS ============ */
.screen--turnend, .screen--roundend, .screen--gameend { justify-content: center; align-items: center; text-align: center; gap: 14px; }
.turnend__title, .roundend__title { font-size: 28px; font-weight: 800; }
.turnend__found { font-size: 18px; color: var(--ink-soft); }
.turnend__found span { color: var(--brand); }
.scoreboard { width: 100%; display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.scoreboard--big { margin: 20px 0; }
.score-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow); }
.score-row .dot { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.score-row__name { flex: 1; text-align: left; font-weight: 700; font-size: 17px; }
.score-row__pts { font-weight: 800; font-size: 20px; }
.score-row.is-leader { outline: 2px solid var(--brand); }
.gameend__crown { width: 72px; height: 72px; color: var(--brand); }
.gameend__winner { font-size: 30px; font-weight: 800; }

/* ============ RULES ============ */
.rules__body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; font-size: 16px; line-height: 1.5; }
.rules__rounds { display: flex; flex-direction: column; gap: 12px; padding-left: 20px; }

/* ============ MENU FAB ============ */
.menu-fab { position: fixed; top: max(env(safe-area-inset-top), 12px); right: 14px; z-index: 45; width: 40px; height: 40px; padding: 8px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); }
.menu-fab svg { stroke-width: 0; }
.menu-fab circle { fill: var(--ink); stroke: none; }

/* ============ SCORE SHEET DRAWER ============ */
/* Peeks from the right edge, tilted, click to bring in fully. */
/* Sits just below the pile bar, above the card's text zone, so it never hides
   the word to guess nor the piles above it. */
.scoresheet { position: fixed; top: 30%; right: 0; z-index: 50; transform: translateX(calc(100% - 30px)) rotate(-4deg); transition: transform 0.35s cubic-bezier(.2,.8,.2,1); transform-origin: right center; }
.scoresheet.is-open { transform: translateX(0) rotate(-1.5deg); }
.scoresheet__tab { position: absolute; left: -2px; top: 50%; transform: translate(-100%, -50%); background: var(--brand); color: #fff; border-radius: 12px 0 0 12px; padding: 12px 8px; box-shadow: var(--shadow); writing-mode: vertical-rl; }
.scoresheet__tab-label { font-size: 13px; font-weight: 800; letter-spacing: 1px; }
.scoresheet__card { width: 250px; background: var(--surface); border-radius: 16px 0 0 16px; box-shadow: var(--shadow-card); padding: 14px; border: 1px solid var(--line); }
.scoresheet__title { font-size: 16px; font-weight: 800; margin-bottom: 10px; }
.scoresheet__rows { display: flex; flex-direction: column; gap: 6px; }
.scoresheet__round { margin-top: 10px; font-size: 11px; color: var(--ink-soft); }

/* Paper-style table: one column per round, then the total. */
.ss-row { display: flex; align-items: center; gap: 4px; }
.ss-row .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-right: 5px; }
.ss-row__name { flex: 1; min-width: 0; display: flex; align-items: center; text-align: left; font-size: 13px; font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ss-col { flex: 0 0 26px; text-align: center; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.ss-col--tot { flex: 0 0 32px; font-size: 16px; font-weight: 800; color: var(--ink); }
.ss-col--live { color: var(--brand); }
.ss-row--head { border-bottom: 1.5px solid var(--line); padding-bottom: 5px; margin-bottom: 2px; }
.ss-row--head .ss-col { font-size: 11px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ink-soft); }

/* ============ MODE BAR (always-on reminder during play) ============ */
.modebar { display: flex; align-items: center; gap: 8px; align-self: center; background: var(--surface); border: 2px solid var(--brand); border-radius: 999px; padding: 5px 14px 5px 6px; box-shadow: var(--shadow); }
.modebar__round { background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: 0.5px; padding: 3px 9px; border-radius: 999px; }
.modebar__mode { font-size: 14px; font-weight: 800; color: var(--ink); }

/* ============ ROUND CHANGE ANNOUNCEMENT (full screen, must be acknowledged) ============ */
.roundchange { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: var(--pad); background: rgba(20,22,30,0.55); backdrop-filter: blur(3px); }
.roundchange__inner {
  width: 100%; max-width: 420px; background: var(--surface); border-radius: 26px;
  padding: 28px 22px; padding-bottom: max(env(safe-area-inset-bottom), 24px);
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  box-shadow: var(--shadow-card); animation: rc-in 0.35s cubic-bezier(.2,.9,.3,1);
}
@keyframes rc-in { from { opacity: 0; transform: scale(0.9) translateY(16px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.roundchange__over { font-size: 16px; font-weight: 700; color: var(--ink-soft); }
.roundchange__arrow { width: 34px; height: 34px; color: var(--brand); }
.roundchange__badge { background: var(--brand); color: #fff; font-size: 15px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; padding: 7px 18px; border-radius: 999px; }
.roundchange__mode { font-size: 34px; font-weight: 800; line-height: 1.05; }
.roundchange__rule { font-size: 16px; color: var(--ink-soft); line-height: 1.45; }
.roundchange .btn--lg { margin-top: 12px; }

/* ============ MODALS ============ */
.modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(20,22,30,0.4); }
.modal__sheet { position: relative; width: 100%; max-width: 480px; background: var(--surface); border-radius: 24px 24px 0 0; padding: 24px; padding-bottom: max(env(safe-area-inset-bottom), 24px); display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-card); animation: sheet-up 0.25s ease; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal__title { font-size: 22px; font-weight: 800; text-align: center; }
.modal__note { font-size: 13px; color: var(--ink-soft); text-align: center; }
.modal__diag { font-size: 12px; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; padding: 6px; }
.trace__box { width: 100%; height: 40vh; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10px; line-height: 1.35; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--bg); color: var(--ink); resize: none; }
