/**
 * GARDA TALI - IFP (Interactive Flat Panel) Mode Stylesheet
 * Didesain khusus untuk layar sentuh besar di depan kelas (Smart Board / TV Interaktif)
 * Mengoptimalkan Split Screen (Kiri Tim A, Kanan Tim B) & Responsive Touch Targets
 */

:root {
  --ifp-team-a: #1d4ed8;
  --ifp-team-a-bg: #eff6ff;
  --ifp-team-b: #b91c1c;
  --ifp-team-b-bg: #fef2f2;
}

body.ifp-mode {
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overflow-x: hidden;
  background-color: #f1f5f9;
}

/* IFP Main Layout */
.ifp-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 12px 18px;
  gap: 12px;
  box-sizing: border-box;
}

/* 1. Header IFP (Kontrol Guru & Timer Sesi Besar) */
.ifp-header {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.ifp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ifp-brand h2 {
  font-size: 1.35rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ifp-session-timer {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #0f172a;
  color: #ffffff;
  padding: 6px 20px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
}

.ifp-timer-display {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-yellow);
  letter-spacing: 2px;
}

.ifp-timer-display.danger {
  color: #ef4444;
  animation: pulse 0.6s infinite;
}

.ifp-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 2. Arena Tarik Tambang Tengah (Lebar Penuh & Animasi Halus) */
.ifp-arena-card {
  background: linear-gradient(180deg, #e0f2fe 0%, #f0fdf4 65%, #cbd5e1 100%);
  border-radius: var(--radius-lg);
  border: 2px solid #cbd5e1;
  padding: 12px 20px 8px;
  box-shadow: var(--shadow-md);
  position: relative;
  flex-shrink: 0;
}

.ifp-scoreboard-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ifp-score-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  font-weight: 800;
}

.ifp-score-pill.team-a {
  border: 2px solid var(--ifp-team-a);
  color: var(--ifp-team-a);
}

.ifp-score-pill.team-b {
  border: 2px solid var(--ifp-team-b);
  color: var(--ifp-team-b);
}

.ifp-score-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
}

.ifp-stage {
  position: relative;
  height: 120px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.ifp-stage .boundary-marker {
  bottom: 15px;
}

.ifp-stage .rope-assembly {
  bottom: 22px;
}

.ifp-stage .tugger {
  width: 80px;
  height: 90px;
}

.ifp-stage .rope-segment {
  height: 14px;
}

.ifp-stage .rope-ribbon {
  width: 18px;
  height: 38px;
}

/* Toast Event Banner */
.ifp-event-banner {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  padding: 8px 24px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  pointer-events: none;
  opacity: 0;
  z-index: 20;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

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

.ifp-event-banner.team-b {
  background: linear-gradient(135deg, var(--ifp-team-b), #7f1d1d);
  box-shadow: var(--shadow-glow-red);
}

/* 3. Split Screen Soal (Kiri Tim A vs Kanan Tim B) */
.ifp-split-screen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0; /* Penting untuk flex children overflow */
}

/* Kolom Tim */
.ifp-team-zone {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 3px solid transparent;
  padding: 16px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.ifp-team-zone.zone-a {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #ffffff 0%, var(--ifp-team-a-bg) 100%);
}

.ifp-team-zone.zone-b {
  border-color: #fca5a5;
  background: linear-gradient(180deg, #ffffff 0%, var(--ifp-team-b-bg) 100%);
}

.ifp-zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 10px;
}

.ifp-zone-title {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.zone-a .ifp-zone-title { color: var(--ifp-team-a); }
.zone-b .ifp-zone-title { color: var(--ifp-team-b); }

.ifp-q-counter {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.zone-a .ifp-q-counter { background: #dbeafe; color: var(--ifp-team-a); }
.zone-b .ifp-q-counter { background: #fee2e2; color: var(--ifp-team-b); }

/* Kotak Pertanyaan IFP */
.ifp-question-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 12px;
}

.ifp-q-image-box {
  text-align: center;
  margin-bottom: 8px;
  display: none;
}

.ifp-q-image-box.show {
  display: block;
}

.ifp-q-image {
  max-height: 120px;
  max-width: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.ifp-q-text {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--primary-navy);
}

/* Tombol Jawaban Besar & Sentuhan Ramah (IFP Touch-Friendly) */
.ifp-choices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ifp-choice-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 2.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  cursor: pointer;
  text-align: left;
  transition: transform 0.1s ease, border-color 0.15s, background-color 0.15s;
  box-shadow: var(--shadow-sm);
  min-height: 64px;
}

.ifp-choice-btn:active {
  transform: scale(0.97);
}

.zone-a .ifp-choice-btn:hover {
  border-color: var(--ifp-team-a);
  background: #eff6ff;
}

.zone-b .ifp-choice-btn:hover {
  border-color: var(--ifp-team-b);
  background: #fef2f2;
}

.ifp-choice-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  background: #f1f5f9;
  flex-shrink: 0;
}

/* State Animasi Jawaban */
.ifp-choice-btn.correct {
  border-color: var(--success-green) !important;
  background: #ecfdf5 !important;
  color: #065f46;
}

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

.ifp-choice-btn.wrong {
  border-color: var(--danger-red) !important;
  background: #fef2f2 !important;
  color: #991b1b;
}

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

.ifp-feedback-msg {
  height: 24px;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  margin-top: 6px;
}

.ifp-feedback-msg.correct { color: var(--success-green); }
.ifp-feedback-msg.wrong { color: var(--danger-red); }

/* Modal Pemenang IFP */
.ifp-winner-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.ifp-winner-modal.show {
  opacity: 1;
  visibility: visible;
}

.ifp-winner-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 620px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ifp-winner-modal.show .ifp-winner-box {
  transform: scale(1);
}

/* Responsif Landscape Tablet / Laptop */
@media (max-height: 720px) {
  .ifp-stage {
    height: 95px;
  }
  .ifp-stage .tugger {
    width: 65px;
    height: 75px;
  }
  .ifp-choice-btn {
    min-height: 52px;
    padding: 10px 12px;
    font-size: 0.95rem;
  }
  .ifp-q-text {
    font-size: 1.05rem;
  }
}
