:root {
  --bg: #0a0c11; --bg2: #10131a; --card: #151922; --card2: #1b2030; --line: #262c3b;
  --text: #eef1f7; --muted: #8f98ad; --accent: #ff6b1f; --accent2: #ffb020; --cyan: #29d3f0;
  --ok: #2fd27a; --text-on-accent: #170a02; --bad: #ff4d5e; --warn: #ffb020; --radius: 14px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; max-width: 100%; }
body { overflow-x: hidden; margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); font-weight: 750; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.gap { gap: 10px; }
.grow { flex: 1; }
.mt { margin-top: 16px; } .mt2 { margin-top: 28px; } .mb { margin-bottom: 16px; }
.hidden { display: none !important; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font: inherit; font-weight: 650;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #170a02; padding: 10px 18px; border-radius: 10px; transition: transform .12s, filter .12s; text-decoration: none; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--card2); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.ok { background: var(--ok); color: #04170c; }
.btn.sm { padding: 6px 12px; font-size: .85rem; border-radius: 8px; }
.btn.block { width: 100%; }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: 6px 10px; border-radius: 8px; }
.icon-btn:hover { background: var(--card2); color: var(--text); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* forms */
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
input, select, textarea { width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
.field { margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: .95rem; margin-bottom: 14px; }
.check input { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 0 14px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.err { color: var(--bad); font-size: .9rem; min-height: 1.2em; margin: 6px 0; }

/* cards & chips */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card.flat { padding: 0; overflow: hidden; }
.chip { display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--card2); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.chip.upcoming { background: rgba(41, 211, 240, .14); color: var(--cyan); }
.chip.ongoing { background: rgba(47, 210, 122, .15); color: var(--ok); }
.chip.completed, .chip.approved, .chip.complete { background: rgba(143, 152, 173, .15); color: var(--muted); }
.chip.approved, .chip.complete { background: rgba(47, 210, 122, .15); color: var(--ok); }
.chip.cancelled, .chip.rejected { background: rgba(255, 77, 94, .15); color: var(--bad); }
.chip.pending { background: rgba(255, 176, 32, .15); color: var(--warn); }
.chip.type { background: rgba(255, 107, 31, .14); color: var(--accent); }
.pos { color: var(--ok); } .neg { color: var(--bad); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
td.wrap { white-space: normal; }
th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; background: var(--bg2); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }
td .btn + .btn { margin-left: 6px; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }

/* game tile */
.gtile { border-radius: 14px; object-fit: cover; display: grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h), 70%, 42%), hsl(calc(var(--h) + 40), 75%, 28%)); flex: none; }
.gtile.md { width: 52px; height: 52px; font-size: 1.1rem; }
.gtile.lg { width: 100%; aspect-ratio: 16/10; font-size: 2.2rem; border-radius: 0; }
.gtile.sm { width: 34px; height: 34px; font-size: .8rem; border-radius: 9px; }

/* modal + toast */
.modal-wrap { position: fixed; inset: 0; background: rgba(4, 6, 10, .7); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; z-index: 100; overflow-y: auto; }
.modal { width: min(480px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 1; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 20px; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 200; max-width: calc(100vw - 32px); }
.toast { background: var(--card2); border: 1px solid var(--line); border-left: 4px solid var(--ok); padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: in .2s ease-out; }
.toast.error { border-left-color: var(--bad); }
.toast.out { opacity: 0; transition: opacity .4s; }
@keyframes in { from { transform: translateY(8px); opacity: 0; } }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =================== website =================== */
.announce { background: linear-gradient(90deg, rgba(255, 107, 31, .18), rgba(255, 176, 32, .12)); border-bottom: 1px solid var(--line); text-align: center; padding: 8px 16px; font-size: .9rem; }
.nav { position: sticky; top: 0; z-index: 50; background: rgba(10, 12, 17, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .container { display: flex; align-items: center; gap: 22px; height: 62px; }
.brand { font-weight: 850; font-size: 1.25rem; color: var(--text); letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand .bname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.brand .logo { flex: none; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--accent2)); display: grid; place-items: center; color: #170a02; font-size: .95rem; }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-links a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: .95rem; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--card2); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 6px; flex: none; }
.wallet-chip { background: var(--card2); border: 1px solid var(--line); color: var(--text); padding: 7px 12px; border-radius: 999px; font-weight: 700; font-size: .9rem; }
.wallet-chip:hover { text-decoration: none; border-color: var(--accent); }
main { min-height: 70vh; padding: 28px 0 60px; overflow-x: hidden; overflow-wrap: break-word; }
@supports (overflow: clip) { html, body { overflow-x: clip; } main { overflow-x: clip; } }

.hero { position: relative; padding: 56px 0 44px; }
.hero::before { content: ""; position: absolute; inset: -40% 0 auto auto; width: min(620px, 100%); aspect-ratio: 1; background: radial-gradient(circle, rgba(255, 107, 31, .28), transparent 65%); pointer-events: none; }
.hero::after { content: ""; position: absolute; inset: auto auto -50% 0; width: min(520px, 100%); aspect-ratio: 1; background: radial-gradient(circle, rgba(41, 211, 240, .14), transparent 65%); pointer-events: none; }
.hero .container { position: relative; z-index: 1; }
.hero h1 .grad { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 580px; margin-bottom: 26px; }
.hero-stats { display: flex; gap: 28px; margin-top: 34px; flex-wrap: wrap; }
.hero-stats b { display: block; font-size: 1.6rem; }
.section { margin-top: 48px; }
.section-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 18px; gap: 10px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }

.grid { display: grid; gap: 16px; }
.grid.games { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grid.matches { grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); }
.grid.features { grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); }
.game-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--text); transition: transform .15s, border-color .15s; display: block; }
.game-card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.game-card .body { padding: 14px 16px; }
.game-card b { display: block; }
.mcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; color: var(--text); transition: transform .15s, border-color .15s; position: relative; }
.mcard:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.mcard .top { display: flex; gap: 12px; align-items: center; }
.mcard h3 { margin: 0; font-size: 1.02rem; }
.mcard .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--bg2); border-radius: 10px; padding: 10px; text-align: center; }
.mcard .stats b { display: block; font-size: .98rem; }
.mcard .stats span { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pin { position: absolute; top: 10px; right: 12px; font-size: .8rem; }
.bar { height: 6px; border-radius: 99px; background: var(--bg2); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.feature .ico { font-size: 1.5rem; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: .92rem; margin: 0; }
.steps { counter-reset: s; display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: s; display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.steps li::before { content: counter(s); background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #170a02; font-weight: 800; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.download { background: linear-gradient(135deg, rgba(255, 107, 31, .18), rgba(41, 211, 240, .1)); border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: flex; gap: 20px; justify-content: space-between; align-items: center; flex-wrap: wrap; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tab { background: var(--card); border: 1px solid var(--line); color: var(--muted); padding: 8px 16px; border-radius: 999px; font-weight: 650; cursor: pointer; font-size: .92rem; }
.tab.active { background: var(--accent); border-color: var(--accent); color: #170a02; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.filters select { width: auto; min-width: 160px; }

.match-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.match-hero .gtile { width: 76px; height: 76px; font-size: 1.6rem; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; margin-bottom: 20px; }
.info-grid .cell { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.info-grid .cell span { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.info-grid .cell b { font-size: 1.05rem; }
.two-col > * { min-width: 0; }
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.room-box { border: 1px dashed var(--ok); background: rgba(47, 210, 122, .08); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.room-box .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.15rem; font-weight: 700; letter-spacing: .04em; user-select: all; }
.video { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: #000; margin-bottom: 16px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.team { background: var(--bg2); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: .92rem; }
.team b { color: var(--accent2); margin-right: 6px; }
.pre { white-space: pre-wrap; }
.auth-card { width: min(430px, 100%); margin: 30px auto; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat span { display: block; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.stat b { font-size: 1.5rem; }
.rank { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--card2); font-weight: 800; font-size: .85rem; }
.rank.r1 { background: #ffd34d; color: #3a2a00; } .rank.r2 { background: #cfd6e4; color: #1a2030; } .rank.r3 { background: #d08a57; color: #2c1405; }
.prose { max-width: 760px; } .prose h2 { margin-top: 1.2em; } .prose li { margin-bottom: .4em; }
footer { border-top: 1px solid var(--line); background: var(--bg2); padding: 32px 0; color: var(--muted); font-size: .9rem; }
footer .links { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.maint { text-align: center; padding: 18vh 16px; }
.maint h1 { font-size: 2.4rem; }

@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav .container { gap: 10px; }
  .nav .brand { flex: 1; }
}
@media (max-width: 520px) {
  th, td { padding: 9px 10px; }
  .hero { padding-top: 32px; }
  .hero-stats { gap: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }


/* ---- additions for the PHP version ---- */
.logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; display: block; }
.slider { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--card); margin-bottom: 8px; aspect-ratio: 21/8; }
.slider .slide { position: absolute; inset: 0; opacity: 0; transition: opacity .5s; display: block; }
.slider .slide.on { opacity: 1; z-index: 1; }
.slider img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slider .dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; z-index: 2; }
.slider .dots button { width: 9px; height: 9px; border-radius: 50%; border: 0; background: rgba(255,255,255,.45); cursor: pointer; padding: 0; }
.slider .dots button.on { background: var(--accent); }
.slider .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 18px 14px; background: linear-gradient(transparent, rgba(0,0,0,.7)); font-weight: 700; }
.hero-img { max-width: 420px; width: 100%; border-radius: 16px; }
.hero-flex { display: flex; gap: 32px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.notice { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.notice b { display: block; }
.ticket-reply { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--ok); background: var(--bg2); border-radius: 8px; }
.pay-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: var(--bg2); }
.pay-card.sel { border-color: var(--accent); }
.qr { max-width: 180px; border-radius: 10px; background: #fff; padding: 6px; margin: 8px 0; display: block; }
.tut { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); }
.tut:hover { border-color: var(--accent); text-decoration: none; }
.tut .play { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--text-on-accent); display: grid; place-items: center; flex: none; }
.socials { display: flex; gap: 14px; flex-wrap: wrap; }
.wa { background: #25d366; color: #04170c; }
.tag-test { background: rgba(255,176,32,.18); color: var(--warn); }
@media (max-width: 520px) { .slider { aspect-ratio: 16/9; } }


/* =====================================================================
   v2 — app feel, avatars, profile, leaderboard podium, Gen-Z motion
   ===================================================================== */
html { -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior-y: none; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 255, 107, 31), .2); }
.btn, .tab { position: relative; overflow: hidden; }
.btn { box-shadow: 0 8px 22px -10px rgba(var(--accent-rgb, 255, 107, 31), .8); }
.btn.ghost, .btn.danger, .btn.ok, .btn.wa { box-shadow: none; }
.btn:active, .tab:active { transform: scale(.96); }
.btn::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent); transform: skewX(-20deg); transition: left .55s; pointer-events: none; }
.btn:hover::after { left: 130%; }
.btn.ghost::after { display: none; }
.btn.lg { padding: 14px 22px; font-size: 1.05rem; border-radius: 14px; }
.ripple { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .38); transform: scale(0); animation: ripple .6s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* ---------- entrances ---------- */
.page-in { animation: pageIn .5s cubic-bezier(.2, .8, .2, 1) backwards; }
@keyframes pageIn { from { opacity: 0; transform: translateY(16px); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
.stagger > * { animation: popIn .55s cubic-bezier(.2, .9, .3, 1.2) backwards; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes popIn { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.skel { border-radius: 14px; background: linear-gradient(90deg, var(--card) 25%, var(--card2) 37%, var(--card) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skel-wrap { display: grid; gap: 16px; padding-top: 8px; }
.skel-wrap .t { height: 34px; width: 42%; } .skel-wrap .g { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; } .skel-wrap .g .skel { height: 168px; }

/* ---------- hero ---------- */
.hero h1 .grad { background-size: 220% auto; animation: gradMove 5s linear infinite; background-image: linear-gradient(90deg, var(--accent), var(--accent2), #ff4d9d, var(--accent)); }
@keyframes gradMove { to { background-position: 220% center; } }
.orbs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, transparent 75%); mask-image: radial-gradient(ellipse at center, #000 35%, transparent 75%); }
.orbs i { position: absolute; border-radius: 50%; filter: blur(46px); opacity: .5; animation: floaty 9s ease-in-out infinite; }
.orbs i:nth-child(1) { width: 220px; height: 220px; background: var(--accent); right: 8%; top: 4%; }
.orbs i:nth-child(2) { width: 180px; height: 180px; background: #29d3f0; left: 2%; bottom: 0; animation-delay: -3s; opacity: .32; }
.orbs i:nth-child(3) { width: 140px; height: 140px; background: #ff4d9d; right: 34%; bottom: 8%; animation-delay: -6s; opacity: .28; }
@keyframes floaty { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(18px, -26px) scale(1.12); } }
.hero-stats b { font-size: 1.9rem; font-variant-numeric: tabular-nums; }
.announce.marq { overflow: hidden; white-space: nowrap; padding: 8px 0; }
.announce.marq span { display: inline-block; padding-left: 100%; animation: marquee 22s linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- cards ---------- */
.glow { position: relative; overflow: hidden; }
.glow::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(240px circle at var(--mx, 50%) var(--my, -40%), rgba(var(--accent-rgb, 255, 107, 31), .2), transparent 62%); opacity: 0; transition: opacity .25s; pointer-events: none; }
.glow:hover::before { opacity: 1; }
.mcard:active, .game-card:active, .mrow:active { transform: scale(.985); }
.chip.ongoing::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: 1px; animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 210, 122, .7); } 100% { box-shadow: 0 0 0 9px rgba(47, 210, 122, 0); } }
.bar i { transform-origin: left; animation: grow .9s cubic-bezier(.2, .8, .2, 1) backwards; }
@keyframes grow { from { transform: scaleX(0); } }
.stat b, .info-grid .cell b { font-variant-numeric: tabular-nums; }
.stat { transition: transform .2s, border-color .2s; }
.stat:hover { transform: translateY(-2px); border-color: var(--accent); }
.toast { animation: toastIn .45s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes toastIn { from { opacity: 0; transform: translateY(24px) scale(.9); } }
.modal { animation: modalIn .35s cubic-bezier(.3, 1.3, .5, 1); }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.94); } }
.fx-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 300; }

/* ---------- avatars ---------- */
.av { display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; flex: none; font-weight: 800; color: #fff; user-select: none;
  background: linear-gradient(135deg, hsl(var(--h, 20), 80%, 52%), hsl(calc(var(--h, 20) + 50), 85%, 36%)); }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av.sm { width: 30px; height: 30px; font-size: .9rem; } .av.md { width: 44px; height: 44px; font-size: 1.3rem; }
.av.lg { width: 64px; height: 64px; font-size: 1.9rem; } .av.xl { width: 96px; height: 96px; font-size: 2.8rem; }
.av-ring { position: relative; display: inline-grid; place-items: center; padding: 4px; border-radius: 50%; }
.av-ring::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--accent), var(--accent2), #ff4d9d, var(--cyan), var(--accent)); animation: spin 4s linear infinite; }
.av-ring .av { position: relative; border: 3px solid var(--card); }
.av-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; justify-items: center; }
.av-pick { position: relative; overflow: hidden; background: none; border: 2px solid transparent; border-radius: 50%; padding: 2px; cursor: pointer; transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.av-pick:hover { transform: scale(1.1) rotate(-4deg); } .av-pick.sel { border-color: var(--accent); }
.nav-right .av-btn { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: .85rem; }
.nav-right .av-btn:hover { text-decoration: none; border-color: var(--accent); }

/* ---------- profile ---------- */
.chip.lvlchip { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--text-on-accent); }
.p-hero { position: relative; overflow: hidden; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 24px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb, 255, 107, 31), .2), rgba(41, 211, 240, .1) 60%, rgba(255, 77, 157, .12)); border: 1px solid var(--line); border-radius: 20px; margin-bottom: 18px; }
.p-hero .who { flex: 1; min-width: 180px; } .p-hero h2 { margin: 0 0 2px; } .p-hero .chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.lvl { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; max-width: 320px; } .lvl i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--ok)); }
.edit-av { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--card); background: var(--accent); color: var(--text-on-accent); display: grid; place-items: center; cursor: pointer; font-size: .85rem; z-index: 2; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr)); gap: 10px; margin-bottom: 18px; }
.mrow { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; color: var(--text); margin-bottom: 10px; transition: transform .15s, border-color .15s; }
.mrow:hover { border-color: var(--accent); text-decoration: none; }
.mrow-top { display: flex; gap: 12px; align-items: center; } .mrow-bot { display: flex; gap: 6px 16px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.gbar { margin-bottom: 12px; } .gbar .row { margin-bottom: 4px; }
code { background: var(--bg2); padding: 1px 6px; border-radius: 6px; }

/* ---------- leaderboard ---------- */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; margin: 8px 0 22px; max-width: 560px; margin-inline: auto; }
.pod { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; animation: riseUp .8s cubic-bezier(.2, .9, .3, 1.15) backwards; min-width: 0; }
.pod.p1 { animation-delay: .25s; } .pod.p2 { animation-delay: .1s; } .pod.p3 { animation-delay: .4s; }
@keyframes riseUp { from { opacity: 0; transform: translateY(60px); } }
.pod-av { position: relative; } .crown { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); font-size: 1.6rem; animation: bob 1.8s ease-in-out infinite; z-index: 3; }
@keyframes bob { 50% { transform: translateX(-50%) translateY(-6px) rotate(6deg); } }
.pod-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.pod-step { width: 100%; border-radius: 12px 12px 0 0; display: grid; place-items: center; font-weight: 900; font-size: 1.6rem; color: rgba(0, 0, 0, .55); }
.pod.p1 .pod-step { height: 92px; background: linear-gradient(#ffd34d, #e0a800); } .pod.p2 .pod-step { height: 66px; background: linear-gradient(#e3e9f4, #aab4c8); } .pod.p3 .pod-step { height: 48px; background: linear-gradient(#e0a070, #b06a35); }
.lb-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-bottom: 8px; animation: slideIn .5s cubic-bezier(.2, .9, .3, 1.1) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
.lb-row.me { border-color: var(--accent); background: linear-gradient(90deg, rgba(var(--accent-rgb, 255, 107, 31), .16), var(--card)); }
.lb-row .grow { min-width: 0; } .lb-row .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-24px); } }
.rank-banner { text-align: center; margin-bottom: 14px; }

