/* PATCH ORNAMEN BATU JADE: khusus kartu, bukan simbol judul. */
.cards-rotator .match-card::after {
  content: "";
  position: absolute;
  left: 50%;
  right: auto;
  top: -18px;
  bottom: auto;
  transform: translateX(-50%);
  display: block;
  width: 30px;
  height: 36px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  font-size: 0;
  line-height: 0;
  background: transparent url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2072%22%20fill%3D%22none%22%3E%0A%20%20%3Cdefs%3E%0A%20%20%20%20%3ClinearGradient%20id%3D%22gold%22%20x1%3D%2210%22%20y1%3D%228%22%20x2%3D%2254%22%20y2%3D%2265%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%20%20%20%20%20%20%3Cstop%20stop-color%3D%22%23fff0ab%22%2F%3E%3Cstop%20offset%3D%22.34%22%20stop-color%3D%22%23b58b36%22%2F%3E%3Cstop%20offset%3D%22.62%22%20stop-color%3D%22%23f2d57b%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2375531b%22%2F%3E%0A%20%20%20%20%3C%2FlinearGradient%3E%0A%20%20%20%20%3ClinearGradient%20id%3D%22jade%22%20x1%3D%2217%22%20y1%3D%2214%22%20x2%3D%2247%22%20y2%3D%2259%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%20%20%20%20%20%20%3Cstop%20stop-color%3D%22%23b0ffe0%22%2F%3E%3Cstop%20offset%3D%22.3%22%20stop-color%3D%22%2336dba4%22%2F%3E%3Cstop%20offset%3D%22.65%22%20stop-color%3D%22%23087e59%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23023e32%22%2F%3E%0A%20%20%20%20%3C%2FlinearGradient%3E%0A%20%20%3C%2Fdefs%3E%0A%20%20%3Cpath%20d%3D%22M32%202%2061%2036%2032%2070%203%2036Z%22%20fill%3D%22%23061a13%22%20stroke%3D%22%23061a13%22%20stroke-width%3D%223%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M32%205%2058%2036%2032%2067%206%2036Z%22%20fill%3D%22url%28%23gold%29%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M32%209%2054%2036%2032%2063%2010%2036Z%22%20fill%3D%22url%28%23jade%29%22%20stroke%3D%22%23d5eaaa%22%20stroke-width%3D%22.7%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M32%209%2026%2029%2010%2036Z%22%20fill%3D%22%2373e6b5%22%2F%3E%0A%20%20%3Cpath%20d%3D%22m32%209%2022%2027-15-7Z%22%20fill%3D%22%23125c43%22%2F%3E%0A%20%20%3Cpath%20d%3D%22m26%2029%206-20%207%2020-7%2019Z%22%20fill%3D%22%235ff5bb%22%2F%3E%0A%20%20%3Cpath%20d%3D%22m10%2036%2016-7%206%2019Z%22%20fill%3D%22%23158c62%22%2F%3E%0A%20%20%3Cpath%20d%3D%22m39%2029%2015%207-22%2012Z%22%20fill%3D%22%2329b780%22%2F%3E%0A%20%20%3Cpath%20d%3D%22m10%2036%2022%2012v15Z%22%20fill%3D%22%23044c3c%22%2F%3E%0A%20%20%3Cpath%20d%3D%22m54%2036-22%2027V48Z%22%20fill%3D%22%230db888%22%2F%3E%0A%20%20%3Cpath%20d%3D%22m26%2029%206%2019%207-19M10%2036l16-7%206-20%22%20stroke%3D%22%23a5ffdc%22%20stroke-opacity%3D%22.6%22%20stroke-width%3D%22.8%22%2F%3E%0A%20%20%3Cpath%20d%3D%22m32%2015%201.2%207.8L38%2025l-4.8%201.4L32%2034l-1.3-7.6L27%2025l3.7-2.2Z%22%20fill%3D%22%23e0ffec%22%20opacity%3D%22.9%22%2F%3E%0A%3C%2Fsvg%3E%0A") center / contain no-repeat;
  box-shadow: none;
  text-shadow: none;
  filter: drop-shadow(0 0 3px rgba(45, 207, 148, .28));
  pointer-events: none;
  z-index: 3;
}
/* AKHIR PATCH ORNAMEN BATU JADE */

