:root {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: #f7f5fb;
  background: #08070c;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;

  --bg: #08070c;
  --surface: #15121c;
  --surface-2: #1c1825;
  --surface-3: #100e15;
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text: #f7f5fb;
  --muted: #aaa3b3;
  --dim: #7d7687;
  --accent: #8f5cf7;
  --accent-bright: #b79aff;
  --positive: #73d5aa;
  --danger: #ef718d;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(143, 92, 247, 0.35);
  outline-offset: 2px;
}

::selection {
  color: white;
  background: rgba(143, 92, 247, 0.55);
}
#root {
  min-height: 100vh;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-bright);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  border-radius: 13px;
  font-weight: 800;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.primary-button {
  border: 1px solid rgba(255, 255, 255, 0.13);
  padding: 12px 18px;
  color: white;
  background: linear-gradient(135deg, #9a6dff, #6330d1);
  box-shadow: 0 15px 34px rgba(91, 43, 195, 0.3);
}

.secondary-button {
  border: 1px solid var(--border-strong);
  padding: 10px 15px;
  color: #eeeaf4;
  background: rgba(28, 24, 36, 0.92);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

/* New-life screen */

.start-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px 18px;
  background:
    radial-gradient(circle at 18% 12%, rgba(143, 92, 247, 0.22), transparent 34%),
    radial-gradient(circle at 82% 86%, rgba(89, 43, 190, 0.13), transparent 32%),
    #08070c;
}

.start-card {
  width: min(100%, 660px);
  padding: 42px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(21, 18, 28, 0.96);
  box-shadow: 0 38px 110px rgba(0, 0, 0, 0.52);
}

.brand-mark,
.small-logo {
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
  background: linear-gradient(145deg, #a57cff, #6330d1);
  box-shadow: 0 14px 34px rgba(96, 47, 199, 0.32);
}

.brand-mark {
  width: 60px;
  height: 60px;
  margin-bottom: 28px;
  border-radius: 18px;
}

.start-card h1 {
  max-width: 590px;
  margin: 0;
  color: white;
  font-size: clamp(2.35rem, 7vw, 4.1rem);
  line-height: 1.01;
  letter-spacing: -0.06em;
}

.intro {
  margin: 20px 0 30px;
  color: #bcb6c5;
  line-height: 1.7;
}

.creation-form {
  display: grid;
  gap: 17px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.creation-form label {
  display: grid;
  gap: 8px;
}

.creation-form label span {
  color: #ddd7e5;
  font-size: 0.8rem;
  font-weight: 700;
}

.creation-form input,
.creation-form select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  padding: 0 15px;
  color: white;
  outline: none;
  background: rgba(7, 6, 10, 0.78);
}

.creation-form input:focus,
.creation-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(143, 92, 247, 0.14);
}

.save-note {
  margin: 18px 0 0;
  color: var(--dim);
  font-size: 0.76rem;
  text-align: center;
}

/* Main shell */

.game-shell {
  min-height: 100vh;
  padding: 22px 26px 44px;
  background:
    radial-gradient(circle at 12% 0%, rgba(136, 82, 243, 0.13), transparent 30%),
    radial-gradient(circle at 88% 26%, rgba(89, 43, 190, 0.08), transparent 25%),
    var(--bg);
}

.app-header,
.hero-card,
.tab-bar,
.content-wrap {
  width: min(1400px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.app-header {
  min-height: 62px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.small-logo {
  width: 43px;
  height: 43px;
  border-radius: 13px;
  font-size: 0.8rem;
}

.app-header h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: -0.035em;
}

.hero-card,
.content-panel {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(25, 21, 33, 0.97), rgba(16, 14, 21, 0.97));
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.24);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(250px, 1.15fr) minmax(320px, 1.65fr) minmax(260px, 1.1fr);
  grid-template-areas:
    "identity facts age"
    "stats stats age";
  gap: 20px 26px;
  padding: 24px;
  border-radius: 23px;
}

.identity-block {
  grid-area: identity;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 17px;
}

.avatar {
  flex: 0 0 auto;
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 21px;
  color: white;
  font-size: 1.3rem;
  font-weight: 900;
  background: linear-gradient(145deg, #a57cff, #6230d2);
  box-shadow: 0 14px 32px rgba(91, 43, 195, 0.32);
}

.identity-block h2 {
  margin: 0 0 7px;
  overflow-wrap: anywhere;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  letter-spacing: -0.04em;
}

.identity-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.hero-facts {
  grid-area: facts;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.hero-facts > div,
.money-grid article,
.overview-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(7, 6, 10, 0.4);
}

.hero-facts > div {
  min-width: 0;
  padding: 11px 12px;
}

.hero-facts span,
.money-grid span,
.overview-card > span {
  display: block;
  margin-bottom: 5px;
  color: var(--dim);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-facts strong {
  display: block;
  overflow: hidden;
  color: white;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-alive {
  color: var(--positive) !important;
}

.status-dead,
.negative-number {
  color: var(--danger) !important;
}

.stat-strip {
  grid-area: stats;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
}

.stat-item > div:first-child,
.relationship-meter > div:first-child,
.stat-item > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.72rem;
}

.stat-item strong {
  color: #ece7f2;
  font-size: 0.7rem;
}

.meter-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
}

.meter-track > div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6935d8, #b38fff);
  box-shadow: 0 0 12px rgba(151, 101, 255, 0.24);
}

.age-button {
  grid-area: age;
  min-height: 126px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 1px solid rgba(184, 153, 255, 0.38);
  border-radius: 18px;
  padding: 16px;
  color: white;
  text-align: left;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.16), transparent 40%),
    linear-gradient(135deg, #8852ef, #6330d1);
  box-shadow: 0 18px 42px rgba(83, 38, 177, 0.3);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.age-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 23px 48px rgba(83, 38, 177, 0.4);
}

.age-button > span {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.19);
  border-radius: 15px;
  font-size: 1.75rem;
  background: rgba(255, 255, 255, 0.11);
}

.age-button strong,
.age-button small {
  display: block;
}

.age-button strong {
  margin-bottom: 4px;
}

.age-button small {
  color: rgba(255, 255, 255, 0.73);
  font-size: 0.7rem;
  line-height: 1.35;
}

.age-button:disabled {
  opacity: 0.48;
}

/* Navigation */

.tab-bar {
  margin-top: 17px;
  margin-bottom: 17px;
  display: flex;
  gap: 7px;
  padding: 7px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(17, 14, 22, 0.88);
}

.tab-bar button {
  flex: 1 0 auto;
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 9px 14px;
  color: #9f98a8;
  font-size: 0.82rem;
  font-weight: 800;
  background: transparent;
}

.tab-bar button:hover {
  color: white;
  background: rgba(255, 255, 255, 0.035);
}

.tab-bar button.active {
  border-color: rgba(181, 150, 255, 0.22);
  color: white;
  background: rgba(143, 92, 247, 0.14);
}

.tab-bar button > span {
  color: var(--accent-bright);
}

/* Content */

.content-panel {
  min-height: 560px;
  padding: 25px;
  border-radius: 21px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.pill {
  flex: 0 0 auto;
  border: 1px solid rgba(181, 150, 255, 0.26);
  border-radius: 999px;
  padding: 7px 11px;
  color: #d5c6fa;
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(143, 92, 247, 0.11);
}

.timeline {
  display: grid;
  gap: 11px;
  margin-top: 20px;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 13px;
  padding: 16px 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(7, 6, 10, 0.43);
}

.timeline-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #81798a;
  box-shadow: 0 0 0 4px rgba(129, 121, 138, 0.12);
}

