/*
 * Everything here is scoped under `.bd-root` (or a `.bd-*` class) because this stylesheet ships
 * inside a Module Federation remote: bare `:root`, `*`, `html`, `body` or element selectors
 * would restyle the host page. `scope.test.ts` enforces this. Page-level rules for the
 * standalone dev page live in `standalone.css`.
 */
.bd-root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--bd-text);
  background: var(--bd-bg);
  --bd-space-1: 4px;
  --bd-space-2: 8px;
  --bd-space-3: 12px;
  --bd-space-4: 16px;
  --bd-space-5: 24px;
  --bd-radius-sm: 8px;
  --bd-radius-md: 12px;
  --bd-radius-lg: 16px;
  --bd-radius-pill: 999px;
  --bd-text-xs: clamp(11px, 2.8vw, 12px);
  --bd-text-sm: clamp(13px, 3.2vw, 14px);
  --bd-text-md: clamp(15px, 3.6vw, 16px);
  --bd-text-lg: clamp(18px, 4.2vw, 22px);
  --bd-text-xl: clamp(22px, 5vw, 28px);
  --bd-text-display: clamp(28px, 7vw, 40px);
  --bd-bg: #05010f;
  --bd-surface: rgba(15, 10, 30, 0.92);
  --bd-surface-border: rgba(244, 114, 182, 0.35);
  --bd-text: #f8fafc;
  --bd-text-muted: rgba(248, 250, 252, 0.72);
  --bd-focus: #c4b5fd;
  --bd-success: #34d399;
  --bd-warning: #fbbf24;
  --bd-error: #f87171;
  --bd-lane-0: #a78bfa;
  --bd-lane-1: #f472b6;
  --bd-lane-2: #22d3ee;
  --bd-lane-3: #fbbf24;
  --bd-motion-fast: 150ms;
  --bd-motion-normal: 280ms;
}

.bd-root,
.bd-root *,
.bd-root *::before,
.bd-root *::after {
  box-sizing: border-box;
}

