/* flagship-app/styles/flagship-components.css — Logical component styles (INV-05, INV-06). */

.btn,
.energy-pill,
.mode-switch__option,
.option-card,
.triad-slot,
.split-card {
  min-inline-size: 44px;
  min-block-size: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-raised);
  color: var(--color-text);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform var(--motion-fast) ease, background-color var(--motion-fast) ease;
}

.btn:active,
.energy-pill:active,
.option-card:active,
.triad-slot:active,
.split-card:active {
  transform: scale(0.97);
}

.btn {
  padding-block: var(--space-2);
  padding-inline: var(--space-4);
  font-weight: 700;
}

.btn--primary {
  border-color: transparent;
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.energy-pills {
  display: flex;
  gap: var(--space-2);
}

.energy-pill {
  flex: 1;
  padding-block: var(--space-2);
  padding-inline: var(--space-3);
  border-radius: 999px;
}

.energy-pill[aria-pressed="true"] {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.mode-switch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-1);
  padding-block: var(--space-1);
  padding-inline: var(--space-1);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.mode-switch__option {
  border-color: transparent;
  background: transparent;
}

.mode-switch__option[aria-pressed="true"] {
  background: var(--color-surface-raised);
  border-color: var(--color-accent);
}

.option-card {
  padding-block: var(--space-3);
  padding-inline: var(--space-3);
  text-align: start;
  unicode-bidi: isolate;
}

.option-card--correct {
  border-color: var(--color-success);
  background: rgb(95 211 154 / 24%);
}

.option-card--wrong {
  border-color: var(--color-danger);
  background: rgb(255 156 143 / 22%);
}

.option-card:disabled {
  cursor: default;
  opacity: 0.92;
}

.study-text {
  unicode-bidi: isolate;
  overflow-wrap: anywhere;
}

:lang(ar) .study-text,
.study-text:lang(ar),
:lang(ar) .triad-slot,
:lang(ar) .split-card {
  line-height: 1.8;
  padding-block: max(0.35em, var(--space-3));
}

:lang(ar) .option-card {
  line-height: 1.65;
  padding-block: max(0.28em, var(--space-2));
}

.triad {
  display: grid;
  grid-template-rows: repeat(3, minmax(44px, auto));
  gap: var(--space-2);
}

.triad-slot {
  display: grid;
  gap: var(--space-1);
  padding-block: var(--space-3);
  padding-inline: var(--space-3);
  border-inline-start: 4px solid var(--color-border);
  text-align: start;
}

.triad-slot--tasweer { border-inline-start-color: var(--color-accent); }
.triad-slot--hukm { border-inline-start-color: var(--color-warning); }
.triad-slot--daleel { border-inline-start-color: var(--color-success); }

.split-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-2);
}

.split-card {
  padding-block: var(--space-3);
  padding-inline: var(--space-3);
  text-align: start;
}

.split-card__badge {
  display: inline-grid;
  place-items: center;
  inline-size: 24px;
  block-size: 24px;
  margin-inline-end: var(--space-2);
  border-radius: 50%;
  background: var(--color-surface);
  font-size: var(--text-sm);
}

.combo-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding-block: var(--space-1);
  padding-inline: var(--space-3);
  border-radius: 999px;
  background: var(--color-surface-raised);
  color: var(--color-warning);
  font-weight: 700;
}

.modal-scrim {
  position: fixed;
  z-index: 50;
  inset: 0;
  background: rgb(0 0 0 / 55%);
}

.modal-drawer {
  position: fixed;
  z-index: 51;
  inset-block-end: 0;
  inset-inline: 0;
  max-block-size: 85dvh;
  overflow-y: auto;
  padding-block-start: var(--space-4);
  padding-block-end: calc(18px + env(safe-area-inset-bottom, 0px));
  padding-inline: var(--space-4);
  border-start-start-radius: var(--radius-lg);
  border-start-end-radius: var(--radius-lg);
  background: var(--color-surface);
}