.timeline-positive .timeline-dot {
  background: var(--positive);
  box-shadow: 0 0 0 4px rgba(115, 213, 170, 0.12);
}

.timeline-negative .timeline-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(239, 113, 141, 0.12);
}

.timeline-age {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-bright);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.timeline-entry p {
  margin: 0;
  color: #c8c1ce;
  font-size: 0.9rem;
  line-height: 1.55;
}

.action-grid,
.people-grid {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.action-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.people-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-card,
.person-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(8, 7, 12, 0.45);
}

.action-card {
  min-height: 188px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.action-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.action-card h3,
.person-card h3,
.asset-section h3 {
  margin: 0;
  color: white;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.action-heading > span {
  border-radius: 999px;
  padding: 5px 8px;
  color: #d9c9ff;
  font-size: 0.66rem;
  font-weight: 800;
  background: rgba(143, 92, 247, 0.12);
}

.action-card p,
.person-card p,
.overview-card p,
.asset-list p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.52;
}

.action-card > button,
.person-actions button,
.asset-list button {
  min-height: 39px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 11px;
  color: #eee9f4;
  font-size: 0.74rem;
  font-weight: 800;
  background: rgba(45, 36, 58, 0.72);
}

.action-card > button:hover:not(:disabled),
.person-actions button:hover:not(:disabled),
.asset-list button:hover:not(:disabled) {
  border-color: rgba(181, 150, 255, 0.5);
  background: rgba(58, 45, 78, 0.92);
}

.action-card > button:disabled,
.person-actions button:disabled,
.asset-list button:disabled {
  color: #706978;
  background: rgba(255, 255, 255, 0.025);
}

.action-danger {
  border-color: rgba(239, 113, 141, 0.18);
}

.person-card {
  padding: 18px;
}

.person-top {
  display: flex;
  align-items: center;
  gap: 13px;
}

.person-avatar {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: white;
  font-size: 0.82rem;
  font-weight: 900;
  background: linear-gradient(145deg, #8b5ae8, #4f279f);
}

.person-top p {
  margin-top: 4px;
}

.trait-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0;
}

.trait-list span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 8px;
  color: #aaa2b3;
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.025);
}

.relationship-meter {
  margin: 15px 0;
}

.relationship-meter strong {
  color: #ece7f2;
  font-size: 0.72rem;
}

.person-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.person-actions button {
  flex: 1 0 auto;
}

.danger-button {
  color: #ffb3c2 !important;
  border-color: rgba(239, 113, 141, 0.22) !important;
}

.person-deceased {
  opacity: 0.58;
}

.overview-grid,
.money-grid {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 20px;
}

.overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.money-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.overview-card,
.money-grid article {
  padding: 16px;
}

.overview-card strong,
.money-grid strong {
  display: block;
  color: white;
  font-size: 1rem;
}

.asset-section {
  margin: 24px 0;
}

.asset-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.asset-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(7, 6, 10, 0.4);
}

.asset-list span {
  display: block;
  margin-bottom: 4px;
  color: var(--dim);
  font-size: 0.62rem;
  font-weight: 850;
  text-transform: uppercase;
}

.asset-list strong {
  display: block;
}

.asset-list p {
  margin-top: 4px;
}

/* Event modal */

.event-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 3, 7, 0.82);
  backdrop-filter: blur(14px);
}

.event-card {
  width: min(100%, 560px);
  padding: 31px;
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  background: #19141f;
  box-shadow: 0 38px 120px rgba(0, 0, 0, 0.64);
}

.event-icon {
  width: 47px;
  height: 47px;
  display: grid;
  place-items: center;
  margin-bottom: 21px;
  border-radius: 14px;
  color: white;
  font-size: 1.1rem;
  font-weight: 900;
  background: linear-gradient(145deg, #a57cff, #6330d1);
}

.event-card h2 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.045em;
}

.event-description {
  margin: 16px 0 24px;
  color: #b8b1bf;
  line-height: 1.7;
}

.event-options {
  display: grid;
  gap: 10px;
}

.event-options button {
  min-height: 51px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  padding: 12px 15px;
  color: #f0ebf5;
  font-weight: 800;
  text-align: left;
  background: rgba(44, 35, 56, 0.72);
}

.event-options button:hover {
  border-color: rgba(181, 150, 255, 0.52);
  background: rgba(58, 45, 78, 0.92);
}

@media (max-width: 1080px) {
  .hero-card {
    grid-template-columns: minmax(240px, 1fr) minmax(280px, 1.3fr);
    grid-template-areas:
      "identity age"
      "facts age"
      "stats stats";
  }

  .hero-facts {
    grid-template-columns: repeat(2, 1fr);
  }

  .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .game-shell {
    padding: 14px 10px 92px;
  }

  .app-header {
    margin-bottom: 12px;
  }

  .hero-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "identity"
      "facts"
      "stats"
      "age";
    padding: 19px;
  }

  .hero-facts,
  .stat-strip,
  .money-grid,
  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .age-button {
    min-height: 86px;
  }

  .tab-bar {
    position: fixed;
    z-index: 20;
    inset: auto 8px 8px;
    margin: 0;
    border-radius: 17px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(14px);
  }

  .tab-bar button {
    min-width: 62px;
    flex-direction: column;
    gap: 3px;
    padding: 7px 5px;
    font-size: 0.62rem;
  }

  .tab-bar button > span {
    font-size: 0.9rem;
  }

  .content-panel {
    min-height: auto;
    padding: 19px;
    border-radius: 18px;
  }

  .action-grid,
  .people-grid {
    grid-template-columns: 1fr;
  }

  .action-card {
    min-height: 160px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .start-card {
    padding: 28px 21px;
  }

  .event-card {
    padding: 24px 20px;
  }
}

