* {
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  box-sizing: border-box;
}

body {
  background-color: hsl(237, 48.6%, 14.5%);
  background-image: radial-gradient(hsl(214, 47.5%, 23.1%), hsl(237, 48.6%, 14.5%));
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: hsl(100, 100%, 100%);
  text-transform: uppercase;
  text-align: center;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  overflow-y: auto;
}

.game-section {
  width: 960px;
  height: 740px;
  margin: auto;
  position: relative;
}

/* ====================================================
   TOP SECTION (LOGO + TIMER DI ATAS)
   ==================================================== */
.top-section {
  width: 720px;
  height: 120px;
  border: 3px solid hsla(100, 100%, 100%, 0.25);
  border-radius: 20px;
  position: absolute;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 35px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
}

.logo {
  width: 150px;
  height: 95px;
}

/* Timer di Posisi Score Box Lama */
.top-timer-box {
  width: 100px;
  height: 90px;
  border-radius: 12px;
  background: linear-gradient(hsl(0, 0%, 98%), hsl(0, 0%, 90%));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.timer-label {
  font-size: 13px;
  letter-spacing: 2px;
  color: hsl(229, 64.4%, 46.3%);
  font-weight: 700;
}

.timer-value {
  color: #dc2626; /* Merah menyala agar kontras */
  font-weight: 700;
  font-size: 46px;
  line-height: 1;
}

/* ====================================================
   LOBBY STANDBY & QR CODE
   ==================================================== */
#lobby-container {
  position: absolute;
  top: 200px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 25px 35px;
  width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#lobby-container h2 {
  font-size: 24px;
  color: #facc15;
  margin-bottom: 18px;
}

#qrcode-wrapper {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.player-slots {
  display: flex;
  gap: 15px;
  width: 100%;
}

.slot-badge {
  flex: 1;
  background: rgba(15, 23, 42, 0.7);
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  color: #38bdf8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.3s;
}

.screen-meta-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 18px;
  gap: 10px;
}

.badge {
  font-size: 12px;
  letter-spacing: 1.2px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  text-transform: uppercase;
}

.room-badge {
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.4);
  font-weight: 700;
}

.status-badge {
  color: #94a3b8;
  transition: color 0.3s, border-color 0.3s;
}

/* ====================================================
   ARENA TANDING & PROFIL PEMAIN KIRI-KANAN
   ==================================================== */
#battle-container {
  position: absolute;
  top: 160px;
  width: 100%;
  height: 560px;
}

/* Kontainer Pemain Kiri & Kanan */
#player-pick-container, 
#house-pick-container {
  width: 320px;
  height: 480px;
  position: absolute;
  top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#player-pick-container { left: 90px; }
#house-pick-container  { right: 90px; }

#player-pick-container.shift-left {
  left: 20px;
  animation: shiftleft 0.5s;
}

#house-pick-container.shift-right {
  right: 20px;
  animation: shiftright 0.5s;
}

@keyframes shiftleft { from { left: 90px; } to { left: 20px; } }
@keyframes shiftright { from { right: 90px; } to { right: 20px; } }

/* Kartu Profil Pemain (Avatar + Nama + Score) */
.player-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(15, 23, 42, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 8px 18px;
  margin-bottom: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.avatar-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.avatar-p1 {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.avatar-p2 {
  background: linear-gradient(135deg, #f43f5e, #be123c);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
}

.player-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.player-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #fff;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-score-tag {
  font-size: 14px;
  color: #facc15;
  font-weight: 700;
  letter-spacing: 1px;
}

.player-score-tag span {
  font-size: 18px;
  color: #fff;
}

.pick-label {
  font-size: 18px;
  letter-spacing: 2.5px;
  margin-bottom: 15px;
  color: #cbd5e1;
}

/* ====================================================
   LINGKARAN PILIHAN TANGAN RPS
   ==================================================== */
.circle {
  border-radius: 100%;
  background: linear-gradient(hsl(0, 0%, 95.3%), hsl(0, 0%, 85.5%));
  position: relative;
}

.large {
  width: 250px;
  height: 244px;
  border: 28px solid;
  transition: box-shadow 0.1s ease-in-out;
}

.large.rock {
  border-color: hsl(349, 71%, 55%);
  box-shadow: 0 11px 0 0 hsl(346, 83%, 34%), 0 10px 0 0 hsl(228, 23.2%, 78%) inset, 0 12px 3px 0 hsla(0, 0%, 0%, 0.2);
}

.large.paper {
  border-color: hsl(229, 89%, 65%);
  box-shadow: 0 11px 0 0 hsl(229, 67%, 46%), 0 10px 0 0 hsl(228, 23.2%, 78%) inset, 0 12px 3px 0 hsla(0, 0%, 0%, 0.2);
}

.large.scissors {
  border-color: hsl(41, 85%, 51%);
  box-shadow: 0 11px 0 0 hsl(28, 76.1%, 44.3%), 0 10px 0 0 hsl(228, 23.2%, 78%) inset, 0 12px 3px 0 hsla(0, 0%, 0%, 0.2);
}

.symbol {
  position: absolute;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;
  pointer-events: none;
}

.rock .symbol     { background-image: url('./images/icon-rock.svg'); }
.paper .symbol    { background-image: url('./images/icon-paper.svg'); }
.scissors .symbol { background-image: url('./images/icon-scissors.svg'); }

.large.rock .symbol     { width: 80px; height: 80px; top: 48px; left: 52px; }
.large.paper .symbol    { width: 85px; height: 100px; top: 38px; left: 50px; }
.large.scissors .symbol { width: 85px; height: 100px; top: 39px; left: 49px; }

.placeholder {
  width: 200px;
  height: 200px;
  border-radius: 100%;
  background-color: hsla(0, 0%, 0%, 0.25);
  animation: pulse 0.3s both infinite alternate;
}

@keyframes pulse {
  from { width: 200px; height: 200px; opacity: 0.8; }
  to   { width: 170px; height: 170px; opacity: 0.3; }
}

/* ====================================================
   STATUS HASIL RONDE & TOMBOL
   ==================================================== */
#win-text, #lose-text, #draw-text {
  position: absolute;
  top: 360px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 42px;
  display: none;
  white-space: nowrap;
  font-weight: 700;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  z-index: 10;
}

#win-text  { color: #4ade80; }
#lose-text { color: #f87171; }
#draw-text { color: #facc15; }

#play-again-button {
  width: 220px;
  height: 48px;
  border-radius: 8px;
  background: #fff;
  color: hsl(229, 24.8%, 30.8%);
  position: absolute;
  top: 440px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

#play-again-button:hover {
  color: hsl(349, 70.6%, 52%);
}

.play-again-text {
  line-height: 48px;
  letter-spacing: 2.5px;
  font-weight: 700;
}

.winner {
  box-shadow: 0 13px 0 0 rgba(0,0,0,0.2), 
              0 0 0 40px hsla(100, 100%, 100%, 0.04), 
              0 0 0 80px hsla(100, 100%, 100%, 0.02) !important;
}

/* ====================================================
   RESPONSIF VIDEOTRON (LAYAR TINGGI TERBATAS)
   ==================================================== */
@media (max-height: 800px) {
  .top-section {
    top: 10px;
    height: 100px;
    transform: translateX(-50%) scale(0.9);
  }
  
  #battle-container {
    top: 130px;
  }

  #player-pick-container, #house-pick-container {
    transform: scale(0.85);
  }

  #win-text, #lose-text, #draw-text {
    top: 310px;
  }

  #play-again-button {
    top: 385px;
  }
}