/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
:root {
  --bg: #0c1017;
  --bg-soft: #101623;
  --panel: #151c2b;
  --panel-2: #1a2336;
  --border: #253049;
  --text: #e8edf6;
  --muted: #8b96ab;
  --accent: #5b8cff;
  --accent-2: #7c5cff;
  --green: #3ecf8e;
  --red: #f4594f;
  --gold: #f2b93b;
  --orange: #f08c3a;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(91, 140, 255, 0.14), transparent 60%),
    radial-gradient(900px 480px at -10% 0%, rgba(124, 92, 255, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.45;
}

button {
  font: inherit;
  cursor: pointer;
}

input {
  font: inherit;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
}

input:focus {
  outline: 2px solid rgba(91, 140, 255, 0.5);
  border-color: var(--accent);
}

.app {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 20px 70px;
}

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  --brand-logo-size: 34px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #6ea8ff, #a58bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand .brand-logo {
  flex: none;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(242, 185, 59, 0.35));
}

.brand small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  flex-basis: 100%;
  margin-left: calc(var(--brand-logo-size) + 10px);
  margin-top: -4px;
}

.topbar .brand {
  --brand-logo-size: 28px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.chip {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 600;
}

.btn {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 15px;
  font-weight: 600;
  transition: transform 0.05s ease, filter 0.15s ease;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.15);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  padding: 9px 18px;
  font-size: 14px;
}

.btn-small {
  padding: 5px 10px;
  font-size: 12.5px;
  border-radius: 8px;
}

/* ---------- Panels + cards ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.panel h3 {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.gm-panel {
  background:
    linear-gradient(135deg, rgba(91, 140, 255, 0.12), rgba(124, 92, 255, 0.10)),
    var(--panel);
  border: 1px solid rgba(91, 140, 255, 0.35);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
  font-size: 15px;
}

.gm-panel .gm-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

/* ---------- Stats ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  grid-gap: 12px;
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px;
}

.stat-card .label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-card .value {
  font-size: 21px;
  font-weight: 750;
  margin-top: 4px;
}

.stat-card .sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.bar-row {
  margin-top: 8px;
}

.bar {
  height: 7px;
  background: #0d1420;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 6px;
}

.bar > div {
  height: 100%;
  border-radius: 99px;
  transition: width 0.35s ease;
}

.value.green { color: var(--green); }
.value.blue { color: var(--accent); }
.value.gold { color: var(--gold); }
.value.red { color: var(--red); }
.value.orange { color: var(--orange); }
.value.muted { color: var(--muted); }

/* ---------- Layout ---------- */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 16px;
  gap: 16px;
  align-items: start;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 860px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

/* ---------- Lists / feed ---------- */

.feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
}

.feed-item {
  border-left: 3px solid var(--border);
  background: var(--panel-2);
  border-radius: 0 9px 9px 0;
  padding: 8px 12px;
  font-size: 13.5px;
}

.feed-item .meta {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

.feed-item.kind-GOOD { border-left-color: var(--green); }
.feed-item.kind-WARNING { border-left-color: var(--red); }
.feed-item.kind-EVENT { border-left-color: var(--gold); }
.feed-item.kind-MONEY { border-left-color: var(--accent); }

.mission {
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
}

.mission:last-child {
  border-bottom: none;
}

.mission .row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
}

.mission .row .title {
  font-weight: 650;
}