.bd-screen {
  min-height: 100dvh;
  padding: max(var(--bd-space-4), env(safe-area-inset-top)) var(--bd-space-4)
    max(var(--bd-space-4), env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 0%, var(--bd-secondary, #7c3aed), var(--bd-primary, #1a0a2e));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bd-panel {
  width: min(420px, 100%);
  background: var(--bd-surface);
  border: 1px solid var(--bd-surface-border);
  border-radius: var(--bd-radius-lg);
  padding: var(--bd-space-5);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.bd-stack {
  display: flex;
  flex-direction: column;
  gap: var(--bd-space-3);
}

.bd-title {
  margin: 0;
  font-size: var(--bd-text-xl);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.bd-subtitle {
  margin: 0;
  font-size: var(--bd-text-sm);
  color: var(--bd-text-muted);
  line-height: 1.5;
}

.bd-kicker {
  margin: 0;
  font-size: var(--bd-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--bd-accent, #f472b6);
  font-weight: 700;
}

.bd-btn {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: var(--bd-radius-pill);
  padding: 12px 18px;
  font-weight: 700;
  font-size: var(--bd-text-md);
  cursor: pointer;
  transition: transform var(--bd-motion-fast), opacity var(--bd-motion-fast);
}

.bd-btn:focus-visible {
  outline: 2px solid var(--bd-focus);
  outline-offset: 2px;
}

.bd-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.bd-btn--primary {
  color: #0f172a;
  background: linear-gradient(90deg, var(--bd-accent, #f472b6), #c4b5fd);
}

.bd-btn--secondary {
  color: var(--bd-text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.bd-btn--icon {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: var(--bd-radius-md);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--bd-text);
  font-size: 18px;
}

.bd-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bd-field {
  display: flex;
  flex-direction: column;
  gap: var(--bd-space-2);
  width: 100%;
}

.bd-field span {
  font-size: var(--bd-text-sm);
  color: var(--bd-text-muted);
}

.bd-field input[type='text'],
.bd-field input:not([type='checkbox']):not([type='range']) {
  border-radius: var(--bd-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: var(--bd-text);
  padding: 12px;
  min-height: 48px;
  font-size: var(--bd-text-md);
}

.bd-select {
  min-height: 48px;
  padding: 0 var(--bd-space-3);
  border-radius: var(--bd-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: var(--bd-text);
  font: inherit;
  font-size: var(--bd-text-md);
}

.bd-select option {
  background: #140c26;
  color: var(--bd-text);
}

.bd-select:focus-visible,
.bd-field input:focus-visible {
  outline: 2px solid var(--bd-focus);
  outline-offset: 1px;
}

.bd-toggle-row {
  display: flex;
  align-items: center;
  gap: var(--bd-space-3);
  min-height: 44px;
  font-size: var(--bd-text-sm);
}

/* "Probaj Good / Perfect" side by side in the settings. */
.bd-test-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--bd-space-2);
}

/* Song picker (native radios in a fieldset). */
.bd-song-list {
  display: grid;
  gap: var(--bd-space-2);
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.bd-song {
  display: flex;
  align-items: center;
  gap: var(--bd-space-3);
  min-height: 52px;
  padding: var(--bd-space-2) var(--bd-space-3);
  border-radius: var(--bd-radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: border-color var(--bd-motion-fast), background var(--bd-motion-fast);
}

.bd-song[data-selected] {
  border-color: var(--bd-lane-1);
  background: rgba(244, 114, 182, 0.14);
  box-shadow: 0 0 16px rgba(244, 114, 182, 0.25);
}

.bd-song input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--bd-lane-1);
}

.bd-song:has(input:focus-visible) {
  outline: 2px solid var(--bd-focus);
  outline-offset: 2px;
}

.bd-song-text {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

/* The title wraps (a second line beats a cut-off name); the artist stays on one line. */
.bd-song-text strong {
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.bd-song-artist {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bd-song-artist,
.bd-song-time {
  font-size: var(--bd-text-sm);
  color: var(--bd-text-muted);
}

.bd-song-time {
  flex: none;
  font-variant-numeric: tabular-nums;
}

.bd-song-meta {
  flex: none;
  display: grid;
  justify-items: end;
  gap: 2px;
}

/* Difficulty from note density; the word carries the meaning, the colour only repeats it. */
.bd-song-level {
  padding: 1px var(--bd-space-2);
  border-radius: var(--bd-radius-pill);
  border: 1px solid currentColor;
  font-size: var(--bd-text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bd-song-level[data-level='lako'] {
  color: var(--bd-success);
}

.bd-song-level[data-level='srednje'] {
  color: var(--bd-warning);
}

.bd-song-level[data-level='teško'] {
  color: var(--bd-lane-1);
}

.bd-intro-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bd-space-2);
  min-width: 0;
}

/* Selected song on the intro; tapping it reopens the picker. 44 px target, but the negative block
   margin keeps the heading row as tall as before (the intro must fit 320x568 above the fold). */
.bd-song-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--bd-space-1);
  min-width: 0;
  max-width: 60%;
  min-height: 44px;
  margin-block: -6px;
  padding: 0 var(--bd-space-3);
  border: 1px solid var(--bd-lane-1);
  border-radius: var(--bd-radius-pill);
  background: rgba(244, 114, 182, 0.12);
  color: var(--bd-text);
  font: inherit;
  font-size: var(--bd-text-sm);
  font-weight: 600;
  cursor: pointer;
}

.bd-song-chip:focus-visible {
  outline: 2px solid var(--bd-focus);
  outline-offset: 2px;
}

.bd-song-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bd-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.bd-note-cards {
  display: grid;
  gap: var(--bd-space-3);
}

.bd-note-card {
  display: flex;
  gap: var(--bd-space-3);
  align-items: center;
  padding: var(--bd-space-3);
  border-radius: var(--bd-radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bd-note-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  /* One neutral colour: in the game the colour only marks the lane, the shape is the instruction. */
  color: #e9d5ff;
  background: rgba(15, 23, 42, 0.6);
}

.bd-note-glyph {
  width: 80%;
  height: 80%;
}

.bd-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--bd-radius-pill);
  font-size: var(--bd-text-xs);
  font-weight: 700;
}

.bd-badge--mock {
  background: rgba(251, 191, 36, 0.2);
  color: var(--bd-warning);
}

.bd-badge--ok {
  background: rgba(52, 211, 153, 0.2);
  color: var(--bd-success);
}

.bd-badge--err {
  background: rgba(248, 113, 113, 0.2);
  color: var(--bd-error);
}

.bd-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--bd-space-3);
}

.bd-stat {
  padding: var(--bd-space-3);
  border-radius: var(--bd-radius-md);
  background: rgba(255, 255, 255, 0.05);
}

.bd-stat:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.bd-stat strong {
  display: block;
  font-size: var(--bd-text-lg);
}

.bd-stat span {
  font-size: var(--bd-text-xs);
  color: var(--bd-text-muted);
}

.bd-screen--play {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-left: max(var(--bd-space-2), env(safe-area-inset-left));
  padding-right: max(var(--bd-space-2), env(safe-area-inset-right));
}

.bd-screen--play .bd-game-shell {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 420px;
  align-self: center;
}

.bd-game-shell {
  width: min(420px, 100%);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--bd-space-2);
  position: relative;
}

.bd-game-hud {
  display: grid;
  grid-template-columns: 1fr auto auto 44px;
  align-items: center;
  gap: var(--bd-space-2);
  padding: var(--bd-space-2) var(--bd-space-3);
  border-radius: var(--bd-radius-md);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: var(--bd-text-sm);
}

.bd-hud-meta {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--bd-space-2);
}

.bd-progress {
  flex: 1;
  height: 6px;
  border-radius: var(--bd-radius-pill);
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.bd-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--bd-accent, #f472b6), #22d3ee);
  transition: width var(--bd-motion-normal);
}

.bd-stage {
  flex: 1 1 0;
  min-height: 0;
  position: relative;
  border-radius: var(--bd-radius-lg);
  overflow: hidden;
  border: 1px solid rgba(167, 139, 250, 0.45);
  box-shadow: inset 0 0 40px rgba(124, 58, 237, 0.25);
  touch-action: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.bd-stage canvas {
  position: absolute;
  inset: 0;
  display: block;
}

.bd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 1, 15, 0.72);
  display: grid;
  place-items: center;
  padding: var(--bd-space-4);
  z-index: 20;
}

.bd-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bd-list__name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.bd-list__score {
  display: flex;
  align-items: baseline;
  gap: var(--bd-space-2);
  font-weight: 700;
}

.bd-list__score small {
  font-weight: 400;
  color: var(--bd-text-muted);
}

.bd-list__own {
  background: rgba(244, 114, 182, 0.14);
  border-radius: var(--bd-radius-sm);
  padding-left: var(--bd-space-2) !important;
  padding-right: var(--bd-space-2) !important;
  outline: 1px solid var(--bd-surface-border);
}

.bd-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--bd-space-3);
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: var(--bd-text-sm);
}

/* Leaderboard page: the overall ranking first, a touch larger, then one section per played song. */
.bd-board {
  display: flex;
  flex-direction: column;
  gap: var(--bd-space-2);
}

.bd-board + .bd-board {
  padding-top: var(--bd-space-2);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* The section divider replaces the last row's line (no double rule). */
.bd-board .bd-list li:last-child {
  border-bottom: none;
}

.bd-board__title {
  margin: 0;
  font-size: var(--bd-text-md);
  font-weight: 700;
}

/* The overall ranking is framed in cyan, so it stands out more than the song sections and never
   reads as the pink own-run highlight. */
.bd-board--primary {
  padding: var(--bd-space-3) var(--bd-space-4);
  border: 1.5px solid var(--bd-lane-2);
  border-radius: var(--bd-radius-md);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.14), rgba(34, 211, 238, 0.04));
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.12),
    0 0 18px rgba(34, 211, 238, 0.22);
}