@media (max-width: 460px) {
  .hero-facts,
  .stat-strip,
  .money-grid,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .identity-block {
    align-items: flex-start;
  }

  .avatar {
    width: 58px;
    height: 58px;
    border-radius: 17px;
    font-size: 1rem;
  }

  .section-header {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* Flexible yearly pace */
.pace-note {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(166, 132, 255, 0.2);
  border-radius: 14px;
  color: #aaa3b2;
  font-size: 0.83rem;
  line-height: 1.55;
  background: rgba(139, 92, 246, 0.07);
}

.pace-note strong {
  color: #ddd2ff;
}


/* Enhanced character creation: countries, cities, and God Mode */
.creation-card-wide {
  width: min(100%, 820px);
}

.creation-section {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(8, 7, 12, 0.36);
}

.creation-section-heading,
.god-mode-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.creation-section-heading > div,
.god-mode-toolbar > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.creation-section-heading h2,
.god-mode-toolbar h2 {
  margin: 0;
  color: white;
  font-size: 1.05rem;
  letter-spacing: -0.025em;
}

.creation-section-heading p {
  max-width: 310px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: right;
}

.section-step {
  display: inline-grid;
  min-width: 34px;
  height: 27px;
  place-items: center;
  border: 1px solid rgba(183, 154, 255, 0.24);
  border-radius: 9px;
  color: var(--accent-bright) !important;
  font-size: 0.64rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em;
  background: rgba(143, 92, 247, 0.1);
}

.inline-secondary-button,
.attribute-presets button {
  min-height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 7px 11px;
  color: #e9e3f0;
  font-size: 0.73rem;
  font-weight: 800;
  background: rgba(32, 27, 41, 0.88);
}

.inline-secondary-button:hover,
.attribute-presets button:hover {
  border-color: rgba(183, 154, 255, 0.42);
  background: rgba(47, 38, 62, 0.95);
}

.location-source {
  margin: -3px 0 0;
  color: var(--dim);
  font-size: 0.68rem;
}

.god-mode-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(8, 7, 12, 0.36);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.god-mode-card.god-mode-active {
  border-color: rgba(183, 154, 255, 0.3);
  box-shadow: inset 0 0 0 1px rgba(143, 92, 247, 0.05);
}

.god-mode-toggle {
  grid-template-columns: auto auto minmax(0, 1fr) !important;
  align-items: center;
  gap: 13px !important;
  padding: 18px 20px;
  cursor: pointer;
}

.god-mode-toggle > input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.toggle-switch {
  position: relative;
  width: 46px;
  height: 26px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #28222f;
  transition: background 180ms ease, border-color 180ms ease;
}

.toggle-switch > span {
  position: absolute;
  width: 18px;
  height: 18px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #a8a0b1;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.28);
  transition: transform 180ms ease, background 180ms ease;
}

.god-mode-toggle > input:checked + .toggle-switch {
  border-color: rgba(183, 154, 255, 0.5);
  background: linear-gradient(135deg, #8f5cf7, #6330d1);
}

.god-mode-toggle > input:checked + .toggle-switch > span {
  transform: translateX(20px);
  background: white;
}

.god-mode-copy {
  display: grid;
  gap: 4px;
}

.god-mode-copy strong {
  color: white;
  font-size: 0.92rem;
}

.god-mode-copy small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.45;
}

.god-mode-controls {
  display: grid;
  gap: 18px;
  padding: 19px 20px 21px;
  border-top: 1px solid var(--border);
  background:
    radial-gradient(circle at 100% 0%, rgba(143, 92, 247, 0.1), transparent 35%),
    rgba(17, 13, 24, 0.78);
}

.attribute-presets {
  display: flex;
  gap: 8px;
}

.attribute-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.attribute-control {
  gap: 10px !important;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(6, 5, 9, 0.46);
}

.attribute-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.attribute-label strong {
  color: #ddd7e5;
  font-size: 0.78rem;
}

.attribute-label b {
  color: var(--accent-bright);
  font-size: 0.75rem;
}

.creation-form .attribute-control input[type='range'] {
  min-height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  accent-color: var(--accent);
  background: transparent;
  box-shadow: none;
}

.begin-life-button {
  width: 100%;
  min-height: 56px;
  font-size: 0.96rem;
}

@media (max-width: 720px) {
  .creation-section {
    padding: 17px;
  }

  .creation-section-heading,
  .god-mode-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .creation-section-heading p {
    max-width: none;
    text-align: left;
  }

  .location-heading {
    flex-direction: row;
    align-items: center;
  }

  .attribute-grid {
    grid-template-columns: 1fr;
  }

  .attribute-presets {
    width: 100%;
  }

  .attribute-presets button {
    flex: 1;
  }

  .god-mode-toggle {
    padding: 16px;
  }

  .god-mode-controls {
    padding: 17px 16px 18px;
  }
}


/* Country conditions, royalty, and supernatural origins */
.country-preview {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(166, 132, 255, 0.2);
  border-radius: 16px;
  background: rgba(139, 92, 246, 0.055);
}

.country-preview-heading,
.extraordinary-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.country-preview-heading h3,
.extraordinary-card h3,
.origin-detail-card h3 {
  margin: 4px 0 0;
  color: #f5f1fb;
}

.country-preview-heading > span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  color: #bfb5cd;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.035);
}

.country-preview-grid,
.origin-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.origin-list,
.origin-detail-card,
.extraordinary-card,
.origin-overview-card {
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(7, 6, 11, 0.44);
}

.origin-list {
  padding: 14px;
}

.origin-list h4,
.origin-detail-card h3 {
  margin: 0 0 10px;
  font-size: 0.82rem;
}

.origin-list ul,
.origin-detail-card ul,
.supernatural-details ul {
  margin: 0;
  padding-left: 18px;
  color: #aaa3b2;
  font-size: 0.78rem;
  line-height: 1.52;
}

.origin-list li + li,
.origin-detail-card li + li,
.supernatural-details li + li {
  margin-top: 6px;
}

.origin-pros h4,
.origin-pros h3 {
  color: #81ddb2;
}

.origin-cons h4,
.origin-cons h3 {
  color: #f08aa0;
}

.origin-laws h4,
.origin-laws h3 {
  color: #b8a2ff;
}

.origin-disclaimer {
  margin: 0;
  color: #777082;
  font-size: 0.72rem;
  line-height: 1.5;
}

.extraordinary-section {
  border-color: rgba(166, 132, 255, 0.22);
  background:
    radial-gradient(circle at 100% 0%, rgba(139, 92, 246, 0.12), transparent 38%),
    rgba(8, 7, 12, 0.4);
}

.extraordinary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.extraordinary-card {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
}

.extraordinary-card-heading > div > span,
.extraordinary-card > label > span {
  color: #9d95a8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.extraordinary-card p {
  margin: 0;
  color: #aaa3b2;
  font-size: 0.82rem;
  line-height: 1.55;
}

.extraordinary-card select {
  width: 100%;
  min-height: 46px;
  margin-top: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 0 12px;
  color: #f5f1fb;
  background: rgba(9, 8, 13, 0.82);
}

.mini-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 10px;
  color: #d9d1e5;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.04);
}

.mini-toggle input {
  accent-color: #9568ff;
}

.supernatural-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.supernatural-details > div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.supernatural-details strong {
  display: block;
  margin-bottom: 7px;
  color: #dcd3ea;
  font-size: 0.76rem;
}

.origin-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.origin-badge {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  color: #bdb5c8;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.035);
}

.royal-badge {
  border-color: rgba(241, 201, 95, 0.28);
  color: #f4d77e;
  background: rgba(241, 201, 95, 0.08);
}

.supernatural-badge {
  border-color: rgba(174, 134, 255, 0.3);
  color: #cdb7ff;
  background: rgba(139, 92, 246, 0.1);
}

.country-badge {
  color: #a9d7ff;
}

.origin-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}

.origin-overview-card {
  padding: 17px;
}

.origin-overview-card > span {
  display: block;
  margin-bottom: 7px;
  color: #807888;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.origin-overview-card strong {
  display: block;
  color: #f4f0f8;
}

.origin-overview-card p {
  margin: 7px 0 0;
  color: #9891a1;
  font-size: 0.78rem;
  line-height: 1.48;
}

.origin-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.origin-detail-card {
  padding: 18px;
}

.supernatural-card h3 {
  color: #cdb7ff;
}

@media (max-width: 850px) {
  .country-preview-grid,
  .extraordinary-grid,
  .origin-overview-grid,
  .origin-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .supernatural-details {
    grid-template-columns: 1fr;
  }

  .country-preview-heading,
  .extraordinary-card-heading {
    align-items: stretch;
    flex-direction: column;
  }
}


/* Society and discrimination system */

.society-creation-section {
  border-color: rgba(190, 151, 255, 0.22);
  background:
    radial-gradient(circle at 100% 0%, rgba(138, 83, 244, 0.1), transparent 32%),
    rgba(16, 13, 22, 0.72);
}

