/* ========================================================
   QUIZ FISHING - MODERN CASUAL GAME CSS
   "Pancing Jawaban, Kumpulkan Ilmu!"
   Dioptimalkan untuk Smartboard 75", Laptop & Tablet
   ======================================================== */

:root {
  --primary-blue: #0077b6;
  --deep-ocean: #03045e;
  --aqua-light: #48cae4;
  --foam-white: #f8fdff;
  --sunny-yellow: #ffb703;
  --coral-orange: #fb8500;
  --emerald-green: #2a9d8f;
  --cherry-red: #ef233c;
  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-shadow: 0 8px 32px 0 rgba(0, 31, 63, 0.22);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #023e8a 0%, #0077b6 50%, #0096c7 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  color: #1a202c;
}

/* Container Game 16:9 Adaptif */
#game-container {
  position: relative;
  width: 100vw;
  height: 56.25vw; /* 16:9 Aspect Ratio */
  max-height: 100vh;
  max-width: 177.78vh; /* 16:9 Aspect Ratio */
  background: #0077b6;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Canvas Gameplay 60 FPS */
#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Utility Hidden */
.hidden {
  display: none !important;
}

/* ========================================================
   LAYAR AWAL (START SCREEN)
   ======================================================== */
.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, rgba(72, 202, 228, 0.92) 0%, rgba(2, 62, 138, 0.96) 100%);
  backdrop-filter: blur(8px);
}

.start-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 680px;
  padding: 30px;
}

.game-logo-wrapper {
  animation: floatSoft 3s ease-in-out infinite;
}

.game-title {
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 2px;
  text-shadow: 0 4px 0 #0077b6, 0 8px 18px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.game-title-icon {
  font-size: 1.1em;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25));
}

.game-tagline {
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  font-weight: 800;
  color: #ffea00;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 24px;
  border-radius: 30px;
  border: 1px solid rgba(255, 234, 0, 0.4);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.menu-buttons-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 360px;
  margin-top: 10px;
}

/* Tombol-tombol Bergaya 3D Glossy Game */
.btn-game-primary {
  background: linear-gradient(180deg, #ffb703 0%, #fb8500 100%);
  color: #ffffff;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 900;
  padding: 16px 28px;
  border-radius: 50px;
  border: none;
  box-shadow: 0 8px 0 #c85a00, 0 14px 25px rgba(251, 133, 0, 0.45);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
}

.btn-game-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 0 #c85a00, 0 16px 28px rgba(251, 133, 0, 0.55);
}

.btn-game-primary:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 #c85a00, 0 6px 12px rgba(251, 133, 0, 0.35);
}

.btn-game-secondary {
  background: linear-gradient(180deg, #ffffff 0%, #caf0f8 100%);
  color: #03045e;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 800;
  padding: 13px 22px;
  border-radius: 50px;
  border: 2px solid #90e0ef;
  box-shadow: 0 6px 0 #0077b6, 0 10px 20px rgba(0, 119, 182, 0.3);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
}

.btn-game-secondary:hover {
  transform: translateY(-2px);
  background: #ffffff;
}

.btn-game-secondary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #0077b6;
}

.branding-footer {
  margin-top: 15px;
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-link {
  color: #ffea00;
  text-decoration: none;
  font-weight: 800;
}

.brand-link:hover {
  text-decoration: underline;
}

/* ========================================================
   HEAD-UP DISPLAY (HUD GAMEPLAY)
   ======================================================== */
#game-hud-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 18px;
}

.hud-top-bar {
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  align-items: start;
  gap: 14px;
}

/* Panel Kiri: Skor & Combo */
.hud-panel-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hud-glass-badge {
  background: var(--glass-bg);
  backdrop-filter: blur(6px);
  border: 2px solid var(--glass-border);
  border-radius: 20px;
  padding: 8px 16px;
  box-shadow: var(--glass-shadow);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-label {
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--primary-blue);
  letter-spacing: 1px;
}

.hud-value-score {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--deep-ocean);
}

.hud-combo-badge {
  background: linear-gradient(135deg, #ff0077 0%, #ff5400 100%);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 900;
  padding: 5px 14px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(255, 84, 0, 0.45);
  animation: pulseScale 0.6s infinite alternate;
  align-self: flex-start;
}

/* Panel Tengah: Panel Soal & Target */
.hud-panel-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 720px;
  margin: 0 auto;
}