/* The frame already separates it from the first song section. */
.bd-board--primary + .bd-board {
  border-top: none;
  padding-top: 0;
}

.bd-board--primary .bd-board__title {
  font-size: var(--bd-text-lg);
  font-weight: 800;
  color: var(--bd-lane-2);
}

.bd-list--primary li {
  font-size: var(--bd-text-md);
}

.bd-list--primary .bd-list__score {
  font-size: 1.08em;
}

/* „Moji rezultati" under a song's ranking: the player's own runs on this device. A full-width button
   (≥44px) in the pink own-run color, with a chevron so it reads as something that opens. */
.bd-personal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bd-space-3);
  width: 100%;
  min-height: 44px;
  padding: 8px var(--bd-space-3);
  border: 1px dashed var(--bd-surface-border);
  border-radius: var(--bd-radius-sm);
  background: rgba(244, 114, 182, 0.08);
  color: var(--bd-text);
  font: inherit;
  font-size: var(--bd-text-sm);
  text-align: left;
  cursor: pointer;
  transition:
    background var(--bd-motion-fast),
    border-color var(--bd-motion-fast);
}

.bd-personal-row:hover,
.bd-personal-row:active {
  background: rgba(244, 114, 182, 0.16);
  border-style: solid;
}

.bd-personal-row:focus-visible,
.bd-link-btn:focus-visible {
  outline: 2px solid var(--bd-focus);
  outline-offset: 2px;
}