.society-toggle-card {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(7, 6, 11, 0.38);
}

.society-intensity-field {
  display: grid;
  gap: 7px;
}

.society-intensity-field > span,
.identity-option-grid label > span {
  color: #dcd6e4;
  font-size: 0.79rem;
  font-weight: 750;
}

.society-intensity-field small {
  color: #8f8798;
  font-size: 0.73rem;
  line-height: 1.5;
}

.identity-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.identity-option-grid label {
  display: grid;
  gap: 8px;
}

.identity-option-grid select,
.society-intensity-field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 13px;
  padding: 0 14px;
  color: #f5f1f8;
  background: rgba(8, 7, 12, 0.75);
}

.society-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  margin-top: 20px;
}

.society-identity-card,
.society-metrics-card,
.incident-card {
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 17px;
  background: rgba(8, 7, 12, 0.45);
}

.society-identity-card,
.society-metrics-card {
  padding: 20px;
}

.society-identity-card > span,
.society-metrics-heading span {
  color: #a89faf;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.society-identity-card dl {
  display: grid;
  gap: 1px;
  margin: 16px 0 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
}

.society-identity-card dl > div {
  padding: 11px 12px;
  background: rgba(10, 8, 14, 0.94);
}

.society-identity-card dt,
.incident-card dt {
  margin-bottom: 4px;
  color: #7f7888;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.society-identity-card dd,
.incident-card dd {
  margin: 0;
  color: #e5dfe9;
  font-size: 0.83rem;
  font-weight: 700;
}

.society-metrics-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.society-metrics-heading strong {
  display: block;
  margin-top: 5px;
  color: #f1ecf5;
  font-size: 1rem;
}

.society-metrics-heading b {
  border: 1px solid rgba(239, 107, 134, 0.28);
  border-radius: 999px;
  padding: 6px 9px;
  color: #f1a4b5;
  font-size: 0.68rem;
  background: rgba(239, 107, 134, 0.09);
}

.society-meter-list {
  display: grid;
  gap: 15px;
  margin-top: 20px;
}

.society-meter > div:first-child {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: #b5adbd;
  font-size: 0.76rem;
}

.society-actions-section,
.incident-history-section {
  margin-top: 28px;
}

.subsection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.subsection-heading h3 {
  margin: 0;
  color: #f5f1f8;
  font-size: 1.15rem;
}

.incident-list {
  display: grid;
  gap: 12px;
}

.incident-card {
  padding: 17px;
}

.incident-card-heading span {
  color: #b69cff;
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.incident-card h4 {
  margin: 5px 0 0;
  color: #f4eff7;
  font-size: 1rem;
}

.incident-card > p {
  margin: 12px 0;
  color: #b9b1c0;
  line-height: 1.55;
}

.incident-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.incident-card dl > div {
  padding: 11px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
}

.compact-empty-state {
  min-height: 140px;
}

.society-safety-note {
  margin: 22px 0 0;
  padding: 14px 15px;
  border: 1px solid rgba(182, 156, 255, 0.16);
  border-radius: 13px;
  color: #9e96a6;
  font-size: 0.76rem;
  line-height: 1.6;
  background: rgba(139, 83, 244, 0.06);
}

@media (max-width: 820px) {
  .society-summary-grid,
  .identity-option-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .incident-card dl {
    grid-template-columns: 1fr;
  }

  .subsection-heading,
  .society-metrics-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Expanded occupation hub */
.action-title-wrap {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.action-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 1.2rem;
  background: rgba(139, 92, 246, 0.1);
}

.action-badge {
  display: inline-block;
  margin-top: 5px;
  color: #a99fb4;
  font-size: 0.66rem;
  font-weight: 750;
}

.occupation-overview {
  margin-bottom: 18px;
}

.occupation-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 24px;
}

.occupation-category {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 13px;
  color: #eee9f4;
  text-align: left;
  background: rgba(8, 7, 12, 0.45);
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.occupation-category:hover {
  transform: translateY(-1px);
  border-color: rgba(182, 151, 255, 0.34);
  background: rgba(31, 25, 40, 0.74);
}

.occupation-category.active {
  border-color: rgba(178, 145, 255, 0.65);
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.22),
    rgba(79, 39, 167, 0.13)
  );
  box-shadow: inset 0 0 0 1px rgba(181, 149, 255, 0.08);
}

.occupation-category-icon,
.occupation-section-icon {
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.13);
}

.occupation-category-icon {
  width: 42px;
  height: 42px;
  font-size: 1.25rem;
}

.occupation-category-copy {
  min-width: 0;
}

.occupation-category-copy strong,
.occupation-category-copy small {
  display: block;
}

.occupation-category-copy strong {
  color: white;
  font-size: 0.84rem;
}

.occupation-category-copy small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.occupation-category-count {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #d9cbff;
  font-size: 0.68rem;
  font-weight: 850;
  background: rgba(139, 92, 246, 0.15);
}

.occupation-section-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 16px;
  padding-top: 4px;
}

.occupation-section-icon {
  width: 48px;
  height: 48px;
  font-size: 1.45rem;
}

.occupation-section-heading h3 {
  margin: 0;
  color: #efeaf5;
  font-size: 1rem;
  font-weight: 700;
}

.empty-state {
  border: 1px dashed var(--border-strong);
  border-radius: 15px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .occupation-category-grid {
    grid-template-columns: 1fr;
  }

  .occupation-category-copy small {
    white-space: normal;
  }

  .occupation-hub .action-grid {
    grid-template-columns: 1fr;
  }
}

/* Country-aware random name */

.name-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: -7px;
}

.name-section-header > span {
  color: #ddd7e5;
  font-size: 0.8rem;
  font-weight: 800;
}

.surprise-name-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(182, 156, 255, 0.28);
  border-radius: 11px;
  padding: 7px 12px;
  color: #d8ccff;
  font-size: 0.76rem;
  font-weight: 800;
  background: rgba(139, 83, 244, 0.1);
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    opacity 150ms ease;
}

.surprise-name-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(182, 156, 255, 0.58);
  color: white;
  background: rgba(139, 83, 244, 0.2);
}

.surprise-name-button:active:not(:disabled) {
  transform: translateY(0);
}

.surprise-name-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.surprise-name-button > span {
  color: #b69cff;
  font-size: 0.9rem;
}

@media (max-width: 520px) {
  .name-section-header {
    align-items: flex-start;
  }

  .surprise-name-button {
    min-height: 34px;
    padding: 6px 10px;
  }
}

/* Stress and supernatural needs */

