/* Revium Mini App. Tokens: see docs/DESIGN.md. Dark only. */
@font-face { font-family: "Unbounded"; font-weight: 800; font-display: swap; src: url("fonts/unbounded-cyrillic-800.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-weight: 800; font-display: swap; src: url("fonts/unbounded-latin-800.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  color-scheme: dark;
  --bg: #000000; --surf: #141414; --surf2: #1E1E1E; --line: #232323;
  --text: #FFFFFF; --hint: #8C8C8C; --primary: #FFFFFF; --on-primary: #000000;
  --up: #4CC38A; --down: #EF6B6B;
  --glass: rgba(28, 28, 28, .62); --glass-strong: rgba(34, 34, 34, .9);
  --glass-line: rgba(255, 255, 255, .08); --glass-hi: rgba(255, 255, 255, .12);
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --display: "Unbounded", var(--ui);
  --r-btn: 16px; --r-card: 24px; --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--ui); font-size: 15px; }
a { color: var(--text); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.defs { position: absolute; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.s { width: 17px; height: 17px; }
svg.i.big { width: 36px; height: 36px; stroke-width: 1.5; color: var(--hint); }

.app { position: fixed; inset: 0; overflow: hidden; }
.glass { background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); border: 1px solid var(--glass-line); box-shadow: inset 0 1px 0 var(--glass-hi), 0 10px 30px rgba(0,0,0,.5); }

.screen { position: absolute; inset: 0; overflow-y: auto; padding: calc(var(--tg-content-safe-area-inset-top, 0px) + 18px) 20px calc(env(safe-area-inset-bottom, 0px) + 120px); display: flex; flex-direction: column; gap: 30px; transition: opacity .22s var(--ease), transform .22s var(--ease); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.screen::-webkit-scrollbar { display: none; }
.screen[hidden] { display: flex !important; opacity: 0; transform: translateX(14px); pointer-events: none; visibility: hidden; }

.hero { display: grid; gap: 6px; margin: -18px -20px 0; padding: 0 20px; }
.hero canvas { width: 100%; aspect-ratio: 1 / .78; display: block; }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-top: -26px; }
.hero h1 { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1.08; letter-spacing: -.02em; margin: 0; }
.hero p { margin: 8px 0 0; color: var(--hint); line-height: 1.4; max-width: 22ch; }
.play { width: 84px; height: 84px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; flex: none; transition: transform .15s var(--ease); }
.play:active { transform: scale(.94); }
.play svg.i { width: 34px; height: 34px; stroke-width: 2.4; }

.search { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-radius: var(--r-btn); background: var(--surf); color: var(--hint); margin: 0; }
.search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; color: var(--text); font: inherit; font-size: 16px; }
.search input::placeholder { color: var(--hint); }
.notfound { background: var(--surf); border-radius: var(--r-card); padding: 18px; display: grid; gap: 8px; }
.notfound span { color: var(--hint); line-height: 1.45; }
.notfound .btn { margin-top: 6px; }

