/**
 * GARDA TALI - Game Arena & Tug of War Stylesheet (game.css)
 */

.game-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 1. Header & Status Bar */
.game-header {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.game-meta h3 {
  font-size: 1.25rem;
  margin-bottom: 2px;
}

.game-meta p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.game-hud {
  display: flex;
  align-items: center;
  gap: 20px;
}

.hud-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.hud-val {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
}

/* Timer Countdown */
.timer-box {
  width: 62px;
  height: 62px;
  border-radius: var(--radius-full);
  background: #f8fafc;
  border: 4px solid var(--team-a-blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.timer-box.timer-warning {
  border-color: var(--accent-gold);
  color: var(--accent-gold-dark);
  animation: pulse 1s infinite;
}

.timer-box.timer-danger {
  border-color: var(--danger-red);
  color: var(--danger-red);
  animation: pulse 0.5s infinite;
}

.timer-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}

.timer-sub {
  font-size: 0.62rem;
  text-transform: uppercase;
  font-weight: 700;
}

/* 2. Visual Tarik Tambang Arena */
.arena-card {
  background: linear-gradient(180deg, #f0fdf4 0%, #e0f2fe 60%, #cbd5e1 100%);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-md);
  padding: 24px 20px 20px;
  position: relative;
  overflow: hidden;
}

/* Skor & Identitas Tim */
.arena-teams {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.team-badge-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.team-badge-box.team-a {
  border: 2px solid var(--team-a-blue);
  color: var(--team-a-blue);
}

.team-badge-box.team-b {
  border: 2px solid var(--team-b-red);
  color: var(--team-b-red);
}

.team-flag {
  font-size: 1.3rem;
}

.team-title {
  font-weight: 800;
  font-size: 1rem;
}

.team-pts {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  background: var(--bg-light);
  padding: 2px 10px;
  border-radius: var(--radius-md);
}

/* Arena Ground & Stage */
.tug-stage {
  position: relative;
  height: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 12px;
}

/* Marka Garis Batas Kemenangan */
.boundary-marker {
  position: absolute;
  top: 10px;
  bottom: 30px;
  width: 2px;
  border-left: 2px dashed rgba(15, 23, 42, 0.2);
}

.boundary-marker.marker-left {
  left: 12%;
  border-left-color: var(--team-a-blue);
}

.boundary-marker.marker-center {
  left: 50%;
  transform: translateX(-50%);
  border-left: 2px solid rgba(15, 23, 42, 0.35);
}

.boundary-marker.marker-right {
  right: 12%;
  border-left-color: var(--team-b-red);
}

.marker-label {
  position: absolute;
  top: -18px;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
}

.marker-left .marker-label {
  background: var(--team-a-blue-light);
  color: var(--team-a-blue);
}

.marker-center .marker-label {
  background: #ffffff;
  color: var(--secondary-navy);
}

.marker-right .marker-label {
  background: var(--team-b-red-light);
  color: var(--team-b-red);
}

/* Siswa Karakter SVG & Tali System */
.rope-assembly {
  position: absolute;
  bottom: 40px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

/* Karakter Kiri (Tim A) */
.tugger {
  width: 110px;
  height: 120px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.tugger-left {
  margin-right: -10px;
}

.tugger-right {
  margin-left: -10px;
  transform: scaleX(-1); /* Balik arah menghadap ke dalam */
}

/* Tali Tambang */
.rope-segment {
  flex: 1;
  max-width: 480px;
  height: 18px;
  background: repeating-linear-gradient(
    45deg,
    #b45309,
    #b45309 8px,
    #d97706 8px,
    #d97706 16px,
    #92400e 16px,
    #92400e 24px
  );
  border-radius: 9px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.25);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pita Tengah Bendera */
.rope-ribbon {
  width: 22px;
  height: 48px;
  background: #ffffff;
  border: 3px solid #dc2626;
  border-radius: 4px;
  position: relative;
  top: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rope-ribbon::before {
  content: '▼';
  position: absolute;
  top: -18px;
  color: #dc2626;
  font-size: 14px;
}

/* Rumput / Tanah Tarik Tambang */
.tug-ground {
  height: 28px;
  background: linear-gradient(180deg, #15803d, #166534);
  border-radius: var(--radius-md);
  box-shadow: inset 0 3px 5px rgba(0,0,0,0.2);
  position: relative;
}

.ground-grass {
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    #22c55e,
    #22c55e 12px,
    #15803d 12px,
    #15803d 24px
  );
  border-radius: 4px;
}

/* Posisi Indikator Numerik */
.position-readout {
  text-align: center;
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--secondary-navy);
}

.position-badge {
  display: inline-block;
  padding: 3px 12px;
  background: #ffffff;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

/* Pull Effect Banner */
.pull-banner-overlay {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  pointer-events: none;
  opacity: 0;
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pull-banner-overlay.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.pull-banner-overlay.banner-team-a {
  background: linear-gradient(135deg, var(--team-a-blue), #1e40af);
  box-shadow: var(--shadow-glow-blue);
}

.pull-banner-overlay.banner-team-b {
  background: linear-gradient(135deg, var(--team-b-red), #991b1b);
  box-shadow: var(--shadow-glow-red);
}

.pull-banner-overlay.banner-timeout {
  background: linear-gradient(135deg, var(--accent-gold), #b45309);
  box-shadow: var(--shadow-glow-gold);
}

/* 3. Kartu Soal & Pilihan Jawaban */
.question-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  position: relative;
}

.question-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.turn-pill {
  background: #eff6ff;
  color: var(--team-a-blue);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.question-image-box {
  text-align: center;
  margin-bottom: 18px;
  display: none;
}

.question-image-box.show {
  display: block;
}

.question-img {
  max-width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.question-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-navy);
  line-height: 1.45;
  margin-bottom: 24px;
}

/* Grid Pilihan Jawaban */
.choices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.choice-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.choice-btn:hover:not(:disabled) {
  border-color: var(--team-a-blue);
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.choice-key {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--secondary-navy);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.choice-btn.selected {
  border-color: var(--team-a-blue);
  background: #eff6ff;
}

.choice-btn.selected .choice-key {
  background: var(--team-a-blue);
  color: #ffffff;
}

.choice-btn.correct-reveal {
  border-color: var(--success-green);
  background: #ecfdf5;
}

.choice-btn.correct-reveal .choice-key {
  background: var(--success-green);
  color: #ffffff;
}

.choice-btn.wrong-reveal {
  border-color: var(--danger-red);
  background: #fef2f2;
}

.choice-btn.wrong-reveal .choice-key {
  background: var(--danger-red);
  color: #ffffff;
}

.choice-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
  transform: none !important;
}

/* Feedback Box */
.feedback-box {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  display: none;
  font-size: 0.95rem;
  line-height: 1.4;
  animation: slideIn 0.3s ease;
}

.feedback-box.show {
  display: block;
}

.feedback-box.correct {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.feedback-box.wrong {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Animasi Tarik Tambang Keyframes */
@keyframes pullShakeA {
  0% { transform: translateX(0); }
  25% { transform: translateX(-15px) rotate(-2deg); }
  50% { transform: translateX(-8px) rotate(-1deg); }
  75% { transform: translateX(-18px) rotate(-3deg); }
  100% { transform: translateX(0); }
}

@keyframes pullShakeB {
  0% { transform: translateX(0); }
  25% { transform: translateX(15px) rotate(2deg); }
  50% { transform: translateX(8px) rotate(1deg); }
  75% { transform: translateX(18px) rotate(3deg); }
  100% { transform: translateX(0); }
}

.anim-pulling-a {
  animation: pullShakeA 0.5s ease-out;
}

.anim-pulling-b {
  animation: pullShakeB 0.5s ease-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Responsive Game Arena */
@media (max-width: 768px) {
  .game-container {
    padding: 12px 14px 30px;
  }
  .choices-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .tug-stage {
    height: 160px;
  }
  .tugger {
    width: 80px;
    height: 90px;
  }
  .rope-segment {
    height: 14px;
  }
  .rope-ribbon {
    width: 18px;
    height: 38px;
  }
  .question-text {
    font-size: 1.1rem;
  }
}