.stat-stress .stress-track > div,
.stress-track > div {
  background: linear-gradient(90deg, #f2b45f, #ef5e76);
  box-shadow: 0 0 13px rgba(239, 94, 118, 0.24);
}

.stat-supernatural .supernatural-track > div,
.supernatural-track > div {
  background: linear-gradient(90deg, #7d4de6, #d092ff);
  box-shadow: 0 0 13px rgba(183, 118, 255, 0.28);
}

.power-track > div {
  background: linear-gradient(90deg, #4f8fe8, #74e0d0);
  box-shadow: 0 0 13px rgba(83, 191, 207, 0.24);
}

.person-nature-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 13px;
  border: 1px solid rgba(185, 137, 255, 0.25);
  border-radius: 999px;
  padding: 6px 10px;
  color: #d7c2ff;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  background: rgba(125, 77, 230, 0.11);
}

.person-nature-badge > span {
  color: #b794ff;
}

.supernatural-view {
  display: grid;
  gap: 22px;
}

.supernatural-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.supernatural-status-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 17px;
  background:
    linear-gradient(
      145deg,
      rgba(31, 26, 42, 0.9),
      rgba(15, 13, 21, 0.92)
    );
}

.supernatural-status-card > span {
  display: block;
  margin-bottom: 7px;
  color: #a8a0b2;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.supernatural-status-card > strong {
  display: block;
  margin-bottom: 13px;
  color: white;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
}

.supernatural-status-card > p {
  margin: 14px 0 0;
  color: #aaa2b2;
  font-size: 0.82rem;
  line-height: 1.58;
}

.supernatural-help {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(174, 132, 255, 0.17);
  border-radius: 15px;
  padding: 15px 17px;
  color: #cfc5da;
  background: rgba(113, 67, 204, 0.08);
}

.supernatural-help strong {
  color: #eee7f7;
  font-size: 0.88rem;
  line-height: 1.5;
}

.supernatural-help span {
  color: #9f96aa;
  font-size: 0.78rem;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .supernatural-status-grid {
    grid-template-columns: 1fr;
  }
}

/* World systems expansion */

.version-tag {
  display: inline-flex;
  margin-left: 8px;
  border: 1px solid rgba(179, 151, 255, 0.22);
  border-radius: 999px;
  padding: 4px 7px;
  color: #bda9f7;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  vertical-align: middle;
  background: rgba(132, 84, 235, 0.08);
}

.relationship-details {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 11px 0 0;
}

.relationship-details span {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 5px 9px;
  color: #978fa0;
  font-size: 0.66rem;
  background: rgba(7, 6, 10, 0.35);
}

.memory-list {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 13px;
  padding: 12px;
  background: rgba(8, 7, 12, 0.42);
}

.memory-list > strong {
  color: #ddd6e6;
  font-size: 0.72rem;
}

.memory-list p {
  margin: 0;
  padding-left: 9px;
  border-left: 2px solid #777080;
  color: #9f97a7;
  font-size: 0.7rem;
  line-height: 1.45;
}

.memory-list .memory-positive {
  border-left-color: #74d9a8;
}

.memory-list .memory-negative {
  border-left-color: #ef718d;
}

.world-feature-view {
  display: grid;
  gap: 22px;
}

.world-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.world-summary-grid article {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  background: rgba(8, 7, 12, 0.43);
}

.world-summary-grid span,
.residence-card span,
.business-grid article > span,
.story-arc-list article > div > span {
  display: block;
  margin-bottom: 6px;
  color: #887f91;
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.world-summary-grid strong {
  overflow-wrap: anywhere;
  color: #f2edf7;
  font-size: 1rem;
}

.world-list {
  display: grid;
  gap: 9px;
}

.world-list h3,
.family-tree-grid + h3,
.heir-panel h3,
.travel-panel h3,
.story-arc-list h3 {
  margin: 0 0 4px;
  color: #ece6f1;
  font-size: 1rem;
}

.world-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 13px;
  background: rgba(10, 8, 14, 0.46);
}

.world-list article div {
  min-width: 0;
}

.world-list article strong,
.world-list article span {
  display: block;
}

.world-list article strong {
  color: #e7e1ed;
  font-size: 0.84rem;
}

.world-list article div span {
  margin-top: 4px;
  color: #8d8595;
  font-size: 0.7rem;
}

.world-list article > span {
  flex: 0 0 auto;
  color: #c3b5eb;
  font-size: 0.73rem;
  font-weight: 800;
}

.family-tree-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.family-tree-grid article,
.save-slot-grid article,
.business-grid article {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(29, 24, 39, 0.9), rgba(12, 10, 17, 0.92));
}

.family-tree-grid strong,
.family-tree-grid span,
.family-tree-grid small {
  display: block;
}

.family-tree-grid strong {
  overflow-wrap: anywhere;
  color: #f0ebf4;
  font-size: 0.86rem;
}

.family-tree-grid span {
  margin-top: 6px;
  color: #958d9e;
  font-size: 0.72rem;
}

.family-tree-grid small {
  margin-top: 5px;
  color: #b6a3e8;
  font-size: 0.68rem;
}

.heir-panel,
.travel-panel,
.residence-card {
  border: 1px solid rgba(170, 131, 255, 0.17);
  border-radius: 16px;
  padding: 18px;
  background: rgba(119, 72, 214, 0.07);
}

.heir-panel p,
.travel-panel p,
.residence-card p {
  color: #9f97a7;
  font-size: 0.8rem;
  line-height: 1.55;
}

.heir-panel button,
.travel-actions button,
.save-toolbar button,
.import-button,
.save-slot-grid button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  padding: 9px 13px;
  color: #eee9f4;
  font-weight: 800;
  background: rgba(36, 30, 46, 0.86);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.heir-panel button {
  width: 100%;
  margin-top: 8px;
  text-align: left;
}

.heir-panel button:hover,
.travel-actions button:hover,
.save-toolbar button:hover,
.import-button:hover,
.save-slot-grid button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(182, 156, 255, 0.5);
  background: rgba(56, 43, 75, 0.92);
}

.residence-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.residence-card h3 {
  margin: 0;
  color: white;
  font-size: 1.2rem;
}

.residence-card > strong {
  flex: 0 0 auto;
  color: #d8c8ff;
  font-size: 1.25rem;
}

.business-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.business-grid h3 {
  margin: 0;
  color: white;
  font-size: 1rem;
}

.business-grid p {
  min-height: 36px;
  color: #948b9d;
  font-size: 0.74rem;
  line-height: 1.45;
}

.business-grid article > div {
  display: grid;
  gap: 4px;
}

.business-grid strong {
  color: #d9cbff;
}

.business-grid small {
  color: #8f8797;
}

.travel-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.travel-fields label {
  display: grid;
  gap: 7px;
}

.travel-fields label > span {
  color: #aca4b4;
  font-size: 0.72rem;
  font-weight: 800;
}

.travel-fields select,
.save-slot-grid input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  padding: 0 12px;
  color: white;
  outline: none;
  background: #0f0c14;
}

.travel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 13px;
}

.story-arc-list {
  display: grid;
  gap: 10px;
}

.story-arc-list article {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 14px;
  background: rgba(8, 7, 12, 0.42);
}

.story-arc-list h4 {
  margin: 0;
  color: #eee8f3;
}

.story-arc-list p {
  margin: 7px 0 0;
  color: #968e9f;
  font-size: 0.76rem;
  line-height: 1.5;
}

.story-arc-list article > strong {
  flex: 0 0 auto;
  color: #c5b4ef;
  font-size: 0.72rem;
}