.mission .row .state {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.mission .desc {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px;
}

.mission .bar {
  margin-top: 7px;
}

.done .row .state {
  color: var(--green);
}

/* ---------- Tables ---------- */

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ledger-table th,
.ledger-table td {
  text-align: left;
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
}

.ledger-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.amount-pos { color: var(--green); font-weight: 650; }
.amount-neg { color: var(--red); font-weight: 650; }

/* ---------- Choice cards ---------- */

.choices {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 14px;
}

.choice {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  text-align: left;
  color: var(--text);
}

.choice:hover {
  border-color: var(--accent);
  background: rgba(91, 140, 255, 0.08);
}

.choice .hint {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- Modal ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 40;
}

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 26px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.modal .category {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.modal h2 {
  margin: 6px 0 8px;
  font-size: 22px;
}

.modal p {
  color: var(--muted);
  margin: 0;
  font-size: 14.5px;
}

.severity-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 99px;
  padding: 3px 9px;
  margin-left: 8px;
  vertical-align: middle;
  background: rgba(242, 185, 59, 0.14);
  color: var(--gold);
}

.severity-pill.Major {
  background: rgba(244, 89, 79, 0.14);
  color: var(--red);
}

/* ---------- Landing ---------- */

.landing {
  max-width: 720px;
  margin: 0 auto;
  padding: 34px 20px;
}

.landing h1 {
  font-size: 38px;
  margin: 8px 0 6px;
  background: linear-gradient(90deg, #6ea8ff, #a58bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing .intro {
  color: var(--muted);
  font-size: 15.5px;
  max-width: 560px;
}

.landing .landing-hero {
  width: 100%;
  height: auto;
  margin: 26px 0 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.45);
  display: block;
}

.landing .form {
  display: flex;
  gap: 10px;
  margin: 26px 0 34px;
  flex-wrap: wrap;
}

.cq-strip {
  margin-top: 34px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
}

.cq-strip-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.cq-strip-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 560px;
}

.cq-strip-body {
  display: grid;
  grid-template-columns: 1fr 210px;
  grid-gap: 22px;
  gap: 22px;
  align-items: center;
  margin-top: 18px;
}

.cq-pillars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 12px;
  gap: 12px;
}

.cq-pillar {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.cq-pillar-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  font-weight: 700;
}

.cq-pillar-top strong {
  color: var(--gold);
  font-size: 15px;
}

.cq-bar {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  margin: 8px 0 6px;
  overflow: hidden;
}

.cq-bar div {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #f2b93b, #ffd97a);
}

.cq-pillar small {
  color: var(--muted);
  font-size: 11px;
}

.cq-dial {
  position: relative;
  width: 210px;
  height: 210px;
  margin: 0 auto;
}

.cq-dial-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.cq-ring {
  fill: none;
  stroke: #253049;
  stroke-width: 10;
}

.cq-ring-fill {
  fill: none;
  stroke: #f2b93b;
  stroke-width: 10;
  stroke-linecap: round;
}

.cq-dial-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.cq-dial-text strong {
  font-size: 36px;
  color: var(--gold);
  line-height: 1;
}

.cq-dial-text span {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin-top: 2px;
}

.cq-dial-text small {
  color: var(--green);
  font-size: 11.5px;
  margin-top: 2px;
}

.cq-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

@media (max-width: 640px) {
  .cq-strip-body {
    grid-template-columns: 1fr;
  }
  .cq-dial {
    width: 168px;
    height: 168px;
  }
}

.landing .form input {
  flex: 1 1;
  min-width: 220px;
}

.world-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.world-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
}

.world-card:hover {
  border-color: var(--accent);
}

.world-card .name {
  font-weight: 650;
}

.world-card .meta {
  font-size: 12.5px;
  color: var(--muted);
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 26px 0;
}

.error {
  color: var(--red);
  font-size: 13.5px;
  margin-top: 10px;
}

/* ---------- Onboarding ---------- */

.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 16px;
  gap: 16px;
  margin-bottom: 18px;
}

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

.option-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  margin-bottom: 9px;
}

.option-card:hover {
  border-color: var(--accent);
}

.option-card.selected {
  border-color: var(--green);
  background: rgba(62, 207, 142, 0.07);
}

.option-card .top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 650;
}

.option-card .sub {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 3px;
}

.actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.inline-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.inline-form input {
  min-width: 110px;
  flex: 1 1;
}

.note {
  color: var(--muted);
  font-size: 12.5px;
}

