:root {
  --bg-deep: #0b1120;
  --bg-panel: #111827;
  --bg-card: #1e293b;
  --bg-elev: #0f172a;
  --border: #334155;
  --border-bright: #475569;
  --text-main: #f8fafc;
  --text-soft: #cbd5e1;
  --text-muted: #94a3b8;
  --btn-blue: #0369a1;
  --btn-blue-hover: #0284c7;
  --btn-amber: #b45309;
  --btn-amber-hover: #d97706;
  --btn-pink: #be185d;
  --btn-pink-hover: #db2777;
  --btn-emerald: #15803d;
  --accent-cyan: #38bdf8;
  --accent-gold: #fbbf24;
  --accent-rose: #f472b6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: #7dd3fc;
  text-decoration: underline;
}
a:hover {
  color: #bae6fd;
}

kbd, code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 1px 5px;
}

.hidden {
  display: none !important;
}

.app-shell {
  max-width: 1008px;
  margin: 0 auto;
  padding: 8px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Header */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
}

.brand-block {
  min-width: 0;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #0369a1;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
}

.top-header h1 {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
  white-space: nowrap;
}

.pill-count {
  font-size: 0.74rem;
  font-weight: 700;
  background: #1e293b;
  color: #7dd3fc;
  border: 1px solid #0369a1;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--text-soft);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.hub-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid var(--border-bright);
  white-space: nowrap;
}

.hub-badge.connected {
  background: #052e16;
  color: #86efac;
  border-color: #15803d;
}

