@import url("./tokens.css");
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
button,
input,
textarea {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s;
  border: 0;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
button:hover:not(:disabled) {
  filter: brightness(1.1);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 550;
  line-height: 1.15;
  letter-spacing: -0.045em;
}
h2 {
  font-size: 1.18rem;
  font-weight: 550;
  letter-spacing: -0.025em;
}
h3 {
  font-size: 1rem;
  font-weight: 600;
}
p {
  color: var(--muted);
}
small {
  font-size: 0.8rem;
  color: var(--muted);
}
em {
  font-family: Georgia, serif;
  color: var(--accent);
  font-weight: 400;
}
header {
  height: 88px;
  border-bottom: 1px solid var(--line);
  max-width: 1440px;
  margin: auto;
  padding: 0 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  letter-spacing: 0.06em;
  font-weight: 750;
  text-decoration: none;
  color: var(--text);
}
.brand span {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 16px;
  letter-spacing: 0.13em;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}
.connection {
  font-size: 0.8rem;
  color: var(--muted);
  max-width: 250px;
}
.icon-button {
  background: transparent;
  color: var(--text);
  font-size: 1.3rem;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
}
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  font-weight: 650;
  color: var(--muted);
}
.accent {
  color: var(--accent);
}
.muted {
  color: var(--muted);
}
.primary {
  background: var(--accent);
  color: var(--button-text);
  padding: 14px 24px;
  font-weight: 700;
  border-radius: 12px;
  min-height: 48px;
}
.large {
  min-width: 230px;
  padding: 18px 30px;
}
.quiet,
.text-button {
  background: transparent;
  color: var(--muted);
  padding: 12px 4px;
  min-height: 44px;
}
.text-button {
  color: var(--accent);
  font-size: 0.86rem;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 12px 34px color-mix(in srgb, var(--accent) 9%, transparent);
}
.badge {
  font-size: 0.73rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  padding: 4px 10px;
  white-space: nowrap;
  color: var(--muted);
}
.section-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.game {
  max-width: 1320px;
  margin: auto;
  padding: 44px 40px 70px;
}
.identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 36px;
}
.identity-name {
  display: flex;
  align-items: center;
  gap: 20px;
}
.identity h1 {
  font-size: 2rem;
  margin: 6px 0 7px;
}
.identity p {
  font-size: 0.88rem;
}
.identity p span {
  margin: 0 8px;
}
.avatar {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 1.4rem;
  border: 1px solid var(--line);
}
.stats {
  display: flex;
}
.fact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.fact span {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.fact strong {
  font-size: 1.05rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.stats .fact {
  padding: 0 25px;
  border-left: 1px solid var(--line);
}
.stats .fact strong {
  font-size: 1.4rem;
}
.stats .fact:last-child strong {
  color: var(--accent);
}
.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 24px;
}
.wheel-panel {
  padding: 25px 28px 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 40%, var(--accent-soft), transparent 65%),
    var(--panel);
}
.wheel-wrap {
  position: relative;
  max-width: 455px;
  margin: 22px auto 8px;
  padding: 12px;
}
canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 50%;
  will-change: transform;
}
.wheel-wrap:before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid #505a46;
  border-radius: 50%;
  pointer-events: none;
}
.wheel-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--panel);
  color: var(--accent);
  border: 7px solid var(--line);
  box-shadow:
    0 0 0 1px #b8c59d55,
    0 8px 30px #0005;
  width: 33%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.wheel-center span {
  font-size: 1.4rem;
  line-height: 1.2;
}
.wheel-center strong {
  font-size: 1.8rem;
  letter-spacing: 0.08em;
}
.wheel-center small {
  font-size: 0.66rem;
  margin-top: 4px;
  color: var(--muted);
}
.pointer {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 23px;
  height: 33px;
  background: #edf2d9;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 2px 5px #000);
}
.wheel-caption {
  text-align: center;
  margin: 10px 0 25px;
}
.wheel-caption h2 {
  font-family: Georgia, serif;
  font-size: 1.8rem;
  font-weight: 400;
}
.wheel-caption p {
  font-size: 0.87rem;
  margin-top: 6px;
}
.wheel-footer {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 7px 0;
}
.wheel-footer span,
.wheel-footer button {
  font-size: 0.75rem;
}
.right-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.quest-preview,
.recent {
  padding: 24px;
}
.quest-preview h2,
.recent h2 {
  font-size: 1rem;
}
.quest {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.quest h3 {
  margin: 10px 0 5px;
}
.quest p {
  font-size: 0.85rem;
  max-width: 320px;
}
.quest-top,
.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.progress-label {
  font-size: 0.75rem;
  color: var(--muted);
}
progress {
  display: block;
  width: 100%;
  height: 5px;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  margin: 16px 0 8px;
  background: #333b30;
  accent-color: var(--accent);
}
progress::-webkit-progress-bar {
  background: #333b30;
}
progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 4px;
}
.history-row {
  display: flex;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.history-age {
  color: var(--accent);
  font-size: 1.1rem;
  min-width: 32px;
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}
.history-age small {
  font-size: 0.7rem;
}
.history-row p {
  font-size: 0.88rem;
  color: var(--text);
}
.history-row small {
  font-size: 0.72rem;
}
.details {
  margin-top: 24px;
  overflow: hidden;
}
.tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
  scrollbar-width: thin;
}
.tabs button {
  white-space: nowrap;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  padding: 20px 15px;
  border-bottom: 2px solid transparent;
}
.tabs .selected {
  color: var(--accent);
  border-color: var(--accent);
}
.section-picker {
  display: none;
}
.context-actions {
  margin-bottom: 30px;
}
.tab-content {
  padding: 26px;
}
.fact-grid,
.intro-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}
.tab-content > h3 {
  margin-top: 25px;
  margin-bottom: 12px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.mini-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.npc-title {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 15px;
}
.small-avatar {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}
.mini-card p,
details {
  font-size: 0.85rem;
}
.welcome {
  text-align: center;
  padding: 60px 20px 40px;
  max-width: 750px;
  margin: auto;
}
.welcome h1 {
  font-size: clamp(3.2rem, 9vw, 6rem);
  margin: 20px 0 12px;
}
.tagline {
  font-size: 1.05rem;
}
.welcome-wheel {
  width: min(300px, 70vw);
  margin: 32px auto;
  position: relative;
}
.welcome-wheel canvas {
  opacity: 0.85;
}
.welcome-wheel .wheel-center {
  font-size: 2rem;
}
.welcome > .quiet {
  display: block;
  margin: 10px auto;
}
.welcome > .muted {
  font-size: 0.83rem;
  margin-top: 15px;
}
.intro {
  max-width: 750px;
  margin: 50px auto;
  padding: 40px;
  text-align: center;
}
.intro h1 {
  margin: 20px 0 12px;
}
.large-avatar {
  width: 100px;
  height: 100px;
  font-size: 2.5rem;
  margin: 24px auto;
}
.intro-facts {
  text-align: left;
  margin: 36px 0;
}
.ending {
  max-width: 900px;
  margin: 45px auto;
  padding: 45px;
}
.ending h1 {
  font-size: 4rem;
  margin: 20px 0;
}
.ending h2 {
  margin: 30px 0 15px;
}
.ending .fact-grid {
  margin-top: 30px;
}
.biography {
  white-space: pre-wrap;
  max-height: 500px;
  overflow: auto;
  color: var(--muted);
  line-height: 1.9;
  margin-bottom: 30px;
}
.modal {
  position: fixed;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  color: var(--text);
  width: calc(100% - 32px);
  max-width: 530px;
  max-height: 88dvh;
  overflow: auto;
  padding: 32px;
  box-shadow: 0 30px 150px #000b;
}
.modal::backdrop {
  background: #080e09be;
  backdrop-filter: blur(8px);
}
.modal h2 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 2rem;
  margin: 22px 0 14px;
  line-height: 1.2;
}
.modal p {
  margin: 14px 0;
}
.modal .section-line {
  margin-top: 20px;
}
.event-context {
  margin: 18px 0;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: rgba(142, 188, 170, 0.08);
}
.event-context p {
  margin: 6px 0 0;
  color: var(--muted);
}
.rarity {
  font-size: 0.78rem;
  color: #8ccb97;
}
.rarity.Uncommon {
  color: #82b8f4;
}
.rarity.Rare {
  color: #d4a1f1;
}
.rarity.Very-Rare {
  color: #e8d483;
}
.rarity.Legendary {
  color: #f58f86;
}
.choices {
  display: grid;
  gap: 10px;
  margin: 24px 0;
}
.choices button {
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  gap: 15px;
  align-items: center;
  text-align: left;
}
.choices button > span:nth-child(2) {
  flex: 1;
}
.choices strong {
  font-size: 0.93rem;
  font-weight: 550;
  display: block;
}
.choices small {
  display: block;
  margin-top: 4px;
  font-size: 0.77rem;
}
.choice-number {
  font-size: 0.8rem;
  color: var(--accent);
}
.modal .fact-grid {
  grid-template-columns: 1fr 1fr;
  margin: 24px 0;
}
.modal .primary {
  width: 100%;
}
.close {
  float: right;
}
.settings-actions {
  display: grid;
  gap: 5px;
  margin: 20px 0;
}
.life-option {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  background: var(--panel-soft);
  color: var(--text);
  padding: 14px;
  border-radius: 10px;
  margin: 8px 0;
  text-align: left;
}
.life-option small {
  flex-shrink: 0;
}
form label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 8px;
}
input,
textarea {
  width: 100%;
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 10px;
  min-height: 48px;
}
textarea {
  height: 110px;
  word-break: break-all;
}
.danger {
  display: block;
  background: transparent;
  color: #dfa297;
  padding: 12px;
  margin: 24px auto 0;
}
#notice:not(:empty) {
  position: fixed;
  z-index: 1000;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 30px);
  background: #d8ee99;
  color: #1b2611;
  padding: 15px 22px;
  border-radius: 12px;
  box-shadow: 0 8px 40px #0008;
  font-size: 0.9rem;
}
@media (min-width: 1400px) {
  .game {
    padding-top: 50px;
  }
  .wheel-wrap {
    max-width: 480px;
  }
}
@media (max-width: 1000px) {
  header {
    padding: 0 25px;
  }
  .brand span {
    display: none;
  }
  .game {
    padding: 30px 24px;
  }
  .identity {
    align-items: flex-start;
    flex-direction: column;
  }
  .stats {
    width: 100%;
    justify-content: space-between;
  }
  .stats .fact {
    border: 0;
    padding: 0;
  }
  .game-grid {
    grid-template-columns: 1.3fr 1fr;
  }
  .wheel-panel {
    padding: 22px 18px 0;
  }
  .wheel-center strong {
    font-size: 1.5rem;
  }
  .wheel-center small {
    display: none;
  }
  .wheel-footer {
    flex-direction: column;
    gap: 0;
    padding-top: 10px;
  }
  .fact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  header {
    height: 72px;
    padding: 0 18px;
  }
  .brand {
    font-size: 0.85rem;
    gap: 8px;
  }
  .brand img {
    width: 28px;
    height: 28px;
  }
  .header-actions {
    gap: 5px;
  }
  .connection {
    font-size: 0.65rem;
    max-width: 120px;
    text-align: right;
  }
  .game {
    padding: 25px 16px 40px;
  }
  .identity {
    margin-bottom: 24px;
    gap: 24px;
  }
  .identity-name {
    gap: 14px;
  }
  .identity h1 {
    font-size: 1.6rem;
  }
  .identity .eyebrow {
    font-size: 0.62rem;
  }
  .identity p {
    font-size: 0.75rem;
  }
  .avatar {
    width: 54px;
    height: 54px;
    font-size: 1.1rem;
  }
  .stats {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
  }
  .stats .fact strong {
    font-size: 1.15rem;
  }
  .stats .fact span {
    font-size: 0.65rem;
  }
  .game-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  .wheel-panel {
    padding: 20px 16px 0;
  }
  .wheel-panel .eyebrow {
    font-size: 0.65rem;
  }
  .wheel-wrap {
    max-width: 390px;
    margin: 18px auto 12px;
  }
  .wheel-caption h2 {
    font-size: 1.6rem;
  }
  .wheel-center strong {
    font-size: 1.7rem;
  }
  .wheel-footer {
    flex-direction: row;
    gap: 10px;
  }
  .wheel-footer span,
  .wheel-footer button {
    font-size: 0.65rem;
  }
  .right-stack {
    gap: 18px;
  }
  .quest-preview,
  .recent {
    padding: 22px;
  }
  .quest-preview .quest:nth-of-type(2) {
    display: none;
  }
  .details {
    margin-top: 18px;
  }
  .tabs {
    display: none;
  }
  .section-picker {
    display: grid;
    gap: 7px;
    padding: 18px 22px 0;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .section-picker select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    color: var(--text);
    padding: 0 14px;
    font: inherit;
    font-size: 0.9rem;
    letter-spacing: 0;
    text-transform: none;
  }
  .tab-content {
    padding: 22px;
  }
  .fact-grid,
  .intro-facts {
    gap: 24px 18px;
    grid-template-columns: 1fr 1fr;
  }
  .fact strong {
    font-size: 0.93rem;
  }
  .intro,
  .ending {
    margin: 24px 16px;
    padding: 28px 22px;
  }
  .intro h1 {
    font-size: 2.2rem;
  }
  .large-avatar {
    width: 90px;
    height: 90px;
    font-size: 2rem;
  }
  .ending h1 {
    font-size: 3.2rem;
  }
  .welcome {
    padding-top: 45px;
  }
  .welcome .eyebrow {
    font-size: 0.65rem;
  }
  .modal {
    padding: 25px 22px;
    border-radius: 20px;
  }
  .modal h2 {
    font-size: 1.8rem;
  }
  .life-option {
    flex-direction: column;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.chance-wheel-wrap {
  position: relative;
  width: min(100%, 310px, 43vh);
  margin: 20px auto;
}
.chance-wheel-wrap canvas { width: 100%; height: auto; display: block; border-radius: 50%; }
.chance-wheel-wrap .pointer { left: 50%; top: -7px; transform: translateX(-50%); z-index: 2; }
.chance-modal { text-align: center; }
.debt-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.debt-row p { margin: 0; }
#repayment-form { display: grid; gap: 14px; margin-top: 22px; }

/* Phase 1: compact, game-first information architecture */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}
.game-grid.single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 860px;
  margin-inline: auto;
}
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.section-header > div { min-width: 0; }
.section-header h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); margin-top: 3px; }
.section-header p { max-width: 620px; margin-top: 5px; }
.content-section { margin-top: 26px; }
.content-section > h3,
.content-section > .section-line { margin-bottom: 12px; }
.action-row,
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.action-chip {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-weight: 650;
  line-height: 1.15;
}
.action-chip:hover:not(:disabled) { background: var(--accent-soft); filter: none; transform: translateY(-1px); }
.action-chip.primary { background: var(--accent); border-color: var(--accent); color: var(--button-text); }
.action-chip.subtle { background: var(--panel-soft); color: var(--accent); }
.action-chip.danger-chip { color: #8b233d; border-color: #ddb2bf; }
.entity-grid,
.compact-list,
.search-results,
.attention-list { display: grid; gap: 10px; min-width: 0; }
.entity-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.entity-card,
.compact-card,
.search-result,
.empty-state,
.summary-card,
.alert-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.entity-card { display: grid; align-content: start; gap: 13px; }
.entity-main,
.person-pill { display: flex; align-items: center; gap: 12px; min-width: 0; }
.entity-copy { min-width: 0; flex: 1; }
.entity-copy p,
.compact-card p,
.search-result p { overflow-wrap: anywhere; }
.compact-card,
.search-result,
.ledger-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.search-results {
  margin: 16px 0 24px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
}
.results-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.status-badge {
  display: inline-flex;
  width: fit-content;
  margin: 5px 6px 0 0;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .76rem;
  font-weight: 700;
}
.more-actions { border-top: 1px solid var(--line); padding-top: 8px; }
.more-actions summary,
.collapsible > summary { cursor: pointer; color: var(--accent); font-weight: 700; }
.collapsible {
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.collapsible[open] > summary { margin-bottom: 14px; }
.empty-state { color: var(--muted); background: var(--panel-soft); }
.empty-state p { margin-top: 4px; }
.compact-empty {
  margin: 6px 0;
  padding: 9px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.compact-empty strong { color: var(--text); }
.alert-card { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; text-align: left; color: var(--text); }
.alert-card > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.alert-card small { justify-self: end; }
.alert-card.static { grid-template-columns: auto 1fr; cursor: default; }
.people-strip { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 3px; }
.person-pill { flex: 0 0 auto; padding: 8px 11px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); text-align: left; }
.person-pill span:last-child { display: grid; }
.tiny-avatar { width: 34px; height: 34px; font-size: .85rem; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.summary-card { display: grid; gap: 3px; }
.summary-card > span,
.finance-hero > span { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.summary-card > strong { font-size: 1.12rem; overflow-wrap: anywhere; }
.finance-hero { padding: 22px; border-radius: 20px; background: linear-gradient(135deg, var(--accent), #5b1934); color: white; display: grid; gap: 2px; }
.finance-hero span,
.finance-hero small { color: #f7dbe6; }
.finance-hero strong { font-family: Georgia, serif; font-size: clamp(2rem, 8vw, 3.3rem); font-weight: 500; }
.money-positive { color: #28714b; }
.money-negative { color: #9a2f48; }
.currency-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.currency-input input { min-width: 0; flex: 1; border: 0; }
.currency-input span { padding: 0 12px; color: var(--muted); font-weight: 700; }
.compact-form { display: grid; gap: 8px; }
.outcome-section { margin-top: 20px; }
.outcome-section h3 { margin-bottom: 9px; }
.transaction-list { display: grid; gap: 7px; }
.transaction-list p { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.transaction-group + .transaction-group { margin-top: 12px; }
.transaction-group h4 { margin: 4px 0; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.family-support-panel { display: grid; gap: 14px; }
.request-context { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 13px 15px; border-radius: 14px; background: var(--panel-soft); }
.request-context p { margin: 4px 0 0; color: var(--muted); }
.family-support-responses { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.family-support-response { display: grid; align-content: space-between; gap: 12px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.family-support-response > div:first-child { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; }
.family-support-response h3 { margin: 0; }
.family-support-response .status-badge,
.family-support-response p { grid-column: 2; }
.family-support-response p { margin: 7px 0 0; color: var(--muted); }
.family-support-modal { width: min(820px, calc(100% - 28px)); }
.npc-financials { display: grid; gap: 12px; margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-soft); }
.financial-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.financial-summary .fact { min-width: 0; }
.marketplace-modal { width: min(900px, calc(100% - 28px)); }
.market-result { align-items: flex-start; }
.modal { max-height: min(88vh, 780px); overflow-y: auto; }

@media (max-width: 720px) {
  .section-header,
  .compact-card,
  .search-result,
  .ledger-row { align-items: stretch; flex-direction: column; }
  .section-header .action-chip { align-self: flex-start; }
  .summary-grid { grid-template-columns: 1fr; }
  .alert-card { grid-template-columns: auto 1fr; }
  .alert-card small { display: none; }
  .entity-grid { grid-template-columns: minmax(0, 1fr); }
  .action-chip { min-height: 44px; }
  .request-context { flex-direction: column; }
  .family-support-responses { grid-template-columns: 1fr; }
  .modal { width: 100%; max-width: none; max-height: 92vh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
}
@media (max-width: 430px) {
  header { padding-inline: 14px; }
  .game-shell { padding-inline: 10px; }
  .tab-content { padding: 18px 14px; }
  .wheel-panel { padding-inline: 10px; }
  .section-header h2 { font-size: 1.35rem; }
  .fact-grid,
  .intro-facts { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .entity-card,
  .compact-card,
  .search-result,
  .summary-card { padding: 13px; }
  .action-row > button { flex: 1 1 auto; }
  .market-result .action-row { width: 100%; }
}
@media (max-width: 340px) {
  .brand span,
  .connection { display: none; }
  .tab-content { padding-inline: 10px; }
  .action-chip { padding-inline: 11px; font-size: .86rem; }
  .wheel-footer { flex-wrap: wrap; }
}
.rent-property-form { display: grid; gap: 8px; }
.property-management {
  display: grid;
  gap: 13px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.property-financials { display: grid; gap: 12px; margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-soft); }
.tenant-candidate { display: grid; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel-soft); }
.status-badge.warning { color: #8a4d18; background: #fff0d7; }
.status-badge.positive { color: #286746; background: #e1f4e9; }
.rent-guidance,
.rent-classification { margin: 0; font-size: .86rem; color: var(--muted); }
.rent-classification { color: var(--accent); font-weight: 700; }
.property-card { align-items: flex-start; }
.visual-card { align-items: center; }
.visual-media { margin: 0; overflow: hidden; }
.visual-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.visual-media figcaption { padding: 4px 2px 0; color: var(--muted); font-size: .64rem; line-height: 1.25; }
.visual-media figcaption a { color: inherit; }
.card-thumbnail { width: 104px; height: 88px; border-radius: 12px; flex: 0 0 auto; }
.card-thumbnail img { height: 72px; border-radius: 12px; }
.market-image { width: 100%; aspect-ratio: 16 / 10; border-radius: 14px; grid-column: 1 / -1; }
.market-image img { aspect-ratio: 16 / 9; border-radius: 14px; }

.appearance-picker { width: min(760px, 100%); margin: 24px auto; text-align: left; }
.appearance-picker > h2, .appearance-picker > p { text-align: center; }
.portrait-choices { display: grid; grid-template-columns: repeat(8, minmax(72px, 1fr)); gap: 10px; }
.portrait-choice { padding: 5px; border: 2px solid transparent; border-radius: 16px; background: var(--surface, #fff); color: inherit; }
.portrait-choice img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 11px; }
.portrait-choice span { display: block; padding: 6px 2px 2px; font-size: .7rem; }
.portrait-choice.selected { border-color: var(--accent, #a36d37); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #a36d37) 18%, transparent); }
.portrait-avatar { display: inline-grid; place-items: center; flex: 0 0 auto; overflow: hidden; border-radius: 50%; background: var(--soft, #ece8df); }
.portrait-avatar img { width: 100%; height: 100%; object-fit: cover; }
.header-avatar { width: 58px; height: 58px; }
.profile-avatar { width: 112px; height: 112px; margin: 0 auto 14px; }
.profile-portrait { display: grid; place-items: center; }
.event-person { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.event-person .profile-avatar { width: 72px; height: 72px; margin: 0; }
.property-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 0 0 18px; }
.property-gallery .visual-media { min-height: 180px; border-radius: 14px; }
.property-gallery img { aspect-ratio: 16 / 10; border-radius: 14px; }
.gallery-primary { grid-column: 1 / -1; }
.visual-market { display: grid; gap: 14px; }
.visual-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 12px 0 20px; }
.visual-option { border: 1px solid var(--line); border-radius: 16px; padding: 10px; background: var(--panel-soft); }
.visual-option.selected { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent); }
.option-image { width: 100%; aspect-ratio: 16 / 10; border-radius: 11px; }
.option-image img { aspect-ratio: 16 / 9; border-radius: 11px; }
.narrative-story { border-left: 4px solid var(--accent); }
@media (max-width: 430px) {
  .welcome { width: 100%; padding: 28px 14px 36px; overflow: visible; }
  .appearance-picker { width: 100%; margin-block: 20px; overflow: visible; }
  .portrait-choices { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; overflow: visible; }
  .portrait-choice { min-width: 0; width: 100%; }
  .portrait-choice span { font-size: .72rem; }
  .header-avatar { width: 46px; height: 46px; }
  .property-gallery { grid-template-columns: 1fr; }
  .visual-options { grid-template-columns: 1fr; }
  .visual-card { align-items: flex-start; }
  .card-thumbnail { width: 84px; height: 64px; }
  .financial-summary { grid-template-columns: 1fr; }
  .financial-outcome .collapsible { margin-top: 8px; }
  .transaction-list p { align-items: flex-start; font-size: .86rem; }
  .transaction-list p span { max-width: 70%; }
  .tenant-candidate { padding: 12px; }
}