.bd-personal-row__label {
  font-weight: 600;
  color: var(--bd-lane-1);
}

.bd-personal-row__value {
  display: flex;
  align-items: baseline;
  gap: var(--bd-space-2);
  font-weight: 700;
}

.bd-personal-row__value small {
  font-weight: 400;
  color: var(--bd-text-muted);
}

.bd-personal-row__chevron {
  font-size: 1.3em;
  line-height: 1;
  color: var(--bd-lane-1);
}

/* Result screen: this run against the player's own earlier runs. */
.bd-standing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.bd-standing__headline {
  margin: 0;
  font-size: var(--bd-text-md);
  font-weight: 700;
}

.bd-standing__detail {
  margin: 0;
  font-size: var(--bd-text-sm);
  color: var(--bd-text-muted);
}

.bd-standing--record .bd-standing__headline {
  color: var(--bd-lane-3);
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.55);
  animation: bd-record-pop 520ms ease-out both;
}

@keyframes bd-record-pop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  60% {
    transform: scale(1.08);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

.bd-link-btn {
  min-height: 44px;
  padding: 0 var(--bd-space-3);
  border: none;
  background: none;
  color: var(--bd-lane-1);
  font: inherit;
  font-size: var(--bd-text-sm);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* „Moji rezultati" dialog. */
.bd-stat--record strong {
  color: var(--bd-lane-3);
}

.bd-pr-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--bd-space-2);
}

.bd-pr-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px var(--bd-space-3);
  border-radius: var(--bd-radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
}

.bd-pr-row--best {
  border-color: rgba(251, 191, 36, 0.45);
}

.bd-pr-row--current {
  background: rgba(244, 114, 182, 0.14);
  border-color: var(--bd-surface-border);
}

.bd-pr-row__main,
.bd-pr-row__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bd-space-2);
}

.bd-pr-row__when {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--bd-text-sm);
  color: var(--bd-text-muted);
}

.bd-pr-row__score {
  display: flex;
  align-items: baseline;
  gap: var(--bd-space-2);
  font-size: var(--bd-text-md);
  font-weight: 700;
}

.bd-pr-row__score small {
  font-size: var(--bd-text-xs);
  font-weight: 400;
  color: var(--bd-text-muted);
}

.bd-pr-tag {
  padding: 1px 8px;
  border-radius: var(--bd-radius-pill);
  font-size: var(--bd-text-xs);
  font-weight: 700;
}

.bd-pr-tag--now {
  background: var(--bd-lane-1);
  color: #1a0a2e;
}

.bd-pr-tag--best {
  background: rgba(251, 191, 36, 0.2);
  color: var(--bd-lane-3);
}

.bd-pr-tag--muted {
  background: rgba(255, 255, 255, 0.08);
  color: var(--bd-text-muted);
}

/* Score relative to the record, so the runs compare at a glance. */
.bd-pr-bar {
  flex: 1 1 auto;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bd-pr-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--bd-lane-1), var(--bd-lane-2));
}

.bd-pr-row--best .bd-pr-bar span {
  background: var(--bd-lane-3);
}

.bd-pr-row__combo {
  font-size: var(--bd-text-xs);
  color: var(--bd-text-muted);
  white-space: nowrap;
}