.hud-question-box {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 2.5px solid #0077b6;
  border-radius: 22px;
  padding: 10px 22px;
  box-shadow: var(--glass-shadow);
  text-align: center;
  width: 100%;
}

.hud-subject-badge {
  font-size: 0.8rem;
  font-weight: 900;
  color: #ffffff;
  background: #0077b6;
  padding: 3px 12px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.hud-question-title {
  font-size: clamp(1.15rem, 2.3vw, 1.45rem);
  font-weight: 900;
  color: #03045e;
  line-height: 1.3;
}

/* Badge Target Tangkap Semua */
.hud-target-badge {
  background: linear-gradient(135deg, #2a9d8f 0%, #264653 100%);
  color: #ffffff;
  padding: 5px 18px;
  border-radius: 18px;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(42, 157, 143, 0.35);
  display: flex;
  align-items: center;
  gap: 8px;
}

#hud-progress-num {
  color: #ffe66d;
  font-weight: 900;
  font-size: 1.15rem;
}

/* Slot Urutan (Mode Sequence) */
.hud-sequence-slots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.seq-slot {
  background: rgba(255, 255, 255, 0.92);
  border: 2px dashed #90e0ef;
  border-radius: 12px;
  padding: 4px 12px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #03045e;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.25s ease;
}

.seq-slot.seq-active {
  border: 2.5px solid #fb8500;
  background: #fff3b0;
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(251, 133, 0, 0.4);
}

.seq-slot.seq-filled {
  border: 2px solid #2a9d8f;
  background: #d8f3dc;
  color: #1b4332;
}

/* Panel Kanan: Timer & Tombol Pengaturan */
.hud-panel-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.hud-timer-badge {
  background: var(--glass-bg);
  backdrop-filter: blur(6px);
  border: 2px solid var(--glass-border);
  border-radius: 20px;
  padding: 6px 14px;
  box-shadow: var(--glass-shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  width: 140px;
}

.hud-timer-val {
  font-size: 1.35rem;
  font-weight: 900;
  color: #03045e;
  min-width: 45px;
}

.hud-timer-val.timer-critical {
  color: var(--cherry-red);
  animation: pulseScale 0.4s infinite alternate;
}

.hud-timer-bar-wrap {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  overflow: hidden;
}

#hud-timer-bar-fill {
  width: 100%;
  height: 100%;
  background-color: #52b788;
  border-radius: 4px;
  transition: width 0.1s linear, background-color 0.3s ease;
}

.hud-mini-actions {
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

.btn-hud-mini {
  background: var(--glass-bg);
  border: 1.5px solid var(--glass-border);
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #03045e;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  transition: all 0.15s ease;
}

.btn-hud-mini:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.btn-hud-mini.btn-active {
  background: #caf0f8;
  color: #0077b6;
  border-color: #0077b6;
}

/* ========================================================
   KONTROL TOUCH SMARTBOARD (BAGIAN BAWAH LAYAR)
   Sangat nyaman untuk jari anak di layar besar 75 inch
   ======================================================== */
.hud-bottom-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  pointer-events: auto;
  margin-bottom: 8px;
}

.sb-btn {
  border: none;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 900;
  box-shadow: 0 8px 0 rgba(0,0,0,0.25), 0 12px 25px rgba(0,0,0,0.2);
  transition: all 0.1s ease;
}

.sb-btn-arrow {
  width: 72px;
  height: 72px;
  font-size: 2rem;
  background: linear-gradient(180deg, #ffffff 0%, #e0e1dd 100%);
  color: #0077b6;
  border: 3px solid #90e0ef;
}

.sb-btn-arrow:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.25);
}

.sb-btn-cast {
  height: 76px;
  padding: 0 42px;
  font-size: 1.6rem;
  background: linear-gradient(180deg, #ffb703 0%, #fb8500 100%);
  color: #ffffff;
  border: 3px solid #ffe66d;
  box-shadow: 0 8px 0 #b35900, 0 14px 28px rgba(251, 133, 0, 0.5);
  letter-spacing: 1px;
}

.sb-btn-cast:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 #b35900;
}

