/* Shadow Studio — "Midnight Lounge" on Telegram theme tokens (falls back to the dark palette). */
:root {
  --bg: var(--tg-theme-bg-color, #0f111e);
  --surface: var(--tg-theme-secondary-bg-color, #181c30);
  --text: var(--tg-theme-text-color, #eef0fb);
  --hint: var(--tg-theme-hint-color, #8a90ad);
  --accent: var(--tg-theme-button-color, #8ca5ff);
  --accent-text: var(--tg-theme-button-text-color, #0f111e);
  --danger: var(--tg-theme-destructive-text-color, #ff6b81);
  --gold: #f5b942;
  --line: color-mix(in srgb, var(--text) 9%, transparent);
  --radius: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.app { max-width: 960px; margin-inline: auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
.top { display: flex; align-items: center; justify-content: space-between; padding-block: 4px 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(135deg, #8ca5ff, #a78bfa); color: #0f111e; font-size: 18px; }
.pill { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }

/* Tabs: bottom bar on phones, segmented control on wider screens. */
.tabs { position: fixed; inset-inline: 0; bottom: 0; z-index: 5; display: flex; justify-content: space-around;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0;
  padding: 6px 4px; font-size: 12px; color: var(--hint); position: relative; border-radius: 12px; }
.tab .ti { font-size: 20px; line-height: 1; }
.tab.active { color: var(--accent); }
.dot { position: absolute; top: 4px; inset-inline-end: calc(50% - 18px); width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
@media (min-width: 600px) {
  .tabs { position: static; justify-content: flex-start; gap: 6px; padding: 4px; margin-bottom: 20px; border: 1px solid var(--line);
    border-radius: 14px; background: var(--surface); backdrop-filter: none; width: fit-content; }
  .tab { flex: none; flex-direction: row; gap: 8px; padding: 9px 16px; font-size: 14px; font-weight: 600; }
  .tab .ti { font-size: 16px; }
  .tab.active { background: color-mix(in srgb, var(--accent) 16%, transparent); }
  .dot { position: static; }
  .app { padding-bottom: 32px; }
}

.view { display: none; }
.view.active { display: block; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.hero h1 { font-size: 28px; line-height: 1.15; margin: 8px 0 6px; letter-spacing: -0.02em; }
.hero p, .sub { color: var(--hint); margin: 0 0 18px; line-height: 1.45; font-size: 15px; }
h2 { font-size: 18px; margin: 26px 0 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.link-card { background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, #a78bfa 28%, var(--surface)) 0%, var(--surface) 60%); }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--hint); font-weight: 700; }
.link-row { margin: 10px 0 14px; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--bg) 70%, transparent);
  overflow-wrap: anywhere; }
.link-row code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
.actions { display: flex; gap: 10px; }
.btn { border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 650; font-size: 15px; }
.btn.primary { background: var(--accent); color: var(--accent-text); flex: 1; }
.btn.ghost { background: color-mix(in srgb, var(--text) 8%, transparent); flex: 1; }
.btn.gold { background: var(--gold); color: #1d1500; }
.btn.small { padding: 8px 12px; font-size: 13px; flex: none; }
.btn.wide { width: 100%; margin-top: 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.note, .empty { color: var(--hint); font-size: 14px; line-height: 1.45; }
.empty { text-align: center; padding: 22px 12px; border: 1px dashed var(--line); border-radius: var(--radius); }

.list { display: grid; gap: 10px; }
@media (min-width: 820px) { .list { grid-template-columns: 1fr 1fr; } }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg-text { font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--hint); font-size: 12px; }
.msg-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 4px 9px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.tag { font-size: 11px; font-weight: 700; color: var(--danger); }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.comp { border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; min-height: 196px;
  border: 1px solid var(--line); position: relative; overflow: hidden; color: #f4f5ff; }
.comp .medal { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 28px;
  background: rgba(255,255,255,.14); backdrop-filter: blur(4px); }
.comp .name { font-weight: 750; font-size: 17px; }
.comp .tagline { font-size: 13px; line-height: 1.4; opacity: .86; flex: 1; }
.comp .lock { position: absolute; top: 12px; inset-inline-end: 12px; font-size: 11px; font-weight: 700; padding: 4px 8px;
  border-radius: 999px; background: rgba(0,0,0,.32); color: var(--gold); }
.comp .btn { background: rgba(255,255,255,.92); color: #141628; }
.g-aria { background: radial-gradient(140% 120% at 0% 0%, #6d5dfc, #2a1f5c 70%); }
.g-leo { background: radial-gradient(140% 120% at 0% 0%, #1fa2a6, #0f3440 70%); }
.g-elena { background: radial-gradient(140% 120% at 0% 0%, #b04a8c, #3a1638 70%); }
.g-marco { background: radial-gradient(140% 120% at 0% 0%, #c98b3a, #2f2a3b 70%); }
.g-maya { background: radial-gradient(140% 120% at 0% 0%, #ff7a7a, #4b2266 70%); }
.g-default { background: radial-gradient(140% 120% at 0% 0%, #5b6bd6, #1c2140 70%); }

.premium-card { text-align: center; padding: 26px 20px; max-width: 520px; margin-inline: auto;
  background: radial-gradient(120% 120% at 50% 0%, color-mix(in srgb, var(--gold) 20%, var(--surface)), var(--surface) 62%); }
.prem-mark { font-size: 40px; }
.premium-card h2 { margin-top: 8px; }
.features { list-style: none; padding: 0; margin: 16px 0 8px; text-align: start; display: grid; gap: 10px; }
.features li { padding: 11px 14px; border-radius: 12px; background: color-mix(in srgb, var(--bg) 60%, transparent); font-size: 15px; }

.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 9; }
.blocker { position: fixed; inset: 0; display: grid; place-items: center; padding: 32px; text-align: center;
  background: var(--bg); color: var(--hint); z-index: 10; }
