/* RPCutter platform styles (loaded after styles.css) */

.page { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
.info-banner { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #fff; text-align: center; padding: 10px 16px; font-weight: 700; font-size: 14px; }

/* Cookie consent */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #0d111a; border-top: 1px solid var(--border); box-shadow: 0 -18px 50px rgba(0,0,0,.45); }
.cookie-inner { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 16px 0; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.cookie-copy { flex: 1; min-width: 260px; }
.cookie-copy strong { display: block; margin-bottom: 4px; }
.cookie-copy p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.cookie-copy a { color: var(--accent); }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-btn { border: 0; border-radius: 11px; padding: 12px 18px; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; }
.cookie-btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
/* Accept and Reject use the same weight/size so neither is nudged (DPA guidance). */
.cookie-btn.solid { background: #eef1f6; color: #0d111a; }
.cookie-btn.ghost { background: transparent; color: var(--text); border: 1px solid #4a5364; }
.cookie-btn:hover { filter: brightness(1.08); }

.cookie-modal { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; }
.cookie-modal-box { background: var(--panel-2); border: 1px solid var(--border); border-radius: 18px; padding: 24px; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; }
.cookie-modal-box h2 { margin: 0 0 14px; }
.cookie-cat { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.cookie-cat-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; margin-bottom: 6px; }
.cookie-cat p { margin: 0; font-size: 13px; }
.cookie-locked { color: var(--success); font-size: 12px; font-weight: 800; }
.cookie-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.cookie-switch input { display: none; }
.cookie-switch .slider { position: absolute; inset: 0; background: #39414f; border-radius: 99px; transition: .2s; }
.cookie-switch .slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.cookie-switch input:checked + .slider { background: var(--accent); }
.cookie-switch input:checked + .slider::before { transform: translateX(20px); }
.cookie-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 8px; }
@media (max-width: 600px) { .cookie-actions, .cookie-modal-actions { width: 100%; } .cookie-actions .cookie-btn, .cookie-modal-actions .cookie-btn { flex: 1; } }

/* Clip manage / bulk select */
.manage-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 4px; }
.clip-card-wrap { position: relative; }
.clip-select { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; accent-color: var(--accent); z-index: 3; cursor: pointer; display: none; }
#ownClipGrid.managing .clip-select { display: block; }
.clip-card-wrap.selected .clip-card { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Search */
.search-bar { display: flex; gap: 8px; margin: 14px 0; }
.search-bar input { flex: 1; border: 1px solid var(--border); background: #0d1118; color: var(--text); border-radius: 12px; padding: 13px 15px; font: inherit; }
.hero { text-align: center; }
.compact-hero { margin: 18px 0 10px; }
.compact-hero h1 { font-size: clamp(30px, 5vw, 52px); }
.home-hero { margin: 30px 0 8px; }

/* --- "How it works" section (numbered steps + detection/timeline demo) --- */
.how { margin: 26px 0 34px; }
.how-head { text-align: center; margin-bottom: 22px; }
.how-head .eyebrow { font-size: 13px; letter-spacing: .12em; }
.how-head p { max-width: 560px; margin: 8px auto 0; }
.how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.how-steps .step { position: relative; border: 1px solid var(--border); border-radius: 16px;
  background: var(--panel, #0d1118); padding: 22px 20px 20px; overflow: hidden; }
.how-steps .step::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2)); opacity: .8; }
.step-num { display: inline-block; font-size: 30px; font-weight: 800; line-height: 1;
  letter-spacing: .02em; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.how-steps .step h3 { margin: 12px 0 6px; font-size: 17px; }
.det-badges { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.det-badge { font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 5px 10px;
  border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.det-badge.on { color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.det-badge.on::first-letter { color: #fff; }
/* timeline demo */
.timeline-demo { margin: 22px 0 0; text-align: center; }
.tl-track { position: relative; height: 46px; max-width: 640px; margin: 0 auto;
  border: 1px solid var(--border); border-radius: 12px; background:
  repeating-linear-gradient(90deg, transparent 0 38px, rgba(255,255,255,.04) 38px 39px); }
.tl-time { position: absolute; top: 50%; transform: translateY(-50%); font-size: 12px;
  font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-time.start { left: 12px; } .tl-time.end { right: 12px; }
.tl-kill { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2)); transform: translateX(-50%); }
.tl-flag { position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: 11px; font-weight: 800; letter-spacing: .05em; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); padding: 4px 9px; border-radius: 999px; }
.timeline-demo figcaption { margin-top: 24px; font-size: 13px; }
@media (max-width: 720px) { .how-steps { grid-template-columns: 1fr; } }

a { color: inherit; }

/* Navbar */
.navbar { position: sticky; top: 0; z-index: 40; background: rgba(9,11,16,.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.nav-inner { width: min(1180px, calc(100% - 32px)); margin: 0 auto; display: flex; align-items: center; gap: 18px; height: 62px; }
.brand { font-weight: 900; font-size: 22px; letter-spacing: -.03em; text-decoration: none; }
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: 4px; margin-left: 8px; flex: 1; }
.nav-links a { padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 14px; }
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,.05); }
.nav-links .admin-link { color: var(--accent-2); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.lang-switch { display: flex; gap: 2px; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.lang-switch a { padding: 6px 9px; font-size: 12px; font-weight: 800; text-decoration: none; color: var(--muted); }
.lang-switch a.active { background: var(--accent); color: #fff; }
.nav-user { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 14px; }
.nav-user img { border-radius: 50%; }
.btn-ghost { padding: 9px 13px; border-radius: 10px; border: 1px solid var(--border); text-decoration: none; font-weight: 700; font-size: 14px; color: var(--text); }
.btn-ghost.disabled { opacity: .5; cursor: not-allowed; }
.btn-discord { background: #5865F2; color: #fff; padding: 10px 15px; border-radius: 10px; text-decoration: none; font-weight: 800; font-size: 14px; }
.discord-join { display: inline-flex; align-items: center; gap: 7px; background: #5865F2; color: #fff; padding: 8px 13px; border-radius: 10px; text-decoration: none; font-weight: 800; font-size: 14px; transition: filter .15s ease; }
.discord-join:hover { filter: brightness(1.1); }
.footer-discord { display: inline-flex; align-items: center; gap: 6px; color: #8b93f8 !important; font-weight: 700; }
@media (max-width: 720px) { .discord-join span { display: none; } .discord-join { padding: 8px; } }
.btn-discord.large { display: inline-block; margin-top: 12px; padding: 14px 22px; font-size: 16px; }

/* Checkboxes */
.checkrow { display: flex; align-items: center; gap: 11px; padding: 12px 0; color: var(--text); font-size: 15px; cursor: pointer; }
.checkrow input { width: 18px; height: 18px; accent-color: var(--accent); }

.login-cta { text-align: center; }

/* Grids */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-top: 8px; }
.clip-grid.small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

/* Clip card */
.clip-card { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--panel-2); }
.clip-thumb { position: relative; display: block; aspect-ratio: 16/9; background: #05070b; }
.clip-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.play-badge { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; color: #fff; background: rgba(0,0,0,.15); opacity: .85; }
.play-badge.big { font-size: 46px; }
.clip-meta { padding: 10px 12px; }
.clip-title { display: block; font-weight: 700; font-size: 14px; text-decoration: none; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip-stats { display: flex; gap: 12px; color: var(--muted); font-size: 12px; align-items: center; }
.pill-private { background: #3a2130; color: #ff9db2; padding: 2px 7px; border-radius: 99px; font-weight: 700; }

/* Featured */
.featured-player { position: relative; display: block; border-radius: 16px; overflow: hidden; margin: 8px 0 12px; aspect-ratio: 16/9; background: #05070b; }
.featured-player video { width: 100%; height: 100%; object-fit: cover; }

/* Sort / tabs */
.sort-bar { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.sort-bar a { padding: 9px 15px; border-radius: 10px; border: 1px solid var(--border); text-decoration: none; color: var(--muted); font-weight: 700; font-size: 14px; cursor: pointer; }
.sort-bar a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager { display: flex; justify-content: space-between; margin-top: 24px; }

/* Watch */
.watch { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; margin-top: 12px; }
.player-wrap { border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 16/9; }
.player-wrap video { width: 100%; height: 100%; }
.watch-info { margin-top: 16px; }
.watch-info h1 { font-size: 24px; margin: 0 0 14px; }
.watch-owner { display: flex; align-items: center; gap: 12px; }
.watch-owner img { border-radius: 50%; }
.owner-name { display: block; font-weight: 800; text-decoration: none; }
.watch-actions { margin-left: auto; }
.like-btn { background: #222936; color: var(--text); border: 1px solid var(--border); padding: 10px 16px; border-radius: 12px; font-weight: 800; cursor: pointer; }
.like-btn .heart { color: #55606f; }
.like-btn.liked { background: rgba(255,65,108,.14); border-color: var(--accent); }
.like-btn.liked .heart { color: var(--accent); }
.retention-note { margin-top: 14px; }
.owner-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.watch-side h3 { margin: 0 0 12px; }

/* Profile */
.profile-head { display: flex; align-items: center; gap: 18px; }
.profile-avatar { border-radius: 50%; border: 2px solid var(--border); }
.profile-id h1 { margin: 0; font-size: 28px; }
.pill-admin { background: var(--accent); color: #fff; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 800; }
.stat-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 18px 0; }
.stat { background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px; padding: 15px; text-align: center; }
.stat span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.stat strong { font-size: 22px; }

/* Profile details */
.details-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 4px 0 0; }
.details-list > div { display: grid; gap: 3px; }
.details-list dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.details-list dd { margin: 0; font-size: 16px; font-weight: 700; }

/* Leaderboard / tables */
.lb-table tbody tr.lb-clickable { cursor: pointer; }
.lb-table tbody tr.lb-clickable:hover { background: rgba(255,255,255,.04); }
.lb-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.lb-table th, .lb-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.lb-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.lb-table td.num, .lb-table th.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; }
.lb-avatar { border-radius: 50%; vertical-align: middle; }
.lb-table a { text-decoration: none; font-weight: 700; }
.rank { font-weight: 900; color: var(--muted); }
.rank-1 { color: #ffd35c; } .rank-2 { color: #cfd6e0; } .rank-3 { color: #e0955b; }

/* Prose (faq / legal) */
.prose { line-height: 1.7; }
.prose h2 { margin: 22px 0 8px; font-size: 19px; }
.prose ul { padding-left: 20px; }
.prose table { margin: 12px 0; }
.placeholder-note { background: rgba(255,122,69,.12); border: 1px solid var(--accent-2); border-radius: 12px; padding: 12px 14px; color: #ffd7b8; font-size: 14px; }

/* Admin */
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 18px 0 6px; }
.admin-topbar h1 { margin: 0; font-size: clamp(24px, 4vw, 34px); }
.admin-nav { display: flex; align-items: center; gap: 10px; }
.field { display: grid; gap: 8px; color: var(--muted); font-size: 14px; margin-top: 12px; }
.field input { width: 100%; border: 1px solid var(--border); background: #0d1118; color: var(--text); border-radius: 12px; padding: 14px; font: inherit; }
.btn-row { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.ok-note { background: rgba(50,210,150,.12); border: 1px solid var(--success); color: #8ff0c8; border-radius: 12px; padding: 11px 14px; }
.admin-h { margin: 26px 0 10px; font-size: 16px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-2); scroll-margin-top: 74px; }
/* Sticky in-page section navigation for the admin dashboard */
.admin-jump { position: sticky; top: 8px; z-index: 20; display: flex; gap: 6px; flex-wrap: wrap;
  padding: 8px; margin: 10px 0 16px; border: 1px solid var(--border); border-radius: 12px;
  background: rgba(13,17,24,.85); backdrop-filter: blur(8px); }
.admin-jump a { padding: 7px 13px; border-radius: 8px; text-decoration: none; color: var(--muted);
  font-weight: 700; font-size: 13px; border: 1px solid transparent; }
.admin-jump a:hover { color: var(--text); border-color: var(--border); background: #0d1118; }
.admin-filter { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.range-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.range-tabs a { padding: 8px 13px; border-radius: 9px; border: 1px solid var(--border); text-decoration: none; color: var(--muted); font-weight: 700; font-size: 13px; }
.range-tabs a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.custom-range { display: flex; gap: 8px; align-items: center; }
.custom-range input { background: #0d1118; border: 1px solid var(--border); color: var(--text); border-radius: 9px; padding: 9px; font: inherit; }
.admin-note { margin-top: 8px; }
.bars { display: grid; gap: 9px; margin-top: 6px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; }
.bar-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 9px; border-radius: 99px; background: #0d1118; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar-num { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; }
.footer-inner { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 26px 0; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.footer-links a:hover { color: var(--text); }
.footer-credit { border-top: 1px solid var(--border); text-align: center; padding: 14px 16px; display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 13px; }
.wa-credit { display: inline-flex; align-items: center; gap: 6px; color: #25D366; text-decoration: none; font-weight: 800; }
.wa-credit:hover { filter: brightness(1.15); }

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .watch { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(3, 1fr); }
  .nav-links { display: none; }
}
@media (max-width: 560px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .bar-row { grid-template-columns: 80px 1fr 36px; }
}

/* ---------------------------------------------------------------------------
   Left-side sponsor ad (admin-configured). Sits in the empty margin left of
   the centred content on wide screens; hidden when there's no room so it can
   never overlap the page. Shown on all public pages except /admin (base.html).
--------------------------------------------------------------------------- */
.sidebar-ad { display: none; }
@media (min-width: 1500px) {
  .sidebar-ad {
    display: block;
    position: fixed;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    width: clamp(120px, calc((100vw - 1160px) / 2 - 56px), 200px);
    z-index: 40;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line, rgba(255,255,255,0.08));
    background: rgba(12,10,22,0.6);
    box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  }
  .sidebar-ad-link { display: block; line-height: 0; }
  .sidebar-ad img,
  .sidebar-ad video { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: cover; }
  .sidebar-ad-tag {
    position: absolute;
    top: 8px; left: 8px;
    font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
    color: rgba(255,255,255,0.75);
    background: rgba(0,0,0,0.55);
    padding: 2px 7px; border-radius: 999px;
    pointer-events: none;
  }
}