/* JADE MOBILE V2
   Load AFTER front.css, only in app/Views/layouts/live.php.
   No changes to scoring, polling, card content, or admin pages.
*/
@media (max-width: 900px) {
  body:has(.cards-rotator) {
    width: 100%;
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    background-color: #03120d;
  }
  .stage:has(.cards-rotator) {
    isolation: isolate;
    height: auto;
    min-height: 100vh;
    padding: 10px max(10px, 2.5vw) 24px;
  }
  /* Decorative layers stay below buttons and cards. */
  .stage:has(.cards-rotator)::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
      url("jade-edge-mobile.svg") left 138px / 65px 400px repeat-y,
      url("jade-edge-right-mobile.svg") right 260px / 65px 400px repeat-y,
      radial-gradient(ellipse at 50% 15%, #0b302766, transparent 70%);
  }
  .stage:has(.cards-rotator)::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: clamp(140px, 38vw, 190px);
    aspect-ratio: 3 / 4;
    z-index: -1;
    background: url("jade-dragon-mobile.webp") right top / contain no-repeat;
    pointer-events: none;
  }
  .stage:has(.cards-rotator) .topbar {
    display: grid;
    /* Equal side tracks keep the title on the cards' center line. */
    grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: center;
    justify-content: normal;
    column-gap: 6px;
    row-gap: 0;
    width: 100%;
    min-height: 0;
    padding: 66px 0 0;
    margin: 0 0 30px;
  }
  .stage:has(.cards-rotator) .topbar > :first-child:not(.title):not(.lb-btn) {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    min-width: 0;
  }
  .stage:has(.cards-rotator) .topbar .brand-logo {
    display: block;
    width: 48px;
    height: auto;
    max-width: 100%;
  }
  .stage:has(.cards-rotator) .topbar .title {
    grid-column: 2;
    grid-row: 1;
    position: static;
    left: auto;
    right: auto;
    transform: none;
    width: auto;
    min-width: 0;
    padding: 0;
    margin: 0;
    text-align: center;
  }
  .stage:has(.cards-rotator) .topbar .title h1 {
    display: block;
    margin: 0;
    padding: 0;
    font-size: clamp(.875rem, 3.8vw, 1.15rem);
    line-height: 1.3;
    letter-spacing: .02em;
    white-space: nowrap;
  }
  .stage:has(.cards-rotator) .topbar .title h1::before,
  .stage:has(.cards-rotator) .topbar .title h1::after {
    display: none;
  }
  .stage:has(.cards-rotator) .topbar .title .flourish {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin: 5px 0 0;
    padding: 0;
    font-size: 24px;
    line-height: 1;
    color: #7fe5b9;
  }
  .stage:has(.cards-rotator) .topbar .title .flourish::before,
  .stage:has(.cards-rotator) .topbar .title .flourish::after {
    content: "";
    display: block;
    flex: 1 1 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ddb85c);
  }
  .stage:has(.cards-rotator) .topbar .title .flourish::after {
    transform: scaleX(-1);
  }
  .stage:has(.cards-rotator) .topbar .lb-btn {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    margin: 0;
    padding: .45rem .5rem;
    font-size: .55rem;
    line-height: 1.2;
    letter-spacing: .035em;
    white-space: nowrap;
    text-align: center;
  }
  .stage:has(.cards-rotator) .cards-rotator {
    width: 100%;
    min-width: 0;
    margin-left: 0;
    margin-right: 0;
  }
  .stage:has(.cards-rotator) .cards-page {
    column-gap: 0;
    row-gap: 26px;
  }
  .stage:has(.cards-rotator) .table-name::after {
    content: "";
    display: inline-block;
    vertical-align: middle;
    width: 30px;
    height: 17px;
    margin-left: 8px;
    background: url("jade-cloud-mobile.svg") center / contain no-repeat;
    pointer-events: none;
  }
}
@media (max-width: 350px) {
  .stage:has(.cards-rotator) .topbar {
    column-gap: 4px;
  }
  .stage:has(.cards-rotator) .topbar .lb-btn {
    font-size: .48rem;
    letter-spacing: .02em;
    padding: .4rem .35rem;
  }
  .stage:has(.cards-rotator) .topbar .brand-logo {
    width: 42px;
  }
}
/* JADE: perbesar logo dan judul mobile.
   Tempel di PALING BAWAH public/assets/jade-mobile-v2.css. */
@media (max-width: 900px) {
  .stage:has(.cards-rotator) .topbar .brand-logo {
    width: clamp(64px, 20vw, 88px);
    height: auto;
    max-width: 100%;
  }
  .stage:has(.cards-rotator) .topbar .title h1 {
    font-size: clamp(18px, 5.2vw, 24px);
    line-height: 1.2;
    letter-spacing: .01em;
  }
}
/* AKHIR PATCH UKURAN HEADER */
/* Kepala naga saja. Tempel di akhir public/assets/jade-mobile-v2.css. */
@media (max-width: 900px) {
  .stage:has(.cards-rotator)::after {
    background-image: url("./jade-dragon-head-right.webp");
    background-position: right top;
    background-size: contain;
    background-repeat: no-repeat;
    aspect-ratio: 3 / 2;
  }
}
@media (max-width: 900px) {
  .stage:has(.cards-rotator) .topbar .brand-logo {
    position: relative;
    top: -60px;
  }
}
@media (max-width: 900px) {
  /* Tombol menutupi tepi bawah potongan kepala naga */
  .stage:has(.cards-rotator) .topbar .lb-btn {
    position: relative;
    top: -8px;
    z-index: 2;
  }

  /* Naikkan kartu 16px, tetap sisakan jarak antarornamen */
  .stage:has(.cards-rotator) .topbar {
    margin-bottom: 14px;
  }
}


@media (max-width: 900px) {
  /* Judul dan ikon hijau ikut naik sejajar logo */
  .stage:has(.cards-rotator) .topbar .title {
    position: relative;
    top: -60px;
    left: auto;
    transform: none;
  }

  /* Geser tombol sedikit ke kanan */
  .stage:has(.cards-rotator) .topbar .lb-btn {
    position: relative;
    top: -8px;
    right: -4px;
    z-index: 2;
  }

  /* Kurangi ruang kosong bekas posisi header */
  .stage:has(.cards-rotator) .topbar {
    margin-bottom: -20px;
  }
}

@media (min-width: 901px) {
  .cards-rotator .player-row .pname {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    text-align: left;
  }

  .cards-rotator .player-row .pname > img {
    display: block;
    flex-shrink: 0;
    margin: 0 !important;
    align-self: center;
  }

  .cards-rotator .player-row .pname > a {
    display: block;
    min-width: 0;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .cards-rotator .player-row .pname > .badge-guest {
    flex-shrink: 0;
    align-self: center;
  }
}
