@font-face { font-family: "Big Shoulders Display"; src: url("../fonts/big-shoulders-display-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Big Shoulders Display"; src: url("../fonts/big-shoulders-display-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --haze: #EEF0F7;
  --paper: #FFFFFF;
  --ink: #1B1F3B;
  --ink-2: #50557A;
  --line: rgba(27, 31, 59, .14);
  --marquee: #FFC93C;
  --marquee-deep: #F2B33D;
  --meadow: #4FA36C;
  --lilac: #8C7AE6;
  --alert: #B4361F;
  --display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --step--1: .875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.75rem;
  --step-3: 2.5rem;
  --step-4: clamp(3rem, 5.6vw, 5.5rem);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--haze);
  color: var(--ink);
  font: 400 var(--step-0)/1.55 var(--body);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--lilac); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- brand bar ---------- */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
}
.brand { white-space: nowrap; display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.brand svg { width: 34px; height: 34px; }
.brand span { font-family: var(--display); font-size: 1.45rem; font-weight: 800; letter-spacing: .01em; }
.bar nav { white-space: nowrap; display: flex; align-items: center; gap: 1.25rem; font-size: var(--step--1); }
.bar nav a { text-decoration: none; color: var(--ink-2); }
.bar nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.bar form { margin: 0; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer; }
.linklike:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.wallet { display: flex; align-items: center; gap: .9rem; padding: .35rem .5rem .35rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.wallet b { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.wallet .live { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .65rem; border-radius: 999px; background: var(--haze); color: var(--ink); }
.wallet .live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--meadow); }
.wallet .live.none::before { background: var(--ink-2); opacity: .4; }

/* ---------- home ---------- */
.is-home { overflow-x: hidden; }
.home {
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: minmax(380px, 40fr) 60fr;
}
.home-copy { display: flex; flex-direction: column; min-height: 100%; }
.home-main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 2rem clamp(1.25rem, 4vw, 3rem) 2.5rem; max-width: 40rem; }
.home h1 {
  font-family: var(--display); font-weight: 800; font-size: var(--step-4);
  line-height: .92; letter-spacing: -.005em; margin: 0 0 1.4rem; text-wrap: balance;
}
.home .lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink-2); margin: 0 0 2.2rem; max-width: 30em; }
.doors { display: grid; gap: .75rem; max-width: 26rem; }
.door {
  display: grid; grid-template-columns: 2.25rem 1fr; align-items: center; gap: .85rem;
  padding: .85rem 1.1rem; border-radius: 14px; text-decoration: none;
  border: 2px solid var(--ink); background: var(--paper); font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease;
}
.door small { display: block; font-weight: 400; color: var(--ink-2); font-size: var(--step--1); }
.door svg { width: 2.25rem; height: 2.25rem; }
.door:hover { transform: translateY(-2px); box-shadow: 0 4px 0 var(--ink); }
.door:active { transform: translateY(0); box-shadow: none; }
.door.primary { background: var(--marquee); }
.home .hint { margin: 1.4rem 0 0; font-size: var(--step--1); color: var(--ink-2); max-width: 26rem; }
.home-foot { padding: 1rem clamp(1.25rem, 4vw, 3rem) 1.4rem; font-size: .8125rem; color: var(--ink-2); }
.home-foot p { margin: 0; }

