body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(to bottom right, #e0f7fa, #ffffff);
  margin: 0;
  padding: 20px;
  color: #2c3e50;
}
.container {
  background: white;
  padding: 20px 10px;
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  max-width: 960px;
  margin: auto;
}
h1 {
  text-align: center;
  color: #2c3e50;
}
.row span {
  font-weight: bold;
  text-align: center;
  font-size: 16px;
  color: #2c3e50;
}
.row button.delete {
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  margin-left: 35px;
}
#buttons {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 20px;
}
button {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}
.add-btn {
  background-color: #3498db;
  color: white;
}
.add-btn:hover {
  background-color: #2980b9;
}
.add-btn:disabled {
  background-color: #95a5a6;
  cursor: not-allowed;
  opacity: 0.65;
}
.add-btn:disabled:hover {
  background-color: #95a5a6;
}
.reset-btn {
  background-color: #f39c12;
  color: white;
}
.reset-btn:hover {
  background-color: #d35400;
}
.note span.red {
  color: red;
  font-weight: bold;
}
.output span.rank-green {
  color: green;
  font-weight: bold;
}
.output span.rank-red {
  color: red;
  font-weight: bold;
}
.output {
  margin: 20px 0;
  background: #fefefe;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  display: flex;
  flex-direction: column-reverse;
}
.output div {
  margin-bottom: 5px;
}
.score-display div {
  text-align: center;
}
.player-rank {
  font-size: 12px;
  font-weight: 600;
  color: #7f8c8d;
  margin-bottom: 2px;
}
@media screen and (min-width: 768px) {
  .nameInputs-row {
    display: grid;
    grid-template-columns: repeat(3, 100px) 100px;
    justify-content: center;
    align-items: center;
    gap: 10px;
  }
  input {
    padding: 10px;
    width: 80px;
    text-align: center;
    border-radius: 5px;
    border: 1px solid #ccc;
    transition: border 0.3s;
  }
  input:focus {
    border-color: #3498db;
    outline: none;
  }
  input.width {
    width: 40px !important;
  }
  .row {
    display: grid;
    grid-template-columns: repeat(4, 60px) 0px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 5px 0px;
  }
  .score-display {
    display: grid;
    grid-template-columns: repeat(4, 60px) 0px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: bold;
    color: #34495e;
    max-width: 520px;
    margin: auto;
    margin-top: 10px;
  }
  #full-screen-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    z-index: 9999;
    display: none;
  }
}
@media screen and (max-width: 767px) {
  .nameInputs-row {
    display: grid;
    grid-template-columns: repeat(3, 80px) 80px;
    justify-content: center;
    align-items: center;
    gap: 10px;
  }
  input {
    padding: 10px;
    margin: 1px 0;
    width: 60px;
    text-align: center;
    border-radius: 5px;
    border: 1px solid #ccc;
    transition: border 0.3s;
    font-size: 16px;
  }
  input:focus {
    border-color: #3498db;
    outline: none;
  }
  input.width {
    width: 40px !important;
  }
  .row {
    display: grid;
    grid-template-columns: repeat(4, 60px) 0px;
    justify-content: center;
    align-items: center;
    gap: 10px;
  }
  .score-display {
    display: grid;
    grid-template-columns: repeat(4, 60px) 0px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: bold;
    color: #34495e;
    max-width: 520px;
    margin: auto;
    margin-top: 10px;
  }
}

/* Scoreboard overlay — full screen (mobile) */
.scoreboard-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 10001;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  pointer-events: none;
  box-sizing: border-box;
  background: linear-gradient(
    180deg,
    rgba(0, 30, 60, 0.97) 0%,
    rgba(0, 0, 0, 0.98) 45%,
    rgba(0, 20, 50, 0.97) 100%
  );
  animation: fireBlastFadeIn 0.2s ease-out forwards;
}
.scoreboard-overlay.hidden {
  display: none;
}
.scoreboard-panel {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  max-width: none;
  margin: 0;
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  animation: fxContentPop 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}
.scoreboard-title {
  display: none;
}
.scoreboard-rows {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  flex: 1;
  width: 100%;
  min-height: 0;
  gap: 0;
  padding: clamp(8px, 2vmin, 16px) 0;
  box-sizing: border-box;
}
.scoreboard-player {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(2px, 1vmin, 8px);
  padding: clamp(4px, 1.5vmin, 12px) clamp(12px, 4vw, 24px);
  box-sizing: border-box;
}
.sb-name {
  margin: 0;
  padding: 0;
  font-weight: 800;
  font-size: clamp(1.1rem, 5.5vmin, 1.65rem);
  line-height: 1.1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b3e5fc;
  text-shadow:
    0 2px 12px rgba(0, 0, 0, 0.9),
    0 0 24px rgba(79, 195, 247, 0.55),
    0 0 40px rgba(41, 182, 246, 0.25);
}
.sb-score {
  margin: 0;
  padding: 0;
  display: block;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  font-size: clamp(2.8rem, 14vmin, 5rem);
  color: #ffffff;
  letter-spacing: -0.02em;
  text-shadow:
    0 4px 16px rgba(0, 0, 0, 0.95),
    0 0 32px rgba(255, 255, 255, 0.35),
    0 0 48px rgba(100, 181, 246, 0.2);
  transition: transform 0.06s ease, color 0.12s ease, text-shadow 0.12s ease;
}
.sb-score.sb-up {
  color: #b9f6ca;
  text-shadow:
    0 4px 16px rgba(0, 0, 0, 0.9),
    0 0 28px rgba(105, 240, 174, 0.85),
    0 0 56px rgba(0, 230, 118, 0.45);
}
.sb-score.sb-down {
  color: #ffab91;
  text-shadow:
    0 4px 16px rgba(0, 0, 0, 0.9),
    0 0 28px rgba(255, 138, 128, 0.85),
    0 0 56px rgba(255, 87, 34, 0.4);
}
.sb-score.sb-tick {
  transform: scale(1.06);
  filter: brightness(1.25);
}