@keyframes bob2 { 50% { transform: translateY(-8px) scale(1.06); } }
.btn.pulse { animation: btnPulse 1.8s ease-in-out infinite; }
@keyframes btnPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb, 255, 107, 31), .55); } 50% { box-shadow: 0 0 0 12px rgba(var(--accent-rgb, 255, 107, 31), 0); } }

/* ---------- mobile tab bar ---------- */
.tabbar { display: none; }
.tb-item { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; color: var(--muted); font-size: .66rem; font-weight: 700; border-radius: 16px; transition: color .2s, background .2s; }
.tb-item:hover { text-decoration: none; color: var(--text); }
.tb-item .ico { width: 22px; height: 22px; transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.tb-item.active { color: var(--text); background: linear-gradient(135deg, rgba(var(--accent-rgb, 255, 107, 31), .24), rgba(var(--accent2-rgb, 255, 176, 32), .1)); }
.tb-item.active .ico { color: var(--accent2); animation: tbPop .55s cubic-bezier(.3, 1.8, .5, 1); transform: translateY(-1px) scale(1.12); }
@keyframes tbPop { 0% { transform: scale(.6) translateY(6px); } 100% { transform: translateY(-1px) scale(1.12); } }
@media (max-width: 860px) {
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 60; padding: 6px;
    background: rgba(21, 25, 34, .84); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 14px 40px rgba(0, 0, 0, .55); }
  main { padding-bottom: 110px; } footer { padding-bottom: 110px; } #toasts { bottom: 100px; right: 12px; left: 12px; }
  .nav-right .av-btn span.nm { display: none; } .nav-right .av-btn { padding: 3px; }
  .p-hero { padding: 16px; gap: 14px; }
  .wallet-chip { padding: 6px 10px; font-size: .85rem; } .icon-btn { padding: 6px 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  .stagger > *, .page-in, .pod, .lb-row { opacity: 1 !important; transform: none !important; filter: none !important; }
}

/* =====================================================================
   v3 — phone-first: sub-pages with back arrow, Profile menu, list rows, no sideways scrolling
   ===================================================================== */
.subhead { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.subhead h2 { margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subhead .back { width: 38px; height: 38px; flex: none; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--text); display: grid; place-items: center; font-size: 1.7rem; line-height: 1; padding-bottom: 3px; transition: transform .15s, border-color .15s; }
.subhead .back:hover { text-decoration: none; border-color: var(--accent); } .subhead .back:active { transform: scale(.92); }
.tabs.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(96px, 100%), 1fr)); gap: 6px; }
.tabs.seg .tab { padding: 9px 6px; text-align: center; font-size: .85rem; white-space: normal; line-height: 1.15; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.mini-stats .stat { padding: 10px 8px; text-align: center; min-width: 0; }
.mini-stats .stat b { font-size: 1.15rem; overflow-wrap: anywhere; } .mini-stats .stat span { font-size: .64rem; }
.menu { display: grid; gap: 8px; margin-bottom: 14px; }
.menu-h { margin: 20px 4px 8px; font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; }
.mrow2 { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; color: var(--text); transition: transform .15s, border-color .15s, background .15s; min-width: 0; }
.mrow2:hover { text-decoration: none; border-color: var(--accent); } .mrow2:active { transform: scale(.985); background: var(--card2); }
.mrow2 .mi { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; background: linear-gradient(135deg, rgba(var(--accent-rgb, 255, 107, 31), .22), rgba(var(--accent2-rgb, 255, 176, 32), .1)); }
.mrow2 .mtxt { flex: 1; min-width: 0; display: grid; } .mrow2 .mtxt b { font-weight: 700; overflow-wrap: anywhere; } .mrow2 small { color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.mrow2 .chev { color: var(--muted); font-size: 1.5rem; flex: none; }
.mrow2.hl { border-color: rgba(41, 211, 240, .5); background: linear-gradient(135deg, rgba(41, 211, 240, .14), rgba(108, 140, 255, .1)); }
.mrow2.hl .mi { background: linear-gradient(135deg, #29d3f0, #6c8cff); }
.lrow { display: flex; gap: 12px; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; margin-bottom: 8px; min-width: 0; }
.lrow .l { flex: 1; min-width: 0; display: grid; gap: 2px; } .lrow .l b { overflow-wrap: anywhere; }
.lrow .r { text-align: right; flex: none; max-width: 46%; overflow-wrap: anywhere; }
.card .lrow { background: var(--bg2); }
.p-hero .av-ring { flex: none; } .p-hero h2 { overflow-wrap: anywhere; }
.pre, .prose, .notice, .room-box, .team { overflow-wrap: anywhere; }
.prose img, .prose iframe, .prose video, .prose table { max-width: 100%; }
.prose pre { overflow-x: auto; max-width: 100%; }

/* tables (admin panel) turn into stacked cards on phones — nothing to slide sideways */
@media (max-width: 700px) {
  .table-wrap { overflow: visible; border: 0; background: none; border-radius: 0; }
  table, thead, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody tr { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; padding: 4px 14px; }
  tbody tr:hover { background: var(--card); }
  td { display: flex; justify-content: space-between; align-items: center; gap: 14px; text-align: right; white-space: normal !important; border-bottom: 1px dashed var(--line); padding: 8px 0 !important; overflow-wrap: anywhere; min-width: 0; }
  td:last-child { border-bottom: 0; }
  td::before { content: attr(data-label); flex: none; max-width: 42%; text-align: left; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
  td:not([data-label])::before, td[data-label=""]::before { display: none; }
  td:not([data-label]), td[data-label=""] { justify-content: flex-start; text-align: left; flex-wrap: wrap; }
  td .btn { margin: 2px 0 2px 6px; }
  td input:not([type=checkbox]), td select { max-width: 60%; }
}
@media (max-width: 860px) { body[data-page="profile"]:not([data-sub]) footer, body[data-page="profile"][data-sub=""] footer { display: none; } }

/* WhatsApp number check at sign-up */
.chip.ok { background: rgba(47, 210, 122, .15); color: var(--ok); text-transform: none; letter-spacing: 0; margin-left: 6px; }
.wa-box { border: 1.5px dashed var(--line); border-radius: 14px; padding: 12px; background: var(--card2); min-width: 0; }
.wa-btn { display: flex; align-items: center; justify-content: center; gap: 10px; background: #25d366; color: #06280f; border-color: transparent; font-weight: 800; }
.wa-btn:hover { filter: brightness(1.06); }
.wa-box .hint, .wa-box .err { margin-top: 8px; }
.wa-wait { display: flex; gap: 12px; align-items: flex-start; min-width: 0; } .wa-wait > div:last-child { min-width: 0; } .wa-wait p { margin: 4px 0 10px; overflow-wrap: anywhere; }
.wa-wait .spin { flex: none; width: 22px; height: 22px; margin-top: 2px; border: 3px solid var(--line); border-top-color: #25d366; border-radius: 50%; animation: spin .8s linear infinite; }
.wa-wait code { background: var(--card); padding: 1px 6px; border-radius: 6px; font-weight: 700; color: var(--text); }
.wa-ok { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--ok); font-size: 1rem; } .wa-ok span { color: var(--text); font-weight: 700; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .wa-wait .spin { animation: none; } }
