* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #0b1220;
  --bg2: #111a2e;
  --card: #16213a;
  --card2: #1c2a4a;
  --line: #27355c;
  --green: #22c55e;
  --green-d: #15803d;
  --gold: #fbbf24;
  --red: #ef4444;
  --text: #eef2ff;
  --muted: #8fa0c5;
  --radius: 16px;
}
html { font-family: 'Cairo', system-ui, sans-serif; }
body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(34,197,94,.18), transparent),
    repeating-linear-gradient(90deg, transparent 0 60px, rgba(255,255,255,.012) 60px 120px);
}
#app { max-width: 480px; margin: 0 auto; padding: 16px 16px 80px; }

.brand { text-align: center; padding: 28px 0 8px; }
.brand .ball { font-size: 52px; display: block; animation: bounce 2.2s infinite ease-in-out; }
@keyframes bounce { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-10px) } }
.brand h1 { font-size: 42px; font-weight: 900; letter-spacing: 1px; }
.brand h1 span { color: var(--green); }
.brand p { color: var(--muted); font-weight: 600; margin-top: 2px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 16px;
}
.card h2 { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.card h2 .num { color: var(--green); }

.btn {
  display: block; width: 100%;
  background: var(--green); color: #05240f;
  border: none; border-radius: 14px;
  padding: 15px; font-family: inherit;
  font-size: 18px; font-weight: 800;
  cursor: pointer; text-align: center;
  text-decoration: none;
  transition: transform .08s, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.btn.wa { background: #25d366; color: #04331a; }
.btn.small { padding: 9px 14px; font-size: 14px; width: auto; display: inline-block; }
.btn.danger { background: var(--red); color: #fff; }
.btn.gold { background: var(--gold); color: #3a2a00; }
.btn:disabled { opacity: .45; cursor: default; }

label.f { display: block; margin-top: 14px; font-weight: 700; font-size: 14px; color: var(--muted); }
input, select {
  width: 100%; margin-top: 6px;
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; font-family: inherit; font-size: 16px; font-weight: 600;
}
input:focus, select:focus { outline: 2px solid var(--green-d); border-color: var(--green); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.switch-row b { font-size: 15px; }
.switch-row small { display: block; color: var(--muted); font-weight: 600; }
.switch { position: relative; width: 52px; height: 30px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; margin: 0; }
.slider { position: absolute; inset: 0; background: var(--line); border-radius: 30px; transition: .2s; }
.slider:before { content: ""; position: absolute; width: 24px; height: 24px; border-radius: 50%; background: #fff; top: 3px; right: 3px; transition: .2s; }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider:before { transform: translateX(-22px); }

.match-head { text-align: center; padding-top: 18px; }
.match-head .venue { font-size: 26px; font-weight: 900; }
.match-head .when { color: var(--muted); font-weight: 700; margin-top: 4px; font-size: 15px; }
.match-head .price { display: inline-block; margin-top: 10px; background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; font-weight: 800; font-size: 14px; }
.match-head .price b { color: var(--gold); }

.progress-wrap { margin-top: 14px; }
.progress-bar { height: 12px; background: var(--bg2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--green-d), var(--green)); border-radius: 999px; transition: width .4s; }
.progress-fill.full { background: linear-gradient(90deg, #b45309, var(--gold)); }
.progress-txt { text-align: center; font-weight: 800; margin-top: 8px; font-size: 15px; }
.progress-txt .ok { color: var(--green); }
.progress-txt .warn { color: var(--gold); }

.rsvp-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.rsvp-btns .btn { font-size: 20px; padding: 18px; }
.btn-in { background: var(--green); color: #05240f; }
.btn-out { background: var(--card2); color: var(--muted); border: 1px solid var(--line); }
.btn-in.active { outline: 3px solid #fff; }
.btn-out.active { outline: 3px solid var(--red); color: var(--text); }
.your-state { text-align: center; margin-top: 10px; font-weight: 700; color: var(--muted); font-size: 14px; }
.your-state b { color: var(--green); }

.plist { list-style: none; margin-top: 8px; }
.plist li {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 12px;
  background: var(--bg2); border: 1px solid var(--line);
  margin-top: 8px; font-weight: 700;
}
.plist li .idx { width: 28px; height: 28px; border-radius: 50%; background: var(--card2); display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); flex-shrink: 0; }
.plist li .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist li .me { font-size: 11px; background: var(--green-d); color: #fff; border-radius: 999px; padding: 2px 8px; flex-shrink: 0; }
.plist li.wait .idx { background: #3a2f10; color: var(--gold); }
.badge { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 3px 10px; flex-shrink: 0; }
.badge.paid { background: rgba(34,197,94,.15); color: var(--green); border: 1px solid var(--green-d); }
.badge.unpaid { background: rgba(239,68,68,.1); color: #fca5a5; border: 1px solid #7f1d1d; }
.pay-toggle { background: none; border: none; cursor: pointer; font-family: inherit; }
.subtle { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 8px; line-height: 1.7; }

.money-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 10px; text-align: center; }
.money-grid .cell { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 6px; }
.money-grid .num { font-size: 20px; font-weight: 900; }
.money-grid .lbl { font-size: 12px; color: var(--muted); font-weight: 700; }
.money-grid .g { color: var(--green); }
.money-grid .y { color: var(--gold); }

.vote-bar { height: 8px; border-radius: 999px; background: var(--bg2); overflow: hidden; margin-top: 6px; }
.vote-fill { height: 100%; background: var(--gold); border-radius: 999px; }
.vote-row { margin-top: 10px; }
.vote-row .top { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; }
.vote-btn { background: var(--card2); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 6px 14px; font-family: inherit; font-weight: 800; font-size: 13px; cursor: pointer; flex-shrink: 0; }
.vote-btn:active { transform: scale(.95); }
.vote-btn.voted { background: var(--gold); color: #3a2a00; border-color: var(--gold); }
.crown { color: var(--gold); }

.admin { border-color: var(--gold); background: linear-gradient(180deg, rgba(251,191,36,.07), transparent 40%), var(--card); }
.admin h2 { color: var(--gold); }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.admin-note { background: rgba(251,191,36,.1); border: 1px dashed var(--gold); border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 700; color: var(--gold); margin-top: 12px; line-height: 1.7; }

.share-box { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 700; direction: ltr; text-align: left; word-break: break-all; color: var(--muted); margin-top: 10px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }

.toast {
  position: fixed; bottom: 24px; right: 50%; transform: translateX(50%);
  background: var(--green-d); color: #fff; font-weight: 800;
  padding: 12px 22px; border-radius: 999px; font-size: 15px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5); z-index: 99;
  animation: pop .25s;
  max-width: 90vw; text-align: center;
}
.toast.err { background: var(--red); }
@keyframes pop { from { transform: translateX(50%) scale(.8); opacity: 0 } }

.center { text-align: center; }
.muted { color: var(--muted); }
.mt { margin-top: 16px; }
.spinner { text-align: center; padding: 60px 0; font-size: 30px; animation: spin 1s infinite linear; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg) } }
.features { margin-top: 20px; }
.features li { list-style: none; display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-weight: 700; font-size: 15px; line-height: 1.7; }
.features li .ic { font-size: 20px; flex-shrink: 0; }
.footer { text-align: center; color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 40px; }
details { margin-top: 8px; }
summary { cursor: pointer; font-weight: 800; color: var(--muted); font-size: 14px; padding: 6px 0; }
.finished-banner { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; font-weight: 800; margin-top: 12px; }
