/* RB Tour – user site theme.
   Flat and practical: one accent (orange), gold only for money, solid surfaces, 1px lines, no glow. */

:root, body.dark-theme {
  --bg: #0F1218;
  --surface: #171B23;
  --raised: #1F2430;
  --line: #2A303D;
  --text: #EDEFF5;
  --muted: #8C94A7;
  --accent: #FF6A2B;
  --gold: #F4B43A;
  --good: #3CCB85;
  --info: #5AA9FF;
  --bad: #FF5C6C;
  --font-body: 'Outfit', 'Hind Siliguri', 'Noto Sans Bengali', system-ui, sans-serif;
  --font-display: var(--font-body);

  /* aliases used by the JS templates */
  --flare: var(--accent); --flare-2: var(--accent); --mint: var(--good); --sky: var(--info);
  --ink: var(--bg); --ink-2: var(--surface); --ink-3: var(--raised); --line-soft: var(--line);

  /* names used by the base stylesheet */
  --bg-white: var(--bg); --bg-light: var(--surface); --bg-soft: var(--raised);
  --primary-blue: var(--accent); --bright-blue: var(--accent); --dark-blue: #E85A1E;
  --blue-gradient: var(--accent);
  --text-dark: var(--text); --text-black: #fff; --text-gray: var(--muted);
  --border-blue: var(--line); --border-light: var(--line);
  --success-green: var(--good);
  --primary: var(--accent); --primary-dark: #E85A1E; --bg-color: var(--bg);
  --text-light: var(--muted); --white: var(--surface); --card-bg: var(--surface);
  --border-color: var(--line); --input-bg: var(--raised);
}