.bd-pr-trend {
  min-width: 4.5em;
  text-align: right;
  font-size: var(--bd-text-xs);
  font-weight: 700;
  white-space: nowrap;
}

.bd-pr-trend--up {
  color: var(--bd-success);
}

.bd-pr-trend--down {
  color: var(--bd-error);
}

.bd-pr-trend--same {
  color: var(--bd-text-muted);
}

.bd-pr-note {
  margin: 0;
  font-size: var(--bd-text-xs);
  color: var(--bd-text-muted);
  text-align: center;
}


.bd-dialog {
  width: min(420px, 100%);
  max-height: 100%;
  overflow-y: auto;
  outline: none;
}

.bd-hint,
.bd-error {
  margin: 0;
  font-size: var(--bd-text-sm);
  color: var(--bd-error);
}

.bd-field span.bd-hint {
  color: var(--bd-error);
}

.bd-field input[aria-invalid='true'] {
  border-color: var(--bd-error);
}

.bd-result-score:focus {
  outline: none;
}

.bd-list li:focus-visible,
.bd-result-score:focus-visible,
.bd-title:focus-visible {
  outline: 2px solid var(--bd-focus);
  outline-offset: 4px;
}

.bd-root input[type='range'],
.bd-root input[type='checkbox'] {
  min-height: 24px;
  accent-color: var(--bd-accent, #f472b6);
}

.bd-root input[type='checkbox'] {
  width: 24px;
  height: 24px;
}

.bd-root input[type='range']:focus-visible,
.bd-root input[type='checkbox']:focus-visible {
  outline: 2px solid var(--bd-focus);
  outline-offset: 2px;
}

/*
 * Screens with instructions (intro, song picker, leaderboard): larger, brighter text for a festival
 * crowd. The page may scroll; the start button stays reachable (sticky).
 */
.bd-readable .bd-subtitle {
  font-size: var(--bd-text-md);
  line-height: 1.55;
  color: rgba(248, 250, 252, 0.88);
}

.bd-readable .bd-note-card strong {
  font-size: var(--bd-text-lg);
}

.bd-readable .bd-note-card .bd-subtitle {
  margin-top: 2px;
}

.bd-readable .bd-note-icon {
  width: 52px;
  height: 52px;
}

.bd-readable .bd-song-artist,
.bd-readable .bd-song-time {
  font-size: var(--bd-text-md);
}

.bd-readable .bd-song-text strong {
  font-size: var(--bd-text-lg);
}

.bd-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--bd-space-2);
  margin-inline: calc(-1 * var(--bd-space-2));
  padding: var(--bd-space-3) var(--bd-space-2) max(var(--bd-space-2), env(safe-area-inset-bottom));
  /* Text scrolling underneath fades out instead of colliding with the button. */
  background: linear-gradient(to bottom, rgba(15, 10, 30, 0), rgba(15, 10, 30, 0.96) 35%);
}

@media (max-height: 700px) {
  /* Short phones (e.g. 320x568): keep the primary action of non-gameplay screens above the fold. */
  .bd-screen:not(.bd-screen--play) {
    padding-top: max(var(--bd-space-2), env(safe-area-inset-top));
    padding-bottom: max(var(--bd-space-2), env(safe-area-inset-bottom));
  }

  .bd-panel {
    padding: var(--bd-space-4);
  }

  .bd-panel .bd-stack {
    gap: var(--bd-space-2);
  }

  .bd-note-cards {
    gap: var(--bd-space-2);
  }

  .bd-note-card {
    padding: var(--bd-space-2);
  }

  .bd-note-icon {
    width: 32px;
    height: 32px;
  }

  .bd-readable .bd-note-icon {
    width: 44px;
    height: 44px;
  }

  .bd-screen--play {
    padding-top: max(var(--bd-space-2), env(safe-area-inset-top));
    padding-bottom: max(var(--bd-space-2), env(safe-area-inset-bottom));
  }

  .bd-screen--play .bd-game-hud {
    padding: var(--bd-space-1) var(--bd-space-2);
    font-size: var(--bd-text-xs);
  }

}

@media (prefers-reduced-motion: reduce) {
  .bd-root * {
    animation: none !important;
    transition: none !important;
  }
}