.btn--large { min-block-size: 64px; inline-size: 100%; font-size: var(--text-lg); }
.btn--spark {
  display: grid;
  gap: var(--space-1);
  place-items: center;
  inline-size: 100%;
  min-block-size: 84px;
  font-size: var(--text-xl);
  border-radius: var(--radius-lg);
}
.btn--spark small { font-size: var(--text-sm); font-weight: 400; }
.hud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 44px;
  padding-inline: var(--space-1);
  padding-block: 0;
  background: var(--color-surface);
}
.icon-speaker {
  inline-size: 20px;
  block-size: 20px;
  flex: none;
}
.hud-bar, .hub-top { inline-size: 100%; display: grid; gap: var(--space-2); }
.hub-top { display: flex; justify-content: space-between; align-items: flex-start; }
.hud-row { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-2); }
.hud-chip {
  display: inline-flex;
  align-items: center;
  min-block-size: 28px;
  padding-inline: var(--space-2);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.hud-progress { inline-size: 100%; block-size: 6px; accent-color: var(--color-accent); }
.hub-stage { inline-size: 100%; display: grid; gap: var(--space-3); padding: var(--space-3); touch-action: manipulation; }
.drill-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.energy-pill[data-drill] { border-radius: var(--radius-md); }
.energy-pill[data-drill][aria-pressed="true"] { border-color: var(--color-accent); background: var(--color-accent); color: var(--color-on-accent); }
.tier-picker { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.tier-label { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-sm); white-space: nowrap; }
.tier-input { inline-size: 76px; text-align: center; }
.input {
  inline-size: 100%;
  min-block-size: 44px;
  padding-block: var(--space-2);
  padding-inline: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 16px;
}
.field { display: grid; gap: var(--space-1); font-size: var(--text-sm); color: var(--color-text-muted); }
.prompt-card {
  inline-size: 100%;
  min-block-size: 84px;
  max-block-size: 100%;
  overflow-y: auto;
  padding: clamp(12px, 3vw, 18px);
  text-align: center;
  touch-action: pan-y;
}
.prompt-card h2 { font-size: var(--text-lg); margin: 0; }
.option-card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  block-size: auto;
  overflow: visible;
  white-space: normal;
  font-size: var(--text-md);
}
.option-card[aria-pressed="true"] { border-color: var(--color-accent); }
.option-card--hidden { visibility: hidden; }
.option-card--eliminated {
  opacity: 0.36;
  text-decoration: line-through;
  filter: grayscale(0.65);
  pointer-events: none;
}
.hud-chip--shards,
.hub-mascot-btn,
.hub-deck-pill {
  min-inline-size: 44px;
  min-block-size: 44px;
  cursor: pointer;
}
.hud-chip--shards {
  border: 1px solid rgb(255 216 115 / 35%);
  color: #ffe28a;
  font-weight: 700;
}
.hub-mascot-btn {
  padding: 2px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 4%);
}
.hub-deck-pill {
  justify-self: center;
  padding-block: 6px;
  padding-inline: 14px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 22%);
  background: rgb(10 12 28 / 64%);
  color: #eef1f7;
  font-size: var(--text-sm);
  font-weight: 600;
}
.profile-pill--active {
  border-color: #63e6be !important;
  background: rgb(99 230 190 / 20%) !important;
  color: #d6fff2 !important;
}
.btn--add-profile {
  border: 1.5px dashed var(--color-accent);
  background: transparent;
  color: var(--color-text);
  font-weight: 700;
}
.skin-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
}
.skin-row--equipped { border-color: #63e6be; }
.skin-swatch {
  flex: none;
  inline-size: 36px;
  block-size: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid rgb(255 255 255 / 30%);
}
.skin-meta { flex: 1; min-inline-size: 0; display: grid; gap: 2px; }
.skin-meta small { color: var(--color-text-muted); font-size: 12px; }
.summary-skin-note {
  margin: 0;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  background: rgb(255 216 115 / 12%);
  color: #ffe28a;
  font-size: var(--text-sm);
  font-weight: 700;
  text-align: center;
}
.victory-skin-need { color: #ffe28a; font-size: 12px; font-weight: 600; }
.option-badge {
  flex: none;
  display: inline-grid;
  place-items: center;
  inline-size: 22px;
  block-size: 22px;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 12px;
}
.option-text { min-inline-size: 0; overflow-wrap: anywhere; }
.hint-btn { justify-self: end; min-block-size: 44px; }
.cloze-blank {
  display: inline-block;
  min-inline-size: 64px;
  margin-inline: var(--space-1);
  border-block-end: 2px solid var(--color-accent);
  color: var(--color-accent);
}
.cloze-blank--open { color: var(--color-success); border-block-end-color: var(--color-success); }
.claim { color: var(--color-accent); font-weight: 700; }
.compare-column { color: var(--color-warning); font-size: var(--text-sm); }
.feedback { font-weight: 700; }
.feedback--good { color: var(--color-success); }
.feedback--retry { color: var(--color-warning); }
.answer-reveal { color: var(--color-success); font-weight: 700; }
.explanation { color: var(--color-text-muted); font-size: var(--text-sm); }
.zone-action { overflow-y: auto; }
.gate-note, .drill-rule { color: var(--color-warning); text-align: center; font-weight: 700; }
.gate-overlay {
  position: absolute;
  inset-inline: var(--space-3);
  inset-block-start: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-surface-raised);
  text-align: center;
}
.kinetic-canvas { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; }
.stroop-word { font-size: var(--text-xl); font-weight: 700; }
.logic-question { font-size: var(--text-xl); font-weight: 700; }
.nback-wrap { display: grid; gap: var(--space-2); justify-items: center; block-size: 100%; padding-block: var(--space-2); }
.nback-grid {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-auto-rows: 44px;
  gap: var(--space-1);
}
.nback-cell { border-radius: var(--radius-sm); background: var(--color-surface-raised); }
.nback-cell--on { background: var(--color-accent); }
.modal-title { font-size: var(--text-lg); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-block-end: var(--space-3); }
.modal-actions, .stack, .import-body { display: grid; gap: var(--space-2); }
.modal-actions { margin-block-start: var(--space-4); }
.import-body { margin-block-start: var(--space-3); }
.import-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: var(--space-2); margin-block: var(--space-3); }
.stat-tile { display: grid; gap: 2px; padding: var(--space-2); border-radius: var(--radius-sm); background: var(--color-surface-raised); text-align: center; }
.stat-tile strong { font-size: var(--text-lg); }
.stat-tile span { color: var(--color-text-muted); font-size: 12px; }
.missed-list, .sample-list, .diagnostic-list { display: grid; gap: var(--space-2); padding-inline-start: 0; list-style: none; }
.missed-item, .diagnostic { display: grid; gap: var(--space-1); padding: var(--space-2); border-radius: var(--radius-sm); background: var(--color-surface-raised); }
.diagnostic--error { border-inline-start: 3px solid var(--color-danger); }
.diagnostic--warning { border-inline-start: 3px solid var(--color-warning); }
.source-path { color: var(--color-text-muted); font-size: var(--text-sm); overflow-wrap: anywhere; }
.source-link { display: inline-flex; align-items: center; overflow-wrap: anywhere; font-size: var(--text-sm); text-decoration: none; }
.chip-row { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.drop-zone {
  display: grid;
  place-items: center;
  min-block-size: 96px;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
}

.flagship-shell:has(.game-canvas) .zone-stage {
  overflow: visible;
  background: transparent;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.zone-stage > canvas.game-canvas,
#game-canvas {
  position: fixed;
  z-index: 0;
  inset: 0;
  inline-size: 100vw;
  block-size: 100dvh;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.flagship-shell:has(.game-canvas) .zone-hud,
.flagship-shell:has(.game-canvas) .zone-action {
  position: relative;
  z-index: 2;
  pointer-events: none;
}
.flagship-shell:has(.game-canvas) :is(.zone-hud, .zone-action) :is(button, a, input, .question-card) { pointer-events: auto; }
.flagship-shell:has(.game-canvas) .hud-chip,
.flagship-shell:has(.game-canvas) .combo-badge,
.flagship-shell:has(.game-canvas) .hud-btn {
  background: rgb(10 12 28 / 62%);
  border-color: rgb(255 255 255 / 18%);
  color: #fff;
  backdrop-filter: blur(6px);
}
.flagship-shell:has(.game-canvas) .gate-note { color: #fff; text-shadow: 0 1px 6px rgb(0 0 0 / 70%); }
.play-controls { display: grid; gap: var(--space-2); justify-items: center; padding-block-end: var(--space-2); text-align: center; }
.play-level {
  padding-block: var(--space-1);
  padding-inline: var(--space-3);
  border-radius: 999px;
  background: rgb(10 12 28 / 58%);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 700;
}
.play-hint {
  max-inline-size: 34rem;
  padding-block: var(--space-2);
  padding-inline: var(--space-4);
  border-radius: var(--radius-md);
  background: rgb(10 12 28 / 74%);
  color: #fff3c8;
  font-size: var(--text-lg);
  font-weight: 700;
  animation: hint-pulse 1.5s ease-in-out infinite;
}
.play-hint[hidden] { display: none; }
.question-card {
  position: fixed;
  z-index: 3;
  inset-inline-start: max(12px, var(--env-inset-start, 0px));
  inset-inline-end: max(12px, var(--env-inset-end, 0px));
  inset-block-end: max(12px, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  display: grid;
  gap: var(--space-2);
  max-inline-size: min(760px, calc(100vw - 24px));
  max-block-size: min(80dvh, calc(100dvh - max(24px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px) + 12px)));
  margin-inline: auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(12px, 3vw, 18px);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-lg);
  background: rgb(16 20 38 / 96%);
  color: #eef1f7;
  box-shadow: 0 12px 40px rgb(0 0 0 / 55%);
  animation: card-rise 220ms ease-out;
}
.question-card--good { border-color: var(--color-success); text-align: center; }
.question-prompt { font-size: var(--text-lg); text-align: center; }
.question-card .option-card:disabled { cursor: default; opacity: 0.86; }
.question-card .option-card--correct { background: rgb(95 211 154 / 24%); }
.question-card .option-card--wrong { background: rgb(255 156 143 / 22%); }

.hub-header { display: grid; align-content: start; gap: var(--space-2); inline-size: 100%; }
.world-banner { display: flex; align-items: center; gap: var(--space-2); min-inline-size: 0; }
.hub-mascot { flex: none; inline-size: 52px; block-size: 52px; }
.world-banner__text { display: grid; min-inline-size: 0; line-height: 1.3; }
.world-banner__text strong { font-size: var(--text-lg); }
.world-banner__text span { color: var(--color-warning); font-size: var(--text-sm); }
.hub-stage--map {
  position: relative;
  align-content: space-between;
  block-size: 100%;
  overflow: hidden;
  isolation: isolate;
}
.map-scene { position: absolute; z-index: -1; inset: 0; inline-size: 100%; block-size: 100%; }
.map-nav { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.map-nav .hud-btn { background: rgb(10 12 28 / 58%); border-color: rgb(255 255 255 / 22%); color: #fff; }
.map-nav__title {
  padding-block: var(--space-1);
  padding-inline: var(--space-3);
  border-radius: 999px;
  background: rgb(10 12 28 / 58%);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 700;
}
.level-map {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(8px, 2.4vmin, 18px);
  justify-items: center;
  margin-block-end: var(--space-1);
}
.level-node {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  inline-size: clamp(48px, 9.5vmin, 66px);
  block-size: clamp(48px, 9.5vmin, 66px);
  padding: 0;
  border: 3px solid rgb(255 255 255 / 72%);
  border-radius: 50%;
  background: rgb(18 18 44 / 86%);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform var(--motion-fast) ease;
}
.level-node:active { transform: scale(0.94); }
.level-node:disabled { border-color: rgb(255 255 255 / 22%); background: rgb(14 14 32 / 70%); cursor: default; }
.level-node--done { border-color: #ffd27a; background: rgb(112 58 22 / 92%); }
.level-node--selected {
  border-color: #fff;
  background: linear-gradient(160deg, #ffe08a, #ff9b45);
  color: #2a1636;
  box-shadow: 0 0 0 4px rgb(255 224 138 / 35%), 0 0 22px rgb(255 190 90 / 75%);
  animation: selected-node-pulse 2.4s ease-in-out infinite;
}
.level-node__num { font-size: 1.05rem; font-weight: 800; line-height: 1; }
.level-node__stars { display: flex; font-size: 0.6rem; line-height: 1; }
.level-node__stars i { color: rgb(255 255 255 / 34%); font-style: normal; }
.level-node__stars i.on { color: #ffe27a; }
.level-node--selected .level-node__stars i { color: rgb(42 22 54 / 32%); }
.level-node--selected .level-node__stars i.on { color: #7a2c00; }
.level-node--link::after {
  position: absolute;
  z-index: -1;
  inset-block-start: 50%;
  inset-inline-start: 100%;
  inline-size: clamp(24px, 9vw, 110px);
  border-block-start: 3px dashed rgb(255 255 255 / 52%);
  content: "";
}
.level-node--drop::before {
  position: absolute;
  z-index: -1;
  inset-block-start: 100%;
  inset-inline-start: 50%;
  block-size: clamp(8px, 2.4vmin, 18px);
  border-inline-start: 3px dashed rgb(255 255 255 / 52%);
  content: "";
}
.map-notice { padding: var(--space-1); border-radius: var(--radius-sm); background: rgb(10 12 28 / 72%); text-align: center; }
.hub-stage--gym {
  align-content: start;
  gap: var(--space-2);
  max-block-size: 100%;
  overflow-y: auto;
  padding: var(--space-3);
  padding-block-end: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
}
.btn--play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  inline-size: 100%;
  min-block-size: 72px;
  border: 0;
  border-block-end: 5px solid #c4561c;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffd873, #ff9d43);
  color: #2a1636;
  font-size: clamp(1.35rem, 3.6vmin, 1.8rem);
  font-weight: 800;
  box-shadow: 0 6px 26px rgb(255 157 67 / 42%);
  animation: play-breathe 2.2s ease-in-out infinite;
}
.btn--play:active { transform: translateY(3px); border-block-end-width: 2px; }
.btn--play__icon { font-size: 0.9em; }
.hub-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hub-tile--wide { grid-column: 1 / -1; }
.hub-tile { display: grid; place-items: center; align-content: center; min-block-size: 52px; line-height: 1.25; }
.hub-tile small { color: var(--color-text-muted); font-size: 11px; font-weight: 400; }
.modal-drawer--victory { border-block-start: 3px solid #ffd27a; text-align: center; }
.victory-stars { display: flex; justify-content: center; gap: var(--space-3); margin-block-start: var(--space-3); font-size: 3.2rem; line-height: 1; }
.victory-star { color: rgb(255 255 255 / 30%); animation: star-pop 420ms cubic-bezier(.2, 1.7, .4, 1) both; }
.victory-star--on { color: #ffd34f; text-shadow: 0 0 18px rgb(255 211 79 / 72%); }

.lane-field {
  position: fixed;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.lane-head {
  position: absolute;
  inset-block-start: calc(max(12px, env(safe-area-inset-top, 0px)) + 66px);
  inset-inline: var(--space-3);
  display: grid;
  gap: var(--space-1);
  max-inline-size: 760px;
  margin-inline: auto;
  padding-block: var(--space-2);
  padding-inline: var(--space-4);
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: var(--radius-md);
  background: rgb(10 12 28 / 84%);
  color: #fff;
  text-align: center;
}
.lane-prompt { font-size: clamp(1.05rem, 2.6vmin, 1.4rem); line-height: 1.75; }
.lane-status { min-block-size: 1.4em; color: #fff3c8; font-size: var(--text-sm); font-weight: 700; }
.lane-status--good { color: #7df0b5; }
.lane-status--answer { color: #ffd98a; }
.lane-hearts { color: #ff7d8c; letter-spacing: 2px; }
.lane-hearts[hidden] { display: none; }
.lane-card {
  position: absolute;
  inset-block-start: 0;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  inline-size: calc(100% / 3);
  padding-inline: 5px;
  will-change: transform;
}
.lane-card[hidden] { display: none; }
.lane-card__text {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  inline-size: 100%;
  min-block-size: 74px;
  padding-block: var(--space-2);
  padding-inline: var(--space-2);
  border: 2px solid rgb(255 255 255 / 45%);
  border-radius: var(--radius-md);
  background: rgb(30 26 66 / 94%);
  color: #fff;
  font-size: clamp(0.95rem, 2.5vmin, 1.2rem);
  font-weight: 700;
  line-height: 1.75;
  text-align: center;
  overflow-wrap: anywhere;
  box-shadow: 0 6px 18px rgb(0 0 0 / 40%);
}
.lane-card--long .lane-card__text { font-size: 0.85rem; line-height: 1.75; }
.lane-card--aimed .lane-card__text { border-color: #ffd873; box-shadow: 0 0 18px rgb(255 216 115 / 60%); }
.lane-card--correct .lane-card__text { border-color: #5fd39a; background: rgb(24 104 70 / 96%); }
.lane-card--wrong .lane-card__text { border-color: #ff7d8c; background: rgb(120 34 52 / 96%); }
.lane-pads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.lane-pad {
  min-block-size: 64px;
  border: 2px solid rgb(255 255 255 / 30%);
  border-radius: var(--radius-md);
  background: rgb(10 12 28 / 72%);
  color: #fff;
  font-size: var(--text-lg);
  font-weight: 800;
  cursor: pointer;
  touch-action: none;
}
.lane-pad[aria-pressed="true"] { border-color: #ffd873; background: rgb(255 190 90 / 34%); }

@keyframes play-breathe { 50% { box-shadow: 0 6px 38px rgb(255 157 67 / 72%); } }
@keyframes selected-node-pulse {
  50% { box-shadow: 0 0 0 6px rgb(255 224 138 / 48%), 0 0 30px rgb(255 190 90 / 92%); }
}
@keyframes hint-pulse { 50% { opacity: 0.74; } }
@keyframes card-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes star-pop { from { opacity: 0; transform: scale(0.2) rotate(-30deg); } }

@media (prefers-reduced-motion: reduce) {
  .btn--play, .level-node--selected, .play-hint, .question-card, .victory-star { animation: none; }
}

@media (min-width: 960px) {
  .modal-drawer {
    max-inline-size: 640px;
    margin-inline: auto;
  }
}

/* Sky Climb: answer lanterns sit in the world and stay real buttons for touch, keyboard and screen readers. */
.sky-lantern {
  position: absolute;
  inset-block-start: 0;
  box-sizing: border-box;
  padding-inline: 4px;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}
.sky-lantern[hidden] { display: none; }
.sky-lantern__card {
  display: grid;
  gap: 2px;
  place-items: center;
  box-sizing: border-box;
  min-block-size: 68px;
  padding: var(--space-2);
  border: 2px solid rgb(255 255 255 / 48%);
  border-radius: var(--radius-md);
  background: rgb(26 22 60 / 94%);
  box-shadow: 0 6px 18px rgb(0 0 0 / 42%);
  font-size: clamp(0.9rem, 2.4vmin, 1.15rem);
  font-weight: 700;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.sky-lantern:hover .sky-lantern__card, .sky-lantern:focus-visible .sky-lantern__card { border-color: #ffe08a; }
.sky-lantern__key { color: #ffe08a; font-size: 0.72rem; }
.sky-lantern--correct .sky-lantern__card { border-color: #7df0b5; background: rgb(18 92 66 / 96%); }
.sky-lantern--wrong .sky-lantern__card { border-color: #ff7d8c; background: rgb(104 26 44 / 96%); }
.sky-upgrades { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); inline-size: 100%; }
.sky-upgrade {
  display: grid;
  gap: 2px;
  min-inline-size: 0;
  padding: var(--space-2);
  border: 2px solid #ffe08a;
  border-radius: var(--radius-md);
  background: rgb(26 22 60 / 96%);
  color: #fff;
  font: inherit;
  font-size: var(--text-sm);
  text-align: center;
  cursor: pointer;
}
.sky-upgrade small { color: #ffe9b8; }

/* Phase 1 polish: long answers stack as full-width rows, summary actions never scroll away. */
.sky-lantern--row .sky-lantern__card { grid-template-columns: auto 1fr; justify-items: start; gap: var(--space-2); text-align: start; }
.sky-lantern--row .sky-lantern__key { font-size: 1rem; }
.modal-actions--sticky {
  position: sticky;
  z-index: 1;
  inset-block-end: calc(-1 * (18px + env(safe-area-inset-bottom, 0px)));
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  margin-inline: calc(-1 * var(--space-4));
  padding-block: var(--space-3);
  padding-inline: var(--space-4);
  border-block-start: 1px solid var(--color-border);
  background: var(--color-surface);
}
.stat-tile strong { unicode-bidi: isolate; }
.gym-start { inline-size: 100%; min-block-size: 64px; font-size: var(--text-lg); }
.map-scene { display: block; }

/* Sky Sprint: countdown, stage bar and calm checkpoint cards. Text stays in the DOM so Arabic shapes correctly. */
.sprint-hud {
  position: fixed;
  z-index: 1;
  inset: 0;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 2px;
  padding-block-start: calc(max(6px, env(safe-area-inset-top, 0px)) + 8px);
  pointer-events: none;
  color: #fff;
  text-align: center;
}
.hud-bar--minimal .hud-telemetry,
.hud-bar--minimal .hud-utilities button:not([data-testid="hud-pause"]) {
  display: none;
}
.hud-bar--minimal .hud-progress {
  position: fixed;
  z-index: 4;
  inset-block-start: 0;
  inset-inline: 0;
  inline-size: 100%;
  block-size: 3px;
  border-radius: 0;
}
.pause-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-1);
  margin-block-start: var(--space-2);
}
.pause-settings .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-block: var(--space-1);
  padding-inline: var(--space-2);
  font-size: var(--text-sm);
}
.hub-more-mode { margin-block-end: var(--space-1); }
.sprint-top-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  inline-size: min(62vw, 280px);
  block-size: 6px;
  margin-block: 4px 2px;
}
.sprint-seg {
  position: relative;
  flex: 1;
  block-size: 100%;
  border-radius: 99px;
  background: rgb(255 255 255 / 22%);
  overflow: hidden;
}
.sprint-seg__fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #ffd873, #ff9d43);
  transition: inline-size 90ms linear;
}
.sprint-seg--done .sprint-seg__fill {
  background: #63e6be;
}
/* The big number counts the whole run's distance up; the small clock counts the stage down. */
.sprint-distance {
  font-size: clamp(2.4rem, 8.5vmin, 3.6rem);
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 2px 10px rgb(0 0 0 / 45%);
  font-variant-numeric: tabular-nums;
}
.sprint-best { margin: 0; font-size: 0.72rem; font-weight: 600; line-height: 1.35; opacity: 0.72; text-shadow: 0 1px 4px rgb(0 0 0 / 60%); }
.sprint-best--new { color: #ffe27a; opacity: 1; }
.sprint-row { display: flex; align-items: center; gap: 8px; }
.sprint-clock { font-size: 0.9rem; font-weight: 700; opacity: 0.88; text-shadow: 0 1px 4px rgb(0 0 0 / 60%); }
.sprint-timer {
  display: inline-block;
  min-inline-size: 1.6em;
  font-variant-numeric: tabular-nums;
}
.sprint-pops { position: fixed; z-index: 1; inset: 0; overflow: hidden; pointer-events: none; }
.sprint-pop {
  position: absolute;
  translate: -50% 0;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.75;
  white-space: nowrap;
  text-shadow: 0 2px 6px rgb(0 0 0 / 92%), 0 0 2px rgb(0 0 0 / 95%);
  animation: sprint-pop-rise 0.85s ease-out forwards;
}
[dir="rtl"] .sprint-pop { translate: 50% 0; }
.sprint-pop--perfect {
  color: #6effa8;
  font-size: clamp(1.15rem, 4.4vw, 1.48rem);
  max-inline-size: calc(100vw - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 6px rgb(0 0 0 / 92%), 0 0 14px rgb(110 255 168 / 80%);
}
/* DEC-50 (v51) ×3+ Fever callouts: foregrounded, outlined, larger (NICE!/COOL!/AWESOME!/PERFECT!). */
.sprint-pops:has(.sprint-pop--fever) { z-index: 3; }
.sprint-pop--fever {
  color: #fff6c8;
  font-size: clamp(1.3rem, 5.2vw, 1.72rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  -webkit-text-stroke: 2px #1c1100;
  paint-order: stroke fill;
  text-shadow: 0 3px 0 #1c1100, 0 0 16px rgb(255 216 115 / 85%), 0 0 28px rgb(182 255 59 / 55%);
}
.zone-stage:empty { background: transparent; border-radius: 0; }
@keyframes sprint-pop-rise {
  0% { opacity: 1; transform: translateY(0) scale(0.92); }
  42% { opacity: 1; transform: translateY(-6px) scale(1.04); }
  100% { opacity: 0; transform: translateY(-48px) scale(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  .sprint-pop { animation: none; }
}
.sprint-timer--warn { color: #ff6f7d; animation: hint-pulse 0.5s ease-in-out infinite; }
.sprint-bar {
  position: relative;
  inline-size: min(56vw, 300px);
  block-size: 4px;
  border-radius: 99px;
  background: rgb(255 255 255 / 20%);
}
.sprint-bar__fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 99px; background: linear-gradient(90deg, #ffd873, #ff9d43); }
.sprint-bar__best { position: absolute; inset-block: -3px; inline-size: 3px; margin-inline-start: -1px; border-radius: 2px; background: #fff; }
.sprint-bar__best[hidden] { display: none; }
.sprint-stage {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  opacity: 0.72;
  text-shadow: 0 1px 4px rgb(0 0 0 / 60%);
  transition: opacity 250ms ease;
}
.sprint-stage--fade { opacity: 0; transition: opacity 450ms ease; }
.sprint-place { margin: 0; font-size: var(--text-xs, 0.75rem); font-weight: 600; line-height: 1.75; opacity: 0.85; text-shadow: 0 1px 6px rgb(0 0 0 / 70%); }
.sprint-mult { color: #fff4c2; font-size: 1.6rem; font-weight: 800; text-shadow: 0 0 14px rgb(255 216 115 / 80%); }
/* DEC-51: the ×2/×3 combo pill sits right under the stage progress bar on its own solid backing, so striped
   ceiling hazards behind it never make it unreadable. */
.sprint-hud .sprint-mult {
  order: 0;
  position: relative;
  z-index: 2;
  margin-block: 2px 0;
  padding: 1px 12px;
  border-radius: 999px;
  font-size: 1.2rem;
  line-height: 1.35;
  background: rgb(14 12 28 / 84%);
  border: 1px solid rgb(255 216 115 / 55%);
}
.sprint-mult[hidden] { display: none; }
.sprint-hint { position: fixed; inset-block-end: calc(max(12px, env(safe-area-inset-bottom, 0px)) + 28px); inset-inline: 16px; margin-inline: auto; max-inline-size: 520px; }
.checkpoint-card { text-align: start; }
.checkpoint-card > *,
.checkpoint-card .stack { min-inline-size: 0; }
.checkpoint-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px var(--space-2);
}
.checkpoint-label { margin: 0; color: #ffd873; font-size: var(--text-sm); font-weight: 800; }
.cp-badge {
  display: inline-flex;
  align-items: center;
  padding-block: 4px;
  padding-inline: 10px;
  border-radius: 99px;
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.5;
}
.cp-badge--easy { border: 1px solid rgb(125 240 181 / 55%); background: rgb(18 92 66 / 55%); color: #b6ffe0; }
.cp-badge--hard { border: 1px solid rgb(255 157 67 / 65%); background: rgb(128 52 24 / 60%); color: #ffe0b2; }
.cp-badge--book { border: 1px solid rgb(255 255 255 / 22%); background: rgb(255 255 255 / 10%); color: var(--color-text-muted); }
.cp-reading {
  margin: 0;
  padding-block: var(--space-2);
  padding-inline-start: var(--space-3);
  border-inline-start: 3px solid #ffd873;
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 6%);
  color: #f4f6ff;
  font-size: var(--text-sm);
  line-height: 1.75;
}
.cp-type-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  min-inline-size: 0;
  max-inline-size: 100%;
}
.cp-type-input {
  box-sizing: border-box;
  min-inline-size: 0;
  max-inline-size: 100%;
  inline-size: 100%;
  min-block-size: 48px;
  padding-block: var(--space-2);
  padding-inline: var(--space-3);
  border: 2px solid rgb(255 216 115 / 55%);
  border-radius: var(--radius-md);
  background: rgb(12 14 34 / 92%);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  line-height: 1.75;
}
.cp-type-input:focus-visible { outline: 2px solid #ffd873; outline-offset: 2px; border-color: #fff; }
.checkpoint-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.checkpoint-choices { display: grid; gap: var(--space-2); }
.checkpoint-choice { inline-size: 100%; min-block-size: 56px; line-height: 1.75; text-align: start; }
.cp-mult { font-weight: 800; }
.game-choice {
  display: grid;
  gap: 2px;
  justify-items: start;
  min-block-size: 64px;
  text-align: start;
  transition: transform 95ms cubic-bezier(0.2, 1.6, 0.4, 1), border-color 140ms ease, box-shadow 140ms ease;
}
.game-choice:hover,
.game-choice:focus-visible {
  border-color: rgb(255 216 115 / 62%);
  box-shadow: 0 0 18px rgb(255 216 115 / 16%);
}
.hub-tile,
.option-card,
.blockout-tool-btn,
.blockout-ctrl-btn {
  transition: transform 95ms cubic-bezier(0.2, 1.6, 0.4, 1), border-color 140ms ease, box-shadow 140ms ease;
}
.hub-tile:active:not(:disabled),
.game-choice:active:not(:disabled),
.option-card:active:not(:disabled),
.blockout-tool-btn:active:not(:disabled),
.blockout-ctrl-btn:active:not(:disabled) {
  transform: scale(0.96);
}
.game-choice small { color: var(--color-text-muted); font-weight: 400; }
.tower-hud {
  position: fixed;
  z-index: 1;
  inset: 0;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 2px;
  padding-block-start: calc(max(6px, env(safe-area-inset-top, 0px)) + 8px);
  pointer-events: none;
  color: #fff;
  text-align: center;
}
.tower-score {
  font-size: clamp(2.4rem, 8.5vmin, 3.6rem);
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 2px 10px rgb(0 0 0 / 45%);
  font-variant-numeric: tabular-nums;
}
/* DEC-49: clean vertical separation between the big score and `Best` (Summit Vault scores reach 4 digits). */
.tower-hud .tower-score { padding-block-end: 2px; }
.tower-hud .sprint-best { margin-block-start: 6px; }
.tower-hud--summit { gap: 6px; }
.tower-hud--summit .tower-score { font-size: clamp(2.1rem, 7.4vmin, 3.1rem); }
.tower-hud--summit .sprint-best {
  margin-block-start: 8px;
  padding: 2px 10px;
  border-radius: 99px;
  background: rgb(10 13 20 / 55%);
}
.tower-bar {
  position: relative;
  inline-size: min(56vw, 300px);
  block-size: 4px;
  border-radius: 99px;
  background: rgb(255 255 255 / 20%);
}
.tower-bar__fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 99px; background: linear-gradient(90deg, #6effa8, #ffd873); }

/* Study-First Discipline System: Focus Charges, Anti-Spam Read Lock & Arcade Gate */
.focus-pips { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.focus-pip { display: inline-flex; align-items: center; justify-content: center; transition: transform 180ms ease, opacity 180ms ease; }
.focus-pip--active svg polygon { fill: #63e6be; stroke: #a8ffea; stroke-width: 1.2; }
.focus-pip--lost svg polygon { fill: transparent; stroke: rgb(255 255 255 / 32%); stroke-width: 1.4; }
.focus-pip--shatter { animation: pip-shatter 380ms ease-out; }
.focus-pip--shatter svg polygon { stroke: #ff6b81; }
@keyframes pip-shatter {
  0% { transform: scale(1.35) rotate(0deg); opacity: 1; }
  45% { transform: scale(1.15) rotate(-18deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 0.55; }
}
@keyframes cp-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  45% { transform: translateX(7px); }
  70% { transform: translateX(-4px); }
  85% { transform: translateX(3px); }
}
.checkpoint-card--shake { animation: cp-shake 340ms cubic-bezier(0.36, 0.07, 0.19, 0.97); }
.cp-read-locked { opacity: 0.48 !important; pointer-events: none !important; transition: opacity 220ms ease; }
.checkpoint-card[data-read-locked="true"] {
  position: fixed;
}
.checkpoint-card[data-read-locked="true"]::after {
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  inline-size: 100%;
  block-size: 4px;
  transform-origin: left center;
  background: linear-gradient(90deg, #ffd873, #63e6be);
  animation: read-lock-fill 1100ms linear forwards;
  pointer-events: none;
}
[dir="rtl"] .checkpoint-card[data-read-locked="true"]::after {
  transform-origin: right center;
}
.checkpoint-card[data-read-locked="true"] .cp-read-locked {
  position: relative;
  overflow: hidden;
}
.checkpoint-card[data-read-locked="true"] .cp-read-locked::after {
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  inline-size: 100%;
  block-size: 3px;
  transform-origin: left center;
  background: linear-gradient(90deg, #ffd873, #63e6be);
  animation: read-lock-fill 1100ms linear forwards;
  pointer-events: none;
}
[dir="rtl"] .checkpoint-card[data-read-locked="true"] .cp-read-locked::after {
  transform-origin: right center;
}
@keyframes read-lock-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.cp-why-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border-inline-start: 3px solid #63e6be;
  background: rgb(99 230 190 / 10%);

  /* DEC-49: long explanations scroll inside the card so Launch/Continue stays visible on 390x844. */
  max-block-size: 112px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.cp-why-card__label {
  font-size: 12px;
  color: #63e6be;
  letter-spacing: 0.02em;
}
.cp-streak-pill {
  padding-block: 3px;
  padding-inline: 8px;
  border-radius: 999px;
  border: 1px solid rgb(255 216 115 / 45%);
  background: rgb(255 216 115 / 14%);
  color: #ffe28a;
  font-size: 12px;
  font-weight: 700;
}
.focus-reset-screen {
  display: grid;
  gap: var(--space-3);
  justify-items: stretch;
  text-align: center;
}
.focus-reset-shards-note {
  margin: 0;
  font-size: var(--text-sm);
  color: #63e6be;
  font-weight: 700;
}
.focus-reset-subhead {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: start;
}
.focus-reset-missed {
  display: grid;
  gap: var(--space-1);
  max-block-size: 30dvh;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: start;
}
.focus-reset-missed__item {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 6%);
  font-size: var(--text-sm);
}
.focus-reset-missed__item span { color: #63e6be; font-weight: 700; }
.modal-drawer, .import-body {
  padding-block-end: calc(24px + env(safe-area-inset-bottom, 0px));
}
.question-card {
  padding-block-end: calc(18px + env(safe-area-inset-bottom, 0px));
}
.focus-reset-banner {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgb(255 111 125 / 45%);
  background: rgb(255 111 125 / 14%);
  color: #ffe3e6;
  font-weight: 700;
  text-align: center;
}
.arcade-gate-banner {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgb(255 216 115 / 30%);
  background: rgb(255 216 115 / 10%);
}
.arcade-gate-banner[hidden] { display: none; }
.arcade-gate-banner[data-unlocked="true"] {
  border-color: rgb(99 230 190 / 40%);
  background: rgb(99 230 190 / 10%);
}
.arcade-gate-bar,
.gate-hold-bar {
  position: relative;
  inline-size: 100%;
  block-size: 8px;
  border-radius: 99px;
  background: rgb(255 255 255 / 14%);
  overflow: hidden;
}
.arcade-gate-bar__fill,
.gate-hold-bar__fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #ffd873, #63e6be);
  transition: inline-size 120ms linear;
}
.gate-hold-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgb(255 216 115 / 35%);
  background: rgb(255 216 115 / 8%);
}
.gate-hold-box .btn {
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.arcade-btn--locked {
  opacity: 0.56;
  cursor: not-allowed;
}
.arcade-lock-toast {
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgb(255 216 115 / 14%);
  color: #ffe28a;
  font-size: var(--text-sm);
  text-align: center;
}
.starter-pack-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.starter-pack-row__meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.starter-pack-row__meta small {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.credits-details summary {
  cursor: pointer;
  font-weight: 700;
}
.credits-details p {
  margin: 6px 0 0;
}

/* Unified Glassmorphic Victory Overlay, Celebration Canvas, Checkpoint Juice & Game 3 Hooks */
.victory-scrim {
  background: rgba(10, 13, 22, 0.56);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.victory-glass {
  background: rgba(16, 21, 34, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-block-start: 2px solid rgba(255, 226, 138, 0.48);
  background-image: radial-gradient(ellipse 85% 48% at 50% 0%, rgba(255, 216, 115, 0.18), rgba(99, 230, 190, 0.06) 55%, transparent 82%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.62);
}
.victory-glass .modal-actions--sticky {
  background: rgba(14, 19, 31, 0.86);
  border-block-start-color: rgba(255, 255, 255, 0.12);
}
.victory-glass .stat-tile {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 140ms ease-out, border-color 180ms ease-out;
}
.victory-glass .stat-tile.stat-tile--pop {
  border-color: rgba(255, 216, 115, 0.55);
}
.victory-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.victory-shard-counter,
.cp-shard-counter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-block: 4px;
  padding-inline: 10px;
  border-radius: 999px;
  border: 1px solid rgba(126, 248, 255, 0.38);
  background: rgba(16, 28, 48, 0.78);
  color: #e8fcff;
  font-size: var(--text-sm);
  font-weight: 800;
  transition: transform 95ms cubic-bezier(0.2, 1.6, 0.4, 1);
}
.victory-shard-icon { color: #ffd873; }
.victory-shard-delta { display: inline-block; color: #63e6be; font-size: 0.78rem; transition: transform 140ms ease-out; }
.victory-vault-chip {
  display: inline-flex;
  margin-block-start: var(--space-1);
  padding-block: 3px;
  padding-inline: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 216, 115, 0.52);
  background: rgba(255, 216, 115, 0.16);
  color: #ffe28a;
  font-size: var(--text-xs);
  font-weight: 800;
}
.victory-skin-panel {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-block: var(--space-2);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  text-align: start;
}
/* DEC-51 (v51.1) "Ready to unlock in Forge" goal card: tappable, subtle gold highlight. */
button.victory-skin-panel {
  inline-size: 100%;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.victory-skin-panel--ready {
  border-color: rgb(255 216 115 / 55%);
  background: linear-gradient(90deg, rgb(255 216 115 / 12%), rgb(255 255 255 / 4%));
  box-shadow: 0 0 0 1px rgb(255 216 115 / 18%), 0 0 18px rgb(255 216 115 / 14%);
}
.victory-skin-panel--ready:focus-visible { outline: 2px solid #ffd873; outline-offset: 2px; }
.victory-skin-ready { color: #ffd873; font-weight: 700; }
.hub-mascot-btn--ready .hub-relic-ring__fill { stroke: #ffd873; }
.forge-focus-pulse { box-shadow: 0 0 0 2px #ffd873, 0 0 18px rgb(255 216 115 / 45%); }
@media (prefers-reduced-motion: no-preference) {
  .forge-focus-pulse { animation: forge-focus-pulse 1.1s ease-in-out 3; }
}
@keyframes forge-focus-pulse { 50% { box-shadow: 0 0 0 3px #ffd873, 0 0 26px rgb(255 216 115 / 65%); } }
.victory-skin-icon-wrap {
  flex: none;
  display: grid;
  place-items: center;
  inline-size: 48px;
  block-size: 48px;
  border-radius: var(--radius-md);
  background: rgba(9, 13, 24, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.victory-skin-canvas { inline-size: 44px; block-size: 44px; }
.victory-skin-meta { flex: 1; min-inline-size: 0; display: grid; gap: 6px; }
.victory-skin-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; font-size: var(--text-xs); }
.victory-skin-name { font-weight: 700; color: #f4f7ff; }
.victory-skin-badge {
  padding-block: 2px;
  padding-inline: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd873, #63e6be);
  color: #101522;
  font-size: 0.72rem;
  font-weight: 800;
}
.victory-skin-bar {
  position: relative;
  inline-size: 100%;
  block-size: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.victory-skin-bar__fill {
  position: relative;
  display: block;
  block-size: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #ffd873, #63e6be);
}
.victory-skin-bar__fill::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  inline-size: 10px;
  border-radius: 99px;
  background: #ffffff;
  box-shadow: 0 0 10px #ffffff, 0 0 18px #ffd873;
}
.celebration-fx-canvas {
  position: fixed;
  inset: 0;
  inline-size: 100vw;
  block-size: 100dvh;
  pointer-events: none;
}

.checkpoint-card {
  position: fixed;
  overflow-x: hidden;
  overflow-y: auto;
}
.checkpoint-card--correct {
  border-color: #63e6be;
  box-shadow: 0 0 26px rgba(99, 230, 190, 0.42), 0 12px 40px rgb(0 0 0 / 55%);
}
.checkpoint-card--flawless::after {
  content: "";
  position: absolute;
  inset: -40% -30%;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 248, 210, 0.28) 50%, transparent 65%);
  animation: cp-sheen-sweep 580ms ease-out forwards;
}
@keyframes cp-sheen-sweep {
  from { transform: translateX(-110%); }
  to { transform: translateX(110%); }
}
.tile-clear-sheen {
  position: relative;
  overflow: hidden;
  animation: tile-sheen-pop 340ms ease-out;
}
@keyframes tile-sheen-pop {
  0% { filter: brightness(1); transform: scale(1); }
  40% { filter: brightness(1.45); transform: scale(1.06); }
  100% { filter: brightness(1); transform: scale(1); }
}

.blockout-canvas {
  cursor: grab;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.blockout-canvas:active {
  cursor: grabbing;
}
.blockout-hud {
  position: fixed;
  z-index: 2;
  inset-block-start: calc(max(8px, env(safe-area-inset-top, 0px)) + 4px);
  inset-inline: 52px;
  display: grid;
  justify-items: center;
  gap: 6px;
  pointer-events: none;
}
.blockout-hud__top,
.blockout-hud__sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.blockout-pill {
  padding-block: 4px;
  padding-inline: 11px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 18%);
  background: rgb(11 16 32 / 72%);
  color: #f4f6ff;
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.blockout-par--expired {
  border-color: rgb(255 255 255 / 12%);
  color: var(--color-text-muted);
}
.blockout-master-badge {
  padding-block: 4px;
  padding-inline: 10px;
  border-radius: 999px;
  border: 1px solid rgb(255 216 115 / 62%);
  background: rgb(126 84 18 / 72%);
  color: #ffe8a3;
  font-size: var(--text-xs);
  font-weight: 800;
}
.blockout-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  pointer-events: none;
}
.blockout-bottom {
  position: fixed;
  z-index: 2;
  inset-block-end: calc(max(10px, env(safe-area-inset-bottom, 0px)) + 8px);
  inset-inline: 12px;
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
}
.blockout-tools-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}
.blockout-tool-btn {
  pointer-events: auto;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-inline-size: 88px;
  min-block-size: 44px;
  padding-block: 6px;
  padding-inline: 10px;
  white-space: nowrap;
  border-radius: var(--radius-md);
  border: 1px solid rgb(255 255 255 / 22%);
  background: rgb(16 24 46 / 90%);
  color: #f4f6ff;
  font-size: 0.78rem;
  font-weight: 700;
}
.blockout-tool-btn[aria-pressed="true"] {
  border-color: #ffd873;
  box-shadow: 0 0 14px rgb(255 216 115 / 38%);
  background: rgb(62 48 16 / 88%);
}
.blockout-tool-badge {
  padding: 1px 6px;
  border-radius: 99px;
  background: rgb(255 216 115 / 20%);
  color: #ffe8a3;
  font-size: 0.72rem;
  font-weight: 800;
}
.blockout-tool-confirm {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgb(255 216 115 / 55%);
  background: rgb(14 19 38 / 95%);
  color: #f4f6ff;
  font-size: 0.78rem;
  font-weight: 700;
  max-inline-size: calc(100vw - 24px);
}
.blockout-tool-confirm[hidden] {
  display: none;
}
.blockout-tool-confirm .btn {
  min-inline-size: 76px;
  min-block-size: 44px;
  padding-block: 6px;
  padding-inline: 12px;
  font-size: 0.8rem;
}
.blockout-par--frozen {
  border-color: #7ee8ff;
  box-shadow: 0 0 12px rgb(126 232 255 / 45%);
  background: rgb(16 48 76 / 88%);
  color: #dcf7ff;
}
.blockout-ctrl-btn {
  pointer-events: auto;
  touch-action: manipulation;
  min-inline-size: 108px;
  min-block-size: 44px;
  border-radius: var(--radius-md);
  border: 1px solid rgb(255 255 255 / 20%);
  background: rgb(16 22 40 / 88%);
  color: #f4f6ff;
  font-weight: 700;
}
.blockout-ctrl-btn:disabled {
  opacity: 0.42;
}

/* --- 3D Relic Home Ring & Forge Drawer (100% logical CSS) --- */
.hub-relic-ring-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  inline-size: 56px;
  block-size: 56px;
}
.hub-relic-ring {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}
.hub-relic-ring__track {
  fill: none;
  stroke: rgb(255 255 255 / 14%);
  stroke-width: 3.5;
}
.hub-relic-ring__fill {
  fill: none;
  stroke: #63e6be;
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 280ms ease;
}
.hub-next-relic {
  color: #bceee0;
  font-size: 11px;
  font-weight: 600;
}
.forge-drawer { gap: var(--space-3); min-inline-size: 0; }
.forge-topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.forge-pedestal {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid rgb(99 230 190 / 28%);
  background: radial-gradient(circle at 30% 35%, rgb(34 52 88 / 85%), rgb(12 16 32 / 94%));
}
@media (max-width: 440px) {
  .forge-pedestal { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
}
.forge-pedestal__canvas {
  inline-size: 152px;
  block-size: 136px;
  touch-action: none;
  cursor: grab;
  border-radius: var(--radius-md);
  background: rgb(0 0 0 / 20%);
}
.forge-pedestal__canvas:active { cursor: grabbing; }
.forge-pedestal__info { display: grid; gap: 6px; min-inline-size: 0; inline-size: 100%; }
.forge-pedestal__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.forge-trait { margin: 0; font-size: var(--text-sm); color: var(--color-text); line-height: 1.4; }
.forge-hint { color: var(--color-text-muted); font-size: 11px; }
.forge-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-block-start: 4px; }
.forge-btn { min-block-size: 44px; padding-inline: 12px; font-weight: 700; }
.forge-roster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}
@media (max-width: 360px) {
  .forge-roster { grid-template-columns: minmax(0, 1fr); }
}
.forge-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 6px 8px;
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  cursor: pointer;
  min-inline-size: 0;
}
.forge-card--selected { border-color: #ffd873; box-shadow: 0 0 0 1px rgb(255 216 115 / 35%); }
.forge-card--equipped { border-color: #63e6be; }
.forge-card--locked { opacity: 0.92; }
.forge-card__canvas { grid-row: 1; inline-size: 56px; block-size: 56px; }
.forge-card__meta { grid-row: 1; display: grid; align-content: center; gap: 3px; min-inline-size: 0; }
.forge-card__meta strong { font-size: 13px; overflow-wrap: anywhere; }
.forge-card__meta small { font-size: 11px; color: var(--color-text-muted); overflow-wrap: anywhere; }
.forge-card__btn { grid-column: 1 / -1; min-block-size: 44px; font-size: 12px; font-weight: 700; }
.forge-progress {
  block-size: 5px;
  inline-size: 100%;
  border-radius: 999px;
  background: rgb(255 255 255 / 12%);
  overflow: hidden;
}
.forge-progress__fill {
  display: block;
  block-size: 100%;
  background: linear-gradient(90deg, #63e6be, #ffd873);
}
.forge-section {
  display: grid;
  gap: 8px;
  padding-block-start: var(--space-2);
  border-block-start: 1px solid var(--color-border);
}
.forge-section h3 { margin: 0; font-size: var(--text-md); }
.forge-portals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.forge-portal-btn {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px;
  min-block-size: 44px;
  font-size: 11px;
}
.forge-portal-btn--active { border-color: #63e6be; background: rgb(99 230 190 / 16%); }
.forge-portal-btn--locked { opacity: 0.68; }
.forge-portal__canvas { inline-size: 34px; block-size: 34px; }
/* DEC-49: 7 trait buttons wrap into a clean 2-column grid on 390x844 instead of squishing in one row. */
.forge-resonance-row,
.trait-resonance-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.trait-resonance-row > .energy-pill {
  min-inline-size: 0;
  inline-size: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.25;
  min-block-size: 44px;
}
.skin-meta-note { margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.victory-test-fly {
  inline-size: 100%;
  min-block-size: 44px;
  border: 1px solid rgb(99 230 190 / 55%);
  background: linear-gradient(90deg, rgb(99 230 190 / 20%), rgb(255 216 115 / 22%));
  color: #e8fff8;
  font-weight: 700;
}
.pause-preview-pill {
  margin: 0;
  padding-block: 6px;
  padding-inline: 12px;
  border-radius: 999px;
  border: 1px solid rgb(99 230 190 / 45%);
  background: rgb(99 230 190 / 16%);
  color: #d6fff2;
  font-size: var(--text-sm);
  font-weight: 700;
  text-align: center;
}

.checkpoint-card .cp-why-card { max-block-size: 112px; overflow-y: auto; flex-shrink: 0; }
/* DEC-51: subtle bottom fade + scroll cue when a long Why? overflows its box. */
.cp-why-card--overflow:not(.cp-why-card--end) {
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent);
  mask-image: linear-gradient(to bottom, #000 72%, transparent);
}
/* DEC-49: keep the post-answer Launch / Continue CTA pinned inside the card viewport on 390x844. */
.checkpoint-card [data-testid="cp-launch"],
.checkpoint-card [data-testid="cp-continue"] {
  position: sticky;
  inset-block-end: 0;
  z-index: 2;
  box-shadow: 0 -10px 18px rgb(10 13 20 / 70%);
}

/* DEC-51 (v51.1) "Missed card · +1 retry stop" toast (Tower Stick + Sky Sprint). */
.retry-toast {
  position: fixed;
  inset-block-start: calc(env(safe-area-inset-top, 0px) + 106px);
  inset-inline: 0;
  margin-inline: auto;
  inline-size: max-content;
  max-inline-size: calc(100% - 32px);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgb(18 14 30 / 82%);
  border: 1px solid rgb(255 138 128 / 55%);
  color: #ffd0cb;
  font-size: 0.82rem;
  font-weight: 700;
  pointer-events: none;
  z-index: 4;
}
@media (prefers-reduced-motion: no-preference) {
  .retry-toast { animation: retry-toast-in 2.2s ease forwards; }
}
@keyframes retry-toast-in {
  0% { opacity: 0; transform: translateY(-6px); }
  10%, 80% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}

/* DEC-51: Tower `Best` steps aside while the Summit Vault bar scrolls under the top HUD. */
.sprint-best { transition: opacity 0.18s ease; }
.sprint-best--faded { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .sprint-best { transition: none; } }

/* --- Pass 3 (DEC-52, v52): 4-Pill Switcher, Curated Packs, AI Builder & Social Blocker --- */
.hub-stage-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  inline-size: 100%;
  block-size: 100%;
  min-block-size: 0;
}

.home-mode-switcher {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  inline-size: 100%;
  min-block-size: 44px;
  padding: 0;
  border-radius: var(--radius-md);
  background: rgb(12 16 32 / 78%);
  border: 1px solid rgb(255 255 255 / 14%);
}

.home-mode-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-inline-size: 0;
  min-block-size: 44px;
  block-size: 44px;
  padding-inline: 4px;
  border: 1px solid transparent;
  border-radius: calc(var(--radius-md) - 2px);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.home-mode-pill__icon {
  flex: none;
  inline-size: 14px;
  block-size: 14px;
}

.home-mode-pill[aria-pressed="true"] {
  border-color: rgb(99 230 190 / 55%);
  background: rgb(99 230 190 / 18%);
  color: #eef9f6;
}

.home-inline-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  overflow: hidden;
  box-sizing: border-box;
  padding-block: 4px;
  padding-inline: 8px;
  border-radius: var(--radius-md);
  background: rgb(16 21 40 / 76%);
  border: 1px solid rgb(255 255 255 / 12%);
  min-block-size: 44px;
}

.home-inline-toggle {
  display: inline-flex;
  gap: 4px;
  flex: none;
}

.home-inline-btn {
  padding-block: 6px;
  padding-inline: 10px;
  min-inline-size: 44px;
  min-block-size: 44px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 16%);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.home-inline-btn[aria-pressed="true"] {
  border-color: var(--color-accent);
  background: rgb(110 231 183 / 18%);
  color: #fff;
}

.home-inline-status {
  min-inline-size: 0;
  flex: 1 1 0%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: end;
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.zone-action {
  grid-template-columns: minmax(0, 1fr);
}

.curated-pack-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgb(255 255 255 / 12%);
  background: rgb(255 255 255 / 4%);
}

.curated-pack-card__info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-inline-size: 0;
}

.curated-pack-card__icon {
  flex: none;
  inline-size: 30px;
  block-size: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgb(99 230 190 / 12%);
  border: 1px solid rgb(99 230 190 / 28%);
}

.curated-pack-card__meta {
  display: grid;
  gap: 2px;
  min-inline-size: 0;
}

.ai-prompt-preview {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
}

.drawer-sep {
  border: 0;
  border-block-start: 1px solid rgb(255 255 255 / 12%);
  margin-block: 4px;
}

.social-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgb(7 10 20 / 88%);
  backdrop-filter: blur(10px);
  overflow-y: auto;
}

.social-gate-card.checkpoint-card {
  position: relative;
  inset: auto;
  transform: none;
  margin-inline: auto;
  box-sizing: border-box;
  inline-size: 100%;
  max-inline-size: min(460px, calc(100vw - 28px));
  max-block-size: calc(100dvh - 28px);
  overflow-y: auto;
  display: grid;
  gap: 12px;
}

.social-gate-emblem {
  display: grid;
  place-items: center;
}

.gate-hold-skip {
  position: relative;
  overflow: hidden;
  min-block-size: 40px;
  opacity: 0.72;
  font-size: var(--text-sm);
}

.gate-hold-skip__fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  inline-size: 0%;
  background: rgb(255 216 115 / 26%);
  pointer-events: none;
}

.shortcuts-steps {
  display: grid;
  gap: 8px;
  padding-inline-start: 20px;
  font-size: var(--text-sm);
  line-height: 1.55;
}

/* --- DEC-53 (v52.1): Home header never slides under the 4-pill switcher --- */
.flagship-shell:has(.hub-header) { grid-template-rows: auto minmax(0, 1fr) auto; }
.hub-top { gap: 6px; }
.hub-top .hud-telemetry { gap: 6px; min-inline-size: 0; }
.hub-top .hud-chip { padding-inline: 6px; font-size: 13px; white-space: nowrap; }
.hub-top .hud-chip--shards { padding-inline: 8px; }
.hub-top .hud-utilities { flex-wrap: nowrap; }
@media (max-height: 760px) {
  .flagship-shell:has(.hub-header) { gap: 6px; }
  .flagship-shell:has(.hub-header) .zone-action { gap: 6px; }
  .flagship-shell:has(.hub-header) .btn--play { min-block-size: 60px; }
  .flagship-shell:has(.hub-header) .hub-actions { gap: 6px; }
  .flagship-shell:has(.hub-header) .hub-tile { min-block-size: 46px; padding-block: 4px; }
  .flagship-shell:has(.hub-header) .home-inline-strip { padding-block: 2px; min-block-size: 48px; }
}

/* DEC-53: Add-notes tabs fit one row; Social Blocker guide never scrolls sideways. */
.import-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.import-tabs .mode-switch__option { padding-inline: 2px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shortcuts-guide { grid-template-columns: minmax(0, 1fr); min-inline-size: 0; overflow-x: hidden; }
.shortcuts-guide > * { min-inline-size: 0; }
.shortcuts-guide .energy-pills { flex-wrap: wrap; }
.shortcuts-guide .energy-pill { flex: 1 1 88px; min-inline-size: 0; padding-inline: var(--space-2); white-space: nowrap; }
.shortcuts-guide .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shortcuts-guide .input { min-inline-size: 0; text-overflow: ellipsis; }
.shortcuts-guide .hud-chip { white-space: normal; line-height: 1.35; padding-block: 6px; }

/* DEC-54: per-game Relic trait effects in the Forge inspector. */
.forge-trait-games { margin: 0; padding-inline-start: 1.1em; font-size: var(--text-sm); line-height: 1.4; color: var(--color-text-muted, var(--color-text)); text-align: start; }
.forge-trait-games li { margin-block: 2px; }
.level-intro-toast {
  position: fixed;
  inset-block-start: calc(env(safe-area-inset-top, 0px) + 150px);
  inset-inline: 0;
  margin-inline: auto;
  inline-size: max-content;
  max-inline-size: calc(100% - 40px);
  padding: 8px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 216, 115, 0.85);
  background: rgba(20, 16, 40, 0.88);
  color: #ffe9b0;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  z-index: 30;
}
@media (prefers-reduced-motion: no-preference) {
  .level-intro-toast { animation: level-intro-in var(--intro-ttl, 3.6s) ease forwards; }
}
@keyframes level-intro-in {
  0% { opacity: 0; transform: translateY(-6px) scale(0.98); }
  8%, 85% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}

/* DEC-55: "Mix" Portal Shape tile glyph sized like the canvas previews. */
.forge-portal__mix { display: block; block-size: 34px; line-height: 34px; font-size: 13px; letter-spacing: 1px; color: #ffd873; }

/* DEC-56: boss-run hearts under the Sky Sprint progress bar. */
.sprint-hud .sprint-hearts { display: block; margin-inline: auto; inline-size: max-content; padding: 2px 10px; border-radius: 999px; background: rgba(20, 16, 40, 0.72); color: #ff7a93; font-size: 15px; letter-spacing: 2px; }
/* DEC-56: Prism Gate real timer — last 10 seconds glow red. */
.blockout-par--urgent { color: #ffd3da; background: rgba(255, 59, 85, 0.28); border-color: rgba(255, 59, 85, 0.7); }
.blockout-timeup { display: grid; gap: 12px; }

/* DEC-56: Daily Challenge tile + "Daily ready" chip on More games. */
.hub-daily { border-color: rgba(255, 216, 115, 0.75); background: linear-gradient(135deg, rgba(255, 216, 115, 0.16), rgba(255, 255, 255, 0.03)); }
.hub-daily--done { border-color: rgba(99, 230, 190, 0.6); background: rgba(99, 230, 190, 0.08); }
.hub-daily-dot { margin-inline-start: 8px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #1a1430; background: #ffd873; }

/* DEC-57: persistent twist chip in Sky Sprint, Tower boss hearts, boss-cleared victory chip. */
.sprint-hud .sprint-twists { display: block; margin: 4px auto 0; inline-size: max-content; max-inline-size: 92%; padding: 2px 10px; border-radius: 999px; background: rgba(20, 16, 40, 0.72); color: #ffd873; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tower-hud .tower-hearts { display: block; margin: 4px auto 0; inline-size: max-content; padding: 2px 10px; border-radius: 999px; background: rgba(20, 16, 40, 0.72); color: #ff7a93; font-size: 15px; letter-spacing: 2px; }
.victory-boss-chip { border-color: rgb(255 216 115 / 55%); color: #ffd873; }

/* --- DEC-58 (v54): simpler home, fold-out menus, calm in-game text (every feature kept) --- */
.hub-top { align-items: center; flex-wrap: nowrap; gap: 8px; }
.hub-top .hub-mascot-btn { flex: none; }
.hub-top .world-banner__text { position: relative; flex: 1 1 0; min-inline-size: 0; gap: 2px; text-align: start; }
.hub-top .world-banner__text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.5; }
[lang="ar"] .hub-top .world-banner__text strong, [dir="rtl"] .hub-top .world-banner__text strong { line-height: 1.75; }
.hub-substats { display: flex; gap: 10px; white-space: nowrap; }
.hub-top .hud-telemetry { flex: none; margin-inline-end: 0; }
.hub-top .hud-utilities { flex: none; }
.hub-stage-shell { container-type: size; }
.hub-stage--map .level-map { gap: clamp(6px, 2.4cqb, 18px) 8px; }
.hub-stage--map .level-node { inline-size: clamp(44px, 19cqb, 66px); block-size: clamp(44px, 19cqb, 66px); }
@container (max-height: 305px) { .hub-stage--map .hub-deck-pill { display: none; } }
@container (max-height: 240px) {
  .hub-stage--map { padding-block: 6px; gap: 4px; }
  .hub-stage--map .map-nav .hud-btn { min-block-size: 44px; block-size: 44px; }
}
.btn--play__text { display: grid; justify-items: center; line-height: 1.2; }
.btn--play__hint { font-size: 13px; font-weight: 600; opacity: 0.78; line-height: 1.5; }
[dir="rtl"] .btn--play__hint { line-height: 1.75; }
.hub-actions--nav { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.hub-nav-tile { position: relative; gap: 2px; min-inline-size: 0; min-block-size: 56px; padding-inline: 2px; padding-block: 4px; }
.hub-nav-tile__icon { font-size: 1.2rem; line-height: 1.1; }
.hub-nav-tile__label { max-inline-size: 100%; overflow: hidden; font-size: 12px; font-weight: 600; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
[dir="rtl"] .hub-nav-tile__label { line-height: 1.75; }
.hub-nav-tile .hub-daily-dot { position: absolute; inset-block-start: 6px; inset-inline-end: 12px; inline-size: 10px; block-size: 10px; margin: 0; padding: 0; border-radius: 50%; }
.hub-section { border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-raised); }
.hub-section__head { display: flex; align-items: center; justify-content: space-between; min-block-size: 50px; padding-inline: var(--space-3); font-weight: 700; line-height: 1.75; cursor: pointer; list-style: none; }
.hub-section__head::-webkit-details-marker { display: none; }
.hub-section__head::after { content: "＋"; color: var(--color-text-muted); font-weight: 400; }
.hub-section[open] > .hub-section__head::after { content: "－"; }
.hub-section__body { padding-inline: var(--space-3); padding-block-end: var(--space-3); }
.hub-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hub-stats .stat-tile { padding: 6px 2px; text-align: center; }
.hub-stats .stat-tile span { font-size: 11px; line-height: 1.4; }
.hub-how { margin: 0; line-height: 1.75; }
.hub-how--game { color: var(--color-text-muted); font-size: var(--text-sm); }
.curated-pack-card > .btn { white-space: nowrap; }
.sprint-calm { opacity: 0 !important; transition: opacity 450ms ease; }
.flagship-shell:has(.hub-header) .zone-stage { border-radius: var(--radius-md); background: transparent; }
.hub-stage-shell > .hub-stage--map { border-radius: var(--radius-md); }
/* DEC-58: tiniest screens — shorter title text, and the map scrolls rather than hiding levels. */
@media (max-width: 374px) {
  .hub-top .world-banner__text strong { font-size: 0.95rem; }
  .hub-top { gap: 5px; }
  .home-inline-status { font-size: 0.64rem; }
  .home-inline-btn { padding-inline: 7px; }
}
@container (max-height: 200px) { .hub-stage--map { overflow-y: auto; } }
/* DEC-58: while a level banner is up, the small HUD lines step aside instead of sitting underneath it. */
body:has(.level-intro-toast) :is(.sprint-stage, .sprint-twists, .sprint-hud .sprint-best) { opacity: 0; }
/* DEC-58: Prism's timer, Master badge and count stay on one line, clear of the crest. */
.blockout-hud__sub { flex-wrap: nowrap; white-space: nowrap; inline-size: max-content; max-inline-size: calc(100vw - 16px); }
.blockout-hud__sub > * { padding-inline: 8px; padding-block: 2px; font-size: 12px; line-height: 1.5; }
[dir="rtl"] .blockout-hud__sub > * { line-height: 1.75; }

/* --- DEC-59 (v55): daily goal --- */
.goal-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.goal-row .energy-pill { min-inline-size: 0; padding-inline: 4px; }
.goal-row .input { grid-column: 1 / -1; }
.goal-deck { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--text-sm); color: var(--color-text-muted); }
.goal-deck .input { inline-size: auto; min-inline-size: 96px; }
.blockout-controls { gap: 8px; }
.blockout-controls .blockout-ctrl-btn { padding-inline: 12px; white-space: nowrap; }
/* DEC-59: the world name always fits beside a big shard count. */
.hub-top .world-banner__text strong { font-size: clamp(0.86rem, 3.9vw, 1.08rem); }
.hub-top .hud-chip--shards { padding-inline: 6px; font-size: 12.5px; }

/* --- DEC-60 (v56): level goals, weekly challenge, looks, Journey road --- */
.level-node__game { position: absolute; inset-block-start: -5px; inset-inline-start: -5px; display: grid; place-items: center; inline-size: 20px; block-size: 20px; border-radius: 50%; background: rgb(14 14 32 / 92%); color: #ffe27a; box-shadow: 0 0 0 1px rgb(255 255 255 / 30%); }
.level-node__game svg { inline-size: 12px; block-size: 12px; }
.level-node__game[data-game="tower"] { color: #7ef8ff; }
.level-node__game[data-game="prism"] { color: #c7a6ff; }
.level-node__goals { position: absolute; inset-block-start: -5px; inset-inline-end: -5px; display: grid; place-items: center; inline-size: 18px; block-size: 18px; border-radius: 50%; background: #ffd24a; color: #2a1636; font-size: 11px; font-weight: 900; }
.map-goals, .victory-goals { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; margin: 0; }
.map-goal { padding-block: 1px; padding-inline: 10px; border-radius: 999px; background: rgb(10 12 28 / 66%); color: #e9edf8; font-size: 12.5px; font-weight: 600; line-height: 1.75; }
.map-goal--done { color: #ffd873; }
.map-goal b { color: #ffd873; }
@container (max-height: 330px) { .map-goals { display: none; } }
.weekly-box { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-raised); }
.weekly-box__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.weekly-box small { color: var(--color-text-muted); line-height: 1.75; }
.weekly-task { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: var(--text-sm); line-height: 1.75; }
.weekly-task--done { color: var(--color-success); }
.weekly-task__bar { grid-column: 1 / -1; display: block; block-size: 6px; border-radius: 999px; background: rgb(128 128 160 / 30%); overflow: hidden; }
.weekly-task__bar > i { display: block; block-size: 100%; background: linear-gradient(90deg, #ffb52e, #ffe27a); }
.look-kind { display: grid; gap: 6px; }
.look-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.look-card { display: grid; justify-items: center; align-content: start; gap: 2px; min-block-size: 92px; padding: 8px 4px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: transparent; color: inherit; font: inherit; font-size: 12px; line-height: 1.75; text-align: center; cursor: pointer; }
.look-card small { font-size: 11px; color: var(--color-text-muted); line-height: 1.75; }
.look-card--worn { border-color: #ffd24a; box-shadow: inset 0 0 0 1px #ffd24a; }
.look-card--locked { opacity: 0.72; }
.look-swatch { display: grid; place-items: center; inline-size: 34px; block-size: 34px; border-radius: 50%; background: linear-gradient(135deg, #8a90ad, #e9edf8); font-style: normal; font-size: 14px; }

/* --- DEC-63 (v58): overlap fixes from the demo recording --- */
.checkpoint-card:has(.cp-graded) { display: flex; flex-direction: column; gap: 8px; overflow: hidden; max-block-size: min(88dvh, calc(100dvh - 24px)); padding-block: 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
.checkpoint-card:has(.cp-graded) > * { flex: none; }
.checkpoint-card > .cp-graded { display: flex; flex: 0 1 auto; flex-direction: column; gap: 10px; min-block-size: 0; }
.cp-graded > .cp-scroll { display: grid; flex: 0 1 auto; gap: 8px; min-block-size: 0; overflow-y: auto; overscroll-behavior: contain; }
.cp-graded > .btn { flex: none; min-block-size: 56px; }
.checkpoint-card .cp-graded > :is([data-testid="cp-launch"], [data-testid="cp-continue"]) { position: static; box-shadow: none; }
.cp-graded .checkpoint-choices { gap: 6px; }
.cp-graded .checkpoint-choice { min-block-size: 48px; padding-block: 6px; }
.cp-graded .feedback { margin: 0; }
body:has(.sprint-hearts, .tower-hearts) .level-intro-toast { inset-block-start: calc(env(safe-area-inset-top, 0px) + 194px); }
body:has(.checkpoint-card) .level-intro-toast { display: none; }
.tower-hud--vault .tower-score { padding-inline: 14px; border-radius: 99px; background: rgb(8 10 22 / 82%); }
.victory-glass { max-block-size: 92dvh; scroll-padding-block-end: 104px; }
.victory-glass .victory-stars { margin-block-start: 8px; font-size: 2.7rem; }
.victory-glass .stat-grid { gap: 6px; margin-block: 10px; }
.victory-glass .stat-tile { padding: 6px; }
.victory-glass .modal-actions--sticky { margin-block-start: 14px; }
.victory-glass .victory-skin-panel { scroll-margin-block-end: 104px; }
body:has(.sprint-mult:not([hidden])) .retry-toast { inset-block-start: calc(env(safe-area-inset-top, 0px) + 126px); }
body:has(.sprint-hearts, .tower-hearts) .retry-toast { inset-block-start: calc(env(safe-area-inset-top, 0px) + 154px); }

/* --- DEC-64 (v59): Review and Brain --- */
.flagship-shell:has(.review-head) { grid-template-rows: auto minmax(128px, 34dvh) minmax(0, 1fr); }
.flagship-shell:has(.review-head) .zone-stage { display: flex; flex-direction: column; gap: var(--space-2); max-block-size: none; min-block-size: 0; align-content: stretch; }
.flagship-shell:has(.review-head) .zone-action { display: flex; flex-direction: column; justify-content: flex-start; gap: var(--space-2); min-block-size: 0; overflow-y: auto; padding-block-end: max(8px, env(safe-area-inset-bottom, 0px)); }
.review-head { display: flex; flex: none; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-block-size: 44px; inline-size: 100%; padding-block-start: 8px; padding-inline: 14px 10px; }
.review-count { font-weight: 700; font-size: var(--text-md); line-height: 1.75; font-variant-numeric: tabular-nums; }
.review-again { padding-block: 1px; padding-inline: 10px; border-radius: 99px; background: rgb(255 196 92 / 16%); color: var(--color-warning); font-size: var(--text-sm); font-weight: 600; line-height: 1.75; }
.review-sizes { display: flex; gap: 6px; margin-inline-start: auto; }
.review-size { min-block-size: 44px; min-inline-size: 48px; padding-inline: 12px; border: 1px solid var(--color-border); border-radius: 99px; background: transparent; color: inherit; font: inherit; font-size: var(--text-sm); font-weight: 600; line-height: 1.75; cursor: pointer; }
.review-size[aria-pressed="true"] { border-color: var(--color-accent); background: rgb(122 196 255 / 16%); }
.flagship-shell:has(.review-head) .prompt-card { display: grid; flex: 1 1 auto; align-content: center; gap: var(--space-2); min-block-size: 0; max-block-size: none; }
.flagship-shell:has(.review-head) .prompt-card h2 { font-size: clamp(1.15rem, 5vw, 1.5rem); }
.flagship-shell:has(.review-head) .prompt-card .stroop-word { margin: 0; font-size: clamp(2rem, 11vw, 2.8rem); line-height: 1.75; }
.flagship-shell:has(.review-head) .prompt-card .logic-question { font-size: clamp(1.6rem, 8vw, 2.2rem); }
.flagship-shell:has(.review-head) .prompt-card .drill-rule { margin: 0; line-height: 1.75; }
.flagship-shell:has(.review-head) .action-grid--choices { grid-template-columns: minmax(0, 1fr); flex: none; }
.flagship-shell:has(.review-head) .action-grid--choices .option-card { min-block-size: 60px; }
/* Once graded, only the picked answer and the right one stay, so the explanation fits. */
.flagship-shell:has(.review-head) .zone-action:has(.feedback) .option-card:disabled:not(.option-card--correct, .option-card--wrong) { display: none; }
.flagship-shell:has(.review-head) .zone-action:has(.feedback) > .btn--primary:last-child { position: sticky; inset-block-end: 0; flex: none; margin-block-start: auto; min-block-size: 60px; }
.flagship-shell:has(.review-head) .zone-action > :is(.feedback, .answer-reveal, .cp-why-card) { flex: none; margin: 0; max-block-size: none; }
.flagship-shell:has(.review-head) .zone-action .cp-reading { max-block-size: none; overflow: visible; }
.brain-head__score { color: var(--color-success); font-weight: 700; }
.brain-head__level { color: var(--color-text-muted); font-size: var(--text-sm); line-height: 1.75; }
.brain-help { margin-inline-start: auto; font-weight: 700; }
.nback-cell { display: grid; place-items: center; color: #0d1120; font-size: 20px; line-height: 1; }
.hub-nav-badge { position: absolute; inset-block-start: 3px; inset-inline-end: 3px; min-inline-size: 20px; padding-inline: 5px; border-radius: 99px; background: #ffc45c; color: #1b1406; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.brain-hero { display: grid; justify-items: center; gap: 8px; padding: 20px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-raised); text-align: center; }
.brain-hero h2, .brain-hero p { margin: 0; line-height: 1.75; }
.brain-hero__icon { font-size: 2.4rem; line-height: 1.2; }
.brain-hero__stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; color: var(--color-text-muted); font-size: var(--text-sm); }
.brain-hero .btn { min-block-size: 48px; padding-inline: 20px; }
.brain-more > summary { min-block-size: 44px; align-content: center; font-weight: 600; line-height: 1.75; cursor: pointer; }
.brain-more[open] { display: grid; gap: var(--space-2); }
.brain-more[open] > :not(summary) { margin-block-start: var(--space-2); }
.brain-how { display: grid; gap: 10px; align-content: start; }
.brain-how__sub { margin: 4px 0 0; font-size: var(--text-md); line-height: 1.75; }
.brain-steps { display: grid; gap: 6px; margin: 0; padding-inline-start: 22px; line-height: 1.75; }
.brain-kind { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); line-height: 1.75; }
.brain-kind small { color: var(--color-text-muted); line-height: 1.75; }
.brain-ex { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: var(--text-md); line-height: 1.75; }
.brain-ex__ink { color: #ff7b72; }
.brain-ex__answer { color: var(--color-success); }
.brain-ex--minis { justify-content: center; gap: 18px; }
.brain-mini { display: grid; justify-items: center; gap: 4px; }
.brain-mini__grid { display: grid; grid-template-columns: repeat(3, 22px); grid-auto-rows: 22px; gap: 3px; }
.brain-mini__grid i { display: grid; place-items: center; border-radius: 4px; background: rgb(128 128 160 / 24%); color: #0d1120; font-size: 11px; font-style: normal; line-height: 1; }
.brain-mini__grid i.on { background: var(--color-accent); }
.summary-note { margin: 8px 0; line-height: 1.75; }
.missed-back { margin-block: 4px 0; }
@media (max-height: 700px) {
  .flagship-shell:has(.review-head) { grid-template-rows: auto minmax(118px, 28dvh) minmax(0, 1fr); }
  .flagship-shell:has(.review-head) .action-grid--choices .option-card { min-block-size: 52px; padding-block: 6px; }
}
.brain-ex[dir="ltr"]:not(.brain-ex--minis) { justify-self: start; }

/* --- DEC-65 (v60): iPhone tap tick --- */
.haptic-switch { position: fixed; inset-block-start: 0; inset-inline-start: 0; inline-size: 1px; block-size: 1px; margin: 0; opacity: 0; pointer-events: none; }
:where(:is(.option-card, .checkpoint-choice, .btn, .hub-nav-tile, .level-node):has(> .haptic-tap)) { position: relative; }
.haptic-tap { position: absolute; inset: 0; z-index: 2; opacity: 0; cursor: inherit; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