.tip {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

.level-xp {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

/* World ticker (GUI Phase I) */
.ticker-item {
  animation: ticker-in 300ms ease;
}

@keyframes ticker-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-item {
    animation: none;
  }
}

/* Phase K — interaction & micro-animation */
.g-metric-value,
.g-progress-fill,
.g-meter-fill {
  transition: color 300ms ease, width 400ms ease, stroke-dashoffset 400ms ease;
}

.hotspot-marker {
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.hotspot-marker:hover,
.hotspot-marker:focus-visible,
.hotspot-link:focus-visible .hotspot-marker {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.hotspot-link {
  border-radius: 12px;
}

.hotspot-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.hotspot-event {
  animation: hotspot-pulse 2s ease-in-out infinite;
}

@keyframes hotspot-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(242, 185, 59, 0.55);
  }
  50% {
    box-shadow: 0 0 0 9px rgba(242, 185, 59, 0);
  }
}

.gm-panel-in {
  animation: slide-in-right 260ms ease;
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.xp-pulse {
  animation: xp-pulse 700ms ease;
}

@keyframes xp-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.25);
    color: var(--gold);
  }
  100% {
    transform: scale(1);
  }
}

.g-pulse {
  animation: g-pulse 900ms ease;
}

@keyframes g-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(242, 185, 59, 0.55);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(242, 185, 59, 0);
  }
}

.toast {
  animation: toast-in 240ms ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.count-up {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.stat-card .bar > div,
.mission .bar > div {
  transition: width 400ms ease;
}

.fatigue-value {
  transition: color 300ms ease;
}

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

/* ============================================================
   Phase L — responsive & density pass (1440 / 1366 / 1024)
   ============================================================ */

/* ---------- clamp() typography ---------- */

body {
  font-size: clamp(13px, 0.9vw + 2px, 15px);
}

.brand {
  font-size: clamp(18px, 1.6vw, 22px);
}

.stat-card .value {
  font-size: clamp(17px, 1.5vw, 21px);
}

.panel h3 {
  font-size: clamp(10.5px, 0.4vw + 10px, 12px);
}

.gm-panel {
  font-size: clamp(13.5px, 0.6vw + 12.5px, 15px);
}

.chip {
  font-size: clamp(12px, 0.5vw + 11px, 13px);
}

.modal h2 {
  font-size: clamp(18px, 1.5vw, 22px);
}

.landing h1 {
  font-size: clamp(28px, 2.7vw, 38px);
}

/* ---------- Game shell ---------- */

.shell {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.shell-topbar {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.shell-metrics {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 10px 20px;
  overflow-x: auto;
}

.shell-world {
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.shell-body {
  display: flex;
  align-items: flex-start;
}

.shell-nav {
  width: 170px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: -webkit-sticky;
  position: sticky;
  top: 62px;
  align-self: flex-start;
  min-height: calc(100vh - 62px);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--panel);
  outline: none;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  object-fit: contain;
}

.nav-icon-fallback {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.shell-main {
  flex: 1 1;
  padding: 20px;
  min-width: 0;
}

/* ---------- 1366x768 — tightened spacing/labels ---------- */

@media (max-width: 1439px) {
  .shell-metrics {
    gap: 14px;
    padding: 9px 14px;
  }

  .shell-nav {
    padding: 10px 8px;
  }

  .nav-link {
    padding: 7px 10px;
    font-size: 13.5px;
  }

  .shell-main {
    padding: 16px;
  }

  .app {
    max-width: 1080px;
    padding: 14px 16px 60px;
  }

  .topbar {
    margin-bottom: 14px;
    padding-bottom: 12px;
    gap: 10px;
  }

  .panel {
    padding: 13px 15px;
  }

  .gm-panel {
    padding: 15px 17px;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    padding: 11px 13px;
  }

  .two-col {
    gap: 12px;
  }

  .col {
    gap: 12px;
  }
}

/* ---------- ~1100px — nav collapses to icons, GM rail becomes drawer ---------- */

@media (max-width: 1280px) {
  .hide-1280 {
    display: none !important;
  }
}

/* ---------- GM drawer (narrow widths) ---------- */

.gm-rail {
  width: 320px;
  flex-shrink: 0;
}

.gm-fab {
  display: none;
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.gm-fab:hover {
  filter: brightness(1.1);
}

.gm-fab-badge {
  display: none;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--gold);
  color: #0c1017;
  font-size: 11px;
  font-weight: 800;
  padding: 0 5px;
  align-items: center;
  justify-content: center;
}

.gm-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, 0.62);
  z-index: 45;
}

.gm-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(360px, 92vw);
  z-index: 46;
  background: var(--bg-soft);
  border-left: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
  flex-direction: column;
  gap: 10px;
  animation: gm-drawer-in 240ms ease;
}

@keyframes gm-drawer-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.gm-drawer-close {
  align-self: flex-end;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 9px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
}

/* ============================================================
   Phase N — final polish pass
   ============================================================ */

/* Time is a first-class resource: prominent next to cash. */

.time-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  background: linear-gradient(135deg, rgba(242, 185, 59, 0.18), rgba(242, 185, 59, 0.05));
  border: 1px solid rgba(242, 185, 59, 0.45);
  border-radius: 12px;
  padding: 5px 14px;
  line-height: 1.15;
}

.time-chip-label {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--gold);
}

