@font-face {
  font-family: "Manrope";
  src: url("/public/assets/fonts/manrope-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0400-052F, U+1C80-1C8A, U+20B4, U+2116, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Manrope";
  src: url("/public/assets/fonts/manrope-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
:root {
  color-scheme: dark;
  --bg: #090711;
  --surface: #120d20;
  --surface-2: #1a1230;
  --line: rgba(255,255,255,.09);
  --text: #f8f6ff;
  --muted: #aaa2bd;
  --purple: #8b5cf6;
  --pink: #f13f9b;
  --cyan: #2dd4d8;
  --green: #4ee88b;
  --danger: #ff4f87;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0,0,0,.34);
  font-family: "Manrope", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); min-height: 100%; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background: radial-gradient(circle at 50% -15%, #26104a 0, var(--bg) 40%);
  overflow-x: hidden;
}
button, input, textarea, select {
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}
button { color: inherit; }
.ambient { position: fixed; width: 280px; height: 280px; border-radius: 50%; filter: blur(100px); opacity: .1; pointer-events: none; }
.ambient-one { background: var(--pink); right: -180px; top: 15%; }
.ambient-two { background: var(--cyan); left: -190px; bottom: 10%; }
.app-shell { width: 100%; max-width: 480px; min-height: 100dvh; margin: 0 auto; position: relative; padding: max(20px, env(safe-area-inset-top)) 16px calc(92px + env(safe-area-inset-bottom)); }
.splash { min-height: 75vh; display: grid; place-items: center; align-content: center; gap: 14px; font-size: 24px; }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 17px; background: linear-gradient(145deg,var(--purple),var(--pink)); box-shadow: 0 0 30px rgba(139,92,246,.4); }
.brand-mark svg { width: 30px; height: 30px; fill: none; stroke: white; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.spinner { width: 24px; height: 24px; border: 2px solid var(--line); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.home { display: flex; flex-direction: column; min-height: calc(100dvh - 120px); }
.home-hero { padding: 42px 4px 28px; }
.eyebrow { color: var(--cyan); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; }
h1,h2,h3,p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(34px,10vw,48px); line-height: .98; letter-spacing: -.045em; }
h2 { margin-bottom: 8px; font-size: 26px; letter-spacing: -.025em; }
h3 { margin-bottom: 8px; font-size: 17px; }
.muted { color: var(--muted); line-height: 1.5; }
.panel, .question-card, .leader-row {
  background: linear-gradient(145deg, rgba(26,18,48,.96), rgba(16,11,29,.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel { padding: 18px; margin-bottom: 14px; }
.home-actions { margin-top: auto; }
.btn {
  min-height: 48px; border: 0; border-radius: 14px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 800; cursor: pointer; transition: transform .15s, opacity .15s, border-color .15s; text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { width: 100%; background: linear-gradient(110deg,var(--purple),var(--pink)); box-shadow: 0 10px 30px rgba(139,92,246,.25); }
.btn-secondary { width: 100%; background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.btn-ghost { background: transparent; border: 1px solid var(--line); min-height: 44px; }
.btn-danger { background: rgba(255,79,135,.12); border: 1px solid rgba(255,79,135,.35); color: #ff8db3; }
.btn-success { background: rgba(78,232,139,.12); border: 1px solid rgba(78,232,139,.34); color: var(--green); }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }
.icon-btn {
  width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.05);
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; -webkit-appearance: none; appearance: none;
}
.icon-btn svg, .btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 700; }
.input {
  width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 14px; background: rgba(5,3,11,.72); color: var(--text); padding: 12px 14px; outline: none; font-size: 16px;
}
.input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(139,92,246,.14); }
textarea.input { resize: vertical; min-height: 78px; }
.code-input { text-transform: uppercase; letter-spacing: .28em; text-align: center; font-size: 22px; font-weight: 900; }
.field-status { min-height: 18px; font-size: 13px; font-weight: 700; color: var(--muted); }
.field-status.checking { color: var(--cyan); }
.field-status.success { color: var(--green); }
.field-status.error { color: #ff8db3; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.page-head > div { min-width: 0; }
.page-head h2 { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.question-editor { padding: 14px; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 12px; background: rgba(255,255,255,.025); }
.editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.option-edit { display: flex; gap: 8px; margin-top: 8px; }
.option-edit .input { min-height: 44px; }
.options + .btn { margin-top: 16px; }
.event-hero { height: 215px; position: relative; border-radius: 24px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 14px; background: linear-gradient(135deg,#25124a,#0b1f2a); }
.event-hero img { width: 100%; height: 100%; object-fit: cover; }
.event-hero::after { content:""; position:absolute; inset:0; background:linear-gradient(180deg,rgba(5,3,10,.05),rgba(5,3,10,.9)); }
.hero-content { position:absolute; z-index:1; left:18px; right:18px; bottom:16px; }
.hero-content h1 { font-size: 27px; margin: 7px 0 0; }
.hero-top { position:absolute; z-index:2; top:12px; left:12px; right:12px; display:flex; justify-content:space-between; align-items:center; }
.chip { display:inline-flex; align-items:center; min-height:28px; padding:0 10px; border-radius:99px; background:rgba(8,5,15,.72); border:1px solid rgba(255,255,255,.13); backdrop-filter:blur(8px); font-size:12px; font-weight:800; }
.balance { color: var(--green); font-variant-numeric: tabular-nums; }
.tabs { display:flex; gap:7px; overflow:auto; padding:2px 1px 10px; scrollbar-width:none; }
.tab { border:1px solid var(--line); background:rgba(255,255,255,.04); border-radius:99px; min-height:44px; padding:0 13px; white-space:nowrap; font-weight:700; color:var(--muted); }
.tab.active { color:white; border-color:rgba(139,92,246,.55); background:rgba(139,92,246,.19); }
.question-card { padding:16px; margin-bottom:12px; }
.question-meta { display:flex; justify-content:space-between; align-items:center; gap:10px; color:var(--muted); font-size:12px; margin-bottom:10px; }
.status { font-weight:900; text-transform:uppercase; letter-spacing:.07em; }
.status-open { color:var(--green); }
.status-closed { color:#ffbc66; }
.status-settled { color:var(--cyan); }
.status-cancelled { color:#ff8db3; }
.question-title { font-size:17px; line-height:1.32; margin-bottom:14px; }
.option-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px 12px; padding:10px 0; border-top:1px solid var(--line); }
.option-name { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.option-data { font-size:13px; font-variant-numeric:tabular-nums; font-weight:800; }
.option-data strong { color:var(--cyan); margin-left:7px; }
.pool-track { grid-column:1/-1; height:3px; background:rgba(255,255,255,.06); border-radius:99px; overflow:hidden; }
.pool-fill { height:100%; background:linear-gradient(90deg,var(--purple),var(--pink)); border-radius:inherit; }
.own-bet { margin-top:12px; padding:10px 12px; border-radius:12px; color:var(--green); background:rgba(78,232,139,.08); font-size:13px; font-weight:700; }
.admin-actions { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin-top:14px; }
.empty { text-align:center; color:var(--muted); padding:34px 14px; border:1px dashed var(--line); border-radius:var(--radius); }
.bottom-nav { position:fixed; z-index:20; bottom:0; left:50%; transform:translateX(-50%); width:min(480px,100%); padding:9px 16px calc(9px + env(safe-area-inset-bottom)); background:rgba(9,7,17,.86); border-top:1px solid var(--line); backdrop-filter:blur(20px); display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.nav-item { min-height:50px; border:0; border-radius:14px; background:transparent; color:var(--muted); display:flex; align-items:center; justify-content:center; gap:8px; font-weight:800; }
.nav-item.active { color:white; background:rgba(139,92,246,.16); }
.nav-item svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2; }
.leader-row { min-height:66px; padding:12px 14px; margin-bottom:9px; display:grid; grid-template-columns:36px 1fr auto; align-items:center; gap:10px; }
.leader-row.current { border-color:rgba(45,212,216,.5); box-shadow:0 0 24px rgba(45,212,216,.08); }
.rank { width:32px; height:32px; display:grid; place-items:center; border-radius:50%; background:rgba(255,255,255,.06); font-weight:900; }
.leader-row:nth-child(1) .rank { background:#e6b93c; color:#241900; }
.leader-row:nth-child(2) .rank { background:#b8c1ce; color:#19202a; }
.leader-row:nth-child(3) .rank { background:#ba7547; color:#251005; }
.modal-backdrop { position:fixed; z-index:50; inset:0; background:rgba(3,2,7,.72); backdrop-filter:blur(8px); display:flex; align-items:flex-end; justify-content:center; }
.sheet { width:min(480px,100%); max-height:92dvh; overflow:auto; border:1px solid var(--line); border-bottom:0; border-radius:24px 24px 0 0; background:#120d20; padding:12px 18px calc(20px + env(safe-area-inset-bottom)); box-shadow:0 -20px 60px rgba(0,0,0,.45); animation:rise .22s ease-out; }
@keyframes rise { from { transform:translateY(24px); opacity:0; } }
.sheet-handle { width:42px; height:4px; border-radius:99px; background:rgba(255,255,255,.18); margin:0 auto 18px; }
.choice { width:100%; min-height:52px; border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.035); padding:10px 13px; margin-bottom:8px; display:flex; justify-content:space-between; align-items:center; text-align:left; }
.choice.selected { border-color:var(--purple); background:rgba(139,92,246,.15); box-shadow:0 0 0 2px rgba(139,92,246,.09); }
.quick-row { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:14px; }
.quick { min-height:44px; border:1px solid var(--line); border-radius:11px; background:rgba(255,255,255,.04); font-weight:700; }
.toast { position:fixed; z-index:100; left:50%; bottom:calc(88px + env(safe-area-inset-bottom)); transform:translate(-50%,15px); width:min(420px,calc(100% - 32px)); padding:12px 14px; border-radius:14px; background:#211735; border:1px solid var(--line); box-shadow:var(--shadow); opacity:0; pointer-events:none; transition:.2s; text-align:center; font-weight:700; }
.toast.show { opacity:1; transform:translate(-50%,0); }
.connection { width:8px; height:8px; border-radius:50%; background:#ffb255; box-shadow:0 0 9px currentColor; }
.connection.online { background:var(--green); }
.copy-grid { display:grid; grid-template-columns:1fr auto; gap:8px; margin-bottom:10px; }
.copy-grid .input { min-width:0; }
.qr-card { margin:16px 0; padding:16px; border:1px solid var(--line); border-radius:16px; background:rgba(255,255,255,.03); text-align:center; }
.qr-card img { display:block; width:min(220px,100%); height:auto; aspect-ratio:1; margin:0 auto 10px; padding:8px; border-radius:14px; background:#fff; object-fit:contain; }
.qr-card p { margin:0 0 14px; color:var(--muted); font-size:13px; }
.qr-card .btn-row .icon-btn { height:48px; width:48px; }
.section-title { display:flex; justify-content:space-between; align-items:center; margin:22px 0 12px; }
.section-title h3 { margin:0; }
@media (min-width: 700px) {
  .app-shell { border-inline:1px solid rgba(255,255,255,.04); box-shadow:0 0 80px rgba(0,0,0,.28); }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration:.01ms!important; transition-duration:.01ms!important; }
}
