/* Shared styles: tokens, buttons, cards, landing, auth, admin. */
:root {
  --green: #0f8a4b;
  --green-dark: #0a6b39;
  --green-soft: #e3f6ea;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --card: #ffffff;
  --bg: #eef4fb;
  --red: #d92d20;
  --gold: #f5b301;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(16, 24, 40, .12);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.45; }
h1, h2, h3, p { margin: 0; }
a { color: var(--green-dark); }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 700; cursor: pointer;
  text-decoration: none; background: #fff; color: var(--ink); transition: transform .08s, filter .15s;
  touch-action: manipulation; user-select: none;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 6px 16px rgba(15, 138, 75, .35); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: rgba(255, 255, 255, .85); box-shadow: 0 2px 8px rgba(16, 24, 40, .08); }
.btn-danger { background: #fee4e2; color: var(--red); }
.btn-lg { padding: 15px 26px; font-size: 1.08rem; }
.btn-block { width: 100%; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--green-soft); color: var(--green-dark); border-radius: 999px; padding: 4px 12px; font-size: .82rem; font-weight: 700; }
.pill.off { background: #f2f4f7; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #17c964; box-shadow: 0 0 0 4px rgba(23, 201, 100, .25); }
.big-emoji { font-size: 3rem; line-height: 1; }

.field { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 14px; }
.field input { display: block; width: 100%; margin-top: 6px; padding: 13px 16px; border-radius: 16px; border: 2px solid transparent; background: #f2f4f7; font-weight: 500; outline: none; }
.field input:focus { border-color: var(--green); background: #fff; }
.field small { display: block; font-weight: 500; color: var(--muted); margin-top: 5px; }
.form-error { background: #fee4e2; color: var(--red); border-radius: 14px; padding: 10px 14px; font-weight: 600; margin-bottom: 12px; }
.notice { background: var(--green-soft); color: var(--green-dark); border-radius: 14px; padding: 10px 14px; font-weight: 600; margin-bottom: 12px; }

/* Pages */
.page { min-height: 100%; background: linear-gradient(180deg, #cfe6fb 0%, #eef4fb 55%, #f4f7ee 100%); display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; }
.topbar nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.brand { font-weight: 900; font-size: 1.25rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.back-link { padding: 16px 18px; font-weight: 700; text-decoration: none; }
.center-card { margin: auto; text-align: center; display: grid; gap: 12px; max-width: 360px; }
.foot { text-align: center; padding: 20px; font-size: .85rem; }

.hero { width: 100%; max-width: 980px; margin: 0 auto; padding: 28px 18px 40px; text-align: center; flex: 1; }
.hero h1 { font-size: clamp(2.3rem, 9vw, 4.4rem); line-height: 1.02; letter-spacing: -.03em; margin: 16px 0 12px; }
.hero .lead { max-width: 620px; margin: 0 auto; color: #344054; font-size: 1.08rem; }
.cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 24px 0 30px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat { background: #fff; border-radius: 20px; padding: 16px 12px; box-shadow: 0 4px 14px rgba(16, 24, 40, .07); }
.stat b { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .85rem; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; text-align: left; }
.features article { background: rgba(255, 255, 255, .9); border-radius: 20px; padding: 18px; }
.features span { font-size: 1.8rem; }
.features h3 { margin: 6px 0 4px; }
.features p { color: var(--muted); font-size: .93rem; }

.auth { width: 100%; max-width: 440px; margin: 0 auto; padding: 4px 18px 40px; text-align: center; }
.auth h1 { font-size: 2.2rem; }
.auth .card { text-align: left; margin-top: 22px; }
.tabs { display: flex; background: #f2f4f7; border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.tab { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 10px; font-weight: 700; color: var(--muted); cursor: pointer; }
.tab.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(16, 24, 40, .1); }
form[data-mode="login"] .only-signup { display: none; }

.admin-main { width: 100%; max-width: 900px; margin: 0 auto; padding: 8px 18px 60px; display: grid; gap: 16px; }
.table-card { overflow-x: auto; padding: 8px 14px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.track-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.track-row audio { display: block; margin-top: 8px; max-width: 100%; height: 36px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Live 3D city behind public pages */
#cityBg { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; opacity: 0; transition: opacity 1.2s; pointer-events: none; }
.city-on #cityBg { opacity: 1; }
.city-veil { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1.2s;
  background: linear-gradient(180deg, rgba(232, 243, 252, .82) 0%, rgba(232, 243, 252, .5) 42%, rgba(232, 243, 252, .22) 100%); }
.city-on .city-veil { opacity: 1; }
.has-city > *:not(#cityBg):not(.city-veil) { position: relative; z-index: 1; }
.has-city .hero h1, .has-city .auth h1 { text-shadow: 0 2px 18px rgba(255, 255, 255, .9); }
.has-city .lead, .has-city .auth > .muted { color: #1d2939; font-weight: 600; text-shadow: 0 1px 10px rgba(255, 255, 255, .95); }
.has-city .foot { color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