/* Full-screen FX overlays */
.fx-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(255, 80, 0, 0.35) 0%, rgba(120, 0, 0, 0.85) 55%, rgba(0, 0, 0, 0.92) 100%);
  animation: fireBlastFadeIn 0.25s ease-out forwards;
}
.fx-overlay.hidden {
  display: none;
}
.fx-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.fx-bolts {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.fx-extra {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.fx-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  animation: fxContentPop 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}
.fx-content .fx-extra {
  position: relative;
  bottom: auto;
  inset: auto;
  height: auto;
  width: 100%;
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.fx-line {
  margin: 0;
  line-height: 1.15;
}
.fx-line + .fx-line {
  margin-top: 10px;
}

/* Kaduruk & MODAR (api) */
.fx-kaduruk,
.fx-modar {
  background: radial-gradient(circle at center, rgba(255, 80, 0, 0.35) 0%, rgba(120, 0, 0, 0.85) 55%, rgba(0, 0, 0, 0.92) 100%);
}
.fx-kaduruk .fx-bg::before,
.fx-modar .fx-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 220, 100, 0.7) 0%, transparent 55%);
  animation: fxFlashOnce 0.55s ease-out forwards;
}
.fx-modar .fx-line {
  color: #ff1744;
  font-size: clamp(2.5rem, 12vw, 5rem);
  font-weight: 900;
  text-shadow:
    0 3px 8px rgba(0, 0, 0, 0.95),
    0 0 24px #ff1744,
    0 0 48px #ff5722,
    0 0 72px rgba(255, 23, 68, 0.85),
    3px 3px 0 #4a0000,
    -1px -1px 0 rgba(0, 0, 0, 0.8);
  animation: fxPulse 0.35s ease-in-out infinite alternate;
}
.fx-kaduruk .fx-line {
  color: #fff;
  font-size: clamp(2.5rem, 12vw, 5rem);
  font-weight: 900;
  text-shadow: 0 0 10px #ff5722, 0 0 30px #ff9800, 0 0 50px #ff5722;
  animation: fxPulse 0.4s ease-in-out infinite alternate;
}
.fx-kaduruk .fx-flames {
  margin-bottom: 0;
}
.fx-flames {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  height: 80px;
  align-items: flex-end;
}
.fx-flames span {
  display: block;
  width: 18px;
  border-radius: 50% 50% 20% 20%;
  background: linear-gradient(to top, #b71c1c, #ff5722 40%, #ffeb3b 85%, transparent);
  animation: fxFlame 0.35s ease-in-out infinite alternate;
}
.fx-flames span:nth-child(odd) { height: 55px; }
.fx-flames span:nth-child(even) { height: 70px; }

/* Jackpot 250 - hijau, petir terus */
.fx-jackpot250 {
  background: radial-gradient(circle at center, rgba(0, 255, 140, 0.3) 0%, rgba(0, 50, 35, 0.92) 55%, #000 100%);
}
.fx-jackpot250 .fx-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 0%, rgba(0, 230, 118, 0.35), transparent 45%),
    radial-gradient(circle at 70% 100%, rgba(118, 255, 3, 0.25), transparent 40%);
  animation: fxJokerPulse 0.7s ease-in-out infinite alternate;
}
.fx-jackpot250 .fx-line {
  color: #00e676;
  font-size: clamp(3rem, 14vw, 6rem);
  font-weight: 900;
  text-shadow:
    0 3px 10px rgba(0, 0, 0, 0.95),
    0 0 28px #00e676,
    0 0 56px #00e676,
    0 0 80px rgba(0, 230, 118, 0.75),
    2px 2px 0 #004d25,
    -2px 2px 0 #004d25;
}
.bolt {
  position: absolute;
  width: 8px;
  background: linear-gradient(to bottom, transparent, currentColor 40%, #fff 70%, currentColor);
  opacity: 0;
  transform-origin: top center;
}
.bolt-green { color: #00e676; filter: drop-shadow(0 0 14px #00e676); }
.bolt-lime { color: #76ff03; filter: drop-shadow(0 0 14px #76ff03); }
.bolt-mint { color: #69f0ae; filter: drop-shadow(0 0 12px #69f0ae); }

/* Jackpot 500 - meriah, petir atas & bawah */
.fx-jackpot500 {
  background: radial-gradient(ellipse at center, #1a0033 0%, #0d001a 45%, #000 100%);
  animation: fxJokerBgFestive 0.1s steps(2) infinite;
}
.fx-jackpot500 .fx-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(255, 23, 68, 0.55), transparent),
    radial-gradient(ellipse 70% 35% at 20% 0%, rgba(124, 77, 255, 0.45), transparent),
    radial-gradient(ellipse 70% 35% at 80% 0%, rgba(255, 109, 0, 0.4), transparent),
    radial-gradient(ellipse 80% 40% at 50% 100%, rgba(224, 64, 251, 0.5), transparent),
    radial-gradient(ellipse 60% 30% at 15% 100%, rgba(255, 215, 0, 0.4), transparent),
    radial-gradient(ellipse 60% 30% at 85% 100%, rgba(0, 229, 255, 0.35), transparent);
  animation: fxJokerPulse 0.45s ease-in-out infinite alternate;
}
.fx-jackpot500 .fx-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, #ffd700 2px, transparent 2px),
    radial-gradient(circle, #ff1744 1.5px, transparent 1.5px);
  background-size: 55px 55px, 80px 80px;
  opacity: 0.35;
  animation: fxSparkleDrift 2.5s linear infinite;
}
.fx-jackpot500 .fx-line {
  color: #fff;
  font-size: clamp(2.5rem, 12vw, 5rem);
  font-weight: 900;
  text-shadow:
    0 3px 12px rgba(0, 0, 0, 0.95),
    0 0 24px #ff1744,
    0 0 48px #e040fb,
    0 0 64px #ffd700,
    3px 3px 0 #4a0080;
  animation: fxPulse 0.18s ease-in-out infinite alternate;
}
.bolt-red { color: #ff1744; filter: drop-shadow(0 0 16px #ff1744); }
.bolt-gold { color: #ffd700; filter: drop-shadow(0 0 14px #ffd700); }
.bolt-purple { color: #7c4dff; filter: drop-shadow(0 0 14px #7c4dff); }
.bolt-magenta { color: #e040fb; filter: drop-shadow(0 0 14px #e040fb); }
.bolt-orange { color: #ff6d00; filter: drop-shadow(0 0 14px #ff6d00); }
.bolt-cyan { color: #00e5ff; filter: drop-shadow(0 0 14px #00e5ff); }
.bolt-storm {
  width: 10px;
  animation: boltStormStrike ease-out infinite;
}
.bolt-from-top {
  top: 0;
  bottom: auto;
  height: 100vh;
  min-height: 100%;
  transform-origin: top center;
}
.bolt-from-bottom {
  top: auto;
  bottom: 0;
  height: 100vh;
  min-height: 100%;
  transform-origin: bottom center;
  animation-name: boltStormStrikeBottom;
}
@keyframes boltStormStrike {
  0%, 100% { opacity: 0; transform: rotate(var(--bolt-rot, 0deg)) scaleY(0.08); }
  6% { opacity: 1; transform: rotate(var(--bolt-rot, 0deg)) scaleY(1); }
  18% { opacity: 0.15; }
  28% { opacity: 1; transform: rotate(var(--bolt-rot, 0deg)) scaleY(0.92); }
  42% { opacity: 0; }
  55% { opacity: 0.9; transform: rotate(var(--bolt-rot, 0deg)) scaleY(1); }
  68% { opacity: 0; }
}
@keyframes boltStormStrikeBottom {
  0%, 100% { opacity: 0; transform: rotate(var(--bolt-rot, 0deg)) scaleY(-0.08); }
  6% { opacity: 1; transform: rotate(var(--bolt-rot, 0deg)) scaleY(-1); }
  18% { opacity: 0.15; }
  28% { opacity: 1; transform: rotate(var(--bolt-rot, 0deg)) scaleY(-0.92); }
  42% { opacity: 0; }
  55% { opacity: 0.9; transform: rotate(var(--bolt-rot, 0deg)) scaleY(-1); }
  68% { opacity: 0; }
}
@keyframes fxJokerBgFestive {
  0%, 100% { filter: hue-rotate(0deg) brightness(1); }
  50% { filter: hue-rotate(15deg) brightness(1.15); }
}
@keyframes fxJokerPulse {
  from { opacity: 0.65; }
  to { opacity: 1; }
}
@keyframes fxSparkleDrift {
  from { transform: translateY(0); }
  to { transform: translateY(60px); opacity: 0.2; }
}

/* Champion */
.fx-champion {
  background: radial-gradient(circle at center, rgba(255, 215, 0, 0.45) 0%, rgba(180, 120, 0, 0.85) 45%, rgba(40, 20, 0, 0.95) 100%);
}
.fx-champion .fx-bg::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 215, 0, 0.35), transparent 30%);
  animation: fxRaysSpin 4s linear infinite;
}
.fx-champion .fx-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, #ffeb3b 3px, transparent 3px),
    radial-gradient(circle, #ffd54f 2px, transparent 2px);
  background-size: 70px 70px, 110px 110px;
  opacity: 0.5;
  animation: fxConfetti 2s linear infinite;
}
.fx-champion .fx-line {
  color: #ffeb3b;
  font-size: clamp(2rem, 10vw, 4.5rem);
  font-weight: 900;
  text-shadow:
    0 3px 10px rgba(0, 0, 0, 0.95),
    0 0 28px #ffd700,
    0 0 56px rgba(255, 215, 0, 0.85),
    0 0 80px rgba(255, 193, 7, 0.6),
    3px 3px 0 #8b6914,
    -2px 2px 0 #5c4a0a;
  animation: fxPulse 0.5s ease-in-out infinite alternate;
}

@keyframes fxContentPop {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes fxFlashOnce {
  0% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes fxPulse {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}
@keyframes fxFlame {
  from { transform: scaleY(0.85); filter: brightness(1); }
  to { transform: scaleY(1.15); filter: brightness(1.3); }
}
@keyframes boltStrikeOnce {
  0% { opacity: 0; transform: scaleY(0) rotate(12deg); }
  15% { opacity: 1; }
  40% { opacity: 1; transform: scaleY(1) rotate(12deg); }
  100% { opacity: 0; transform: scaleY(1.05) rotate(12deg); }
}
@keyframes boltStrike {
  0% { opacity: 0; transform: scaleY(0); }
  10% { opacity: 1; transform: scaleY(1); }
  25% { opacity: 0.2; }
  35% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes fxJokerBg {
  0%, 100% { background-color: #0a0a0a; }
  50% { background-color: #1a0000; }
}
@keyframes fxRaysSpin {
  to { transform: rotate(360deg); }
}
@keyframes fxConfetti {
  from { transform: translateY(0); }
  to { transform: translateY(80px); opacity: 0.3; }
}

@keyframes fireBlastFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Site nav & pages */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  max-width: 960px;
  margin: 0 auto 16px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.site-nav a {
  color: #2980b9;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.site-nav a.active {
  color: #1a5276;
  text-decoration: underline;
}
.home-page {
  min-height: 100vh;
  background: linear-gradient(165deg, #e8f4fc 0%, #f5f7fa 45%, #fff8e7 100%);
}
.home-wrap {
  max-width: 720px;
  padding-bottom: 48px;
}
.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  margin-bottom: 28px;
  padding: 28px 24px 26px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #1a5276 0%, #2980b9 50%, #5dade2 100%);
  box-shadow: 0 14px 36px rgba(41, 128, 185, 0.38);
  position: relative;
  overflow: hidden;
}
.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(255, 255, 255, 0.08) 0%, transparent 45%);
  pointer-events: none;
}
.home-hero-icon,
.home-hero-text {
  position: relative;
  z-index: 1;
}
.home-hero-icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.home-hero-text {
  width: 100%;
  max-width: 520px;
}
.home-title {
  margin: 0 0 8px;
  font-size: clamp(2rem, 9vw, 2.75rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
.home-sub {
  margin: 0 auto;
  font-size: clamp(0.88rem, 3vw, 1rem);
  font-weight: 500;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
  max-width: 420px;
}
.mode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 560px) {
  .mode-grid {
    grid-template-columns: 1fr 1fr;
  }
  .home-hero {
    align-items: center;
    justify-content: center;
    padding: 36px 40px 32px;
    gap: 18px;
  }
  .home-hero-icon {
    width: 72px;
    height: 72px;
    font-size: 2.5rem;
    border-radius: 18px;
  }
  .home-hero-text {
    text-align: center;
  }
  .home-title {
    font-size: 2.5rem;
    letter-spacing: 0.14em;
    margin-bottom: 10px;
  }
  .home-sub {
    font-size: 1rem;
    max-width: 480px;
  }
}
@media (max-width: 559px) {
  .home-hero {
    padding: 22px 18px 20px;
  }
  .home-title {
    letter-spacing: 0.08em;
  }
}
.mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 20px;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.mode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}
.mode-exhibition .mode-icon {
  color: #27ae60;
}
.mode-ranked .mode-icon {
  color: #e67e22;
}
.mode-label {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.mode-desc {
  font-size: 0.9rem;
  color: #7f8c8d;
}
.container h1.scoresheet-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  line-height: 1.15;
  margin-bottom: 16px;
}
.scoresheet-title-main {
  display: block;
}
.mode-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 6px;
  background: #fdebd0;
  color: #d35400;
}
.mode-tag.exhibition {
  background: #d5f5e3;
  color: #1e8449;
}

.match-replay-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  width: 100%;
  max-width: 320px;
}

.btn-match-replay {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: #1a252f;
  background: linear-gradient(180deg, #f7dc6f 0%, #f0b429 100%);
  box-shadow: 0 4px 14px rgba(211, 84, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-match-replay:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(211, 84, 0, 0.32);
}

.btn-match-replay:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-match-replay.is-running {
  opacity: 0.85;
  cursor: wait;
}

.match-replay-status {
  font-size: 0.78rem;
  font-weight: 600;
  color: #7f8c8d;
  min-height: 1.2em;
  text-align: center;
}

.readonly-sheet .match-replay-bar {
  margin-bottom: 4px;
}
.page-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 12px 40px;
}
.page-desc {
  color: #7f8c8d;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #ecf0f1;
  text-align: left;
  font-size: 14px;
}
.data-table th {
  background: #ecf0f1;
  font-weight: 700;
}
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-pending {
  background: #fef9e7;
  color: #b7950b;
}
.badge-approved {
  background: #d5f5e3;
  color: #1e8449;
}
.badge-rejected {
  background: #fadbd8;
  color: #c0392b;
}
.match-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.match-filter-label {
  font-weight: 700;
  font-size: 14px;
  color: #2c3e50;
  margin-right: 4px;
}
.match-filter-btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: #2980b9;
  background: #ecf0f1;
  transition: background 0.15s, color 0.15s;
}
.match-filter-btn:hover {
  background: #d6eaf8;
  color: #1a5276;
}
.match-filter-btn.active {
  background: #3498db;
  color: white;
}
.match-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.match-list-item {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e8ecef;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.07);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.match-list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: #d5dbdb;
}
.match-list-item--pending {
  border-left: 5px solid #f1c40f;
}
.match-list-item--approved {
  border-left: 5px solid #27ae60;
}
.match-list-item--rejected {
  border-left: 5px solid #e74c3c;
}
.match-list-card {
  padding: 16px 18px 14px;
}
.match-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ecf0f1;
}
.match-list-id {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1a5276;
  letter-spacing: 0.02em;
}
.match-list-head .badge {
  font-size: 11px;
  padding: 4px 12px;
}
.match-list-arrow {
  margin-left: auto;
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  color: #bdc3c7;
  transition: color 0.15s, transform 0.15s;
}
.match-list-item:hover .match-list-arrow {
  color: #2980b9;
  transform: translateX(3px);
}
.match-list-players-block {
  margin-bottom: 12px;
}
.match-list-section-label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7f8c8d;
}
.match-list-players {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.match-list-players li {
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
  background: #f4f6f7;
  border-radius: 8px;
  border: 1px solid #ecf0f1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.match-list-players li.match-list-player--high {
  color: #1e6b3a;
  background: linear-gradient(180deg, #e8f8ef 0%, #d5f5e3 100%);
  border-color: #82e0aa;
  box-shadow: inset 0 0 0 1px rgba(39, 174, 96, 0.15);
}
.match-list-players li.match-list-player--low {
  color: #922b21;
  background: linear-gradient(180deg, #fdedec 0%, #fadbd8 100%);
  border-color: #f1948a;
  box-shadow: inset 0 0 0 1px rgba(231, 76, 60, 0.12);
}
.match-list-item:hover .match-list-players li:not(.match-list-player--high):not(.match-list-player--low) {
  background: #eaf2f8;
  border-color: #d6eaf8;
}
.match-list-item:hover .match-list-players li.match-list-player--high {
  background: linear-gradient(180deg, #eafaf1 0%, #abebc6 100%);
  border-color: #58d68d;
}
.match-list-item:hover .match-list-players li.match-list-player--low {
  background: linear-gradient(180deg, #fef5f4 0%, #f5b7b1 100%);
  border-color: #ec7063;
}
.match-list-foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px dashed #ecf0f1;
}
.match-list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: #7f8c8d;
}
.match-list-meta-item {
  font-weight: 500;
}
.match-list-review {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  background: #f8f9fa;
}
.match-list-review--approved {
  color: #1e8449;
  background: #eafaf1;
}
.match-list-review--rejected {
  color: #c0392b;
  background: #fdedec;
}
@media screen and (max-width: 480px) {
  .match-list-card {
    padding: 14px;
  }
  .match-list-players {
    grid-template-columns: 1fr;
  }
  .match-list-id {
    font-size: 1.05rem;
  }
}
.match-review-cell {
  font-size: 13px;
  min-width: 140px;
}
.match-review-line {
  display: block;
  font-weight: 600;
}
.match-review-line--approved {
  color: #1e8449;
}
.match-review-line--rejected {
  color: #c0392b;
}
.match-review-at {
  display: block;
  color: #7f8c8d;
  font-size: 11px;
  margin-top: 2px;
}
.match-review-empty {
  color: #bdc3c7;
}
.readonly-review {
  font-weight: 600;
}
.readonly-review--approved {
  color: #1e8449;
}
.readonly-review--rejected {
  color: #c0392b;
}
.ranked-submit {
  margin-top: 24px;
  overflow: hidden;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #dfe6e9;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}
.ranked-submit-header {
  padding: 18px 20px;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #2980b9 0%, #1a5276 100%);
}
.ranked-submit-title {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.ranked-submit-desc {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  opacity: 0.92;
  font-weight: 400;
}
.ranked-submit-desc strong {
  font-weight: 700;
}
.ranked-submit-body {
  padding: 20px;
  background: #f8fafb;
}
.ranked-submit-row {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}
.ranked-submit-row--2 {
  grid-template-columns: 1fr 1fr;
}
.ranked-submit-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
.ranked-submit-field--full {
  margin-bottom: 16px;
}
.ranked-submit-label {
  font-size: 16px;
  font-weight: 700;
  color: #2c3e50;
  letter-spacing: 0.02em;
}
.ranked-submit-optional {
  font-style: normal;
  font-weight: 500;
  color: #7f8c8d;
}
.ranked-submit-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid #cfd8dc;
  border-radius: 8px;
  font-size: 16px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ranked-submit-input:hover {
  border-color: #aeb6bf;
}
.ranked-submit-input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.18);
}
.ranked-submit-textarea {
  min-height: 72px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.45;
}
.nameInputs-row select {
  width: 100%;
  max-width: 120px;
  padding: 10px 8px;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 14px;
  background: white;
}
.ranked-submit.readonly-notes {
  padding: 20px;
  background: #f8fafb;
}
.ranked-submit.readonly-notes h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  color: #2c3e50;
}
.ranked-submit-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}
.submit-btn {
  width: 100%;
  max-width: 280px;
  background: linear-gradient(180deg, #27ae60 0%, #1e8449 100%);
  color: white;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.03em;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(30, 132, 73, 0.3);
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}
.submit-btn:hover {
  background: linear-gradient(180deg, #2ecc71 0%, #219a52 100%);
  box-shadow: 0 6px 18px rgba(30, 132, 73, 0.38);
}
.submit-btn:active {
  transform: scale(0.98);
}
.submit-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  background: #95a5a6;
  box-shadow: none;
  transform: none;
}
.submit-btn:disabled:hover {
  background: #95a5a6;
  box-shadow: none;
}
.submit-min-score-hint {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: #c0392b;
  text-align: center;
  line-height: 1.45;
}
.submit-min-score-hint--ok {
  color: #1e8449;
}
.submit-status {
  margin: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  min-height: 1.25em;
}
.submit-status.success {
  color: #27ae60;
}
.submit-success-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}
.submit-success-overlay.hidden {
  display: none;
}
.submit-success-popup {
  width: 100%;
  max-width: 360px;
  padding: 28px 24px 24px;
  text-align: center;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  animation: submitSuccessPop 0.35s ease-out;
}
@keyframes submitSuccessPop {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.submit-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, #2ecc71 0%, #27ae60 100%);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  line-height: 56px;
}
.submit-success-title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  color: #1e8449;
}
.submit-success-msg {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.5;
  color: #555;
}
.submit-success-btn {
  min-width: 120px;
  padding: 12px 28px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #27ae60 0%, #1e8449 100%);
  box-shadow: 0 4px 14px rgba(30, 132, 73, 0.35);
}
.submit-success-btn:hover {
  background: linear-gradient(180deg, #2ecc71 0%, #219a52 100%);
}
.submit-status.error {
  color: #c0392b;
}
@media screen and (max-width: 767px) {
  .ranked-submit-header {
    padding: 16px;
  }
  .ranked-submit-body {
    padding: 16px;
  }
  .ranked-submit-row--2 {
    grid-template-columns: 1fr;
  }
  .ranked-submit-actions .submit-btn {
    max-width: 100%;
  }
}
.readonly-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 14px;
}
.readonly-names {
  margin-bottom: 16px;
}
.readonly-player-name {
  font-weight: 700;
  padding: 8px 12px;
  background: #ecf0f1;
  border-radius: 6px;
  text-align: center;
}
/* Overlay FX: default .hidden; saat replay match readonly tampil full screen */
body.match-replay-playing .fx-overlay:not(.hidden),
body.match-replay-playing .scoreboard-overlay:not(.hidden) {
  display: flex !important;
  z-index: 100000;
}
.readonly-field {
  background: #f4f6f7 !important;
  color: #2c3e50 !important;
  cursor: default;
  opacity: 1;
}
.readonly-field:focus {
  outline: none;
  border-color: #bdc3c7 !important;
}
.readonly-row input.width {
  pointer-events: none;
}
input.width.input-invalid {
  border-color: #e74c3c !important;
  background-color: #fdecea;
  cursor: help;
}
input.width.input-invalid:focus {
  border-color: #c0392b !important;
  outline: none;
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.25);
}
/* Admin login */
.admin-login-page {
  background: linear-gradient(165deg, #e8f4fc 0%, #f0f3f5 50%, #eafaf1 100%);
  min-height: 100vh;
}
.admin-page--guest {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 120px);
  max-width: 440px;
}
.admin-login-shell {
  width: 100%;
  margin: 24px auto;
}
.admin-login-card {
  margin: 0;
  padding: 0;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(41, 128, 185, 0.18);
}
.admin-login-header {
  padding: 28px 28px 22px;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #1a5276 0%, #2980b9 55%, #3498db 100%);
}
.admin-login-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.admin-login-header h1 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.admin-login-subtitle {
  margin: 0;
  font-size: 0.88rem;
  opacity: 0.9;
}
.admin-login-alert {
  margin: 16px 24px 0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}
.admin-login-fields {
  padding: 24px 28px 8px;
}
.admin-login-label {
  display: block;
  margin-bottom: 18px;
}
.admin-login-label span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #5d6d7e;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.admin-login-label input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid #d5dbdb;
  border-radius: 10px;
  background: #fafbfc;
  color: #2c3e50;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.admin-login-label input::placeholder {
  color: #aab7b8;
  font-weight: 400;
}
.admin-login-label input:hover {
  border-color: #aeb6bf;
}
.admin-login-label input:focus {
  outline: none;
  border-color: #3498db;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}
.admin-login-submit {
  display: block;
  width: calc(100% - 56px);
  margin: 8px 28px 28px;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #27ae60 0%, #1e8449 100%);
  box-shadow: 0 4px 14px rgba(30, 132, 73, 0.35);
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}
.admin-login-submit:hover {
  background: linear-gradient(180deg, #2ecc71 0%, #219a52 100%);
  box-shadow: 0 6px 18px rgba(30, 132, 73, 0.4);
}
.admin-login-submit:active {
  transform: scale(0.98);
}
.admin-login-submit:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  background: #95a5a6;
  box-shadow: none;
}
.admin-login-recaptcha {
  display: flex;
  justify-content: center;
  padding: 4px 28px 12px;
}
.admin-login-recaptcha .g-recaptcha {
  transform-origin: center top;
}
@media (max-width: 480px) {
  .admin-page--guest {
    min-height: calc(100vh - 100px);
    padding: 0 8px;
  }
  .admin-login-fields {
    padding: 20px 20px 8px;
  }
  .admin-login-submit {
    width: calc(100% - 40px);
    margin-left: 20px;
    margin-right: 20px;
    margin-bottom: 24px;
  }
  .admin-login-header {
    padding: 24px 20px 18px;
  }
  .admin-login-recaptcha {
    padding: 4px 16px 12px;
  }
  .admin-login-recaptcha .g-recaptcha {
    transform: scale(0.92);
  }
}
.admin-dashboard-page {
  background: linear-gradient(165deg, #e8f4fc 0%, #f5f7fa 50%, #f8fafb 100%);
  min-height: 100vh;
}
.admin-page .page-wrap {
  max-width: 1100px;
}
.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 18px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8ecef;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}
.admin-bar-user {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.admin-bar-label {
  font-size: 13px;
  color: #7f8c8d;
}
.admin-bar-name {
  font-size: 1.05rem;
  color: #2c3e50;
}
.admin-logout-form {
  margin: 0;
}
.admin-logout-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: #7f8c8d;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.admin-logout-btn:hover {
  background: #5d6d7e;
}
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding: 6px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8ecef;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.admin-tabs a {
  padding: 10px 18px;
  border-radius: 8px;
  background: transparent;
  text-decoration: none;
  color: #5d6d7e;
  font-weight: 700;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
.admin-tabs a:hover {
  background: #ecf0f1;
  color: #2c3e50;
}
.admin-tabs a.active {
  background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(41, 128, 185, 0.35);
}
.admin-section {
  margin-bottom: 24px;
}
.admin-section-head {
  margin-bottom: 16px;
}
.admin-section-head h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #1a5276;
}
.admin-section-desc {
  margin: 0;
  font-size: 14px;
  color: #7f8c8d;
  line-height: 1.45;
}
.admin-toolbar,
.admin-user-add-form,
.admin-player-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.inline-form {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.admin-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e8ecef;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  background: #fff;
}
.admin-table-wrap--wide {
  -webkit-overflow-scrolling: touch;
}
.admin-page .data-table.admin-table {
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  border: none;
}
.admin-page .admin-table thead th {
  padding: 14px 14px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #ecf0f1;
  background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
  border-bottom: none;
  white-space: nowrap;
}
.admin-page .admin-table tbody td {
  padding: 12px 14px;
  font-size: 14px;
  vertical-align: middle;
}
.admin-page .admin-table tbody tr {
  transition: background 0.12s ease;
}
.admin-page .admin-table tbody tr:hover {
  background: #f8fafb;
}
.admin-page .admin-table tbody tr:last-child td {
  border-bottom: none;
}
.admin-col-id {
  width: 56px;
  font-weight: 800;
  color: #2980b9;
  white-space: nowrap;
}
.admin-match-link {
  font-weight: 800;
  color: #2980b9;
  text-decoration: none;
}
.admin-match-link:hover {
  text-decoration: underline;
}
.admin-cell-name {
  color: #2c3e50;
}
.admin-col-date {
  font-size: 13px;
  color: #7f8c8d;
  white-space: nowrap;
}
.admin-col-players {
  font-size: 13px;
  line-height: 1.4;
  max-width: 200px;
}
.admin-col-meta {
  font-size: 13px;
  line-height: 1.4;
  color: #5d6d7e;
}
.admin-col-meta small {
  color: #95a5a6;
}
.admin-col-notes {
  font-size: 13px;
  color: #5d6d7e;
  max-width: 160px;
}
.admin-col-actions {
  min-width: 140px;
}
.admin-btn-primary {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: #2980b9;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.admin-btn-primary:hover {
  background: #1a5276;
}
.admin-btn-secondary {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #2c3e50;
  background: #ecf0f1;
  border: 1px solid #d5dbdb;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.admin-btn-secondary:hover {
  background: #d5dbdb;
}
.admin-row-form {
  margin: 0;
}
.admin-player-name-cell {
  min-width: 220px;
}
.admin-player-rename-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
}
.admin-player-rename-input {
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 280px;
}
.admin-match-status-locked {
  margin: 0 0 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #7f8c8d;
  background: #f4f6f7;
  border: 1px dashed #d5dbdb;
  border-radius: 8px;
}
.admin-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.admin-actions-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.admin-page .alert {
  margin-bottom: 16px;
  border-radius: 10px;
  font-weight: 600;
}
.admin-inline-input,
.admin-role-select {
  padding: 10px 12px;
  border: 1px solid #bdc3c7;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: #2c3e50;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.admin-inline-input {
  min-width: 140px;
}
.admin-inline-input::placeholder {
  color: #95a5a6;
}
.admin-inline-input:hover,
.admin-role-select:hover {
  border-color: #aeb6bf;
}
.admin-inline-input:focus,
.admin-role-select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.18);
}
.admin-inline-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-inline-field--role {
  min-width: 120px;
}
.admin-inline-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7f8c8d;
}
.admin-role-select {
  min-width: 120px;
  padding-right: 32px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235d6d7e' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
}
.admin-role-select option {
  font-weight: 600;
}
.admin-inline-submit {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, #27ae60 0%, #1e8449 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(30, 132, 73, 0.28);
  white-space: nowrap;
}
.admin-inline-submit:hover {
  background: linear-gradient(180deg, #2ecc71 0%, #219a52 100%);
}
@media (max-width: 640px) {
  .admin-toolbar,
  .admin-user-add-form,
  .admin-player-add-form {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-inline-input,
  .admin-inline-field--role,
  .admin-role-select {
    width: 100%;
    min-width: 0;
  }
  .admin-inline-submit {
    width: 100%;
  }
  .admin-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-logout-form {
    width: 100%;
  }
  .admin-logout-btn {
    width: 100%;
  }
}
.admin-role-cell {
  min-width: 160px;
}
.admin-role-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.admin-role-select--table {
  min-width: 100px;
  padding: 7px 28px 7px 10px;
  font-size: 13px;
}
.admin-role-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #95a5a6;
}
.admin-user-pw-cell {
  width: 200px;
  min-width: 200px;
  vertical-align: top;
}
.admin-pw-change-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 10px;
  background: #f8fafb;
  border: 1px solid #e8ecef;
  border-radius: 10px;
}
.admin-pw-user-tag {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #2980b9;
  margin-bottom: 2px;
}
.admin-pw-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}
.admin-pw-field--compact .admin-pw-label {
  font-size: 10px;
}
.admin-pw-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7f8c8d;
}
.admin-pw-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #bdc3c7;
  border-radius: 7px;
  font-size: 13px;
  background: #fff;
  color: #2c3e50;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.admin-pw-input::placeholder {
  color: #aeb6bf;
  font-weight: 400;
}
.admin-pw-input:hover {
  border-color: #aeb6bf;
}
.admin-pw-input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.18);
}
.admin-pw-submit {
  width: 100%;
  margin-top: 2px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, #2980b9 0%, #1a5276 100%);
  border: none;
  border-radius: 7px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(26, 82, 118, 0.25);
}
.admin-pw-submit:hover {
  background: linear-gradient(180deg, #3498db 0%, #2471a3 100%);
}
.admin-role-badge {
  margin: 0 8px;
  vertical-align: middle;
  text-transform: uppercase;
  font-size: 11px;
}
.admin-role-badge--admin {
  background: #d6eaf8;
  color: #1a5276;
}
.admin-role-badge--bandar {
  background: #fdebd0;
  color: #7d6608;
}
.admin-account-section {
  max-width: 440px;
}
.admin-account-card {
  padding: 20px 22px 22px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8ecef;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}
.admin-account-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.admin-account-form .admin-pw-field {
  margin-bottom: 14px;
}
.admin-account-form .admin-pw-label {
  font-size: 12px;
}
.admin-account-form .admin-pw-input {
  padding: 11px 12px;
  font-size: 15px;
  border-radius: 8px;
}
.admin-account-submit {
  width: 100%;
  margin-top: 6px;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(180deg, #27ae60 0%, #1e8449 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(30, 132, 73, 0.3);
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}
.admin-account-submit:hover {
  background: linear-gradient(180deg, #2ecc71 0%, #219a52 100%);
  box-shadow: 0 6px 18px rgba(30, 132, 73, 0.35);
}
.admin-account-submit:active {
  transform: scale(0.98);
}
@media (max-width: 900px) {
  .admin-page .admin-table--matches .admin-col-players,
  .admin-page .admin-table--matches .admin-col-notes {
    max-width: 120px;
    font-size: 12px;
  }
}
@media (max-width: 767px) {
  .admin-user-pw-cell {
    min-width: 180px;
  }
  .admin-account-section {
    max-width: 100%;
  }
  .admin-role-form {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-role-select--table {
    width: 100%;
  }
  .admin-role-form .admin-btn-secondary {
    width: 100%;
  }
  .admin-actions-stack {
    width: 100%;
  }
  .match-status-form {
    width: 100%;
  }
  .match-status-form select {
    flex: 1;
    min-width: 0;
  }
}
.alert {
  padding: 12px;
  border-radius: 8px;
}
.alert.error {
  background: #fadbd8;
  color: #922b21;
}
.alert.success {
  background: #d5f5e3;
  color: #1e5631;
}
.btn-danger {
  background: #e74c3c !important;
  color: white !important;
}
.hint {
  font-size: 12px;
  color: #95a5a6;
}
.empty-msg {
  color: #7f8c8d;
  text-align: center;
  padding: 24px;
}
.actions-cell form {
  display: inline-block;
  margin-right: 0;
}
.match-status-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.match-status-form select,
.admin-page .status-select {
  padding: 8px 10px;
  min-width: 108px;
  border-radius: 8px;
  border: 1px solid #bdc3c7;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  cursor: pointer;
}
.match-status-form select:focus,
.admin-page .status-select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}
.match-view-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: #2980b9;
  text-decoration: none;
}
.match-view-link:hover {
  text-decoration: underline;
}
.match-delete-form {
  display: inline;
  margin: 0;
}
.match-delete-form {
  display: inline-block;
  margin-left: 4px;
}
.btn-delete-match {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #c0392b;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.btn-delete-match:hover {
  background: #e74c3c;
}

/* Leaderboard & Match history */
.leaderboard-page,
.match-page {
  background: linear-gradient(165deg, #e8f4fc 0%, #f5f7fa 45%, #fff8e7 100%);
  min-height: 100vh;
}
.leaderboard-wrap {
  max-width: 720px;
}
.leaderboard-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  margin-bottom: 24px;
  padding: 22px 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1a5276 0%, #2980b9 55%, #3498db 100%);
  color: #fff;
  box-shadow: 0 12px 32px rgba(41, 128, 185, 0.35);
}
.leaderboard-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(1.5rem, 5vw, 2rem);
  letter-spacing: 0.02em;
  text-align: center;
  width: 100%;
}
.leaderboard-hero-desc {
  margin: 0;
  font-size: 0.92rem;
  opacity: 0.92;
  line-height: 1.45;
}
.leaderboard-hero-desc strong {
  color: #fdebd0;
}
.leaderboard-hero-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.leaderboard-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}
.leaderboard-table thead {
  background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
  color: #ecf0f1;
}
.leaderboard-table th {
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: left;
  border: none;
}
.leaderboard-table th.col-rank {
  width: 72px;
  text-align: center;
}
.leaderboard-table th.col-points,
.leaderboard-table th.col-matches {
  text-align: right;
}
.leaderboard-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #ecf0f1;
  vertical-align: middle;
}
.leaderboard-table tbody tr {
  transition: background 0.15s ease;
}
.leaderboard-table tbody tr:hover {
  background: #f8fafb;
}
.leaderboard-table tbody tr:last-child td {
  border-bottom: none;
}
.col-rank {
  text-align: center;
}
.col-points,
.col-matches {
  text-align: right;
}
.lb-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 15px;
  background: #ecf0f1;
  color: #5d6d7e;
}
.lb-player-name {
  font-weight: 700;
  font-size: 1rem;
  color: #2c3e50;
}
.lb-points {
  font-weight: 800;
  font-size: 1.15rem;
  color: #2980b9;
  font-variant-numeric: tabular-nums;
}
.lb-matches {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: #eaf2f8;
  color: #5d6d7e;
}
.lb-row--rank1 {
  background: linear-gradient(90deg, rgba(241, 196, 15, 0.14) 0%, transparent 55%);
}
.lb-row--rank1 .lb-rank-badge {
  background: linear-gradient(145deg, #f4d03f, #d4ac0d);
  color: #5c4a03;
  box-shadow: 0 2px 8px rgba(212, 172, 13, 0.45);
  font-size: 17px;
  min-width: 40px;
  height: 40px;
}
.lb-row--rank1 .lb-player-name {
  font-size: 1.08rem;
  color: #7d6608;
}
.lb-row--rank1 .lb-points {
  font-size: 1.35rem;
  color: #b7950b;
}
.lb-row--rank2 {
  background: linear-gradient(90deg, rgba(189, 195, 199, 0.2) 0%, transparent 55%);
}
.lb-row--rank2 .lb-rank-badge {
  background: linear-gradient(145deg, #ecf0f1, #bdc3c7);
  color: #566573;
  box-shadow: 0 2px 6px rgba(149, 165, 166, 0.4);
}
.lb-row--rank2 .lb-points {
  color: #707b7c;
}
.lb-row--rank3 {
  background: linear-gradient(90deg, rgba(211, 84, 0, 0.1) 0%, transparent 55%);
}
.lb-row--rank3 .lb-rank-badge {
  background: linear-gradient(145deg, #e59866, #ca6f1e);
  color: #fff;
  box-shadow: 0 2px 6px rgba(202, 111, 30, 0.4);
}
.lb-row--rank3 .lb-points {
  color: #ca6f1e;
}
.leaderboard-empty {
  padding: 48px 24px;
  text-align: center;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
@media (max-width: 560px) {
  .leaderboard-hero {
    padding: 20px 16px;
  }
  .leaderboard-table th,
  .leaderboard-table td {
    padding: 10px 8px;
  }
  .lb-player-name {
    font-size: 0.92rem;
  }
  .lb-points {
    font-size: 1rem;
  }
}