.save-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.import-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.import-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.save-slot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.save-slot-grid article.active-slot {
  border-color: rgba(166, 127, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(132, 84, 235, 0.08);
}

.save-slot-grid p,
.save-slot-grid small {
  display: block;
}

.save-slot-grid p {
  min-height: 38px;
  margin: 12px 0 4px;
  color: #b7afbf;
  font-size: 0.78rem;
}

.save-slot-grid small {
  color: #777080;
  font-size: 0.68rem;
}

.save-slot-grid article > div {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.save-slot-grid button {
  flex: 1;
}

.save-slot-grid button:disabled,
.save-toolbar button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 1050px) {
  .world-summary-grid,
  .family-tree-grid,
  .business-grid,
  .save-slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .world-summary-grid,
  .family-tree-grid,
  .business-grid,
  .save-slot-grid,
  .travel-fields {
    grid-template-columns: 1fr;
  }

  .residence-card,
  .story-arc-list article {
    align-items: flex-start;
    flex-direction: column;
  }

  .travel-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .tab-bar {
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: thin;
  }

  .tab-bar button {
    flex: 0 0 auto;
  }
}

/* Stability, changelog, and runtime recovery */

.save-recovery-banner {
  margin-bottom: 16px;
  border: 1px solid rgba(104, 211, 166, 0.28);
  border-radius: 14px;
  padding: 12px 14px;
  color: #c9f4df;
  background: rgba(53, 151, 111, 0.1);
}

.backup-status-card,
.changelog-panel {
  margin-top: 18px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 16px;
  padding: 17px;
  background: rgba(12, 10, 17, 0.48);
}

.backup-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.backup-status-card p,
.changelog-entry p {
  margin: 5px 0 0;
  color: #9f97aa;
  line-height: 1.5;
}

.changelog-panel > h3 {
  margin: 0 0 14px;
}

.changelog-list {
  display: grid;
  gap: 12px;
}

.changelog-entry {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 12px;
}

.changelog-entry:first-child {
  border-top: 0;
  padding-top: 0;
}

.changelog-entry ul {
  margin: 9px 0 0;
  padding-left: 19px;
  color: #bcb4c6;
}

.runtime-recovery-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #f7f4fb;
  background: #09080d;
}

.runtime-recovery-card {
  width: min(100%, 720px);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: #17131e;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.runtime-eyebrow {
  margin: 0 0 8px;
  color: #b69cff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.runtime-recovery-card h1 {
  margin: 0 0 12px;
}

.runtime-recovery-card > p:not(.runtime-eyebrow) {
  color: #bbb4c3;
  line-height: 1.6;
}

.runtime-recovery-card pre {
  max-height: 240px;
  overflow: auto;
  padding: 12px;
  border-radius: 12px;
  color: #f0c6cf;
  white-space: pre-wrap;
  word-break: break-word;
  background: #0d0a11;
}

.runtime-recovery-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.runtime-recovery-actions button {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  color: white;
  font-weight: 800;
  background: #282130;
}

.runtime-recovery-actions button:first-child {
  border: 0;
  background: linear-gradient(135deg, #9468ff, #6331d3);
}

.runtime-recovery-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.runtime-recovery-actions .runtime-danger-button {
  color: #ffd9df;
  background: rgba(152, 45, 68, 0.28);
}

@media (max-width: 650px) {
  .backup-status-card {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Compact phone-app interface */
:root {
  --compact-app-width: 920px;
  --compact-gap: 9px;
  --compact-nav-height: 62px;
}

html,
body,
#root {
  min-height: 100%;
}

.game-shell {
  width: min(100%, var(--compact-app-width));
  height: calc(100dvh - 18px);
  min-height: 620px;
  margin: 9px auto;
  padding: 9px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: var(--compact-gap);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background:
    radial-gradient(circle at 15% 0%, rgba(136, 82, 243, 0.13), transparent 28%),
    #09080d;
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.42);
}

.app-header,
.hero-card,
.tab-bar,
.content-wrap {
  width: 100%;
  margin: 0;
}

.app-header {
  grid-row: 1;
  min-height: 43px;
  padding: 0 3px;
}

.app-brand {
  gap: 9px;
}

.small-logo {
  width: 35px;
  height: 35px;
  border-radius: 11px;
  font-size: 0.67rem;
}

.app-header .eyebrow {
  display: none;
}

.app-header h1 {
  font-size: 1.05rem;
}

.version-tag {
  font-size: 0.55rem;
}

.app-header .secondary-button {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 0.72rem;
}

.hero-card {
  grid-row: 2;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "identity age"
    "facts facts"
    "stats stats";
  gap: 8px 10px;
  padding: 11px;
  border-radius: 17px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
}

.identity-block {
  gap: 10px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 0.86rem;
  box-shadow: 0 8px 22px rgba(91, 43, 195, 0.25);
}

.identity-block .eyebrow {
  display: none;
}

.identity-block h2 {
  margin-bottom: 3px;
  font-size: 1.05rem;
}

.identity-meta {
  max-width: 430px;
  overflow: hidden;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.origin-badges {
  gap: 4px;
  margin-top: 5px;
}

.origin-badge {
  padding: 3px 7px;
  font-size: 0.57rem;
}

.hero-facts {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
  scrollbar-width: none;
}

.hero-facts::-webkit-scrollbar,
.stat-strip::-webkit-scrollbar,
.tab-bar::-webkit-scrollbar,
.person-actions::-webkit-scrollbar {
  display: none;
}

.hero-facts > div {
  flex: 1 0 104px;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 10px;
  scroll-snap-align: start;
}

.hero-facts span {
  margin-bottom: 2px;
  font-size: 0.5rem;
}

.hero-facts strong {
  font-size: 0.7rem;
}

.stat-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
  scrollbar-width: none;
}

.stat-item {
  flex: 1 0 104px;
  min-width: 0;
  scroll-snap-align: start;
}

.stat-item > div:first-child,
.relationship-meter > div:first-child {
  margin-bottom: 4px;
  font-size: 0.61rem;
}

.stat-item strong {
  font-size: 0.61rem;
}

.meter-track {
  height: 5px;
}

.age-button {
  width: 106px;
  min-height: 64px;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(83, 38, 177, 0.25);
}

.age-button > span {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 1.3rem;
}

.age-button strong {
  margin: 0;
  font-size: 0.76rem;
}

.age-button small {
  display: none;
}

.content-wrap {
  grid-row: 3;
  min-height: 0;
  overflow: hidden;
}

.content-panel {
  height: 100%;
  min-height: 0;
  padding: 13px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 16px;
  scrollbar-color: rgba(166, 129, 255, 0.35) transparent;
  scrollbar-width: thin;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

.content-panel::-webkit-scrollbar {
  width: 5px;
}

.content-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(166, 129, 255, 0.34);
}

.section-header {
  position: sticky;
  top: -13px;
  z-index: 4;
  margin: -13px -13px 11px;
  padding: 12px 13px 10px;
  border-bottom-color: rgba(255, 255, 255, 0.07);
  background: rgba(20, 17, 27, 0.97);
  backdrop-filter: blur(13px);
}

.section-header .eyebrow {
  margin-bottom: 3px;
  font-size: 0.55rem;
}

.section-header h2 {
  font-size: 1.03rem;
}

.pill {
  max-width: 48%;
  padding: 5px 8px;
  overflow: hidden;
  font-size: 0.59rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-bar {
  grid-row: 4;
  height: var(--compact-nav-height);
  margin: 0;
  padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
  gap: 3px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  border-radius: 15px;
  background: rgba(18, 15, 24, 0.96);
  box-shadow: 0 -9px 30px rgba(0, 0, 0, 0.24);
  scrollbar-width: none;
}

.tab-bar button {
  flex: 0 0 64px;
  min-width: 64px;
  min-height: 48px;
  flex-direction: column;
  gap: 2px;
  padding: 5px 4px;
  border-radius: 10px;
  font-size: 0.56rem;
  line-height: 1;
  scroll-snap-align: center;
}

.tab-bar button > span {
  font-size: 0.92rem;
}

.timeline {
  gap: 7px;
  margin-top: 10px;
}

.timeline-entry {
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 9px;
  padding: 10px 11px;
  border-radius: 11px;
}

.timeline-dot {
  width: 6px;
  height: 6px;
  margin-top: 5px;
}

.timeline-age {
  margin-bottom: 2px;
  font-size: 0.55rem;
}

.timeline-entry p {
  font-size: 0.78rem;
  line-height: 1.42;
}

.action-grid,
.people-grid {
  grid-template-columns: 1fr;
  gap: 7px;
}

.action-card {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 12px;
}

.action-heading {
  gap: 8px;
}

.action-title-wrap {
  gap: 8px;
}

.action-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 0.83rem;
}

.action-card h3,
.person-card h3,
.overview-card h3 {
  font-size: 0.84rem;
}

.action-card p {
  margin-top: 4px;
  font-size: 0.69rem;
  line-height: 1.36;
}

.action-badge {
  font-size: 0.55rem;
}

.action-card > button {
  min-width: 72px;
  min-height: 35px;
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 0.65rem;
}

.pace-note,
.supernatural-help,
.society-safety-note,
.origin-disclaimer,
.save-recovery-banner {
  margin-bottom: 10px;
  padding: 10px 11px;
  border-radius: 11px;
  font-size: 0.69rem;
  line-height: 1.42;
}

.people-grid {
  margin-top: 8px;
}

.person-card {
  padding: 11px;
  border-radius: 12px;
}

.person-top {
  gap: 9px;
}

.person-avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 0.68rem;
}