.time-chip-year {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* Active decisions are impossible to miss. */

.btn-alert {
  background: linear-gradient(135deg, var(--gold), var(--orange)) !important;
  border-color: transparent !important;
  color: #0c1017 !important;
  animation: alert-pulse 1.6s ease-in-out infinite;
}

@keyframes alert-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(242, 185, 59, 0.55);
  }
  50% {
    box-shadow: 0 0 0 9px rgba(242, 185, 59, 0);
  }
}

.pending-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  background: linear-gradient(135deg, rgba(242, 185, 59, 0.16), rgba(240, 140, 58, 0.08));
  border: 1px solid rgba(242, 185, 59, 0.5);
  border-radius: 12px;
  padding: 9px 14px;
  margin-bottom: 14px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--gold);
}

.pending-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(242, 185, 59, 0.6);
  animation: pending-dot 1.4s ease-in-out infinite;
}

@keyframes pending-dot {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(242, 185, 59, 0.6);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(242, 185, 59, 0);
  }
}

/* City is the hero of Home. */

.world-viewport {
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(91, 140, 255, 0.16),
    inset 0 0 70px rgba(0, 0, 0, 0.25);
}

/* Consistent focus / hover / pressed states. */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:active,
.option-card:active,
.choice:active,
.nav-link:active {
  transform: translateY(1px);
}

/* Event modal entrance. */

.modal {
  animation: modal-in 260ms ease;
}

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

/* ============================================================
   Phase P — City V2: player-owned assets alter the city
   ============================================================ */

.city-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.city-empty-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  background: rgba(12, 16, 23, 0.72);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11.5px;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1100px) {
  .shell-nav {
    width: 62px;
    padding: 10px 6px;
  }

  .nav-link {
    justify-content: center;
    padding: 9px 0;
  }

  .nav-label {
    display: none;
  }

  .gm-rail {
    display: none;
  }

  .gm-fab {
    display: inline-flex;
  }

  .gm-fab-badge {
    display: inline-grid;
  }

  .gm-drawer-backdrop {
    display: block;
  }

  .gm-drawer {
    display: flex;
  }
}

/*!**********************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./components/ui/system.css ***!
  \**********************************************************************************************************************************************************************************************************************************************************************/
/* ============================================================
   Life Game design system
   Prompt 1 — design tokens + UI primitives
   ============================================================ */

