:root{
  --bg:#0b1119;
  --bg2:#070b12;
  --text:#f4f1ea;
  --muted:rgba(244,241,234,.72);

  --gold:#f3c977;
  --gold2:#d49f4f;

  --card:rgba(255,255,255,.06);
  --card2:rgba(255,255,255,.05);
  --stroke:rgba(255,255,255,.12);
  --stroke2:rgba(255,255,255,.16);

  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --r14:14px;
  --r18:18px;
  --r22:22px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color:var(--text);
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(243,201,119,.12), transparent 60%),
    radial-gradient(900px 700px at 110% 10%, rgba(120,140,255,.10), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow:hidden;
}

a{ color:var(--gold); text-decoration:none; }
a:hover{ text-decoration:underline; }

.app{
  height:100%;
  display:flex;
  flex-direction:column;
}

.topbar{
  padding: calc(12px + var(--safe-top)) 14px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(8,12,22,.55);
  backdrop-filter: blur(10px);
}

.brand{ display:flex; align-items:center; gap:10px; min-width:0; }
.brand-dot{
  width:11px; height:11px; border-radius:999px;
  background: radial-gradient(circle at 30% 30%, #fff, var(--gold));
  box-shadow: 0 0 0 6px rgba(243,201,119,.12);
}
.brand-text{ min-width:0; }
.brand-title{ font-weight:900; letter-spacing:.2px; line-height:1.05; }
.brand-sub{ font-size:12px; color:var(--muted); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width: 60vw; }

.topbar-right{ display:flex; align-items:center; gap:10px; }

.pill{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
}

.iconbtn{
  width:38px; height:38px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color: rgba(255,255,255,.92);
  cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.iconbtn:hover{ transform: translateY(-1px); box-shadow: 0 10px 26px rgba(0,0,0,.35); background: rgba(255,255,255,.08); }

.stage{
  flex:1 1 auto;
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px calc(96px + var(--safe-bot));
}

.card{
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--r18);
  box-shadow: var(--shadow);
}

.block{ padding: 14px; }
.h1{ font-size: 18px; font-weight: 900; margin:0 0 6px; }
.p{ margin:0; color: var(--muted); line-height: 1.45; }

.hr{ height:1px; border-radius:999px; background: rgba(255,255,255,.10); margin: 12px 0; }

.grid{ display:grid; gap:12px; }
.grid2{ display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
@media (max-width: 420px){ .grid2{ grid-template-columns:1fr; } }

.label{ font-size:12px; color: rgba(255,255,255,.82); margin-bottom:6px; display:block; }

.input, .select, .textarea{
  width:100%;
  padding: 12px 12px;
  border-radius: var(--r14);
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--text);
  outline:none;
}
.textarea{ min-height: 84px; resize: vertical; }
.input:focus,.select:focus,.textarea:focus{
  border-color: rgba(243,201,119,.34);
  box-shadow: 0 0 0 4px rgba(243,201,119,.10);
}

.chips{ display:flex; flex-wrap:wrap; gap:8px; }
.chip{
  border-radius:999px;
  padding: 8px 10px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  font-size:12px;
  cursor:pointer;
  user-select:none;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.chip:hover{ transform: translateY(-1px); background: rgba(255,255,255,.08); }
.chip.on{
  border-color: rgba(243,201,119,.34);
  background: rgba(243,201,119,.12);
}

.bottombar{
  position: fixed;
  left:0; right:0; bottom:0;
  padding: 10px 14px calc(10px + var(--safe-bot));
  display:flex;
  gap:10px;
  background: rgba(8,12,22,.62);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,.08);
}

.btn{
  flex:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 12px 14px;
  border-radius: 16px;
  border:1px solid transparent;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.95);
  font-weight: 800;
  cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  white-space: nowrap;
}
.btn:hover{ transform: translateY(-1px); box-shadow: 0 10px 26px rgba(0,0,0,.35); }
.btn.ghost{ border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.05); }
.btn.primary{
  background: linear-gradient(180deg, #f5d588, var(--gold2));
  color: #1f1407;
}

.cardsRow{
  display:flex;
  gap:10px;
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
}
.cardMini{
  flex: 0 0 auto;
  width: 168px;
  border-radius: var(--r18);
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  overflow:hidden;
  scroll-snap-align: start;
}
.cardMini img{
  width:100%;
  height: 210px;
  object-fit: cover;
  display:block;
  background: rgba(0,0,0,.2);
}
.cardMini .meta{ padding: 10px 10px 12px; }
.cardMini .t{ font-weight:900; font-size:13px; line-height:1.15; }
.cardMini .s{ margin-top:6px; font-size:12px; color: var(--muted); line-height:1.35; }

.center{
  min-height: 40vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
}

.spinner{
  width:26px; height:26px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.18);
  border-top-color: rgba(243,201,119,.8);
  animation: spin .9s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

.toast{
  position: fixed;
  left: 50%;
  bottom: calc(78px + var(--safe-bot));
  transform: translateX(-50%);
  max-width: min(520px, 92vw);
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(8,12,22,.88);
  color: rgba(255,255,255,.95);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  opacity:0;
  pointer-events:none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.on{
  opacity:1;
  transform: translateX(-50%) translateY(-4px);
}

.small{ font-size:12px; color: var(--muted); }
.kv{ display:flex; gap:10px; flex-wrap:wrap; }
.kv .k{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
}
