:root {
  color-scheme: dark;
  --bg: #0f1020;
  --panel: #1a1b28;
  --panel-2: #212233;
  --line: #2c2d40;
  --accent: #6842ff;
  --accent-2: #8b6bff;
  --gold: #ffcc55;
  --good: #58e0a4;
  --bad: #ff6b81;
  --text: #fff;
  --muted: #aaadbe;
  font-family:
    "Nunito",
    ui-rounded,
    "SF Pro Rounded",
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}
body {
  padding: 10px;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 10px;
  padding: 7px 11px;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.08s ease;
}
button:hover:not(:disabled) {
  background: #2b2c41;
  border-color: var(--accent);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
}
dl,
dd,
dt,
ul,
li,
p {
  margin: 0;
  padding: 0;
  list-style: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.shell {
  display: grid;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}
.brand h1 {
  font-size: 19px;
  letter-spacing: 0.2px;
}
.wallet {
  display: flex;
  gap: 8px;
}
.wallet-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 10px;
  text-align: right;
  min-width: 74px;
}
.wallet-item dt {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
}
.wallet-item dd {
  font-size: 15px;
  font-weight: 800;
}
.wallet-item:nth-child(2) dd {
  color: var(--gold);
}

.meters {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 10px;
}
.meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
}
.meter-label b {
  color: var(--text);
}
.bar {
  display: block;
  height: 7px;
  border-radius: 99px;
  background: var(--panel-2);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  transition: width 0.25s linear;
}
.meter-level .bar i {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.meter-health .bar i {
  background: linear-gradient(90deg, #ff7a5c, #ffb05c);
}
.meter-mood .bar i {
  background: linear-gradient(90deg, #4ec2ff, #58e0a4);
}
.meter-fame .bar i {
  background: linear-gradient(90deg, #c78bff, var(--gold));
}

.status {
  display: flex;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.portrait {
  width: 84px;
  height: 84px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--panel-2);
  flex: 0 0 auto;
}
.status-body {
  min-width: 0;
  flex: 1;
}
.status-role {
  font-size: 17px;
  font-weight: 800;
}
.status-place {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.ledger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
}
.ledger div {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
}
.ledger dt {
  color: var(--muted);
}
.ledger dd {
  font-weight: 700;
}
[data-tone="good"] {
  color: var(--good);
}
[data-tone="bad"] {
  color: var(--bad);
}

.drive {
  display: grid;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.life-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}
.life-age {
  font-size: 13px;
  color: var(--muted);
}
.life-age b {
  font-size: 24px;
  color: var(--text);
  margin-right: 4px;
}
.life-stage {
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.bar-life {
  height: 10px;
}
.bar-life i {
  background: linear-gradient(90deg, var(--good), var(--gold) 60%, var(--bad));
}
.life-note {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}
.speeds {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.speeds button {
  display: grid;
  gap: 1px;
  padding: 9px 6px;
  line-height: 1.15;
}
.speeds button b {
  font-size: 16px;
}
.speeds button small {
  font-size: 9.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.speeds button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent-2);
  box-shadow: 0 4px 14px rgb(104 66 255 / 35%);
}
.speeds button[aria-pressed="true"] small {
  color: rgb(255 255 255 / 75%);
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs button {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}
.tabs button[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent-2);
}

.panel {
  display: grid;
  gap: 8px;
}
.hint,
.banner {
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  line-height: 1.5;
}
.banner {
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.track {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 10px 8px;
}
.track > summary {
  cursor: pointer;
  padding: 8px 2px;
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}
.track > summary span {
  color: var(--muted);
  font-size: 11px;
}
.track .card {
  background: var(--panel-2);
}

.card {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.card-art {
  width: 52px;
  height: 52px;
  border-radius: 9px;
  object-fit: cover;
  background: #2a2b3d;
  flex: 0 0 auto;
}
.card-body {
  flex: 1 1 190px;
  min-width: 0;
}
.card-body h3 {
  font-size: 14px;
  font-weight: 800;
}
.card-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.45;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 6px;
}
.meta li {
  font-size: 10.5px;
  font-weight: 700;
  background: #2a2b3d;
  border-radius: 6px;
  padding: 2px 7px;
  color: #d5d7e6;
}
.blockers {
  margin-top: 6px;
  display: grid;
  gap: 2px;
}
.blockers li {
  font-size: 10.5px;
  color: var(--bad);
}
.blockers li::before {
  content: "· ";
}
.card-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.card-actions button {
  font-size: 12px;
  padding: 6px 10px;
}
.tag {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-2);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 5px 9px;
}
.art-missing {
  background: linear-gradient(135deg, #2c2d43, #3a3c58);
}
.card-current {
  border-color: var(--accent);
}
.card-done {
  border-color: #2f6d53;
}
.card-up .card-sub {
  color: var(--good);
}
.card-down .card-sub {
  color: var(--bad);
}

.journal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.journal h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 6px;
}
.journal li {
  font-size: 12px;
  line-height: 1.55;
  padding: 2px 0;
  border-top: 1px solid #23243400;
}
.journal li b {
  color: var(--muted);
  font-size: 10.5px;
  margin-right: 5px;
}
.journal li[data-tone="good"] {
  color: var(--good);
}
.journal li[data-tone="bad"] {
  color: var(--bad);
}

.foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 2px 10px;
}
.foot p {
  font-size: 11px;
  color: var(--muted);
  flex: 1 1 220px;
}
.ghost {
  background: none;
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgb(6 6 16 / 74%);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 10;
}
.scrim[hidden] {
  display: none;
}
.sheet {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  max-width: 420px;
  width: 100%;
  display: grid;
  gap: 10px;
  box-shadow: 0 24px 60px rgb(0 0 0 / 55%);
}
.sheet-art {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--panel-2);
}
.sheet h2 {
  font-size: 18px;
}
.sheet p {
  font-size: 13px;
  line-height: 1.6;
  color: #d7d9e8;
}
.sheet-actions {
  display: grid;
  gap: 6px;
}
.sheet-actions button {
  text-align: left;
  padding: 11px 13px;
  font-size: 13px;
  font-weight: 700;
}

@media (min-width: 560px) {
  .meters {
    grid-template-columns: repeat(4, 1fr);
  }
  .drive {
    grid-template-columns: 1fr minmax(280px, 0.8fr);
    align-items: center;
  }
  .portrait {
    width: 112px;
    height: 112px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
