/**
 * =================================================================
 * RTP LIVE - STYLESHEET v2.0
 * =================================================================
 * Layout Desktop : Sidebar provider (kiri) + game grid (kanan)
 * Layout Mobile  : Full-width, 3-column grid, bottom navbar
 * =================================================================
 */

/* === RESET / BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--mc-body-bg-color, #21222c);
  color: var(--mc-text-color, #f2f2f2);
  font-family: 'MCFont', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }

.rtp-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* === HEADER === */
.rtp-header {
  background: var(--mc-color-4, #990303);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
}
.rtp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}
.rtp-logo img { height: 42px; width: auto; }
.rtp-header-btns { display: flex; gap: 8px; }
.rtp-hbtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
  transition: all .2s;
  border: none;
  cursor: pointer;
}
.rtp-hbtn-daftar {
  background: var(--mc-color-5, #fca501);
  color: #000;
}
.rtp-hbtn-daftar:hover { filter: brightness(1.15); color: #000; }
.rtp-hbtn-live {
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
}
.rtp-hbtn-live:hover { background: rgba(255,255,255,.2); color: #fff; }

/* === BANNER (single image) === */
.rtp-banner {
  width: 100%;
  background: #111;
}
.rtp-banner-img { width: 100%; display: block; }

/* === MOBILE PROVIDER SLIDER (hidden on desktop) === */
.rtp-m-providers {
  display: none; /* shown via media query on mobile */
  align-items: center;
  gap: 0;
  background: rgba(var(--mc-color-2-rgb, 0,0,0), .35);
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 12px 0;
  margin-bottom: 14px;
  position: relative;
}
.rtp-m-prov-arrow {
  flex-shrink: 0;
  width: 28px; height: 28px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: background .2s;
  margin: 0 4px;
}
.rtp-m-prov-arrow:hover { background: rgba(255,255,255,.18); }
.rtp-m-prov-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  padding: 4px 4px;
  scrollbar-width: none;
}
.rtp-m-prov-track::-webkit-scrollbar { display: none; }
.rtp-m-prov-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 70px;
  padding: 8px 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.rtp-m-prov-item img {
  width: 40px; height: 40px;
  object-fit: contain;
}
.rtp-m-prov-item span {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72px;
}
.rtp-m-prov-item:hover { background: rgba(var(--mc-color-5-rgb, 252,165,1), .1); }
.rtp-m-prov-item.active {
  background: var(--mc-linear-gradient-1, linear-gradient(to bottom, var(--mc-color-3, #6d0101), var(--mc-color-4, #990303)));
  box-shadow: 0 0 10px rgba(var(--mc-color-5-rgb, 252,165,1), .25);
}
.rtp-m-prov-item.active span { color: #fff; font-weight: 700; }

/* === MAIN BODY (sidebar + content) === */
.rtp-body {
  display: flex;
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* === SIDEBAR === */
.rtp-sidebar {
  width: 200px;
  min-width: 200px;
  background: rgba(var(--mc-color-2-rgb, 0,0,0), .35);
  border-right: 1px solid rgba(255,255,255,.06);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  max-height: calc(100vh - 160px);
  position: sticky;
  top: 58px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.rtp-sidebar::-webkit-scrollbar { width: 4px; }
.rtp-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

.rtp-prov {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: all .2s;
  white-space: nowrap;
  cursor: pointer;
}
.rtp-prov img {
  width: 32px; height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}
.rtp-prov span {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  overflow: hidden;
  text-overflow: ellipsis;
}
.rtp-prov:hover {
  background: rgba(var(--mc-color-5-rgb, 252,165,1), .1);
}
.rtp-prov.active {
  background: var(--mc-linear-gradient-1, linear-gradient(to bottom, var(--mc-color-3, #6d0101), var(--mc-color-4, #990303)));
  box-shadow: 0 0 12px rgba(var(--mc-color-5-rgb, 252,165,1), .3);
}
.rtp-prov.active span { color: #fff; font-weight: 700; }

/* === CONTENT === */
.rtp-content {
  flex: 1;
  padding: 16px;
  min-width: 0;
}

/* Desktop head: title + search side by side */
.rtp-d-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}
.rtp-d-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: .5px;
  white-space: nowrap;
}
.rtp-d-title .rtp-prov-label {
  color: var(--mc-color-5, #fca501);
}

/* Mobile head (hidden on desktop) */
.rtp-m-head { display: none; }
.rtp-m-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  text-align: center;
  margin-bottom: 12px;
}
.rtp-m-title .rtp-prov-label {
  color: var(--mc-color-5, #fca501);
}

/* Search input (shared) */
.rtp-d-search { max-width: 240px; width: 100%; }
.rtp-m-search { max-width: 100%; width: 100%; margin-bottom: 16px; }
.rtp-sinput {
  width: 100%;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(var(--mc-bg-color-rgb, 54,57,73), .6);
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
}
.rtp-sinput::placeholder { color: rgba(255,255,255,.4); }
.rtp-sinput:focus { border-color: var(--mc-color-5, #fca501); }

/* === GAME GRID === */
.rtp-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

/* Loading spinner */
.rtp-loading {
  grid-column: 1 / -1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 0;
  gap: 14px; color: rgba(255,255,255,.5);
  font-size: 13px;
}
.rtp-spin {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,.1);
  border-top-color: var(--mc-color-5, #fca501);
  border-radius: 50%;
  animation: rtpSpin .8s linear infinite;
}
@keyframes rtpSpin { to { transform: rotate(360deg); } }

/* Empty state */
.rtp-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 16px;
  color: rgba(255,255,255,.4);
  font-size: 14px;
}
.rtp-empty i { font-size: 40px; margin-bottom: 10px; display: block; color: rgba(255,255,255,.2); }

/* === GAME CARD === */
.rtp-card {
  border-radius: 10px;
  overflow: hidden;
  background: rgba(var(--mc-bg-color-rgb, 54,57,73), .5);
  border: 1px solid rgba(255,255,255,.06);
  transition: transform .2s, box-shadow .2s;
}
.rtp-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}

/* Card image wrapper */
.rtp-card-img {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #111;
}
.rtp-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* NEW badge */
.rtp-badge-new {
  position: absolute;
  top: 6px; left: 6px;
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #ffd700, #ff9800);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 7px;
  font-weight: 900;
  color: #000;
  text-transform: uppercase;
  letter-spacing: .3px;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
  z-index: 3;
}

/* RTP bar at bottom of image */
.rtp-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 22px;
  display: flex; align-items: center;
  padding: 0 6px;
  z-index: 3;
}
.rtp-bar-bg {
  position: absolute; inset: 0;
  border-radius: 0;
  overflow: hidden;
}
.rtp-bar-fill {
  height: 100%;
  border-radius: 0;
  transition: width .6s ease;
}
.rtp-bar-text {
  position: relative; z-index: 2;
  font-size: 10px; font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
  width: 100%;
  text-align: center;
  letter-spacing: .5px;
}

/* RTP colors */
.rtp-bar.rtp-high .rtp-bar-bg { background: rgba(0,0,0,.3); }
.rtp-bar.rtp-high .rtp-bar-fill { background: linear-gradient(90deg, #22c55e, #16a34a); }

.rtp-bar.rtp-med .rtp-bar-bg { background: rgba(0,0,0,.3); }
.rtp-bar.rtp-med .rtp-bar-fill { background: linear-gradient(90deg, #eab308, #f59e0b); }

.rtp-bar.rtp-low .rtp-bar-bg { background: rgba(0,0,0,.3); }
.rtp-bar.rtp-low .rtp-bar-fill { background: linear-gradient(90deg, #ef4444, #dc2626); }

/* Card info section */
.rtp-card-info {
  padding: 8px 10px 10px;
}
.rtp-card-name {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
  line-height: 1.3;
}

/* Time slot badge */
.rtp-time {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 5px;
  margin-bottom: 6px;
  letter-spacing: .3px;
  width: 100%;
  text-align: center;
}
.rtp-time i { font-size: 10px; }

/* Pola Main section */
.rtp-pola-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--mc-color-5, #fca501);
  margin-bottom: 5px;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  text-align: center;
}
.rtp-pola-label i { font-size: 10px; }

.rtp-pola-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}
.rtp-pola-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.75);
  line-height: 1.2;
  flex-wrap: nowrap;
}
.rtp-pola-row .p-ma { color: rgba(255,255,255,.5); font-style: italic; font-size: 10px; }
.rtp-pola-row .p-num { color: #fff; font-weight: 800; }
.rtp-pola-row .p-icon { font-size: 12px; line-height: 1; }
.rtp-pola-row .p-icon.p-green { color: #22c55e; }
.rtp-pola-row .p-icon.p-red { color: #ef4444; }

/* === LOAD MORE === */
.rtp-more {
  text-align: center;
  padding: 20px 0;
}
.rtp-morebtn {
  background: var(--mc-linear-gradient-1, linear-gradient(to bottom, var(--mc-color-3, #6d0101), var(--mc-color-4, #990303)));
  color: #fff;
  border: none;
  padding: 10px 30px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .2s;
}
.rtp-morebtn:hover { filter: brightness(1.2); }

/* === FLOATING NOTIFICATION === */
.rtp-notif {
  position: fixed;
  bottom: 80px; left: 16px;
  background: linear-gradient(135deg, rgba(var(--mc-color-3-rgb, 109,1,1), .95), rgba(var(--mc-color-4-rgb, 153,3,3), .95));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(var(--mc-color-5-rgb, 252,165,1), .3);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  z-index: 80;
  max-width: 280px;
  animation: rtpSlideUp .4s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.rtp-notif-text { display: flex; align-items: center; gap: 6px; }
@keyframes rtpSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* === BOTTOM NAVBAR (mobile only) === */
.rtp-bnav {
  display: none; /* hidden on desktop */
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 99;
  background: var(--mc-color-4, #990303);
  box-shadow: 0 -2px 10px rgba(0,0,0,.4);
  padding: 0;
  border-top: 1px solid rgba(255,255,255,.08);
}
.rtp-bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 8px 0;
  color: rgba(255,255,255,.7);
  font-size: 10px;
  font-weight: 600;
  transition: color .2s;
  gap: 3px;
}
.rtp-bnav-item i { font-size: 18px; }
.rtp-bnav-item:hover,
.rtp-bnav-item:active { color: var(--mc-color-5, #fca501); }
.rtp-bnav-daftar {
  background: var(--mc-color-5, #fca501);
  color: #000 !important;
  font-weight: 800;
  border-radius: 0;
}
.rtp-bnav-daftar:hover { filter: brightness(1.1); color: #000 !important; }

/* === MODAL === */
.rtp-modal-c {
  background: var(--mc-bg-color, #363949) !important;
  border: 1px solid rgba(255,255,255,.08);
  color: #fff;
}
.rtp-modal-h {
  background: var(--mc-color-4, #990303);
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: #fff;
}
.rtp-modal-b { color: rgba(255,255,255,.8); font-size: 14px; }

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Tablet + smaller desktop */
@media (max-width: 1100px) {
  .rtp-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .rtp-sidebar { width: 170px; min-width: 170px; }
}

/* Mobile and small tablets */
@media (max-width: 768px) {
  /* Show mobile head, hide desktop head */
  .rtp-m-head { display: block; margin-bottom: 0; }
  .rtp-d-head { display: none; }

  /* Show mobile provider slider */
  .rtp-m-providers { display: flex; }

  /* Hide sidebar */
  .rtp-sidebar { display: none; }

  /* Body stretches full */
  .rtp-body { flex-direction: column; }
  .rtp-content { padding: 12px 10px; }

  /* Grid 3 columns */
  .rtp-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }

  /* Show bottom navbar */
  .rtp-bnav { display: flex; }

  /* Push content up for navbar */
  .rtp-page { padding-bottom: 60px; }

  /* Notification above navbar */
  .rtp-notif { bottom: 72px; left: 10px; right: 10px; max-width: none; }

  /* Header smaller */
  .rtp-logo img { height: 34px; }
  .rtp-hbtn { padding: 6px 12px; font-size: 11px; }

  /* Game card adjustments */
  .rtp-card-info { padding: 6px 6px 8px; }
  .rtp-card-name { font-size: 10px; }
  .rtp-time { font-size: 9px; padding: 4px 6px; }
  .rtp-pola-label { font-size: 9px; }
  .rtp-pola-row { font-size: 8.5px; gap: 3px; }
  .rtp-pola-row .p-ma { font-size: 8.5px; }
  .rtp-pola-row .p-icon { font-size: 10px; }
  .rtp-badge-new { width: 22px; height: 22px; font-size: 6px; }
  .rtp-bar { height: 18px; }
  .rtp-bar-text { font-size: 10px; }
}

/* Extra small phones */
@media (max-width: 400px) {
  .rtp-grid { gap: 6px; }
  .rtp-card-info { padding: 4px 5px 6px; }
  .rtp-card-name { font-size: 12px; }
  .rtp-pola-row { font-size: 10px; }
  .rtp-pola-row .p-ma { font-size: 10px; }
  .rtp-m-title { font-size: 14px; }
}

/* Large desktop */
@media (min-width: 1200px) {
  .rtp-grid { grid-template-columns: repeat(5, 1fr); gap: 16px; }
  .rtp-sidebar { width: 210px; min-width: 210px; }
}

@media (min-width: 1600px) {
  .rtp-grid { grid-template-columns: repeat(6, 1fr); }
}