.person-top p,
.relationship-details,
.memory-list p {
  font-size: 0.65rem;
}

.trait-list {
  gap: 4px;
  margin: 8px 0;
}

.trait-list span,
.person-nature-badge {
  padding: 3px 6px;
  font-size: 0.56rem;
}

.relationship-meter {
  margin: 9px 0;
}

.person-actions {
  flex-wrap: nowrap;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.person-actions button {
  flex: 0 0 auto;
  min-height: 33px;
  padding: 6px 9px;
  font-size: 0.61rem;
}

.overview-grid,
.money-grid,
.origin-overview-grid,
.origin-detail-grid,
.society-summary-grid,
.supernatural-status-grid,
.world-summary-grid,
.save-slot-grid {
  gap: 7px;
  margin-top: 9px;
  margin-bottom: 9px;
}

.overview-card,
.money-grid article,
.origin-overview-card,
.origin-detail-card,
.society-identity-card,
.society-metrics-card,
.supernatural-status-card,
.world-summary-grid article,
.save-slot-grid article,
.backup-status-card,
.changelog-panel {
  padding: 10px;
  border-radius: 11px;
}

.asset-section,
.society-actions-section,
.incident-history-section,
.changelog-panel {
  margin: 12px 0;
}

.asset-list,
.incident-list,
.world-list,
.changelog-list {
  gap: 7px;
}

.asset-list article,
.incident-card,
.world-list article,
.changelog-entry {
  padding: 10px;
  border-radius: 11px;
}

.save-toolbar {
  gap: 6px;
}

.save-toolbar button,
.import-button,
.save-slot-grid button,
.backup-status-card button {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 0.63rem;
}

/* Events remain centered and scroll inside the card instead of moving the page. */
.event-backdrop {
  z-index: 100;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  background: rgba(4, 3, 7, 0.88);
  backdrop-filter: blur(18px);
}

.event-card {
  width: min(100%, 430px);
  max-height: min(82dvh, 650px);
  display: flex;
  flex-direction: column;
  padding: 18px;
  overflow: hidden;
  border-radius: 19px;
  box-shadow: 0 32px 110px rgba(0, 0, 0, 0.72);
  animation: compact-event-in 170ms ease-out;
}

.event-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  border-radius: 11px;
  font-size: 0.92rem;
}

.event-card .eyebrow {
  font-size: 0.56rem;
}

.event-card h2 {
  font-size: 1.35rem;
}

.event-description {
  min-height: 0;
  max-height: 32dvh;
  margin: 10px 0 14px;
  overflow-y: auto;
  color: #beb7c5;
  font-size: 0.82rem;
  line-height: 1.48;
}

.event-options {
  flex: 0 0 auto;
  gap: 7px;
}

.event-options button {
  min-height: 43px;
  padding: 9px 11px;
  border-radius: 11px;
  font-size: 0.75rem;
}

@keyframes compact-event-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Character creation keeps every option but uses an app-sized card. */
.start-screen {
  height: 100dvh;
  min-height: 0;
  align-items: start;
  overflow-y: auto;
  padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
}

.start-card,
.creation-card-wide {
  width: min(100%, 600px);
  margin: auto;
  padding: 20px;
  border-radius: 20px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  margin-bottom: 15px;
  border-radius: 13px;
  font-size: 0.74rem;
}

.start-card h1 {
  font-size: clamp(2rem, 9vw, 3rem);
}

.intro {
  margin: 11px 0 17px;
  font-size: 0.84rem;
  line-height: 1.5;
}

.creation-form {
  gap: 10px;
}

.creation-section,
.god-mode-card {
  gap: 10px;
  padding: 13px;
  border-radius: 13px;
}

.creation-section-heading p {
  font-size: 0.68rem;
}

.creation-form input,
.creation-form select {
  min-height: 42px;
  border-radius: 10px;
  padding: 0 11px;
  font-size: 0.78rem;
}