:root {
  /* Palette */
  --navy-bg: #0b1026;
  --navy-panel: #111735;
  --navy-panel-2: #1a2147;
  --navy-panel-3: #232b57;
  --primary: #6e4be8;
  --primary-strong: #7e5cf0;
  --primary-soft: rgba(110, 75, 232, 0.16);
  --action: #2d6bff;
  --action-soft: rgba(45, 107, 255, 0.14);
  --success: #35c66b;
  --success-soft: rgba(53, 198, 107, 0.14);
  --warning: #f0b83a;
  --warning-soft: rgba(240, 184, 58, 0.14);
  --danger: #e55555;
  --danger-soft: rgba(229, 85, 85, 0.14);
  --surface: #ffffff;
  --surface-soft: #f4f6fb;
  --ink: #1d2433;
  --ink-soft: #39415a;
  --muted-text: #5c667a;
  --line-dark: rgba(255, 255, 255, 0.1);
  --line-dark-strong: rgba(255, 255, 255, 0.18);
  --line-light: #e3e8f2;

  /* Shape */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-1: 0 1px 2px rgba(5, 8, 20, 0.35), 0 4px 12px rgba(5, 8, 20, 0.22);
  --shadow-2: 0 8px 26px rgba(5, 8, 20, 0.4);
  --shadow-3: 0 18px 50px rgba(5, 8, 20, 0.5);

  /* Spacing (8px grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Type */
  --font-body: "Inter", "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Inter", "Manrope", "Segoe UI", system-ui, sans-serif;
  --num: "Inter", "Manrope", "Segoe UI", system-ui, sans-serif;

  /* Motion */
  --dur-fast: 150ms;
  --dur-med: 280ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ---------- Primitive base ---------- */

.g-card,
.g-dark-card {
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.g-card {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-2);
  border: 1px solid var(--line-light);
}

.g-dark-card {
  background: linear-gradient(180deg, var(--navy-panel-2), var(--navy-panel));
  color: #f2f5ff;
  border: 1px solid var(--line-dark);
  box-shadow: var(--shadow-1);
}

/* ---------- Section header ---------- */

.g-section {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.g-section h2,
.g-section h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 750;
  letter-spacing: -0.01em;
}

.g-section h2 {
  font-size: clamp(16px, 1.2vw, 18px);
}

.g-section h3 {
  font-size: clamp(14px, 0.9vw, 15px);
}

.g-section .g-section-sub {
  display: block;
  color: var(--muted-text);
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 2px;
}

.g-section .g-section-action {
  flex-shrink: 0;
}

/* ---------- Metric ---------- */

.g-metric {
  min-width: 0;
}

.g-metric .g-metric-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-text);
}

.g-metric .g-metric-label .g-metric-icon {
  display: inline-flex;
  color: currentColor;
  opacity: 0.85;
}

.g-metric .g-metric-value {
  font-family: var(--num);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-size: clamp(19px, 1.7vw, 24px);
  font-weight: 800;
  line-height: 1.15;
  margin-top: 3px;
  letter-spacing: -0.01em;
  color: #f2f5ff;
}

.g-card .g-metric .g-metric-value {
  color: var(--ink);
}

.g-metric .g-metric-value.g-metric-value-sm {
  font-size: clamp(16px, 1.3vw, 19px);
}

.g-metric .g-metric-delta {
  font-family: var(--num);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.g-metric .g-metric-delta.tone-success {
  color: var(--success);
}

.g-metric .g-metric-delta.tone-danger {
  color: var(--danger);
}

.g-metric .g-metric-delta.tone-neutral {
  color: var(--muted-text);
}

.g-metric .g-metric-delta.tone-warning {
  color: var(--warning);
}

/* ---------- Progress bar ---------- */

.g-progress {
  --bar-color: var(--primary);
  width: 100%;
}

.g-progress .g-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(11, 16, 38, 0.45);
  overflow: hidden;
  border: 1px solid var(--line-dark);
}

.g-progress .g-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--bar-color);
  transition: width var(--dur-med) var(--ease-out);
}

.g-progress.tone-success { --bar-color: var(--success); }
.g-progress.tone-warning { --bar-color: var(--warning); }
.g-progress.tone-danger { --bar-color: var(--danger); }
.g-progress.tone-action { --bar-color: var(--action); }

.g-progress .g-progress-caption {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: 11.5px;
  color: var(--muted-text);
  margin-top: 5px;
  font-family: var(--num);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* ---------- Circular meter ---------- */

.g-meter {
  --meter-color: var(--primary);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.g-meter svg {
  transform: rotate(-90deg);
  display: block;
}

.g-meter .g-meter-track {
  stroke: rgba(11, 16, 38, 0.35);
}

.g-meter .g-meter-fill {
  stroke: var(--meter-color);
  stroke-linecap: round;
  transition: stroke-dashoffset var(--dur-med) var(--ease-out), stroke var(--dur-fast) var(--ease-out);
}

.g-meter .g-meter-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--num);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.g-meter .g-meter-center .g-meter-value {
  font-weight: 800;
  font-size: 20px;
  color: #f2f5ff;
}

.g-meter .g-meter-center .g-meter-cap {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-text);
}

