@font-face { font-family: 'Pixelify Sans'; src: url('/assets/fonts/pixelify-sans-latin.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: Figtree; src: url('/assets/fonts/figtree-latin.woff2') format('woff2'); font-weight: 300 900; font-display: swap; }
@font-face { font-family: Figtree; src: url('/assets/fonts/figtree-italic-latin.woff2') format('woff2'); font-style: italic; font-weight: 300 900; font-display: swap; }
:root {
  color-scheme: dark;
  --purple: #160e20; --surface: #21162b; --field: #2b1c36; --gold: #e6c480; --gold-high: #f5dca9; --gold-low: #d5af66;
  --text: #f6f0e7; --muted: #c0b3ca; --faint: #9a8ca6; --line: #49364f; --water: #a385c7; --track: #34283a; --edge: #0e0915;
  --pixel: 'Pixelify Sans', monospace; --gutter: clamp(20px, 3.4vw, 48px);
  font: 18px/1.4 var(--pixel); background: var(--purple); color: var(--text); accent-color: var(--gold);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; color: inherit; border-radius: 0; }
button, a, input { touch-action: manipulation; }
button { cursor: pointer; background: none; border: 0; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
button svg { pointer-events: none; }
[hidden] { display: none !important; }
::selection { background: var(--gold); color: var(--purple); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; font-weight: 400; }
h1 { font-size: 32px; line-height: 1.2; }
h1[tabindex='-1']:focus { outline: none; }
h2 { font-size: 24px; line-height: 1.25; }
h3 { font-size: 20px; line-height: 1.3; }
b, strong { font-weight: 500; }
.muted, .small { color: var(--muted); }
.small, .eyebrow, .sample-label { font-size: 16px; }
.eyebrow { color: var(--muted); margin-bottom: 4px; }
.pixel-icon { width: 16px; height: 16px; flex: none; color: inherit; }
span[data-icon] { display: inline-flex; flex: none; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 100; background: var(--gold); color: var(--purple); padding: 12px; }
.skip-link:focus { top: 10px; }
.demo-banner { min-height: 44px; padding: 4px var(--gutter); display: flex; justify-content: center; align-items: center; gap: 24px; border-bottom: 2px solid var(--line); font-size: 14px; color: var(--muted); background: var(--surface); }
.demo-banner b { color: var(--gold); }
.demo-banner .text-button { font-size: 14px; white-space: nowrap; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 88px; padding: 16px var(--gutter); border-bottom: 2px solid var(--line); max-width: 1600px; margin: auto; }
.brand { display: flex; align-items: center; gap: 12px; min-height: 44px; font: 600 19px/1.4 Figtree, sans-serif; letter-spacing: -.02em; flex-shrink: 0; }
.brand em { font-weight: 500; }
.brand-divider { margin: 0 12px; color: var(--faint); font-weight: 400; }
.brand-voyages { color: var(--gold); font: 24px var(--pixel); letter-spacing: 0; }
.pixel-tabs { display: flex; gap: 8px; }
.pixel-tab { position: relative; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border: 2px solid var(--line); background: var(--surface); color: var(--muted); box-shadow: 0 3px 0 var(--edge); font-size: 18px; line-height: 1.2; }
.pixel-tab:hover { border-color: var(--faint); color: var(--text); }
.pixel-tab:is([aria-current='page'], [aria-pressed='true']) { color: var(--gold); border-color: var(--gold); background: var(--field); box-shadow: inset 0 -3px 0 var(--line); }
.pixel-tab:is([aria-current='page'], [aria-pressed='true']):after { content: ''; position: absolute; top: 3px; right: 3px; width: 3px; height: 3px; background: var(--gold); }
.pixel-tab:active { box-shadow: none; transform: translateY(2px); }
.purse { display: flex; align-items: center; gap: 8px; color: var(--muted); min-height: 44px; white-space: nowrap; }
.purse b, .purse .pixel-icon { color: var(--gold); }
.purse b { font-size: 22px; }
.shell { max-width: 1328px; margin: auto; padding: 28px var(--gutter) 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.button, .log-button, .stage-edit { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 10px 20px; border: 2px solid var(--gold); background: var(--gold); color: var(--purple); box-shadow: inset 0 -4px 0 var(--gold-low), 0 3px 0 var(--edge); font-size: 18px; line-height: 1.3; }
.button:hover { background: var(--gold-high); }
.button:active, .log-button:active, .stage-edit:active { box-shadow: none; transform: translateY(2px); }
.button.secondary, .log-button, .stage-edit { background: var(--surface); border-color: var(--faint); color: var(--text); box-shadow: inset 0 -3px 0 var(--field), 0 3px 0 var(--edge); }
.button.secondary:hover, .log-button:hover, .stage-edit:hover { border-color: var(--gold); color: var(--gold); }
.text-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 18px; padding: 8px 4px; }
.text-button:hover, footer a:hover { color: var(--gold); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(340px, 1fr); gap: 24px; align-items: stretch; }
.world-card, .quest-panel, .comparison { border: 2px solid var(--line); background: var(--surface); min-width: 0; box-shadow: 4px 4px 0 var(--edge); }
.world-card, .comparison { overflow: hidden; }
.world-stage { position: relative; background: #35203f; }
.pixel-scene { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.stage-label { position: absolute; top: 16px; left: 16px; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.live-pixel { width: 4px; height: 4px; background: var(--gold); }
.stage-coordinate { position: absolute; top: 16px; right: 16px; font-size: 14px; color: var(--muted); }
.stage-edit { position: absolute; bottom: 16px; right: 16px; font-size: 16px; padding: 8px 12px; }
.identity-strip { padding: 20px; display: flex; justify-content: space-between; gap: 24px; align-items: center; border-top: 2px solid var(--line); }
.identity-strip > div:first-child { min-width: 0; flex: 1; }
.identity-strip h2 { display: flex; align-items: center; gap: 12px; font-size: 26px; overflow-wrap: anywhere; }
.level-pill, .count-pill { padding: 4px 8px; border: 2px solid var(--line); font-size: 16px; color: var(--gold); white-space: nowrap; }
.ship-line { font-size: 16px; margin-top: 4px; overflow-wrap: anywhere; }
.xp-block { width: 44%; min-width: 190px; }
.xp-label { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.xp-label b { color: var(--text); }
.progress-track { height: 8px; background: var(--track); }
.progress-track i { display: block; height: 100%; background: var(--gold); box-shadow: inset 0 -2px 0 var(--gold-low); }
.xp-block p { font-size: 14px; color: var(--muted); margin-top: 8px; }
.quest-panel { padding: 24px; display: flex; flex-direction: column; }
.section-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.count-pill { color: var(--muted); }
.quest { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; padding: 20px 0; border-bottom: 2px solid var(--line); }
.quest:last-child { border-bottom: 0; }
.quest-icon { width: 32px; height: 32px; display: grid; place-items: center; background: var(--field); color: var(--gold); }
.quest-icon.tests { color: var(--water); }
.quest-icon.review { color: #e8a9ba; }
.quest-target { color: var(--muted); font-size: 16px; margin-top: 4px; }
.quest-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.quest-rewards { font-size: 14px; line-height: 1.5; color: var(--muted); }
.quest-rewards b { color: var(--gold); }
.log-button { min-height: 44px; padding: 8px 12px; font-size: 16px; flex: none; }
.log-button.completed { border-color: var(--line); color: var(--muted); box-shadow: none; }
.quest-note { margin-top: auto; padding-top: 16px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.voyage-strip { display: flex; gap: 32px; align-items: center; padding: 24px 0; margin: 12px 0 20px; border-bottom: 2px solid var(--line); }
.voyage-title { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.route-icon { color: var(--gold); }
.voyage-title h2 { font-size: 22px; }
.route-progress { flex: 1; }
.route-labels { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.route-labels span:nth-child(2) { color: var(--gold); }
.route-track { height: 6px; background: var(--track); position: relative; }
.route-track:before, .route-track:after { content: ''; position: absolute; top: -2px; width: 10px; height: 10px; background: var(--gold); }
.route-track:before { left: 0; }
.route-track:after { right: 0; background: var(--faint); }
.route-track i { display: block; background: var(--gold); height: 100%; position: relative; }
.route-track i:after { content: ''; position: absolute; width: 10px; height: 10px; right: 0; top: -2px; background: var(--gold); border: 2px solid var(--purple); }
.port-reward { display: flex; gap: 12px; align-items: center; border-left: 2px solid var(--line); padding-left: 24px; }
.port-reward p { font-size: 14px; color: var(--muted); }
.port-reward b { display: block; font-size: 18px; color: var(--text); margin-top: 4px; }
.reward-sun { width: 28px; height: 28px; background: #c79391; border: 4px solid #614457; clip-path: polygon(25% 0,75% 0,75% 15%,100% 15%,100% 85%,75% 85%,75% 100%,25% 100%,25% 85%,0 85%,0 15%,25% 15%); flex: none; }
.crew-section-heading { margin: 24px 0 16px; }
.sample-label { color: var(--muted); font-weight: 400; }
.crew-section-heading h2 { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.crew-preview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.crew-card { min-width: 0; background: var(--surface); border: 2px solid var(--line); overflow: hidden; text-align: left; padding: 0; box-shadow: 3px 3px 0 var(--edge); }
.crew-card:hover { border-color: var(--gold); }
.crew-card-art { height: 112px; position: relative; overflow: hidden; background: var(--field); display: flex; align-items: flex-end; justify-content: center; }
.crew-card-art:after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 16px; background: #352a42; }
.crew-card-art > svg { height: 108px; width: auto; z-index: 1; }
.crew-card-level { position: absolute; right: 8px; top: 8px; font-size: 14px; color: var(--muted); }
.crew-card-body { padding: 12px; }
.crew-card-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.crew-card-row b { font-size: 20px; overflow-wrap: anywhere; }
.crew-card-row span { font-size: 16px; color: var(--gold); white-space: nowrap; }
.crew-card-body p { font-size: 16px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.session-log { margin-top: 28px; border-top: 2px solid var(--line); padding-top: 20px; }
.session-log ul { list-style: none; padding: 0; margin: 12px 0 0; }
.session-log li { display: flex; justify-content: space-between; gap: 16px; font-size: 16px; padding: 8px 0; color: var(--muted); }
.session-log li span:last-child { color: var(--gold); }
.creator-grid { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr); gap: 40px; align-items: start; }
.creator-preview { position: sticky; top: 24px; min-width: 0; }
.character-stage { height: 352px; display: grid; place-items: center; background: var(--field); padding: 24px; }
.character-stage > svg { width: 100%; max-width: 364px; height: 308px; image-rendering: pixelated; }
.character-stage[data-preview-kind='ship'] > svg { max-width: 432px; height: auto; }
.character-stage[data-preview-kind='setting'] { height: auto; padding: 0; }
.character-stage[data-preview-kind='setting'] > svg { max-width: none; height: auto; }
.creator-preview .identity-strip { min-height: 76px; }
.creator-actions { margin-top: 16px; }
.creator-actions .button { width: 100%; }
.creator-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
.part-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 24px; }
.control-group { margin-bottom: 24px; }
.control-group h2, .control-group label { font-size: 20px; display: block; margin-bottom: 12px; font-weight: 400; }
.control-group input { width: 100%; min-height: 48px; background: #180f21; border: 2px solid var(--line); box-shadow: inset 3px 3px 0 var(--edge); padding: 10px 12px; caret-color: var(--gold); }
.control-group input:focus { border-color: var(--gold); }
.head-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.head-controls .control-group:first-child { grid-column: 1 / -1; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 48px; height: 48px; border: 2px solid var(--faint); padding: 6px; background: var(--surface); position: relative; box-shadow: 0 3px 0 var(--edge); }
.swatch i { display: block; width: 100%; height: 100%; background: var(--swatch); }
.swatch[aria-pressed='true'] { border-color: var(--gold); box-shadow: inset 0 -2px 0 var(--line); }
.swatch .pixel-icon { position: absolute; right: 2px; bottom: 2px; color: var(--gold); background: var(--purple); }
.option-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.item-option { min-width: 0; border: 2px solid var(--line); background: var(--surface); padding: 0; overflow: hidden; text-align: left; box-shadow: 3px 3px 0 var(--edge); }
.item-option:hover { border-color: var(--faint); }
.item-option[aria-pressed='true'] { border-color: var(--gold); }
.option-art { height: 112px; display: flex; align-items: center; justify-content: center; background: var(--field); overflow: hidden; }
.option-art svg { height: 100px; width: auto; max-width: 100%; }
.option-art.setting-art { height: auto; aspect-ratio: 5/3; }
.setting-art svg { height: auto; width: 100%; }
.option-info { padding: 12px; display: block; font-size: 18px; }
.option-info b { display: block; line-height: 1.2; overflow-wrap: anywhere; }
.option-info > span { min-height: 40px; display: flex; gap: 6px; align-items: flex-start; font-size: 14px; line-height: 1.4; color: var(--muted); margin-top: 8px; }
.option-info .pixel-icon { margin-top: 2px; }
.item-option[aria-pressed='true'] .option-info > span { color: var(--gold); }
.item-option[aria-disabled='true'] .option-art { opacity: .55; }
.pattern-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.crew-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 0 24px; border-bottom: 2px solid var(--line); margin-bottom: 24px; }
.crew-summary strong { display: block; font-size: 40px; line-height: 1.2; }
.crew-summary small { font-size: 20px; color: var(--muted); }
.crew-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: start; }
.leaderboard { margin: 16px 0; }
.leaderboard-row { display: grid; grid-template-columns: 24px 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 12px 8px; min-height: 96px; border-bottom: 2px solid var(--line); border-left: 4px solid transparent; }
.leaderboard-row:hover, .leaderboard-row[aria-pressed='true'] { background: var(--surface); }
.leaderboard-row[aria-pressed='true'] { border-left-color: var(--gold); }
.rank { font-size: 16px; color: var(--muted); }
.leaderboard-avatar { width: 56px; height: 64px; background: var(--field); }
.leaderboard-avatar svg { width: 100%; height: 100%; }
.leaderboard-name { font-size: 22px; display: block; overflow-wrap: anywhere; }
.leaderboard-name small { color: var(--muted); font-size: 14px; margin-left: 8px; }
.leaderboard-detail { display: block; font-size: 16px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.leaderboard-km { font-size: 18px; color: var(--gold); white-space: nowrap; }
.compare-scene { aspect-ratio: 5/2; overflow: hidden; }
.compare-scene .pixel-scene { margin-top: -12%; }
.compare-body { padding: 24px; }
.compare-body h2 { display: flex; justify-content: space-between; align-items: center; gap: 12px; overflow-wrap: anywhere; }
.compare-body > p { color: var(--muted); font-size: 16px; margin-top: 8px; overflow-wrap: anywhere; }
.compare-stat { display: flex; justify-content: space-between; gap: 12px; padding: 16px 0; border-bottom: 2px solid var(--line); font-size: 16px; }
.compare-stat span { color: var(--muted); }
.compare-body .button { width: 100%; margin-top: 20px; }
.saluted { background: var(--field); color: var(--gold); border-color: var(--gold); }
footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 2px solid var(--line); margin-top: 40px; padding: 20px 0 24px; font-size: 14px; color: var(--muted); }
footer a { min-height: 44px; display: flex; gap: 8px; align-items: center; }
.notice { padding: 16px; border: 2px solid var(--line); margin-bottom: 24px; color: var(--muted); }
.notice h1, .notice h2 { margin-bottom: 12px; color: var(--text); }
.notice p + p { margin-top: 12px; }
.connection-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 20px; }
.save-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; border-bottom: 2px solid var(--line); padding-bottom: 12px; }
.save-panel p { color: var(--muted); }
.save-panel .text-button { flex-shrink: 0; color: var(--gold); }
.live-note { margin-top: 24px; max-width: 72ch; }
.purchase-panel { scroll-margin-top: 16px; }
button:disabled { opacity: .65; }
.main-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 480px) {
  .save-panel { flex-wrap: wrap; gap: 4px; }
  .connection-actions > .button { width: 100%; }
}
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--gold); color: var(--purple); border: 2px solid var(--gold-low); box-shadow: 4px 4px 0 var(--edge); padding: 12px 20px; font-size: 18px; width: max-content; max-width: calc(100% - 40px); text-align: center; opacity: 0; pointer-events: none; }
.toast.visible { opacity: 1; }
dialog { width: min(440px, calc(100% - 40px)); background: var(--surface); color: var(--text); border: 2px solid var(--faint); box-shadow: 6px 6px 0 var(--edge); padding: 40px 28px 28px; text-align: center; }
dialog::backdrop { background: #160e20d9; }
dialog h2 { font-size: 32px; }
dialog > p { font-size: 18px; color: var(--muted); margin-top: 12px; }
.dialog-close { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; display: grid; place-items: center; color: var(--muted); }
.dialog-close:hover { color: var(--gold); }
.reward-art { height: 112px; display: flex; justify-content: center; margin-bottom: 20px; }
.reward-art svg { height: 100%; width: auto; }
.reward-values { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 24px 0; }
.reward-values span { background: var(--field); border: 2px solid var(--line); padding: 8px; color: var(--gold); font-size: 16px; }
dialog .button { width: 100%; }
@media (max-width: 1100px) {
  .site-header { gap: 16px; }
  .brand { font-size: 17px; gap: 8px; }
  .brand-divider { margin: 0 8px; }
  .pixel-tab { padding: 10px; }
  .creator-grid, .crew-layout { gap: 24px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.3fr) minmax(320px, 1fr); gap: 20px; }
  .identity-strip { flex-wrap: wrap; gap: 16px; }
  .xp-block { width: 100%; }
  .creator-preview .identity-strip { flex-wrap: nowrap; }
  .port-reward, .stage-coordinate { display: none; }
  .quest-panel { padding: 20px; }
  .option-grid { gap: 8px; }
  .option-info { padding: 12px 8px; }
}
@media (max-width: 800px) {
  .site-header { flex-wrap: wrap; min-height: 0; padding-top: 12px; padding-bottom: 16px; }
  .main-nav { order: 3; width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shell { padding-top: 24px; }
  .dashboard-grid, .creator-grid, .crew-layout { grid-template-columns: 1fr; }
  .creator-grid { gap: 24px; }
  .creator-preview { position: sticky; top: 0; z-index: 5; padding: 8px 0 12px; background: var(--purple); }
  .character-stage { height: 192px; padding: 12px; }
  .character-stage > svg { height: 176px; max-width: 260px; }
  .character-stage[data-preview-kind='ship'] > svg { max-width: 240px; max-height: 164px; }
  .character-stage[data-preview-kind='setting'] { height: 192px; padding: 0; overflow: hidden; }
  .character-stage[data-preview-kind='setting'] > svg { height: 100%; width: 100%; }
  .creator-preview .identity-strip { min-height: 56px; padding: 12px 16px; }
  .creator-preview .identity-strip h2 { font-size: 24px; }
  .creator-actions { margin-top: 12px; }
  .creator-controls { min-width: 0; }
  .creator-controls :is(button, input) { scroll-margin-top: 344px; }
  .crew-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .voyage-strip { flex-wrap: wrap; gap: 20px; }
  .route-progress { min-width: 200px; }
  .comparison { max-width: 600px; }
  .crew-layout { gap: 24px; }
}
@media (max-width: 480px) {
  .demo-banner { font-size: 14px; gap: 8px; text-align: left; justify-content: space-between; }
  .banner-detail { display: none; }
  .demo-banner .text-button { font-size: 14px; }
  .demo-banner .text-button .pixel-icon { display: none; }
  .brand { font-size: 16px; }
  .brand img { width: 20px; height: 24px; }
  .brand-divider { margin: 0 8px; }
  .brand-voyages { font-size: 22px; }
  .site-header { gap: 12px; }
  .purse { gap: 4px; }
  .purse > span:last-child { display: none; }
  .pixel-tabs { gap: 6px; }
  .pixel-tab { flex-direction: column; gap: 4px; min-height: 64px; padding: 8px 2px; font-size: 16px; }
  .page-heading { gap: 12px; margin-bottom: 16px; }
  .page-heading h1 { font-size: 28px; }
  .page-heading .text-button { font-size: 16px; }
  .character-stage { height: 144px; padding: 4px; }
  .character-stage > svg { height: 132px; max-width: 220px; }
  .character-stage[data-preview-kind='ship'] > svg { height: 132px; max-width: 200px; }
  .character-stage[data-preview-kind='setting'] { height: 144px; }
  .creator-preview .identity-strip { padding: 8px 12px; min-height: 48px; }
  .creator-preview .identity-strip h2 { font-size: 22px; }
  .level-pill { font-size: 14px; }
  .creator-actions .button { font-size: 18px; }
  .head-controls { grid-template-columns: 1fr; }
  .creator-controls :is(button, input) { scroll-margin-top: 296px; }
  .option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .option-art { height: 100px; }
  .option-art svg { height: 88px; }
  .option-info { padding: 12px; }
  .quest-panel { padding: 16px; }
  .quest { column-gap: 8px; }
  .quest h3 { font-size: 20px; }
  .identity-strip { flex-direction: column; align-items: flex-start; padding: 16px; }
  .creator-preview .identity-strip { flex-direction: row; align-items: center; }
  .identity-strip h2 { font-size: 24px; flex-wrap: wrap; }
  .xp-block { width: 100%; }
  .stage-label { top: 12px; left: 12px; }
  .stage-edit { bottom: 12px; right: 12px; min-height: 44px; font-size: 16px; }
  .voyage-title, .route-progress { width: 100%; }
  .route-progress { flex: auto; }
  .crew-section-heading h2 { font-size: 22px; }
  .crew-section-heading > .text-button { font-size: 16px; text-align: right; }
  .crew-card-body { padding: 12px; }
  .crew-card-row b { font-size: 20px; }
  .crew-card-art { height: 100px; }
  .crew-card-art > svg { height: 96px; }
  .crew-summary { align-items: flex-start; }
  .leaderboard-row { grid-template-columns: 20px 44px minmax(0, 1fr) auto; gap: 8px; padding: 12px 4px; }
  .leaderboard-avatar { width: 44px; height: 56px; }
  .leaderboard-name { font-size: 20px; }
  .leaderboard-detail { font-size: 14px; }
  .leaderboard-km { font-size: 16px; }
  .compare-body { padding: 20px; }
  .session-log li { flex-direction: column; gap: 4px; }
  footer { margin-top: 32px; }
  .toast { font-size: 16px; }
  dialog { padding: 40px 20px 24px; }
}
@media (max-width: 360px) { .pixel-tab { font-size: 14px; } }
@media (max-width: 800px) {
  .main-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .creator-preview { position: static; }
  .creator-controls :is(button, input) { scroll-margin-top: 16px; }
}
@media (max-height: 600px) {
  .creator-preview { position: static; }
  .creator-controls :is(button, input) { scroll-margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* The hub is a quiet list, not a second dashboard or visual system. */
.main-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.main-nav .pixel-tab { min-height: 44px; flex-direction: row; white-space: nowrap; }
#voyages-hub { max-width: 880px; margin-inline: auto; min-height: 400px; }
#voyages-hub .page-heading { flex-wrap: wrap; }
#voyages-hub .page-heading h1 { min-width: 0; flex: 1 1 220px; overflow-wrap: anywhere; }
#voyages-hub .page-heading > .hub-actions { min-width: 0; max-width: 100%; }
.hub-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hub-status { min-height: 28px; margin-top: 20px; }
.hub-filters { margin-bottom: 24px; width: fit-content; }
.hub-filters .pixel-tab { min-width: 44px; }
.hub-empty { padding: 36px 0; }
.hub-list, .hub-badges { list-style: none; margin: 0; padding: 0; }
.hub-list { border-top: 2px solid var(--line); }
.hub-row { display: flex; align-items: center; gap: 16px; min-height: 88px; padding: 16px 0; border-bottom: 2px solid var(--line); }
.hub-row-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hub-row h3 { font-size: 22px; }
.hub-row .small { margin-top: 2px; }
.hub-title-button { display: block; min-height: 44px; max-width: 100%; padding: 4px 0; text-align: left; font-size: 22px; overflow-wrap: anywhere; }
.hub-title-button:hover { color: var(--gold); }
.hub-menu { flex: none; position: relative; }
.hub-menu summary { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; color: var(--muted); padding: 8px; list-style: none; }
.hub-menu summary::-webkit-details-marker { display: none; }
.hub-menu summary .pixel-icon { transform: rotate(90deg); }
.hub-menu[open] summary, .hub-menu summary:hover { color: var(--gold); }
.hub-menu > div { position: absolute; right: 0; top: 100%; z-index: 10; min-width: 200px; max-width: min(280px, 80vw); padding: 8px; background: var(--surface); border: 2px solid var(--faint); }
.hub-menu > div .text-button { display: flex; width: 100%; justify-content: flex-start; padding-inline: 12px; text-align: left; }
.hub-menu > div .text-button:hover { background: var(--field); }
.hub-badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-block: 12px; }
.hub-badge { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; padding: 20px 12px; border-bottom: 2px solid var(--line); min-height: 144px; }
.hub-badge:hover { background: var(--surface); }
.hub-badge b { font-size: 22px; overflow-wrap: anywhere; }
.hub-badge-icon { display: grid; place-items: center; width: 32px; height: 32px; color: var(--gold); background: var(--field); }
.hub-avatar { width: 56px; height: 72px; flex: none; background: var(--field); }
.hub-avatar svg { width: 100%; height: 100%; image-rendering: pixelated; }
.hub-section { margin-top: 36px; }
.hub-section > h2 { margin-bottom: 16px; }
.hub-caption { margin-bottom: 20px; }
.hub-dialog { text-align: left; padding: 28px; width: min(480px, calc(100% - 32px)); max-height: calc(100svh - 32px); overflow-y: auto; }
.hub-dialog h2 { font-size: 28px; margin-bottom: 24px; overflow-wrap: anywhere; }
.hub-dialog .hub-caption { margin-top: 12px; }
.hub-dialog .control-group input, .hub-dialog select { width: 100%; min-height: 48px; padding: 10px 12px; color: var(--text); background: #180f21; border: 2px solid var(--faint); font: inherit; border-radius: 0; }
.hub-dialog .control-group { margin-bottom: 20px; }
.hub-dialog .control-group label { margin-bottom: 8px; }
.hub-dialog-status { margin-top: 16px; min-height: 28px; overflow-wrap: anywhere; }
.hub-dialog-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.hub-dialog .button { width: auto; }
.hub-dialog [data-hub-fields] > p { overflow-wrap: anywhere; }
.hub-dialog .hub-row { gap: 12px; }
@media (max-width: 1100px) {
  .site-header { flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; }
}

/* Signed-out tabs: what the view is, one sign-in action, a short list. */
#voyages-preview { max-width: 880px; margin-inline: auto; }
.preview-status:empty { display: none; }
.preview-status { margin-bottom: 16px; }
.preview-panel h1 { margin-bottom: 8px; }
.preview-lead { font-size: 22px; color: var(--muted); max-width: 40ch; }
.preview-actions { margin: 24px 0 32px; }
.preview-art { margin: 0 0 32px; }
.preview-art figcaption { padding: 12px 16px; border-top: 2px solid var(--line); }
.preview-facts { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--line); }
.preview-facts li { display: flex; align-items: flex-start; gap: 16px; padding: 16px 0; border-bottom: 2px solid var(--line); font-size: 18px; }
.preview-facts li > span[data-icon] { width: 32px; height: 32px; display: grid; place-items: center; background: var(--field); color: var(--gold); }
@media (max-width: 480px) {
  .main-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .main-nav .pixel-tab { padding-inline: 2px; font-size: 16px; gap: 4px; }
  .main-nav .pixel-icon { display: none; }
  .hub-row { gap: 8px; }
  .hub-row h3, .hub-title-button { font-size: 20px; }
  .hub-badges { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .hub-badge { padding-inline: 4px; }
  .hub-avatar { width: 40px; height: 56px; }
  .hub-menu summary { padding-inline: 2px; font-size: 16px; }
  .hub-dialog { padding: 24px 20px; }
  .hub-dialog-actions { flex-wrap: wrap; }
  .hub-dialog-actions > .button { flex: 1; min-width: 100px; }
  .preview-lead { font-size: 18px; }
  .preview-actions .button { width: 100%; }
  .preview-facts li { gap: 12px; font-size: 16px; }
}