/* ========================================================
   MODAL POPUPS (TUTORIAL, PENGATURAN, MODE GURU)
   ======================================================== */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 4, 94, 0.72);
  backdrop-filter: blur(6px);
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-card {
  background: #ffffff;
  border-radius: 28px;
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border: 3px solid #caf0f8;
  overflow: hidden;
  animation: popIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-header {
  padding: 18px 26px;
  background: linear-gradient(135deg, #0077b6 0%, #023e8a 100%);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.45rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.25);
  border: none;
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.3rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.45);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Tutorial Steps Card */
.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.tutorial-step-card {
  background: #f8fdff;
  border: 2px solid #caf0f8;
  border-radius: 20px;
  padding: 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.step-number {
  background: #0077b6;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-icon {
  font-size: 2.4rem;
}

.step-desc {
  font-size: 0.95rem;
  font-weight: 700;
  color: #03045e;
  line-height: 1.4;
}

/* ========================================================
   MODE GURU (TEACHER PANEL)
   ======================================================== */
.teacher-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 2px solid #e2e8f0;
}

.toolbar-left, .toolbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-teacher-act {
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  padding: 8px 16px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.9rem;
  color: #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-teacher-act:hover {
  background: #e2e8f0;
}

.btn-teacher-primary {
  background: #0077b6;
  color: #ffffff;
  border-color: #0077b6;
}

.btn-teacher-primary:hover {
  background: #023e8a;
}

.teacher-q-card {
  background: #f8fdff;
  border: 2px solid #caf0f8;
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.q-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.q-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 1.05rem;
  color: #03045e;
}

.q-num {
  background: #0077b6;
  color: #fff;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 900;
}

.badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 12px;
}

.badge-multi {
  background: #d8f3dc;
  color: #1b4332;
  border: 1px solid #52b788;
}

.badge-sequence {
  background: #ffe5d9;
  color: #9d0208;
  border: 1px solid #fb8500;
}

.q-time {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 700;
}

.q-card-actions {
  display: flex;
  gap: 6px;
}

.btn-icon {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.btn-icon:hover {
  background: #f1f5f9;
}

.q-card-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-opt {
  font-size: 0.82rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 10px;
}

.opt-correct {
  background: #d8f3dc;
  color: #2d6a4f;
  border: 1px solid #74c69d;
}

.opt-wrong {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.opt-order {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}

/* Editor Form Soal */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group label {
  font-weight: 800;
  font-size: 0.95rem;
  color: #03045e;
}

.form-input, .form-select {
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid #cbd5e1;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: #0077b6;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fdff;
  border: 1.5px solid #caf0f8;
  padding: 10px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.opt-text-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  font-family: inherit;
  font-size: 0.95rem;
}

.btn-remove-opt {
  background: #fee2e2;
  color: #ef233c;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

/* ========================================================
   LAYAR HASIL RAPOR (RESULT SCREEN)
   ======================================================== */
.result-card {
  background: #ffffff;
  border-radius: 32px;
  padding: 36px 42px;
  text-align: center;
  max-width: 580px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  border: 3.5px solid #ffea00;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-header h1 {
  font-size: 2.2rem;
  font-weight: 900;
  color: #03045e;
}

.result-stars {
  font-size: 2.8rem;
  margin: 10px 0;
}

.result-score-highlight {
  background: linear-gradient(135deg, #caf0f8 0%, #90e0ef 100%);
  border-radius: 20px;
  padding: 16px;
  margin: 14px 0;
}

.res-score-lbl {
  font-size: 0.9rem;
  font-weight: 800;
  color: #0077b6;
  text-transform: uppercase;
}

.res-score-num {
  font-size: 3.2rem;
  font-weight: 900;
  color: #03045e;
}

.result-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.stat-item {
  background: #f8fdff;
  border: 1.5px solid #caf0f8;
  border-radius: 14px;
  padding: 10px;
}

.stat-item .stat-lbl {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 700;
}

.stat-item .stat-val {
  font-size: 1.25rem;
  font-weight: 900;
  color: #03045e;
  margin-top: 3px;
}

.result-predikat {
  font-size: 1.15rem;
  font-weight: 800;
  color: #2a9d8f;
  margin-bottom: 22px;
}

.result-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
}

/* ========================================================
   ANIMASI KEYFRAMES
   ======================================================== */
@keyframes floatSoft {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

@keyframes pulseScale {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

@keyframes popIn {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ========================================================
   RESPONSIVE OPTIMIZATION
   ======================================================== */
@media (max-width: 900px) {
  .hud-top-bar {
    grid-template-columns: 160px 1fr 160px;
    gap: 8px;
  }
  .hud-question-title {
    font-size: 1.05rem;
  }
  .sb-btn-arrow {
    width: 60px;
    height: 60px;
    font-size: 1.6rem;
  }
  .sb-btn-cast {
    height: 64px;
    padding: 0 28px;
    font-size: 1.3rem;
  }
}