.g-meter.tone-success { --meter-color: var(--success); }
.g-meter.tone-warning { --meter-color: var(--warning); }
.g-meter.tone-danger { --meter-color: var(--danger); }
.g-meter.tone-action { --meter-color: var(--action); }

/* ---------- Buttons ---------- */

.g-btn {
  --btn-bg: var(--primary);
  --btn-color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-md);
  padding: 11px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 650;
  color: var(--btn-color);
  background: var(--btn-bg);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), filter var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
  text-decoration: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.g-btn:hover:not(:disabled):not(.is-loading) {
  filter: brightness(1.12);
  box-shadow: 0 6px 18px rgba(110, 75, 232, 0.35);
  transform: translateY(-1px);
}

.g-btn:active:not(:disabled):not(.is-loading) {
  transform: translateY(0);
  filter: brightness(0.98);
}

.g-btn:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

.g-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.g-btn.is-loading {
  cursor: wait;
  opacity: 0.8;
}

.g-btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.g-btn-secondary {
  --btn-bg: transparent;
  --btn-color: #e8ecff;
  border: 1px solid var(--line-dark-strong);
  background: rgba(255, 255, 255, 0.04);
}

.g-btn-secondary:hover:not(:disabled):not(.is-loading) {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 18px rgba(5, 8, 20, 0.3);
}

.g-btn .g-btn-spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: g-spin 0.7s linear infinite;
}

@keyframes g-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Icon button ---------- */

.g-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line-dark);
  background: rgba(255, 255, 255, 0.04);
  color: #dbe2f5;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.g-icon-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.g-icon-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.g-icon-btn:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

.g-icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.g-icon-btn .g-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--navy-panel);
}

/* ---------- Choice button ---------- */

.g-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-dark-strong);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  color: #eef2ff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.g-choice:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(110, 75, 232, 0.22);
}

.g-choice:active:not(:disabled) {
  transform: translateY(0);
}

.g-choice:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

.g-choice:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.g-choice .g-choice-hint {
  display: block;
  font-size: 12px;
  font-weight: 550;
  color: var(--muted-text);
  margin-top: 2px;
}

.g-choice .g-choice-risk {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.g-choice .g-choice-risk.risk-low {
  color: var(--success);
  background: var(--success-soft);
}

.g-choice .g-choice-risk.risk-mid {
  color: var(--warning);
  background: var(--warning-soft);
}

.g-choice .g-choice-risk.risk-high {
  color: var(--danger);
  background: var(--danger-soft);
}

/* ---------- Status chip ---------- */

.g-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--action-soft);
  color: var(--action);
  border: 1px solid transparent;
}

.g-chip.tone-success {
  background: var(--success-soft);
  color: var(--success);
}

.g-chip.tone-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.g-chip.tone-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.g-chip.tone-primary {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.g-chip.tone-neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted-text);
  border-color: var(--line-dark);
}

.g-chip .g-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Tooltip ---------- */

.g-tooltip {
  position: relative;
  display: inline-flex;
}

.g-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(3px);
  background: var(--navy-panel-3);
  color: #eef2ff;
  border: 1px solid var(--line-dark-strong);
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  z-index: 60;
}

.g-tooltip:hover::after,
.g-tooltip:focus-within::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Skeleton ---------- */

.g-skeleton {
  display: inline-block;
  border-radius: 8px;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.06) 30%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(255, 255, 255, 0.06) 70%
  );
  background-size: 200% 100%;
  animation: g-shimmer 1.4s ease-in-out infinite;
}

.g-card .g-skeleton {
  background: linear-gradient(
    100deg,
    rgba(29, 36, 51, 0.06) 30%,
    rgba(29, 36, 51, 0.14) 50%,
    rgba(29, 36, 51, 0.06) 70%
  );
  background-size: 200% 100%;
}

@keyframes g-shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------- Reduced motion ---------- */

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

