:root {
  --bg: #0e1430;
  --bg2: #131a3d;
  --surface: #171f47;
  --surface2: #1e2858;
  --primary: #2dd4bf;     /* teal */
  --primary-dark: #14b8a6;
  --accent: #ff5fa2;      /* miami pink */
  --gold: #f6b73c;
  --text: #f3f5fb;
  --muted: #9aa6c4;
  --border: #2a3566;
  --danger: #ff6b6b;
  --good: #43d9a3;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body { background-image: radial-gradient(circle at 15% 0%, rgba(255,95,162,0.12), transparent 45%), radial-gradient(circle at 85% 10%, rgba(45,212,191,0.12), transparent 45%); background-attachment: fixed; }

.font-display { font-family: 'Fraunces', Georgia, serif; letter-spacing: -0.01em; }
.tabular { font-variant-numeric: tabular-nums; }
.max { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
a { color: inherit; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1.2rem; border-radius: .6rem; font-weight: 600; font-size: .92rem; cursor: pointer; border: 1px solid transparent; transition: all .15s ease; white-space: nowrap; text-decoration: none; }
.btn-primary { background: var(--primary); color: #06231f; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #2a0a18; }
.btn-accent:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface2); }
.btn-sm { padding: .45rem .75rem; font-size: .82rem; }
.btn-lg { padding: .9rem 1.6rem; font-size: 1.05rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; }
.input, .select { width: 100%; background: var(--bg2); border: 1px solid var(--border); border-radius: .6rem; padding: .7rem .9rem; font-size: .95rem; color: var(--text); font-family: inherit; }
.input:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,212,191,.18); }
.label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .35rem; color: var(--muted); }
.help { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.divider { height: 1px; background: var(--border); border: 0; margin: 1rem 0; }
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; font-size: .72rem; font-weight: 700; border-radius: 999px; background: rgba(45,212,191,.14); color: var(--primary); }
.pill.pink { background: rgba(255,95,162,.16); color: var(--accent); }
.pill.gold { background: rgba(246,183,60,.16); color: var(--gold); }
.muted { color: var(--muted); }
.good { color: var(--good); }
.bad { color: var(--danger); }

/* Market table */
.mtable { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.mtable th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.mtable td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.mtable tbody tr:last-child td { border-bottom: 0; }
.mtable tbody tr:hover { background: var(--surface); }
.buildcard:hover { border-color: var(--primary); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(14,20,48,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.hbar { height: 64px; display: flex; align-items: center; justify-content: space-between; }
.nav-link { font-size: .9rem; font-weight: 600; color: var(--muted); padding: .5rem .8rem; border-radius: .5rem; }
.nav-link:hover { color: var(--text); background: var(--surface); }
.cash-chip { font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; background: rgba(246,183,60,.1); padding: .35rem .7rem; border-radius: 999px; border: 1px solid rgba(246,183,60,.25); }

/* Hero */
.hero { padding: 4rem 0 3rem; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); line-height: 1.02; margin: 0; }
.neon { background: linear-gradient(92deg, var(--accent), var(--gold), var(--primary)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* District grid */
.district-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.1rem; }
.district { border-radius: 1rem; overflow: hidden; border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.district:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.district .banner { height: 92px; background-size: cover; background-position: center; position: relative; }
.district .banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(23,31,71,.85)); }
.district .body { padding: 1rem; }

/* Plot grid */
.plotgrid { display: grid; gap: .5rem; }
.plot { aspect-ratio: 1; border-radius: .55rem; border: 1px solid var(--border); background: var(--bg2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; cursor: pointer; padding: .3rem; text-align: center; transition: all .12s ease; position: relative; }
.plot:hover { border-color: var(--primary); transform: scale(1.03); }
.plot.owned { background: var(--surface2); }
.plot.mine { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.plot.ai { border-color: rgba(255,95,162,.5); }
.plot .price { font-size: .7rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.plot .who { font-size: .62rem; color: var(--muted); line-height: 1.1; }
.plot .biz { font-size: .62rem; color: var(--primary); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(6,9,22,.7); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 1rem; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; max-width: 44rem; width: 100%; max-height: 88vh; overflow:auto; padding: 1.5rem; }
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: .7rem 1.2rem; border-radius: .6rem; font-size: .9rem; z-index: 80; }

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: .9rem; padding: 1rem 1.2rem; }
.stat .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat .v { font-family: 'Fraunces', serif; font-size: 1.8rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.footer { border-top: 1px solid var(--border); margin-top: 4rem; color: var(--muted); font-size: .85rem; }
.shimmer { background: linear-gradient(90deg, var(--surface) 0%, var(--surface2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sh 1.5s linear infinite; border-radius: .5rem; }
@keyframes sh { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