.sec { display: grid; gap: 14px; }
.sh h2 { margin: 0; font-size: 29px; font-weight: 700; letter-spacing: -.02em; }
.sub { color: var(--hint); font-size: 14px; margin-top: -10px; }
.cards { display: grid; gap: 10px; }
.cell { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; min-width: 0; }
.cell.card { background: var(--surf); border-radius: var(--r-card); padding: 14px 18px; transition: background .15s var(--ease); }
.cell.card:active { background: var(--surf2); }
.grow { flex: 1; min-width: 0; display: grid; gap: 3px; }
.t { font-size: 17px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d { font-size: 14.5px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { color: var(--hint); font-size: 14px; flex: none; font-variant-numeric: tabular-nums; }
.meta.good { color: var(--up); }
.meta.bad { color: var(--down); }
.circ { width: 58px; height: 58px; border-radius: 50%; background: var(--surf2); display: grid; place-items: center; flex: none; }
.rank { display: grid; gap: 18px; }
.rank .cell { gap: 16px; }
.rank .n { width: 18px; font-weight: 700; font-size: 17px; text-align: center; font-variant-numeric: tabular-nums; }
.skel { height: 86px; border-radius: var(--r-card); background: linear-gradient(90deg, var(--surf) 0%, var(--surf2) 50%, var(--surf) 100%); background-size: 200% 100%; animation: sk 1.2s infinite linear; }
@keyframes sk { to { background-position: -200% 0; } }
.hint-empty { color: var(--hint); line-height: 1.45; padding: 4px 6px; }

.ava { width: 58px; height: 58px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 22px; }
.ava.xl { width: 104px; height: 104px; font-size: 40px; }
.ava.m { width: 84px; height: 84px; font-size: 32px; }
.g0 { background: linear-gradient(135deg, #3a3a3a, #111); }
.g1 { background: linear-gradient(135deg, #5b5b5b, #1b1b1b); }
.g2 { background: linear-gradient(135deg, #2b2b2b, #0c0c0c); box-shadow: inset 0 0 0 1px #2f2f2f; }

.more { position: absolute; top: calc(var(--tg-content-safe-area-inset-top, 0px) + 12px); right: 14px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surf); }
.ph { display: grid; justify-items: center; text-align: center; gap: 6px; padding-top: 10px; }
.ph .nm { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -.02em; margin-top: 10px; overflow-wrap: anywhere; }
.ph .un { color: var(--hint); font-size: 15px; display: flex; gap: 6px; align-items: center; }
.ph .un button { color: var(--hint); display: inline-flex; }
.votes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vote { height: 92px; border-radius: var(--r-card); background: var(--surf); display: grid; place-items: center; align-content: center; gap: 6px; border: 1.5px solid transparent; transition: background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease); }
.vote:active { transform: scale(.97); }
.vote svg.i { width: 28px; height: 28px; }
.vote .n { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vote.up[aria-pressed="true"] { border-color: var(--up); color: var(--up); }
.vote.down[aria-pressed="true"] { border-color: var(--down); color: var(--down); }
.vote[aria-pressed="true"] .n { color: var(--text); }
.votes.self .vote { display: none; }
.stat { background: var(--surf); border-radius: var(--r-card); padding: 18px; display: grid; gap: 12px; }
.bar { height: 6px; border-radius: 3px; background: var(--down); overflow: hidden; }
.bar.none { background: var(--surf2); }
.bar i { display: block; height: 100%; width: 0; background: var(--up); transition: width .3s var(--ease); }
.nums { display: flex; justify-content: space-between; gap: 8px; color: var(--hint); font-size: 14px; font-variant-numeric: tabular-nums; }
.nums b { color: var(--text); }
.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 18px 0 6px; }
.empty b { font-size: 16px; }
.empty span { color: var(--hint); font-size: 14px; line-height: 1.45; }
.gate { margin: auto 0; }
.foot { color: var(--hint); font-size: 13.5px; text-align: center; line-height: 1.45; }

.me { background: var(--surf); border-radius: var(--r-card); padding: 20px; display: grid; gap: 16px; }
.me .who { display: flex; gap: 16px; align-items: center; min-width: 0; }
.me .nm { font-size: 21px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .d { display: flex; align-items: center; gap: 6px; }
.btn { height: 52px; border-radius: var(--r-btn); background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: 17px; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; transition: transform .15s var(--ease); }
.btn:active { transform: scale(.98); }
.btn.sec { background: var(--surf2); color: var(--text); }
.glabel { color: var(--hint); font-size: 15px; font-weight: 500; padding: 0 6px; margin-bottom: -6px; }
.list { background: var(--surf); border-radius: var(--r-card); overflow: hidden; }
.li { width: 100%; display: flex; align-items: center; gap: 16px; padding: 10px 18px; min-height: 64px; text-align: left; }
.li .t { font-size: 17px; }
.sw { width: 51px; height: 31px; border-radius: 999px; background: var(--surf2); position: relative; flex: none; transition: background .2s var(--ease); }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; transition: transform .22s var(--ease), background .2s; }
.sw[aria-checked="true"] { background: #fff; }
.sw[aria-checked="true"]::after { transform: translateX(20px); background: #000; }

.tabs { position: absolute; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); display: flex; align-items: center; gap: 2px; padding: 6px; border-radius: 999px; }
.tabs[hidden] { display: none; }
.tab { width: 70px; height: 52px; border-radius: 999px; display: grid; place-items: center; color: var(--hint); transition: color .2s var(--ease), background .2s var(--ease); }
.tab svg.i { width: 26px; height: 26px; }
.tab[aria-selected="true"] { color: var(--text); background: rgba(255,255,255,.09); }
.tsep { width: 1px; height: 26px; background: var(--glass-line); margin: 0 4px; }

.scrim { position: absolute; inset: 0; z-index: 40; background: rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .18s var(--ease); }
.scrim.on { opacity: 1; pointer-events: auto; }
.menu { position: absolute; z-index: 41; right: 14px; top: calc(var(--tg-content-safe-area-inset-top, 0px) + 58px); width: 250px; border-radius: 22px; padding: 6px; background: var(--glass-strong); transform-origin: top right; transform: scale(.85); opacity: 0; pointer-events: none; transition: transform .2s var(--ease), opacity .18s var(--ease); }
.menu.on { transform: scale(1); opacity: 1; pointer-events: auto; }
.mi { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 14px; font-size: 16px; }
.mi:active { background: rgba(255,255,255,.08); }
.mi.danger { color: var(--down); }
.toast { position: absolute; z-index: 50; left: 50%; top: calc(var(--tg-content-safe-area-inset-top, 0px) + 14px); transform: translate(-50%, -12px); opacity: 0; padding: 11px 18px; border-radius: 999px; font-size: 14.5px; font-weight: 500; max-width: calc(100% - 32px); text-align: center; pointer-events: none; transition: transform .25s var(--ease), opacity .2s var(--ease); }
.toast.on { transform: translate(-50%, 0); opacity: 1; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
