/* app.css — Royal Rumble Pool (Gold + Black)
   Updated for CURRENT index.html (no .header wrapper)
   - Adds a proper title bar (uses #poolTitle if present; falls back gracefully)
   - Styles the top tabs row + right-side buttons consistently
   - Tight scoreboard whitespace on iPhone
   - Entrants “card mode” fixed and full-width on iPhone
   - Removes scroll gradient band artifacts
*/

/* -------------------- THEME -------------------- */
:root{
  --bg: #070707;
  --panel: rgba(255,255,255,.04);
  --panel2: rgba(0,0,0,.55);

  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.66);

  --gold: #d7b24c;
  --gold2: rgba(215,178,76,.22);
  --line: rgba(215,178,76,.16);

  --shadow: 0 14px 40px rgba(0,0,0,.55);
}

/* -------------------- BASE -------------------- */
*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  background: linear-gradient(#070707, #050505);
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Helvetica Neue", sans-serif;
}

/* Keep content above glow */
body > *{ position: relative; z-index: 1; }

/* Gold glow layer */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1200px 520px at 15% -5%, rgba(215,178,76,.10), transparent 60%),
    radial-gradient(900px 520px at 90% 0%, rgba(215,178,76,.08), transparent 65%);
  transform: translateZ(0);
  will-change: transform;
}

/* Links */
a{ color:inherit; text-decoration:none; }
a:hover{ text-decoration:none; }

/* -------------------- TITLE (since .header is gone) -------------------- */
/* If you add <div class="title" id="poolTitle"></div> above .tabs, this styles it.
   If you don’t, nothing breaks. */
.title{
  max-width: 1100px;
  margin: 18px auto 0;
  padding: 14px 16px 0;
  font-weight: 1000;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.05;
  color: rgba(215,178,76,.95);
  text-shadow: 0 12px 34px rgba(0,0,0,.6);
}

/* If you use the “Updated” pill anywhere */
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .4px;
  color: var(--muted);
}

/* -------------------- TABS / BUTTONS ROW -------------------- */
.tabs{
  max-width: 1100px;
  margin: 12px auto 0;
  padding: 10px 16px;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;

  border-radius: 18px;
  border: 1px solid rgba(215,178,76,.12);
  background: rgba(0,0,0,.40);
  box-shadow: var(--shadow);
}

/* tab pills */
.tab{
  user-select:none;
  cursor:pointer;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(215,178,76,.18);
  background: rgba(0,0,0,.45);
  color: rgba(255,255,255,.86);
  font-weight: 900;
  letter-spacing: .4px;
  text-transform: uppercase;
  font-size: 12px;
}
.tab:hover{
  border-color: rgba(215,178,76,.35);
  background: rgba(0,0,0,.55);
}
.tab.active{
  border-color: rgba(215,178,76,.50);
  background: rgba(215,178,76,.14);
  color: rgba(255,255,255,.95);
}

/* buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  cursor:pointer;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(215,178,76,.20);
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.92);
  font-weight: 900;
  letter-spacing: .4px;
  text-transform: uppercase;
  font-size: 12px;
}
.btn:hover{
  border-color: rgba(215,178,76,.40);
  background: rgba(255,255,255,.05);
}

/* right-side “button group” in your inline div */
.tabs > div[style*="margin-left:auto"]{
  display:flex !important;
  gap:10px !important;
  flex-wrap:wrap !important;
  align-items:center;
}

/* -------------------- Bounty pill -------------------- */
.bountyPill{
  display:inline-block;
  margin-left:6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,123,123,.25);
  background: rgba(160,0,0,.20);
  color:#ffb4b4;
  font-weight: 900;
  font-size: 12px;
}

/* clickable scoreboard player name */
.scoreName{
  all: unset;
  cursor: pointer;
  display: inline-block;
  width: 100%;
  padding: 6px 0;
}
.scoreName.isActive b{
  color: rgba(215,178,76,.95);
  text-shadow: 0 0 18px rgba(215,178,76,.25);
}