@media (max-width: 760px) {
  .game-shell {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    margin: 0;
    padding:
      max(7px, env(safe-area-inset-top))
      7px
      max(7px, env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .tab-bar {
    position: static;
    inset: auto;
    height: calc(var(--compact-nav-height) + env(safe-area-inset-bottom));
    margin: 0;
    border-radius: 14px;
  }

  .content-panel {
    padding: 11px;
    border-radius: 14px;
  }

  .section-header {
    top: -11px;
    margin: -11px -11px 9px;
    padding: 10px 11px 9px;
  }

  .hero-card {
    padding: 9px;
  }

  .identity-meta {
    max-width: 54vw;
  }

  .action-card {
    grid-template-columns: minmax(0, 1fr) 68px;
  }

  .action-card > button {
    min-width: 68px;
  }

  .event-card {
    width: min(100%, 390px);
    max-height: 80dvh;
    padding: 16px;
  }
}

@media (max-width: 460px) {
  .hero-facts,
  .stat-strip,
  .money-grid,
  .overview-grid {
    grid-template-columns: none;
  }

  .avatar {
    width: 43px;
    height: 43px;
  }

  .identity-block h2 {
    font-size: 0.94rem;
  }

  .age-button {
    width: 78px;
    min-height: 58px;
    flex-direction: column;
    gap: 2px;
  }

  .age-button > span {
    width: 28px;
    height: 28px;
    font-size: 1.05rem;
  }

  .age-button strong {
    font-size: 0.63rem;
  }

  .origin-badges {
    max-width: 62vw;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .section-header {
    align-items: center;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}
/* Life Simulator authentication UI */

.auth-screen,
.auth-loading,
.auth-screen *,
.auth-loading *,
.account-backdrop,
.account-backdrop * {
  box-sizing: border-box;
}

.auth-screen,
.auth-loading {
  min-height: 100vh;
  width: 100%;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px 14px;
  color: #f7f4fb;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 14% 8%, rgba(151, 91, 255, 0.24), transparent 34%),
    radial-gradient(circle at 88% 88%, rgba(76, 45, 166, 0.16), transparent 36%),
    linear-gradient(180deg, #0e0b14 0%, #08070b 100%);
}

.auth-card {
  width: min(100%, 480px);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(31, 26, 40, 0.98), rgba(22, 18, 29, 0.98));
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.auth-logo {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-bottom: 23px;
  border-radius: 18px;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 950;
  letter-spacing: -0.04em;
  background: linear-gradient(145deg, #a578ff, #5e2dca);
  box-shadow: 0 15px 34px rgba(92, 44, 199, 0.34);
}

.auth-eyebrow {
  margin: 0 0 8px;
  color: #bea5ff;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.auth-card h1,
.account-card h2 {
  margin: 0;
  color: #ffffff;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  letter-spacing: -0.045em;
}

.auth-card h1 {
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1.03;
}

.auth-intro {
  margin: 16px 0 22px;
  color: #bdb5c6;
  font-size: 0.95rem;
  line-height: 1.65;
}

.auth-social-buttons {
  display: grid;
  gap: 11px;
}

.auth-social,
.auth-primary,
.auth-guest,
.account-danger,
.account-button,
.account-close,
.auth-code-actions button {
  font: inherit;
  cursor: pointer;
}

.auth-social {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 9px 13px;
  font-weight: 900;
  text-align: center;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    filter 140ms ease;
}

.auth-social::after {
  content: "";
  width: 34px;
}

.auth-social:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.auth-social:focus-visible,
.auth-primary:focus-visible,
.auth-guest:focus-visible,
.account-danger:focus-visible,
.account-button:focus-visible,
.account-close:focus-visible,
.auth-code-actions button:focus-visible,
.auth-form input:focus-visible {
  outline: 3px solid rgba(170, 125, 255, 0.42);
  outline-offset: 2px;
}

.auth-social-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 950;
}

.auth-google {
  color: #242129;
  background: #ffffff;
}

.auth-google-icon {
  border: 1px solid #e2dfe6;
  color: #4285f4;
  background: #ffffff;
}

.auth-discord {
  color: #ffffff;
  background: #5865f2;
}

.auth-discord-icon {
  color: #5865f2;
  background: #ffffff;
}

.auth-social:disabled,
.auth-primary:disabled,
.auth-guest:disabled,
.account-danger:disabled,
.auth-code-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 19px 0;
  color: #766f7e;
  font-size: 0.74rem;
  font-weight: 750;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(255, 255, 255, 0.09);
}

.auth-email-divider {
  margin: 18px 0;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 8px;
}

.auth-form label > span,
.auth-destination > span {
  color: #ded7e5;
  font-size: 0.78rem;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 0 15px;
  color: #ffffff;
  font: inherit;
  outline: none;
  background: rgba(8, 7, 12, 0.78);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.auth-form input::placeholder {
  color: #746d7a;
}

.auth-form input:focus {
  border-color: #9b6cff;
  box-shadow: 0 0 0 4px rgba(155, 108, 255, 0.14);
}

.auth-code {
  font-size: 1.45rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.34em;
  text-align: center;
}

.auth-primary,
.auth-guest,
.account-danger {
  width: 100%;
  min-height: 51px;
  border-radius: 14px;
  padding: 11px 16px;
  font-weight: 900;
  transition:
    transform 140ms ease,
    filter 140ms ease;
}

.auth-primary:hover:not(:disabled),
.auth-guest:hover:not(:disabled),
.account-danger:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.auth-primary {
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  background: linear-gradient(135deg, #9a6dff, #6230d1);
  box-shadow: 0 14px 30px rgba(91, 47, 190, 0.28);
}

.auth-guest {
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: #f0ebf5;
  background: #282131;
}

.auth-note {
  margin: 0;
  color: #928a9b;
  font-size: 0.76rem;
  line-height: 1.55;
}

.auth-centered {
  margin-top: 14px;
  text-align: center;
}

.auth-success,
.auth-error {
  margin: 15px 0 0;
  border-radius: 13px;
  padding: 11px 13px;
  font-size: 0.8rem;
  line-height: 1.5;
}

.auth-success {
  border: 1px solid rgba(94, 212, 161, 0.2);
  color: #baf5da;
  background: rgba(49, 151, 109, 0.11);
}

.auth-error {
  border: 1px solid rgba(238, 101, 128, 0.23);
  color: #ffc4d0;
  background: rgba(184, 57, 83, 0.12);
}

.auth-destination {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 13px;
  background: rgba(7, 6, 10, 0.52);
}

.auth-destination strong {
  overflow-wrap: anywhere;
  color: #f2edf6;
  font-size: 0.88rem;
}

.auth-code-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.auth-code-actions button {
  border: 0;
  padding: 6px 0;
  color: #c1a9ff;
  font-size: 0.75rem;
  font-weight: 850;
  background: transparent;
}

.auth-loading {
  align-content: center;
  gap: 14px;
}

.auth-loading strong {
  color: #c7c0ce;
  font-size: 0.9rem;
}

.account-button {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 80;
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 50%;
  color: #ffffff;
  font-weight: 950;
  background: linear-gradient(145deg, #8e5cf1, #5a2bc4);
  box-shadow: 0 13px 32px rgba(0, 0, 0, 0.34);
}

.account-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 3, 7, 0.82);
  backdrop-filter: blur(12px);
}

.account-card {
  position: relative;
  width: min(100%, 430px);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  color: #f7f4fb;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: #1a1620;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.62);
}

.account-close {
  position: absolute;
  top: 12px;
  right: 13px;
  width: 35px;
  height: 35px;
  border: 0;
  border-radius: 50%;
  color: #ada5b5;
  font-size: 1.4rem;
  background: rgba(255, 255, 255, 0.06);
}

.account-identity {
  margin: 14px 0 18px;
  overflow-wrap: anywhere;
  color: #bdb5c5;
  line-height: 1.55;
}

.account-status {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  padding: 12px 13px;
  color: #9d95a4;
  background: rgba(7, 6, 10, 0.46);
}

.account-status strong {
  color: #7fe2b5;
}

.account-danger {
  margin-top: 18px;
  border: 1px solid rgba(238, 101, 128, 0.24);
  color: #ffc5d0;
  background: rgba(181, 55, 81, 0.14);
}

@media (max-width: 600px) {
  .auth-screen {
    align-items: start;
    padding: 12px;
  }

  .auth-card {
    padding: 24px 20px;
    border-radius: 22px;
  }

  .auth-card h1 {
    font-size: 2.2rem;
  }

  .account-button {
    top: auto;
    right: 14px;
    bottom: 76px;
  }
}

/* Always-visible logout control for signed-in users */

.logout-button {
  position: fixed;
  top: 16px;
  right: 70px;
  z-index: 80;
  min-height: 43px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0 17px;
  color: #f8f4fb;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
  background: rgba(31, 25, 40, 0.96);
  box-shadow: 0 13px 32px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.logout-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(47, 38, 60, 0.98);
}

.logout-button:focus-visible {
  outline: 3px solid rgba(170, 125, 255, 0.42);
  outline-offset: 2px;
}

.logout-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

@media (max-width: 600px) {
  .logout-button {
    top: auto;
    right: 68px;
    bottom: 76px;
    min-height: 42px;
    padding: 0 15px;
  }
}

/* Mobile logout stays at the top */
@media (max-width: 600px) {
  .logout-button {
    top: 16px;
    right: 70px;
    bottom: auto;
    min-height: 43px;
    padding: 0 17px;
  }
}