.btn-ghost {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid var(--border-bright);
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-ghost:hover {
  background: #334155;
}

.hub-link {
  background: var(--btn-blue);
  color: #ffffff;
  text-decoration: underline;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 7px;
  white-space: nowrap;
}
.hub-link:hover {
  background: var(--btn-blue-hover);
  color: #ffffff;
}

.toast-banner {
  background: #052e16;
  color: #bbf7d0;
  border: 1px solid #22c55e;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Main Menu */
.screen-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}

.menu-intro h2 {
  font-size: 1rem;
  color: #ffffff;
  margin-bottom: 2px;
}

.menu-intro p {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.compass-chip {
  background: #1e293b;
  border: 1px solid #0369a1;
  border-radius: 8px;
  padding: 6px 12px;
  text-align: right;
  flex-shrink: 0;
}
.compass-label {
  display: block;
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.compass-chip strong {
  font-size: 0.86rem;
  color: #7dd3fc;
}

.track-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.track-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-bright);
  border-radius: 12px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.track-card-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.track-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.track-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #475569;
}

.track-progress-tag {
  font-size: 0.74rem;
  font-weight: 800;
  color: #fde047;
}

.track-card h3 {
  font-size: 1.04rem;
  color: #ffffff;
}

.track-card p {
  font-size: 0.81rem;
  color: var(--text-soft);
  line-height: 1.42;
}

.mini-dots {
  display: flex;
  gap: 5px;
  margin-top: 2px;
}

.mini-dot {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 0;
  border-radius: 5px;
  background: #0f172a;
  color: #94a3b8;
  border: 1px solid #334155;
}
.mini-dot.done {
  background: #052e16;
  color: #86efac;
  border-color: #15803d;
}
.mini-dot.next {
  background: #0c4a6e;
  color: #e0f2fe;
  border-color: #38bdf8;
}

.btn-play-track {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.86rem;
  font-weight: 800;
  color: #ffffff;
  cursor: pointer;
}
.btn-track-standard { background: var(--btn-blue); }
.btn-track-standard:hover { background: var(--btn-blue-hover); }
.btn-track-insane { background: var(--btn-amber); }
.btn-track-insane:hover { background: var(--btn-amber-hover); }
.btn-track-ai { background: var(--btn-pink); }
.btn-track-ai:hover { background: var(--btn-pink-hover); }

/* Trophies Strip */
.trophies-strip {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.trophies-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.trophies-strip-head h3 {
  font-size: 0.88rem;
  color: #fde047;
}
.muted-note {
  font-weight: 400;
  font-size: 0.76rem;
  color: var(--text-soft);
}
.badge-counter {
  font-size: 0.76rem;
  font-weight: 800;
  color: #86efac;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.badge-mini-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 7px 9px;
  opacity: 0.78;
}
.badge-mini-card.unlocked {
  opacity: 1;
  background: #052e16;
  border-color: #22c55e;
}
.badge-mini-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 5px;
}
.badge-mini-desc {
  font-size: 0.72rem;
  color: var(--text-soft);
  margin-top: 2px;
}

/* Stage Screen */
.screen-stage {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
}

.btn-back {
  background: #1e293b;
  color: #ffffff;
  border: 1px solid var(--border-bright);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-back:hover { background: #334155; }

.stage-track-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #7dd3fc;
}

.level-stepper {
  display: flex;
  gap: 5px;
}

.step-pill {
  background: #0f172a;
  color: #cbd5e1;
  border: 1px solid #475569;
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}
.step-pill.active {
  background: #0369a1;
  color: #ffffff;
  border-color: #7dd3fc;
}
.step-pill.done:not(.active) {
  background: #052e16;
  color: #86efac;
  border-color: #15803d;
}
.step-pill.locked {
  background: #0b1120;
  color: #94a3b8;
  border-style: dashed;
  cursor: not-allowed;
}

.lock-notice {
  background: #451a03;
  color: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.stage-grid {
  display: grid;
  grid-template-columns: 472px 1fr;
  gap: 10px;
  align-items: stretch;
}

.canvas-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#trolleyCanvas {
  width: 100%;
  height: auto;
  display: block;
  background: #080e1c;
  border: 1px solid #1e293b;
  border-radius: 8px;
  touch-action: none;
  cursor: pointer;
}

.canvas-legend {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.legend-chip {
  font-size: 0.73rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.legend-a {
  background: #0c4a6e;
  color: #e0f2fe;
  border: 1px solid #0284c7;
}
.legend-b {
  background: #4a044e;
  color: #fce7f3;
  border: 1px solid #db2777;
}

.dilemma-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.dilemma-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dilemma-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fde047;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 999px;
  padding: 2px 8px;
}

.dilemma-seq {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-soft);
}

.dilemma-title {
  font-size: 1.04rem;
  color: #ffffff;
}

.dilemma-prompt {
  font-size: 0.82rem;
  color: #e2e8f0;
  line-height: 1.44;
}

.choices-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}

.choice-btn {
  text-align: left;
  border-radius: 9px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: #ffffff;
  border: 2px solid transparent;
  transition: transform 0.08s ease;
}
.choice-a {
  background: #0369a1;
  border-color: #38bdf8;
}
.choice-a:hover { background: #0284c7; }
.choice-b {
  background: #be185d;
  border-color: #f472b6;
}
.choice-b:hover { background: #db2777; }

.choice-btn.selected {
  box-shadow: 0 0 0 2px #fde047;
}
.choice-btn.dimmed {
  opacity: 0.62;
}

.choice-key {
  font-size: 0.7rem;
  font-weight: 800;
  color: #f1f5f9;
  text-transform: uppercase;
}
.choice-main {
  font-size: 0.83rem;
  line-height: 1.25;
}
.choice-sub {
  font-size: 0.73rem;
  color: #f1f5f9;
  line-height: 1.3;
}

.debrief-box {
  background: #1e293b;
  border: 1px solid #38bdf8;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.debrief-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.debrief-verdict {
  font-size: 0.76rem;
  font-weight: 800;
  color: #86efac;
}

.debrief-split {
  font-size: 0.74rem;
  font-weight: 700;
  color: #fde047;
}

.debrief-text {
  font-size: 0.77rem;
  color: #e2e8f0;
  line-height: 1.38;
}

.debrief-actions {
  display: flex;
  justify-content: flex-end;
}

.btn-next {
  background: var(--btn-emerald);
  color: #ffffff;
  border: 1px solid #4ade80;
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}
.btn-next:hover { background: #16a34a; }

/* Footer */
.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.73rem;
  color: var(--text-soft);
  padding: 4px 4px 2px;
}

/* Upfront Disclosure & Sharing Mode Bar */
.disclosure-bar {
  background: #0f172a;
  border: 1px solid #334155;
  border-left: 4px solid #38bdf8;
  border-radius: 9px;
  padding: 7px 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.disclosure-copy {
  font-size: 0.75rem;
  color: #e2e8f0;
  line-height: 1.35;
}
.disclosure-copy strong {
  color: #7dd3fc;
}

.disclosure-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.nickname-input {
  background: #080e1c;
  color: #f8fafc;
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  width: 138px;
}
.nickname-input:focus {
  outline: 2px solid #38bdf8;
  border-color: #38bdf8;
}

.btn-mode {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #475569;
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.btn-mode.active {
  background: #0369a1;
  color: #ffffff;
  border-color: #7dd3fc;
}
#btnModeShare.active {
  background: #15803d;
  color: #ffffff;
  border-color: #86efac;
}

.debrief-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

/* Post-Level Results & User Breakdown Screen */
.screen-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.results-nav-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.results-banner-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.saved-pill {
  background: #052e16;
  color: #86efac;
  border: 1px solid #15803d;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.74rem;
  font-weight: 800;
}

.results-level-heading {
  font-size: 0.92rem;
  color: #ffffff;
}

.results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 10px;
  align-items: stretch;
}

.results-card {
  min-width: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.your-choice-box {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.your-choice-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.your-choice-verdict {
  font-size: 0.84rem;
  font-weight: 800;
  color: #86efac;
}

.results-debrief-text {
  font-size: 0.76rem;
  color: #e2e8f0;
  line-height: 1.36;
}

.pct-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pct-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pct-head-row h3,
.users-card-head h3 {
  font-size: 0.9rem;
  color: #ffffff;
}

.votes-pill {
  font-size: 0.72rem;
  font-weight: 800;
  color: #bae6fd;
  background: #0c4a6e;
  border: 1px solid #0284c7;
  border-radius: 999px;
  padding: 2px 8px;
}

.pct-split-bar {
  height: 14px;
  width: 100%;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  border: 1px solid #475569;
}
.pct-fill-a {
  background: #0284c7;
  height: 100%;
  transition: width 0.22s ease;
}
.pct-fill-b {
  background: #db2777;
  height: 100%;
  transition: width 0.22s ease;
}

.pct-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pct-stat-card {
  min-width: 0;
  border-radius: 8px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pct-card-a {
  background: #082f49;
  border: 1px solid #0284c7;
}
.pct-card-b {
  background: #4a044e;
  border: 1px solid #db2777;
}
.pct-stat-card.chosen-card {
  box-shadow: 0 0 0 2px #fde047;
}

.pct-stat-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.pct-option-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #f1f5f9;
}
.pct-big-num {
  font-size: 1.08rem;
  font-weight: 900;
  color: #ffffff;
}
.pct-opt-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pct-count-sub {
  font-size: 0.71rem;
  color: #cbd5e1;
}

.baseline-ref-line {
  font-size: 0.72rem;
  color: #cbd5e1;
}

.share-status-box {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 7px 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.share-status-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #e2e8f0;
}
.share-status-label.shared-ok {
  color: #86efac;
}

.share-inline-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-share-post {
  background: #0369a1;
  color: #ffffff;
  border: 1px solid #7dd3fc;
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.btn-share-post:hover {
  background: #0284c7;
}
.btn-share-post.shared-mode {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #64748b;
}

.users-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.users-sub {
  font-size: 0.73rem;
  color: var(--text-soft);
  margin-top: 2px;
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 278px;
  overflow-y: auto;
  padding-right: 2px;
}

.user-choice-row {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.user-choice-row.is-self {
  border-color: #fde047;
}

.user-who {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.user-kind-tag {
  font-size: 0.67rem;
  font-weight: 800;
  border-radius: 5px;
  padding: 2px 5px;
  flex-shrink: 0;
}
.kind-verified {
  background: #052e16;
  color: #86efac;
  border: 1px solid #15803d;
}
.kind-agent {
  background: #2e1065;
  color: #ddd6fe;
  border: 1px solid #7c3aed;
}
.kind-guest {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #475569;
}

.user-name-text {
  font-size: 0.79rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-did-pill {
  font-size: 0.73rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 58%;
}
.did-a {
  background: #0369a1;
  border: 1px solid #38bdf8;
}
.did-b {
  background: #be185d;
  border: 1px solid #f472b6;
}

.users-empty {
  background: #0f172a;
  border: 1px dashed #475569;
  border-radius: 8px;
  padding: 14px 12px;
  font-size: 0.77rem;
  color: #cbd5e1;
  line-height: 1.42;
  text-align: center;
}

/* Compact menu spacing so disclosure + 3 track cards + 4 badges + footer fit 1024x768 */
.screen-menu {
  gap: 7px;
}
.menu-intro {
  padding: 7px 11px;
}
.track-card {
  padding: 9px 11px;
  gap: 7px;
}
.trophies-strip {
  padding: 7px 11px;
}


/* v1.1.1 Above-the-fold 1024x768 fit including 4 Trophy Room cards & footer */
.app-shell {
  padding: 6px 12px 4px;
  gap: 6px;
}
.top-header {
  padding: 6px 12px;
}
.screen-menu {
  gap: 6px;
}
.menu-intro {
  padding: 6px 11px;
}
.menu-intro h2 {
  font-size: 0.94rem;
  margin-bottom: 1px;
}
.menu-intro p {
  font-size: 0.78rem;
  line-height: 1.32;
}
.disclosure-bar {
  padding: 5px 10px;
}
.disclosure-copy {
  font-size: 0.75rem;
  line-height: 1.3;
}
.track-card {
  padding: 8px 11px;
  gap: 6px;
}
.track-card h3 {
  font-size: 0.98rem;
}
.track-card p {
  font-size: 0.77rem;
  line-height: 1.32;
}
.btn-play-track {
  padding: 7px 10px;
  font-size: 0.82rem;
}
.trophies-strip {
  padding: 6px 10px;
}
.trophies-strip-head {
  margin-bottom: 5px;
}
.badge-mini-card {
  padding: 5px 8px;
  min-width: 0;
}
.badge-mini-title {
  font-size: 0.73rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge-mini-desc {
  font-size: 0.69rem;
  line-height: 1.26;
  margin-top: 1px;
}
.app-footer {
  padding-top: 2px;
  font-size: 0.74rem;
}

@media (max-width: 900px) {
  .top-header { flex-wrap: wrap; }
  .brand-sub { white-space: normal; }
  .disclosure-bar { flex-direction: column; align-items: stretch; }
  .disclosure-controls { flex-wrap: wrap; }
  .track-cards-grid { grid-template-columns: 1fr; }
  .badges-grid { grid-template-columns: repeat(2, 1fr); }
  .stage-grid { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .choices-stack { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .badges-grid { grid-template-columns: 1fr; }
  .pct-cards-row { grid-template-columns: 1fr; }
  .header-actions { flex-wrap: wrap; }
  .stage-bar { flex-wrap: wrap; }
}


/* iOS Safari real-device hardening: prevent tap auto-zoom & horizontal slide */
@media (max-width: 680px) {
  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }
  input, select, textarea {
    font-size: 16px !important;
  }
  .card, .track-card, .trophy-mini-card, .dilemma-card, .choice-card, .results-card {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}