.home-world { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: #B9D3EE; }
.home-world .world { position: absolute; inset: 0; width: 100%; height: 100%; }
.world text { font-family: var(--display); font-weight: 800; fill: var(--ink); }
.world .sign-big { font-size: 46px; }
.world .sign-small { font-size: 30px; font-weight: 700; }
.world .sign-tower { font-size: 26px; fill: var(--marquee); }
.world .sign-house { font-size: 28px; }
.place { cursor: pointer; }
.place .lift { transition: transform .2s ease; transform-box: fill-box; transform-origin: 50% 100%; }
.place:hover .lift, .place:focus-visible .lift { transform: translateY(-8px); }
.place:focus-visible { outline: none; }
.place:focus-visible .lift { filter: drop-shadow(0 0 0 var(--lilac)) drop-shadow(0 6px 0 rgba(27,31,59,.25)); }
.place-tower .waves path { transition: opacity .2s; }
.place-tower:hover .waves, .place-tower:focus-visible .waves { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

@media (max-width: 900px) {
  .home { grid-template-columns: 1fr; }
  .home-world { order: -1; position: relative; height: auto; aspect-ratio: 900 / 880; width: 100%; }
  .home-copy .bar { position: absolute; top: 0; left: 0; right: 0; z-index: 2; }
  .home-copy .bar .brand, .home-copy .bar nav a { color: var(--ink); }
  .home-main { padding-top: 2rem; }
}
@media (max-width: 520px) {
  .bar { padding-left: 1rem; padding-right: 1rem; }
  .bar .hide-sm { display: none; }
  .brand span { font-size: 1.25rem; }
  .bar nav { gap: .9rem; }
  .wallet { gap: .5rem; padding-left: .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .door, .place .lift { transition: none; }
  .place-tower .waves { animation: none !important; }
}

/* ---------- inner pages ---------- */
.page { max-width: 72rem; margin: 0 auto; padding: 1rem clamp(1.25rem, 4vw, 3rem) 4rem; }
.page-narrow { max-width: 34rem; margin: 0 auto; padding: 1.5rem clamp(1.25rem, 4vw, 2rem) 4rem; }
.page h1, .page-narrow h1 { font-family: var(--display); font-weight: 800; font-size: var(--step-3); line-height: 1; margin: 1rem 0 .9rem; }
.page h2, .page-narrow h2 { font-family: var(--display); font-weight: 800; font-size: var(--step-2); line-height: 1.05; margin: 0 0 .75rem; }
.muted { color: var(--ink-2); }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.25rem, 3vw, 2rem); }
.foot { max-width: 72rem; margin: 0 auto; padding: 1.5rem clamp(1.25rem, 4vw, 3rem) 2rem; font-size: .8125rem; color: var(--ink-2); border-top: 1px solid var(--line); }

.notice { padding: .85rem 1.1rem; border-radius: 12px; margin: 0 0 1.25rem; background: #E7F4EA; border: 1px solid #BFE0C8; }
.notice.err { background: #FBEAE5; border-color: #F0C3B6; color: #6E2312; }
.notice.warn { background: #FFF3CF; border-color: #F2D788; }
.notice a, .notice button { font-weight: 600; }

/* ---------- forms ---------- */
.field { margin: 0 0 1.15rem; }
.field > label, .field > .label { display: block; font-weight: 600; margin: 0 0 .35rem; }
.field .help { display: block; font-size: var(--step--1); color: var(--ink-2); margin-top: .35rem; }
.field .error { display: block; font-size: var(--step--1); color: var(--alert); margin-top: .35rem; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=month], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid rgba(27,31,59,.28); border-radius: 10px; padding: .7rem .85rem;
}
textarea { min-height: 8rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(140,122,230,.45); outline-offset: 0; border-color: var(--lilac); }
[aria-invalid=true] { border-color: var(--alert) !important; }
.checks { display: flex; flex-wrap: wrap; gap: .5rem; }
.check { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .75rem; border: 1.5px solid rgba(27,31,59,.2); border-radius: 999px; background: var(--paper); cursor: pointer; font-size: var(--step--1); }
.check:has(input:checked) { border-color: var(--ink); background: #FFF3CF; }
.check input { accent-color: var(--ink); }
.consent { display: flex; gap: .6rem; align-items: flex-start; }
.consent input { margin-top: .3rem; accent-color: var(--ink); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 600px) { .row2 { grid-template-columns: 1fr; } }
fieldset { border: 0; padding: 0; margin: 0 0 1.15rem; }
legend { font-weight: 600; padding: 0; margin-bottom: .45rem; }

.money { position: relative; }
.money > span { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); font-family: var(--display); font-weight: 800; font-size: 1.9rem; color: var(--ink-2); }
.money input { padding-left: 2.3rem; font-family: var(--display); font-weight: 800; font-size: 2rem; padding-top: .45rem; padding-bottom: .45rem; font-variant-numeric: tabular-nums; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.chips button { font: inherit; font-size: var(--step--1); padding: .35rem .8rem; border-radius: 999px; border: 1.5px solid rgba(27,31,59,.2); background: var(--paper); cursor: pointer; }
.chips button:hover { border-color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 600 var(--step-0)/1 var(--body); padding: .9rem 1.4rem; border-radius: 12px; cursor: pointer;
  border: 2px solid var(--ink); background: var(--marquee); color: var(--ink); text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 3px 0 var(--ink); }
.btn:active { transform: none; box-shadow: none; }
.btn.secondary { background: var(--paper); }
.btn.small { padding: .5rem .8rem; font-size: var(--step--1); border-radius: 9px; border-width: 1.5px; }
.btn.small:hover { box-shadow: 0 2px 0 var(--ink); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.counter { font-variant-numeric: tabular-nums; }
.counter.over { color: var(--alert); font-weight: 600; }

/* ---------- promote landing ---------- */
.promo { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: start; padding-top: 1.5rem; }
.promo h1 { font-size: clamp(2.75rem, 5vw, 4.5rem); line-height: .95; margin-top: 0; }
.promo .lede { font-size: var(--step-1); color: var(--ink-2); max-width: 32em; }
.steps { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1rem; counter-reset: s; max-width: 32rem; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 2.4rem 1fr; gap: .9rem; align-items: start; }
.steps li::before { content: counter(s); font-family: var(--display); font-weight: 800; font-size: 1.4rem; width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--ink); }
.steps b { display: block; }
.steps span { color: var(--ink-2); font-size: var(--step--1); }
@media (max-width: 860px) { .promo { grid-template-columns: 1fr; } }

/* ---------- dashboard ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin: 1rem 0 1.25rem; }
.dash-head h1 { margin: 0; }
.figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.figure { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.2rem; }
.figure dt { font-size: var(--step--1); color: var(--ink-2); }
.figure dd { margin: .15rem 0 0; font-family: var(--display); font-weight: 800; font-size: 2.4rem; line-height: 1; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .figures { grid-template-columns: 1fr 1fr; } .figures .figure:last-child { grid-column: span 2; } }
.chart-panel header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.chart-panel h2 { margin: 0; }
.chart-panel select { width: auto; padding: .45rem .7rem; font-size: var(--step--1); }
.chart-box { position: relative; height: 280px; }
.table-wrap { overflow-x: auto; margin-top: 1rem; }
table.campaigns { width: 100%; border-collapse: collapse; min-width: 720px; }
.campaigns th { text-align: left; font-size: var(--step--1); font-weight: 500; color: var(--ink-2); padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
.campaigns td { padding: .85rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.campaigns tr:last-child td { border-bottom: 0; }
.campaigns .game { display: flex; gap: .8rem; align-items: center; min-width: 14rem; }
.campaigns .game img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); background: var(--haze); }
.campaigns .game b { display: block; }
.campaigns .game small { color: var(--ink-2); display: block; max-width: 24rem; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.actions { display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; }
.actions form { margin: 0; }
.meter { width: 7rem; height: 6px; border-radius: 99px; background: var(--haze); overflow: hidden; margin-top: .35rem; }
.meter i { display: block; height: 100%; background: var(--meadow); }
.meter.low i { background: var(--marquee-deep); }
.meter.empty i { background: var(--alert); }

.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .6rem; border-radius: 999px; font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.live { background: #E2F2E6; color: #22663C; }
.pill.paused { background: #ECE8FB; color: #4D3FA6; }
.pill.out_of_budget { background: #FBE6DF; color: var(--alert); }
.pill.setup, .pill.awaiting_payment { background: #FFF3CF; color: #7A5A00; }
.pill.rejected { background: #EDEDF2; color: var(--ink-2); }

.empty { text-align: center; padding: 2.5rem 1rem; }
.new-camp { display: flex; gap: .75rem; align-items: end; flex-wrap: wrap; }
.new-camp .field { margin: 0; flex: 0 1 14rem; }
.new-camp .money input { font-size: 1.4rem; }
.new-camp .money > span { font-size: 1.3rem; }

/* ad preview on setup */
.setup-grid { display: grid; grid-template-columns: 1fr 20rem; gap: 2rem; align-items: start; }
@media (max-width: 860px) { .setup-grid { grid-template-columns: 1fr; } }
.preview-card { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); padding: 1rem; display: grid; grid-template-columns: 56px 1fr; gap: .85rem; }
.preview-card img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--haze); }
.preview-card b { display: block; }
.preview-card p { margin: .2rem 0 .6rem; font-size: var(--step--1); color: var(--ink-2); overflow-wrap: anywhere; }
.preview-card .cta { display: inline-block; font-size: .8125rem; font-weight: 600; padding: .3rem .7rem; border-radius: 8px; background: var(--marquee); }
.preview-label { font-size: .75rem; color: var(--ink-2); margin: 0 0 .5rem; }
.icon-drop { display: flex; align-items: center; gap: 1rem; }
.icon-drop img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; border: 1px solid var(--line); background: var(--haze); }

.code { font: 13px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--ink); color: #E9E6FA; border-radius: 12px; padding: 1rem; overflow-x: auto; white-space: pre; }

/* inner pages: align the header with the content column */
body:not(.is-home) > .bar { max-width: 72rem; margin: 0 auto; }
.actions { flex-wrap: nowrap; }
input[type=file] { font: inherit; font-size: var(--step--1); color: var(--ink-2); }
input[type=file]::file-selector-button {
  font: 600 var(--step--1)/1 var(--body); color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--ink); border-radius: 9px; padding: .5rem .8rem; margin-right: .75rem; cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: #FFF3CF; }

/* local mode strip */
.localbar { position: fixed; right: 12px; bottom: 12px; z-index: 50; display: flex; gap: .85rem; align-items: center;
  background: var(--ink); color: #E9E6FA; font-size: .8125rem; padding: .5rem .9rem; border-radius: 999px; box-shadow: 0 6px 20px rgba(27,31,59,.25); }
.localbar b { color: var(--marquee); font-weight: 600; margin-right: .2rem; }
.localbar a { color: #fff; }
@media (max-width: 520px) { .localbar span { display: none; } }