/* -------------------- LAYOUT -------------------- */
.shell{
  max-width: 1100px;
  margin: 14px auto 28px;
  padding: 0 16px 26px;
  display:flex;
  gap:14px;
  align-items:flex-start;
}

.rail{
  width: 340px;
  min-width: 300px;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.main{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:14px;
}

/* cards */
.card{
  background: var(--panel);
  border: 1px solid rgba(215,178,76,.14);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}

/* section headings */
.h3{
  font-weight: 1000;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: rgba(215,178,76,.95);
  font-size: 14px;
}
.mini{
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.divider{
  height:1px;
  background: rgba(255,255,255,.06);
  margin: 12px 0;
}

/* status banner */
#statusBanner{
  max-width: 1100px;
  margin: 12px auto;
  background: rgba(160,0,0,.18);
  border: 1px solid rgba(255,123,123,.25);
  color: #ffd0d0;
}

/* -------------------- TABLES -------------------- */
.tableWrap{
  overflow:auto;
  border-radius: 14px;
  border: 1px solid rgba(215,178,76,.14);
  background: rgba(0,0,0,.35);

  /* artifact reduction for sticky headers in overflow containers */
  transform: translateZ(0);
  will-change: transform;
}

table{
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

/* no backdrop-filter on sticky header (kills banding) */
thead th{
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(0,0,0,.92);
  text-align:left;
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: rgba(215,178,76,.92);
  font-weight: 1000;
  letter-spacing: .5px;
  text-transform: uppercase;
  font-size: 11px;
  white-space: nowrap;
}

tbody td{
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  vertical-align: top;
}

tbody tr:hover td{ background: rgba(255,255,255,.02); }
td b{ color: rgba(255,255,255,.95); }

/* Compact headers */
th.compactHead{ padding-left: 8px; padding-right: 8px; }

/* Entrants small numeric columns (desktop/tablet) */
.main table th:nth-child(5),
.main table td:nth-child(5),
.main table th:nth-child(6),
.main table td:nth-child(6),
.main table th:nth-child(7),
.main table td:nth-child(7),
.main table th:nth-child(8),
.main table td:nth-child(8),
.main table th:nth-child(9),
.main table td:nth-child(9){
  width: 56px;
  text-align: center;
  white-space: nowrap;
}

/* -------------------- SCOREBOARD: tighter whitespace -------------------- */
.rail .tableWrap table{
  table-layout: fixed;
}
.rail .tableWrap th:nth-child(1),
.rail .tableWrap td:nth-child(1){ width: 42px; }
.rail .tableWrap th:nth-child(3),
.rail .tableWrap td:nth-child(3){
  width: 54px;
  text-align: right;
}
.rail .tableWrap th:nth-child(2),
.rail .tableWrap td:nth-child(2){
  width: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail .tableWrap th,
.rail .tableWrap td{ padding: 9px 10px; }

/* -------------------- ROW HIGHLIGHTS -------------------- */
tr.rowFinalFour td{ background: rgba(215,178,76,.10); }
tr.rowWinner td{
  background: rgba(215,178,76,.18);
  border-top: 1px solid rgba(215,178,76,.25);
  border-bottom: 1px solid rgba(215,178,76,.25);
}

/* -------------------- FILTER PILL BAR -------------------- */
#entrantFilterBar .pill{
  border-color: rgba(215,178,76,.22);
  background: rgba(215,178,76,.10);
  color: rgba(255,255,255,.88);
}

/* -------------------- MOBILE -------------------- */
@media (max-width: 760px){

  /* Stack rail and main */
  .shell{
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  .rail, .main{
    width: 100%;
    min-width: unset;
  }

  /* Make the top tabs row sticky */
  .tabs{
    position: sticky;
    top: 0;
    z-index: 60;
    backdrop-filter: none; /* keep artifacts away */
  }

  /* Slightly tighter scoreboard padding */
  .rail .tableWrap th,
  .rail .tableWrap td{ padding: 8px 10px; }

  /* --- ENTRANTS card mode (table.compact) --- */
  /* remove inner scroller so cards fill the width */
  .main .tableWrap{
    overflow: visible;
    border: none;
    background: transparent;
    border-radius: 0;
    transform: none;
    will-change: auto;
  }

  /* hide header in card mode */
  .main table.compact thead{ display:none; }

  /* block layout */
  .main table.compact,
  .main table.compact tbody,
  .main table.compact tr,
  .main table.compact td{
    display:block;
    width:100%;
  }

  /* card */
  .main table.compact tr{
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 18px;
    border: 1px solid rgba(215,178,76,.16);
    background: rgba(255,255,255,.03);
    box-shadow: 0 10px 26px rgba(0,0,0,.45);
    overflow: hidden;
  }

  /* lines */
  .main table.compact td{
    display:grid;
    grid-template-columns: 78px 1fr;
    gap: 10px;
    padding: 10px 0;
    border: none;
    text-align: left !important;
  }
  .main table.compact td + td{
    border-top: 1px solid rgba(255,255,255,.06);
  }

  .main table.compact td::before{
    content: attr(data-label);
    color: rgba(215,178,76,.92);
    font-weight: 1000;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 11px;
  }

  .main table.compact td.nameCell{
    font-size: 16px;
    font-weight: 1000;
    padding-top: 12px;
  }
  .main table.compact td.ptsCell{
    font-size: 20px;
    font-weight: 1000;
    padding-bottom: 12px;
  }

  /* highlight borders in card mode */
  .main table.compact tr.rowFinalFour{
    border-color: rgba(215,178,76,.30);
    box-shadow: 0 0 0 1px rgba(215,178,76,.10) inset, 0 10px 26px rgba(0,0,0,.45);
  }
  .main table.compact tr.rowWinner{
    border-color: rgba(255,215,100,.48);
    box-shadow: 0 0 0 1px rgba(255,215,100,.18) inset, 0 10px 26px rgba(0,0,0,.45);
  }
}
.bountyBadge{
  display:inline-flex;
  align-items:center;
  margin-left:8px;
  font-size:12px;
  opacity:.95;
}

.tabs{
  border: 1px solid rgba(215,178,76,.14);
  border-radius: 18px;
  padding: 10px 12px;
  background: rgba(0,0,0,.35);
  box-shadow: 0 14px 40px rgba(0,0,0,.55);
}


/* -------------------- SMALLER TWEAKS -------------------- */
@media (max-width: 420px){
  .tab, .btn{ padding: 9px 12px; }
  .title{ font-size: 32px; }
}

/* hard kill fixed background attachment */
html, body { background-attachment: scroll !important; }
/* ===============================
   RETRO PPV VIBE PACK
   - Ring-rope separators
   - PPV header treatment
   - Champion belt plate row
   =============================== */

/* --- PPV HEADER TREATMENT --- */
.header.ppv {
  position: relative;
  padding-top: 18px;
}

.header.ppv::before{
  content:"";
  position:absolute;
  inset:-10px 0 auto 0;
  height: 140px;
  pointer-events:none;
  background:
    radial-gradient(900px 120px at 35% 10%, rgba(215,178,76,.20), transparent 65%),
    radial-gradient(700px 120px at 80% 0%, rgba(215,178,76,.14), transparent 70%),
    linear-gradient(to bottom, rgba(0,0,0,.55), transparent 70%);
  opacity: .9;
}

/* retro scanline shimmer */
.header.ppv::after{
  content:"";
  position:absolute;
  inset: 0;
  pointer-events:none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,.035),
    rgba(255,255,255,.035) 1px,
    transparent 1px,
    transparent 6px
  );
  mix-blend-mode: overlay;
  opacity: .22;
}

/* title becomes a PPV banner */
.title.ppvTitle{
  display: inline-block;
  padding: 10px 14px 10px;
  border-radius: 14px;
  border: 1px solid rgba(215,178,76,.20);
  background:
    linear-gradient(180deg, rgba(215,178,76,.10), rgba(0,0,0,.55)),
    radial-gradient(900px 90px at 25% 0%, rgba(215,178,76,.14), transparent 60%);
  box-shadow: 0 18px 60px rgba(0,0,0,.65);
  position: relative;
  overflow: hidden;
}

/* subtle “broadcast bevel” stripes */
.title.ppvTitle::before{
  content:"";
  position:absolute;
  inset:-40px -80px;
  background: repeating-linear-gradient(
    115deg,
    rgba(255,255,255,.06),
    rgba(255,255,255,.06) 8px,
    transparent 8px,
    transparent 20px
  );
  opacity: .12;
  transform: rotate(-8deg);
}

/* gold underline glow (PPV vibe) */
.title.ppvTitle::after{
  content:"";
  display:block;
  height: 3px;
  width: 220px;
  margin-top: 10px;
  background: linear-gradient(90deg, transparent, rgba(215,178,76,.95), transparent);
  box-shadow: 0 0 18px rgba(215,178,76,.25);
}

/* --- RING-ROPE SEPARATORS --- */
/* turn off normal hairline borders where we add ropes */
.rail .tableWrap tbody td,
.main .tableWrap tbody td{
  border-bottom: none;
}

/* each row gets a “rope” line under it */
.rail .tableWrap tbody tr,
.main .tableWrap tbody tr{
  position: relative;
}

.rail .tableWrap tbody tr::after,
.main .tableWrap tbody tr::after{
  content:"";
  position:absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 6px;
  pointer-events:none;

  /* rope = dark edge + gold core + dark edge */
  background:
    linear-gradient(to bottom,
      rgba(0,0,0,.0) 0%,
      rgba(0,0,0,.55) 25%,
      rgba(215,178,76,.28) 50%,
      rgba(0,0,0,.55) 75%,
      rgba(0,0,0,.0) 100%
    );

  opacity: .55;
}

/* slightly stronger rope on hover */
.rail .tableWrap tbody tr:hover::after,
.main .tableWrap tbody tr:hover::after{
  opacity: .75;
}

/* keep winner/final-four row fills intact (your existing highlights),
   but let the rope still show through */
tr.rowWinner td,
tr.rowFinalFour td{
  background-clip: padding-box;
}

/* --- CHAMPION ROW BELT PLATE --- */
/* apply to scoreboard row #1 (we’ll add class in app.js) */
tr.championRow td{
  background: rgba(215,178,76,.10);
}

tr.championRow td:nth-child(2){
  position: relative;
}

/* belt “plate” behind the champ name */
tr.championRow td:nth-child(2)::before{
  content:"";
  position:absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 34px;
  border-radius: 999px;

  background:
    linear-gradient(180deg, rgba(255,215,120,.22), rgba(0,0,0,.55)),
    radial-gradient(140px 40px at 25% 0%, rgba(255,215,120,.30), transparent 70%);

  border: 1px solid rgba(215,178,76,.35);
  box-shadow:
    0 10px 24px rgba(0,0,0,.55),
    0 0 0 1px rgba(215,178,76,.10) inset;

  opacity: .9;
  pointer-events:none;
}

/* ensure button text is above the plate */
tr.championRow .scoreName{
  position: relative;
  z-index: 1;
}

/* add a little “belt buckle” accent */
tr.championRow .scoreName::before{
  content:"🏆";
  display:inline-block;
  margin-right: 8px;
  filter: drop-shadow(0 0 10px rgba(215,178,76,.35));
}

/* tighten scoreboard row height a touch so belt looks intentional */
.rail .tableWrap tbody tr td{
  padding-top: 10px;
  padding-bottom: 10px;
}

/* -------------------- MODALS -------------------- */
.modalOverlay{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.62);
  z-index: 9999;
}
.modalOverlay.open{ display:flex; }

.modal{
  width: min(520px, 96vw);
  max-height: min(78vh, 720px);
  overflow: auto;
  background: rgba(12,12,12,.95);
  border: 1px solid rgba(215,178,76,.18);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,.7);
  padding: 14px;
}

.modalHeader{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}

.iconBtn{
  all: unset;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 999px;
  border: 1px solid rgba(215,178,76,.20);
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.85);
  font-weight: 1000;
}
.iconBtn:hover{
  border-color: rgba(215,178,76,.40);
  background: rgba(255,255,255,.06);
}

@media (max-width: 760px){
  .modal{
    width: 100%;
    max-height: 82vh;
  }
}
