/* Papan Scoring — layar rotasi empat kuadran */
#papan-scoring.scoring-board {
  --scoring-navy: #09284a;
  --scoring-blue: #1265c5;
  --scoring-sky: #e8f4ff;
  --scoring-green: #0a8f67;
  --scoring-gold: #f5b82e;
  --scoring-ink: #183047;
  --scoring-muted: #64748b;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: calc(100vh - 84px);
  padding: clamp(.85rem, 1.5vw, 1.5rem);
  color: var(--scoring-ink);
  background:
    radial-gradient(circle at 4% 0%, rgba(34, 149, 242, .16), transparent 27rem),
    radial-gradient(circle at 97% 8%, rgba(15, 156, 111, .12), transparent 25rem),
    #f5f9fd;
  border-radius: 1.15rem;
}

#papan-scoring.scoring-board::before,
#papan-scoring.scoring-board::after {
  position: absolute;
  z-index: -1;
  width: 16rem;
  height: 16rem;
  content: "";
  border: 2.5rem solid rgba(18, 101, 197, .04);
  border-radius: 50%;
}

#papan-scoring.scoring-board::before {
  right: -9rem;
  bottom: -10rem;
}

#papan-scoring.scoring-board::after {
  top: 7rem;
  left: -11rem;
  border-color: rgba(10, 143, 103, .045);
}

.scoring-board__header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .9rem;
  padding: .9rem 1.15rem;
  color: #fff;
  background: linear-gradient(120deg, var(--scoring-navy), #0e4e91 65%, #0c7d9a);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 1rem;
  box-shadow: 0 .65rem 1.8rem rgba(10, 55, 99, .2);
}

.scoring-board__header::after {
  position: absolute;
  top: 0;
  right: 13%;
  bottom: 0;
  width: 5rem;
  content: "";
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .1), transparent);
  transform: skewX(-24deg);
}

.scoring-board__eyebrow,
.scoring-panel__eyebrow {
  margin: 0 0 .18rem;
  font-size: .62rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.scoring-board__eyebrow { color: rgba(255, 255, 255, .72); }

.scoring-board__header h1 {
  margin: 0;
  font-size: clamp(1.18rem, 2vw, 1.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.025em;
}

.scoring-board__subtitle {
  margin: .18rem 0 0;
  font-size: clamp(.78rem, 1.15vw, .95rem);
  font-weight: 600;
  color: #e0f2fe;
}

.scoring-board__meta {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: .5rem;
  font-size: .68rem;
  font-weight: 700;
  color: #dbeafe;
  text-align: right;
}

.scoring-branch-dots { display: flex; gap: .3rem; }

.scoring-branch-dots i {
  width: .42rem;
  height: .42rem;
  background: rgba(255, 255, 255, .35);
  border-radius: 99px;
  transition: width .25s ease, background-color .25s ease;
}

.scoring-branch-dots i.is-active {
  width: 1.35rem;
  background: #fcd34d;
}

.scoring-board__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: .9rem;
}

.scoring-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: .95rem;
  box-shadow: 0 .4rem 1.15rem rgba(15, 41, 72, .1);
}

.scoring-panel::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: .25rem;
  content: "";
  background: var(--scoring-blue);
}

.scoring-panel--top-right::before,
.scoring-panel--bottom-right::before { background: var(--scoring-green); }

