/* 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%);
}
.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%); }
.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;
}
.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%);
}
.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[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;
}
.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; }
.forge-resonance-row { display: flex; flex-wrap: wrap; gap: 8px; }
.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;
}
