:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", sans-serif;
  background: #0d0d20;
  color: #f5f2ff;
  --muted: #b3adcc;
  --line: #302b49;
  --lavender: #c6b6ff;
  --gold: #ffd88d;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; background: radial-gradient(ellipse at 50% 12%, #19142f, transparent 60%); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .68; }
:focus-visible { outline: 3px solid #ffd88d; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
p { color: var(--muted); line-height: 1.6; }
.shell { width: min(1100px, calc(100% - 48px)); margin-inline: auto; }
.topbar { border-bottom: 1px solid #27233b; background: #100f24; }
.header-content { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 5px; white-space: nowrap; font-weight: 750; }
.brand b { color: var(--lavender); }
.brand-icon { display: grid; place-items: center; width: 33px; height: 33px; background: #282044; border: 1px solid #4c3c75; color: #d2bbff; border-radius: 10px; margin-right: 5px; }
nav { display: flex; gap: 5px; }
nav a { padding: 9px 13px; border-radius: 8px; color: var(--muted); font-size: .88rem; }
nav a:hover, nav a[aria-current] { background: #29213f; color: #f5f2ff; }
main { min-height: 66vh; padding-block: 28px 38px; }
.hero, .profile-banner { position: relative; isolation: isolate; overflow: hidden; border: 1px solid #3b3157; border-radius: 25px; background: linear-gradient(110deg, #211638, #231743 55%, #17142f); }
.hero { min-height: 364px; display: grid; align-items: center; padding: 36px clamp(23px, 5vw, 60px); }
.hero::before, .profile-banner::before, .planet-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle, #d2c4fe9c 0 1px, transparent 1.5px), radial-gradient(circle, #d2c4fe69 0 1px, transparent 1.5px);
  background-size: 113px 89px, 151px 127px; background-position: 23px 9px, 68px 62px;
  mask-image: linear-gradient(90deg, transparent 18%, #000 70%);
}
.hero-copy { z-index: 2; }
.eyebrow { color: var(--lavender); font-size: .73rem; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
h1 { margin-block: 13px 12px; font-size: clamp(2.2rem, 6vw, 4.45rem); line-height: 1.01; letter-spacing: -.065em; }
em { color: var(--lavender); font-style: normal; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; border-radius: 10px; padding: 10px 15px; font-weight: 750; font-size: .88rem; }
.primary { background: #c8b4ff; color: #211339; border: 1px solid #dac9ff; }
.primary:hover:enabled, a.primary:hover { background: #e1d4ff; }
.secondary { background: #2c2244; color: #f3eaff; border: 1px solid #594775; }
.hero .primary { margin-top: 23px; }
.hero-art { position: absolute; right: 5%; top: 50%; transform: translateY(-50%); width: 45%; height: 92%; pointer-events: none; }
.hero-planet {
  position: absolute; width: min(68%, 270px); aspect-ratio: 1; top: 50%; left: 51%; transform: translate(-50%, -50%) rotate(-19deg);
  border-radius: 50%; background: radial-gradient(ellipse at 29% 16%, #e4b8ff, transparent 62%),
    repeating-linear-gradient(171deg, #a076e1 0 13px, #8c5ad1 25px, #673cac 48px, #ac77e6 62px);
  box-shadow: inset -28px -28px 56px #27144f, inset 8px 5px 24px #f0caff75, 0 0 62px #9f56ee65;
}
.hero-orbit { position: absolute; z-index: 1; left: 5%; top: 38%; width: 95%; height: 29%; border: 2px solid #d5a9faab; border-top-color: transparent; border-radius: 50%; transform: rotate(-22deg); box-shadow: 0 10px 12px -12px #ddaaff; }
.moon { position: absolute; width: 34px; aspect-ratio: 1; border-radius: 50%; right: 8%; top: 18%; background: radial-gradient(circle at 30% 20%, #fbd6a6, #a26983 60%, #41254b); }
.hero-art span, .hero-art b, .hero-art i { position: absolute; color: #ead1ff; font-style: normal; }
.hero-art span { top: 24%; left: 13%; font-size: 25px; }
.hero-art b { right: 3%; bottom: 22%; font-size: 30px; }
.hero-art i { bottom: 10%; left: 24%; font-size: 16px; }
.planets, .mission-section { margin-top: 28px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.section-heading > span { font-size: .7rem; letter-spacing: .13em; color: var(--muted); }
h2 { font-size: clamp(1.25rem, 3vw, 1.65rem); letter-spacing: -.03em; }
.planet-grid, .mission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.planet-card { --accent: #cabbff; --light: #e5b8fd; --mid: #9a6ad9; --shade: #4d2e88; --panel: #241939; }
.mint { --accent: #9ff4e4; --light: #c7fae1; --mid: #4fbfaa; --shade: #176170; --panel: #112e38; }
.solar { --accent: #ffd88d; --light: #ffedb9; --mid: #d98b4a; --shade: #8c432e; --panel: #352233; }
.violet { --accent: #cabbff; --light: #e5b8fd; --mid: #9a6ad9; --shade: #4d2e88; --panel: #241939; }
.planet-card { display: flex; align-items: center; gap: 15px; min-height: 166px; padding: 17px; position: relative; isolation: isolate; border: 1px solid var(--line); border-radius: 19px; background: linear-gradient(115deg, var(--panel), #181527); }
.planet-card:hover, .control-link:hover { border-color: var(--accent, #af99ea); }
.planet-art { position: relative; flex: 0 0 clamp(72px, 12vw, 145px); aspect-ratio: 1; }
.sphere { position: absolute; left: 18%; top: 16%; width: 64%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(ellipse at 30% 20%, var(--light), transparent 60%), repeating-linear-gradient(153deg, var(--mid) 4px, var(--shade) 21px, var(--mid) 31px); box-shadow: inset -10px -10px 20px var(--shade), 0 0 28px color-mix(in srgb, var(--mid), transparent 53%); }
.orbit { position: absolute; z-index: 1; left: 3%; top: 36%; width: 94%; height: 26%; border: 1px solid var(--accent); border-top-color: transparent; border-radius: 50%; transform: rotate(-24deg); }
.planet-art i { position: absolute; background: var(--light); width: 6%; aspect-ratio: 1; border-radius: 50%; right: 11%; top: 22%; }
.planet-art b { position: absolute; color: var(--accent); left: 7%; bottom: 9%; font-size: 13px; }
.card-copy { flex: 1; }
.card-copy, .profile-banner h1 { overflow-wrap: anywhere; }
.card-copy h3 { font-size: clamp(1.45rem, 4vw, 2rem); line-height: 1.14; margin: 3px 0; }
.card-copy p { font-size: .85rem; }
.card-copy .eyebrow { color: var(--accent); font-size: .66rem; }
.stars { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--gold); border-radius: 20px; background: #ffd48816; padding: 5px 9px; font-size: .77rem; margin-top: 8px; }
.arrow, .control-icon { display: grid; place-items: center; width: 33px; height: 33px; flex: 0 0 auto; border-radius: 9px; border: 1px solid #65548170; color: var(--accent, var(--lavender)); background: #a77bec14; }
.control-link { margin-top: 17px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); background: #181529; border-radius: 13px; padding: 11px 15px; }
.control-link .arrow { margin-left: auto; }
small { color: var(--muted); display: block; margin-top: 4px; }
.profile-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: clamp(18px, 4vw, 38px); }
.profile-banner em { color: var(--accent, var(--lavender)); }
.profile-banner h1, .auth h1 { font-size: clamp(2rem, 5vw, 3.7rem); }
.back { display: inline-block; color: var(--muted); margin-bottom: 12px; font-size: .85rem; }
.mission-grid { margin-top: 13px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mission-card, .panel { border: 1px solid var(--line); background: #1a172d; border-radius: 15px; padding: 16px; }
.mission-card { display: flex; flex-direction: column; align-items: start; gap: 8px; }
.mission-top { display: flex; width: 100%; align-items: center; justify-content: space-between; }
.mission-top .stars { margin: 0; }
.mission-icon, .row-icon { display: grid; place-items: center; border-radius: 12px; background: #2c2444; width: 51px; height: 51px; font-size: 28px; }
.martin .mission-icon { width: 72px; height: 72px; font-size: 42px; background: #19333e; }
.mission-card h3 { font-size: 1rem; }
.mission-actions { width: 100%; display: grid; gap: 5px; margin-top: auto; padding-top: 4px; }
.mission-action, .listen, .row-buttons button { color: #eee7ff; background: #30254a; border: 1px solid #55436f; padding: 8px 10px; border-radius: 8px; font-size: .86rem; min-height: 39px; }
.mission-action:hover:enabled, .listen:hover, .row-buttons button:hover { background: #493665; }
.martin .mission-action { min-height: 47px; }
.panel { margin-top: 15px; }
.reward-target, .reward-caption { display: flex; align-items: center; gap: 10px; }
.reward-target > div { flex: 1; }
.reward-target .mission-icon { flex: 0 0 51px; }
.reward-target .stars { margin: 0; }
.reward-panel progress { display: block; width: 100%; height: 13px; margin: 14px 0 6px; border: 0; border-radius: 20px; overflow: hidden; background: #352d48; accent-color: var(--accent); }
.reward-panel progress::-webkit-progress-bar { background: #352d48; }
.reward-panel progress::-webkit-progress-value { background: var(--accent); border-radius: 20px; }
.reward-panel progress::-moz-progress-bar { background: var(--accent); border-radius: 20px; }
.reward-caption { justify-content: space-between; flex-wrap: wrap; font-size: .85rem; }
.reward-caption strong { color: #f5f2ff; }
.reward-catalog { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.reward-tier + .reward-tier { margin-top: 13px; }
.reward-tier h3 { color: var(--accent); font-size: .9rem; }
.reward-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 8px; }
.reward-list li { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.reward-symbol { font-size: 1.4rem; }
.reward-ready { color: #a2edd5; }
.custom-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 275px), 1fr)); gap: 12px; margin-block: 14px; }
.custom-form { display: grid; align-content: start; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.custom-form label { display: grid; gap: 4px; }
.custom-form select { width: 100%; padding: 8px; border: 1px solid #544669; border-radius: 7px; color: #fff; background: #130f23; font: inherit; }
.custom-form button { justify-self: start; }
.council-form { margin-top: 14px; max-width: 580px; }
.council-form output:empty { display: none; }
.reward-options { max-height: 320px; overflow-y: auto; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; }
.custom-form .reward-options label { display: flex; }
.reward-options input { flex-shrink: 0; }
.reward-option-tier { min-width: 0; margin: 4px 0; border: 1px solid var(--line); border-radius: 8px; }
.reward-option-tier legend { padding: 0 5px; color: var(--lavender); }
.participation { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: .85rem; }
.participation select { max-width: 100%; font: inherit; padding: 5px; color: inherit; background: #130f23; border: 1px solid #544669; border-radius: 6px; }
#reward-save:empty { display: none; }
#reward-edit-status:empty { display: none; }
#edit-reward .reward-paid { display: flex; align-items: center; }
.custom-form textarea { width: 100%; resize: vertical; font: inherit; padding: 8px; border: 1px solid #544669; border-radius: 7px; color: #fff; background: #130f23; }
.card-description { margin: 4px 0; font-size: .87rem; line-height: 1.4; }
.reward-list .listen { margin-top: 6px; }
#mission-save:empty { display: none; }
#mission-selection fieldset { min-width: 0; border: 1px solid var(--line); border-radius: 8px; }
#mission-selection fieldset label { display: flex; }
#mission-selection fieldset input { flex-shrink: 0; }
.mission-editor-group { min-width: 0; }
.mission-editor { margin-top: 7px; border-top: 1px solid var(--line); }
.mission-editor summary { padding-block: 10px; cursor: pointer; overflow-wrap: anywhere; }
.mission-editor .edit-label { color: var(--lavender); font-size: .82rem; margin-left: 6px; }
.panel h2 + p, .panel h2 + label { margin-top: 10px; }
.panel h2 small { display: inline; }
.auth { max-width: 580px; margin-inline: auto; padding: clamp(18px, 4vw, 35px); }
.auth form { display: grid; justify-items: start; gap: 8px; margin-top: 16px; }
input { color: #fff; background: #130f23; border: 1px solid #544669; border-radius: 7px; padding: 8px; max-width: 100%; }
.planning { display: grid; gap: 6px; margin-top: 10px; }
.planning label { display: flex; gap: 8px; align-items: center; min-height: 32px; }
input[type=checkbox] { accent-color: #c8b4ff; width: 18px; height: 18px; }
.records { margin: 10px 0 0; padding: 0; list-style: none; }
.records li { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding-block: 9px; border-top: 1px solid var(--line); }
.row-icon { width: 36px; height: 36px; font-size: 20px; }
.row-buttons { display: flex; gap: 5px; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; padding-block: 16px 25px; border-top: 1px solid #262137; font-size: .78rem; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 700px) {
  .shell { width: calc(100% - 28px); }
  main { padding-top: 16px; }
  .hero { min-height: 315px; }
  .hero-art { right: -1%; }
  .mission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .planet-card { padding: 12px; gap: 7px; min-height: 135px; }
}
@media (max-width: 480px) {
  .header-content { flex-wrap: wrap; gap: 7px; padding-block: 9px; }
  nav { width: 100%; justify-content: space-between; }
  nav a { padding: 8px; }
  .hero { min-height: 325px; align-items: end; }
  .hero-art { right: -3%; top: 28%; height: 57%; width: 55%; opacity: .82; }
  .hero-copy { text-shadow: 0 2px 12px #180f29; }
  .hero .primary { text-shadow: none; }
  .planet-grid { grid-template-columns: 1fr; }
  .planet-card { gap: 13px; }
  .mission-card { padding: 11px; }
  .records li { grid-template-columns: auto 1fr auto; }
  .row-buttons { grid-column: 2 / -1; }
  .profile-banner:has([data-lock]) { flex-wrap: wrap; }
}