.scoring-panel--bottom-left::before { background: #3b82f6; }

.scoring-panel--bottom-right::before { background: #14b87a; }

.scoring-panel__header {
  flex: 0 0 auto;
  padding: .7rem .9rem .62rem;
  border-bottom: 1px solid #e5edf5;
}

.scoring-panel__eyebrow { color: var(--scoring-blue); }
.scoring-panel--top-right .scoring-panel__eyebrow,
.scoring-panel--bottom-right .scoring-panel__eyebrow { color: var(--scoring-green); }

.scoring-panel__header h2 {
  margin: 0;
  overflow: hidden;
  font-size: clamp(.88rem, 1.2vw, 1.06rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--scoring-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scoring-panel__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.scoring-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scrollbar-color: #b3c5d8 transparent;
  scrollbar-width: thin;
}

.scoring-table {
  width: 100%;
  margin: 0;
  font-size: clamp(.64rem, .78vw, .76rem);
  border-collapse: separate;
  border-spacing: 0;
}

.scoring-table th,
.scoring-table td {
  padding: .49rem .58rem;
  vertical-align: middle;
  border-bottom: 1px solid #edf2f7;
}

.scoring-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .045em;
  color: #55708c;
  background: #eef6ff;
  white-space: nowrap;
}

.scoring-panel--top-right .scoring-table thead th { background: #ecfdf5; }

.scoring-table tbody tr { transition: background-color .18s ease; }
.scoring-table tbody tr:nth-child(even) { background: rgba(241, 245, 249, .58); }
.scoring-table tbody tr:hover { background: #eaf4ff; }
.scoring-panel--top-right .scoring-table tbody tr:hover { background: #ecfdf5; }
.scoring-table tbody tr:last-child td { border-bottom: 0; }

.scoring-percent {
  font-weight: 800;
  color: #087857;
}

.scoring-rank {
  width: 2rem;
  font-weight: 800;
  color: #1d4f87;
  text-align: center;
}

.scoring-table tbody tr:nth-child(1) .scoring-rank { color: #d38a00; }
.scoring-table tbody tr:nth-child(2) .scoring-rank { color: #667085; }
.scoring-table tbody tr:nth-child(3) .scoring-rank { color: #a35a24; }

.scoring-person { font-weight: 700; color: #23415f; }

.scoring-empty-cell {
  padding: 1.25rem !important;
  color: var(--scoring-muted);
  font-style: italic;
  text-align: center;
}

.scoring-chart-wrap {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-height: 0;
  padding: .35rem .6rem .15rem;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.scoring-chart-wrap canvas {
  display: block;
  width: 100%;
  max-width: 100%;
}

.scoring-board--enter { animation: scoring-board-in .42s ease-out both; }

@keyframes scoring-board-in {
  from { opacity: 0; transform: translateY(.45rem); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tampilan apresiasi setiap tanggal 25 */
.scoring-board--celebration {
  background:
    radial-gradient(circle at 7% 0%, rgba(251, 191, 36, .22), transparent 27rem),
    radial-gradient(circle at 93% 4%, rgba(244, 114, 182, .14), transparent 23rem),
    #fffaf0;
}

.scoring-board__header--celebration {
  background: linear-gradient(120deg, #76216b, #b63a68 53%, #d98522);
}

.scoring-board__header--celebration .scoring-board__subtitle { color: #fff5d5; }

.scoring-board__meta strong {
  display: inline-grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  font-size: 1.08rem;
  color: #8b2454;
  background: #fff5d5;
  border-radius: 50%;
  box-shadow: 0 .3rem .8rem rgba(74, 16, 61, .22);
}

.scoring-board--celebration .scoring-panel::before { background: linear-gradient(90deg, #db2777, #f59e0b); }
.scoring-board--celebration .scoring-panel__eyebrow { color: #bd2c68; }
.scoring-board--celebration .scoring-table thead th { background: #fff3db; }
.scoring-board--celebration .scoring-percent { color: #b75413; }

.scoring-confetti {
  position: absolute;
  z-index: 3;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.scoring-confetti i {
  position: absolute;
  top: -1.5rem;
  left: var(--left);
  width: .48rem;
  height: .85rem;
  background: #f5b82e;
  border-radius: .12rem;
  opacity: .88;
  transform: rotate(var(--rotate));
  animation: scoring-confetti-fall var(--duration) var(--delay) linear infinite;
}

.scoring-confetti i:nth-child(3n) { background: #e64980; border-radius: 50%; }
.scoring-confetti i:nth-child(3n + 1) { background: #1ca9d0; }
.scoring-confetti i:nth-child(4n) { background: #10a879; width: .7rem; height: .38rem; }

@keyframes scoring-confetti-fall {
  0% { transform: translate3d(0, -1rem, 0) rotate(var(--rotate)); opacity: 0; }
  12% { opacity: .9; }
  100% { transform: translate3d(3rem, 105vh, 0) rotate(calc(var(--rotate) + 540deg)); opacity: .15; }
}

@media (min-width: 992px) {
  #papan-scoring.scoring-board {
    display: flex;
    flex-direction: column;
  }

  .scoring-board__grid { flex: 1 1 auto; min-height: 0; }
  .scoring-panel { min-height: 0; }
}

@media (max-height: 770px) and (min-width: 992px) {
  #papan-scoring.scoring-board { min-height: calc(100vh - 67px); padding: .7rem; }
  .scoring-board__header { margin-bottom: .65rem; padding: .65rem .9rem; }
  .scoring-panel__header { padding: .48rem .7rem; }
  .scoring-panel__eyebrow { margin-bottom: .12rem; font-size: .55rem; }
  .scoring-table th, .scoring-table td { padding: .32rem .46rem; }
}

@media (max-width: 991.98px) {
  #papan-scoring.scoring-board { min-height: auto; border-radius: .75rem; }
  .scoring-board__header { align-items: flex-start; }
  .scoring-board__grid { grid-template-columns: 1fr; grid-template-rows: auto; }
  .scoring-panel { min-height: 18rem; }
  .scoring-table-wrap { max-height: 19rem; }
}

@media (max-width: 575.98px) {
  #papan-scoring.scoring-board { padding: .55rem; }
  .scoring-board__header { gap: .5rem; padding: .75rem; border-radius: .7rem; }
  .scoring-board__meta span { display: none; }
  .scoring-table { font-size: .62rem; }
  .scoring-table th, .scoring-table td { padding: .42rem .38rem; }
}

@media (prefers-reduced-motion: reduce) {
  .scoring-board--enter,
  .scoring-confetti i { animation: none; }
}