html { color-scheme: dark; }
* { font-family: var(--font-body); }
::selection { background: var(--accent); color: #fff; }
body { background: var(--bg); color: var(--text); }
#main-content { padding-bottom: 96px; }

/* ---------- header ---------- */
header { background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: none; padding: 10px 16px; }
.logo { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.logo img { height: 34px; border-radius: 8px; }
.logo-text { font: 600 19px/1 var(--font-body); color: var(--text); background: none; -webkit-text-fill-color: currentColor; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: var(--accent); color: #fff; font: 700 13px/1 var(--font-body); letter-spacing: .3px;
}
.brand-mark.big { width: 64px; height: 64px; border-radius: 16px; font-size: 22px; margin: 0 auto 6px; }
.balance-pill { background: var(--raised); border: 1px solid var(--line); color: var(--gold); font: 600 14px var(--font-body); padding: 6px 13px; }
.balance-pill span { font-family: var(--font-body); }
.icon-btn { background: transparent; border: 0; color: var(--text); }
.icon-btn:hover { background: var(--raised); }
.notif-badge { background: var(--accent); color: #fff; border: 2px solid var(--surface); }
.btn-login-nav { background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 8px; font: 500 13px var(--font-body); }
.btn-reg-nav { background: var(--accent); color: #fff; border: 0; border-radius: 8px; font: 600 13px var(--font-body); }

/* ---------- headings ---------- */
.section-title { font: 600 19px var(--font-body); color: var(--text); margin: 22px 0 12px; }
.back-nav { color: var(--muted); font-weight: 500; }
.back-nav:hover { color: var(--text); }

/* ---------- banner ---------- */
.slider-container { border-radius: 14px; border: 1px solid var(--line); box-shadow: none; }
.slide::after { background: linear-gradient(to top, rgba(15, 18, 24, .75), transparent 50%); }
.slide-caption { font: 600 15px var(--font-body); }
.slider-progress-seg { background: rgba(255, 255, 255, .28); }
.slider-progress-seg-fill { background: #fff; }

/* ---------- categories ---------- */
.category-list { gap: 12px; }
.game-card { border-radius: 14px; border: 1px solid var(--line); box-shadow: none; background-color: var(--raised); }
.game-card::after { background: linear-gradient(to top, rgba(15, 18, 24, .92), rgba(15, 18, 24, 0) 70%); }
.game-card-bg.no-img { display: flex; align-items: flex-start; justify-content: flex-end; padding: 12px 14px; }
.game-card-bg.no-img i { font-size: 46px; color: rgba(255, 255, 255, .22); }
.game-title { font: 600 16px var(--font-body); text-transform: none; letter-spacing: 0; color: #fff; text-shadow: none; }
.match-count { display: block; font-size: 12px; font-weight: 400; color: rgba(255, 255, 255, .72); background: none; padding: 0; margin-top: 2px; }
.match-count::before { display: none; }
.how-to-join-btn { background: var(--surface); border: 1px solid var(--line); color: var(--text); border-radius: 12px; font-weight: 500; }

/* ---------- tabs ---------- */
.tab-container { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; gap: 0; box-shadow: none; overflow-x: auto; }
.tab-btn { background: transparent; color: var(--muted); border: 0; border-radius: 0; font: 500 14px var(--font-body); padding: 12px 16px; white-space: nowrap; box-shadow: inset 0 -2px 0 transparent; }
.tab-btn.active { background: transparent; color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- match card ---------- */
.match-card { position: relative; padding: 0; margin-bottom: 14px; overflow: visible; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: none; }
.match-card:hover { transform: none; box-shadow: none; }
.tk-body { padding: 14px 14px 12px; }
.m-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.m-img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); }
.m-title { font: 600 16px/1.3 var(--font-body); color: var(--text); }
.m-time { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tk-type { margin-left: auto; align-self: flex-start; flex: none; font: 500 12px var(--font-body); color: var(--text); background: var(--raised); border: 1px solid var(--line); padding: 3px 9px; border-radius: 6px; }
.tk-prize { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.tk-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 1px; }
.tk-money { font: 700 30px/1.1 var(--font-body); color: var(--gold); }
.tk-side { text-align: right; }
.tk-side b { font: 600 17px var(--font-body); color: var(--text); }
.tk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tk-chips span { font-size: 12px; color: var(--muted); background: var(--raised); padding: 3px 9px; border-radius: 6px; }
.tk-chips span i { color: var(--muted); margin-right: 5px; }
.progress-bar { height: 4px; background: var(--raised); border-radius: 4px; overflow: hidden; }
.progress-fill { background: var(--accent); border-radius: 4px; }
.m-status-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

.tk-tear { position: relative; height: 0; border-top: 1px dashed var(--line); margin: 0 16px; }
.tk-tear::before, .tk-tear::after { content: ''; position: absolute; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); }
.tk-tear::before { left: -26px; clip-path: inset(0 0 0 50%); }
.tk-tear::after { right: -26px; clip-path: inset(0 50% 0 0); }

.tk-stub { padding: 12px 14px 14px; display: grid; gap: 10px; }
.tk-entry { display: flex; align-items: baseline; justify-content: space-between; }
.tk-fee { font: 600 18px var(--font-body); color: var(--text); }
.tk-actions { display: flex; gap: 8px; }
.tk-actions button { flex: 1; width: auto; margin: 0; }

.btn-join-outline, .btn-view-participants, .btn-view-result, .btn-room, .btn-full-outline, .btn-prize {
  border-radius: 8px; border: 1px solid transparent; font: 600 13px var(--font-body); padding: 10px 8px; cursor: pointer;
}
.btn-join-outline { background: var(--accent); color: #fff; }
.btn-join-outline:hover { background: #E85A1E; }
.btn-view-participants, .btn-room, .btn-view-result { background: transparent; color: var(--text); border-color: var(--line); }
.btn-view-participants:hover, .btn-room:hover, .btn-view-result:hover { background: var(--raised); }
.btn-full-outline { background: var(--raised); color: var(--muted); cursor: default; }

.timer-display { display: flex; justify-content: center; gap: 6px; text-align: center; color: var(--muted); font: 500 12px var(--font-body); padding: 2px 0 0; background: none; border: 0; }
.timer-display .cd { min-width: 48px; background: var(--raised); border-radius: 8px; padding: 6px 4px; }
.timer-display .cd b { display: block; font: 600 17px/1.1 var(--font-body); color: var(--text); }
.timer-display .cd i { font-style: normal; font-size: 10px; color: var(--muted); }

.tk-type.won { background: rgba(60, 203, 133, .14); border-color: transparent; color: var(--good); }
.tk-type.lost { color: var(--muted); }
.tk-type.live { background: rgba(255, 106, 43, .15); border-color: transparent; color: var(--accent); }
.tk-type.joined { background: rgba(90, 169, 255, .14); border-color: transparent; color: var(--info); }
.tk-chips .tk-rank { color: var(--gold); background: rgba(244, 180, 58, .1); }
.tk-chips .tk-rank i { color: var(--gold); }

/* results */
.result-view-header { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.result-view-title { font: 600 17px var(--font-body); }
.result-table th { background: var(--raised); color: var(--muted); font-weight: 500; }
.result-table td { border-color: var(--line); color: var(--text); }
.winner-row td { background: rgba(244, 180, 58, .08); color: var(--gold); }

/* ---------- panels & forms ---------- */
.card-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: none; }
.card-panel h3 { font-family: var(--font-body); font-weight: 600; }
.form-group label { color: var(--muted); font-size: 13px; font-weight: 500; }
.input-field, select.input-field, textarea.input-field { background: var(--raised); border: 1px solid var(--line); color: var(--text); border-radius: 10px; }
.input-field::placeholder { color: #667087; }
.input-field:focus { border-color: var(--accent); box-shadow: none; outline: none; }
select option { background: var(--raised); color: var(--text); }

.primary-btn { background: var(--accent); color: #fff; border: 0; border-radius: 10px; box-shadow: none; font: 600 15px var(--font-body); padding: 13px; }
.primary-btn:hover { background: #E85A1E; }
.primary-btn:disabled { background: var(--raised); color: var(--muted); }
.btn-cancel { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; }

.method-btn { display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; color: var(--text); }
.method-btn:hover { border-color: var(--accent); }
.method-btn.selected { border-color: var(--accent); background: rgba(255, 106, 43, .08); box-shadow: none; }
.method-btn > span:not(.pay-badge) { font: 500 16px var(--font-body); }
.payment-details-box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }

.pay-badge { flex: none; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font: 600 12px var(--font-body); color: #fff; box-shadow: none; }
.pay-badge.bkash { background: #E2136E; }
.pay-badge.nagad { background: #EC1C24; }
.pay-badge.rocket { background: #8C3494; }
.pay-logo { flex: none; width: 48px; height: 48px; border-radius: 12px; object-fit: contain; background: #fff; padding: 4px; box-shadow: none; }
.pay-hero { padding: 22px 18px 20px; text-align: center; color: #fff; background: var(--accent); display: flex; flex-direction: column; align-items: center; }
.pay-hero .pay-badge, .pay-hero .pay-logo { width: 58px; height: 58px; font-size: 13px; }
.pay-hero.gw-bkash { background: #E2136E; }
.pay-hero.gw-nagad { background: #EC1C24; }
.pay-hero.gw-rocket { background: #8C3494; }
.pd-number { font-weight: 600; color: var(--gold); letter-spacing: .4px; }

.rules-box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.rules-title { font: 600 15px var(--font-body); color: var(--text); }
.rules-list li { color: var(--text); border-color: var(--line); }
.rules-list li i { color: var(--accent); }

.joined-item { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.joined-name { color: var(--text); font-weight: 500; }
.joined-uid { color: var(--muted); }

.stat-card { background: var(--raised); border: 1px solid var(--line); border-radius: 12px; box-shadow: none; }
.stat-card-label { color: var(--muted); font-size: 12px; }
.stat-card-value { font: 600 19px var(--font-body); color: var(--gold); }
.profile-avatar-ring { border: 2px solid var(--line); background: none; }

/* ---------- sidebars, modals, auth ---------- */
.sidebar, .notif-sidebar { background: var(--surface); border-left: 1px solid var(--line); box-shadow: none; }
.sidebar-header { background: var(--raised); border-bottom: 1px solid var(--line); color: var(--text); }
.sidebar-close { color: var(--muted); }
.sidebar-overlay { background: rgba(0, 0, 0, .6); }
.sidebar-menu li { color: var(--text); }
.sidebar-menu li:hover { background: var(--raised); }
.sidebar-menu li i { color: var(--muted); }
.logout-item { color: var(--bad) !important; border-top: 1px solid var(--line) !important; }
.notif-item { border-bottom: 1px solid var(--line); }
.notif-icon { background: var(--raised); color: var(--accent); }
.notif-content h5 { color: var(--text); }
.notif-content p { color: var(--muted); }

.modal { background: rgba(0, 0, 0, .65); }
.modal-box { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; color: var(--text); }

.auth-page { background: var(--bg); }
.auth-container { width: 100%; max-width: 380px; padding: 24px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: none; }
.auth-title { font: 600 26px var(--font-body); color: var(--text); }
.auth-sub { color: var(--muted); }
.toast { background: var(--raised); border: 1px solid var(--line); color: var(--text); }

/* ---------- bottom bar ---------- */
.bottom-nav { left: 0; right: 0; transform: none; width: 100%; max-width: none; bottom: 0; height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.bottom-nav-item { color: var(--muted); font: 500 11px var(--font-body); position: relative; }
.bottom-nav-item.bn-active { color: var(--accent); }
.bottom-nav-item.bn-active::after { display: none; }
.bottom-nav-fab button { background: var(--accent); border: 4px solid var(--bg); margin-top: -26px; box-shadow: none; }

/* ---------- inline colours written for a light theme ---------- */
[style*="color:#666"], [style*="color: #666"], [style*="color:#888"], [style*="color:#999"],
[style*="color:#555"], [style*="color:#ccc"], [style*="color: #999"] { color: var(--muted) !important; }
[style*="color:#333"] { color: var(--text) !important; }
[style*="color:#2f855a"] { color: var(--good) !important; }
[style*="color:var(--youtube-red)"] { color: var(--accent) !important; }
[style*="border-bottom:1px solid #eee"], [style*="border-top:1px solid #eee"] { border-color: var(--line) !important; }
[style*="background:#eee"] { background: var(--raised) !important; color: var(--muted) !important; }
[style*="background:white"] { background: var(--raised) !important; }
[style*="background:#fff0f5"] { background: rgba(226, 19, 110, .12) !important; }
[style*="background:#f4faff"] { background: rgba(90, 169, 255, .1) !important; border-color: rgba(90, 169, 255, .3) !important; }
[style*="background:#f0fff4"] { background: rgba(60, 203, 133, .1) !important; border-color: rgba(60, 203, 133, .35) !important; }
[style*="background:#fff5f5"] { background: rgba(255, 106, 43, .1) !important; }

@media (min-width: 700px) {
  .category-list { grid-template-columns: repeat(3, 1fr); }
  #matches-container { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
