/* ====== Anti-copy & container ====== */
.ahx-exam, .ahx-leaderboard { user-select: none; -webkit-user-select: none; }
.ahx-note{opacity:.75;margin:0}
.ahx-note-small{font-size:12px}
.ahx-center{ display:flex; justify-content:center; align-items:center; text-align:center }

/* ===== Header ujian ===== */
.ahx-header{
  display:flex; align-items:center; gap:12px;
  background:#ffffff; border:1px solid #e5e7eb; border-radius:16px;
  padding:12px 14px; margin:12px 0;
  box-shadow:0 2px 10px rgba(0,0,0,.04);
}
.ahx-dot{
  width:12px; height:12px; border-radius:999px;
  background:var(--brand,#1ABC9C);
  box-shadow:0 0 0 4px color-mix(in srgb, var(--brand,#1ABC9C) 18%, transparent);
  flex:0 0 12px;
}
.ahx-h-text{ display:flex; flex-direction:column; gap:2px }
.ahx-h-title{ font-weight:800; font-size:20px; color:#0f172a !important; }
.ahx-h-sub{ font-size:14px; color:#111 !important; }

/* Card */
.ahx-card{background:#fff !important;border:1px solid #e5e7eb;border-radius:14px;padding:16px;margin:12px 0;box-shadow:0 2px 10px rgba(0,0,0,.04)}

/* Rows & grid */
.ahx-row{margin-bottom:12px}
.ahx-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.ahx-grid-mobile-1{grid-template-columns:1fr}
@media(min-width:768px){ .ahx-grid-mobile-1{grid-template-columns:1fr 1fr} }

/* Buttons (paksa kontras, override theme) */
.ahx-btn{
  border:1px solid #cdd5df !important;
  border-radius:16px !important;
  padding:14px 18px !important;
  cursor:pointer !important;
  background:#f6f8fb !important;
  color:#111 !important;
  font-weight:800 !important;
  line-height:1.2 !important;
  box-sizing:border-box !important;
}
.ahx-btn.primary {
  background: var(--brand, #2D7F74) !important;
  border-color: var(--brand, #1ABC9C) !important;
  color: #fff !important;
  margin-top: 16px;
}
.ahx-btn.ghost{background:#fff !important;color:#111 !important;border-color:#cdd5df !important}
.ahx-btn.danger{background:#e11d48 !important;color:#fff !important;border-color:#e11d48 !important}
.ahx-btn[disabled]{opacity:.6 !important;cursor:not-allowed !important}
.ahx-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.ahx-actions.ahx-center{justify-content:center}

/* Top bar */
.ahx-topbar{position:sticky;top:0;z-index:5;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:8px;display:flex;gap:10px;justify-content:space-between;align-items:center;margin-bottom:10px}
.ahx-timer{font-weight:800;font-size:18px;color:var(--brand,#1ABC9C)}
.ahx-saved-badge{margin-left:8px;color:#16a34a;font-weight:700}

/* Inputs & selects (border jelas, full width) */
.ahx-input, .ahx-textarea, .ahx-select,
.ahx-q input[type="text"], .ahx-q textarea, .ahx-q select{
  width:100%; background:#fff; color:#111;
  border:1px solid #cbd5e1; border-radius:12px;
  padding:12px 14px; font-size:16px;
  box-shadow:0 2px 8px rgba(0,0,0,.03);
}
.ahx-select{ appearance:none; -webkit-appearance:none; background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat:no-repeat; background-position:right 12px center; background-size:16px }

/* Question card */
.ahx-q{
  background:#fff; border-radius:16px;
  box-shadow:0 6px 18px rgba(0,0,0,.06);
  padding:16px 18px; margin:12px 0 18px;
}
.ahx-q .stem{
  color:#111; font-size:18px; line-height:1.5; user-select:none; margin-bottom:10px;
}
.ahx-q img{ width:100%; max-width:520px; border-radius:12px; display:block; margin:8px 0 12px }

/* Options – kartu besar ramah jempol */
.ahx-options{display:flex;flex-direction:column;gap:12px;margin-top:8px}
@media (min-width:640px){ .ahx-options{display:grid;grid-template-columns:1fr 1fr;gap:12px} }
.ahx-opt{
  position:relative; display:block;
  border:1px solid #e5e7eb; border-radius:14px;
  padding:14px 16px; background:#fff;
  box-shadow:0 2px 8px rgba(0,0,0,.04);
  transition:box-shadow .15s ease, transform .05s ease, border-color .15s ease;
  cursor:pointer;
}
.ahx-opt input{ position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer }
.ahx-opt span{ display:block; font-size:16px; color:#111 }
.ahx-opt:has(input:checked){
  border-color:var(--brand,#1ABC9C);
  box-shadow:0 0 0 4px color-mix(in srgb, var(--brand,#1ABC9C) 18%, transparent);
}
.ahx-opt:active{ transform:scale(.99) }
.ahx-opt:has(input:focus-visible){ outline:3px solid color-mix(in srgb, var(--brand,#1ABC9C) 35%, transparent); outline-offset:2px }

/* Pager */
.ahx-pager{
  display:flex; flex-wrap:wrap; gap:12px;
  margin:12px 0 20px;
}
.ahx-pager .ahx-btn{ flex:1 1 45%; min-width:140px; text-align:center }
.ahx-btn.ghost.ahx-prev{
  background:#f59e0b !important; border-color:#f59e0b !important; color:#fff !important;
}
.ahx-btn.ghost.ahx-prev[disabled]{ filter:grayscale(.3); opacity:.6 }
.ahx-btn.ghost.ahx-next{
  background:var(--brand,#1ABC9C) !important; border-color:var(--brand,#1ABC9C) !important; color:#fff !important;
}

/* Camera preview */
.ahx-video{
  display:none; width:100%; max-width:520px;
  border-radius:12px; background:#000; margin:8px 0;
}
.ahx-preview{
  display:none; width:100%; max-width:520px;
  border:1px dashed #cbd5e1; border-radius:12px; margin:8px 0;
}

/* Leaderboard table */
.ahx-table{width:100%;border-collapse:collapse}
.ahx-table th,.ahx-table td{border:1px solid #e5e7eb;padding:8px;text-align:left}

/* Snackbar */
.ahx-snackbar{
  position:fixed; left:50%; transform:translateX(-50%);
  bottom:16px; background:#111; color:#fff;
  padding:10px 14px; border-radius:10px;
  box-shadow:0 6px 18px rgba(0,0,0,.18); z-index:9999
}
.ahx-snackbar.error{ background:#e11d48 }
.ahx-snackbar.info{ background:#111 }

/* Anti copy tambahan */
.ahx-exam ::selection{background:transparent}

.ahx-notes{
  margin-top: 16px;
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
  Color: #64748b !important;
}
.ahx-note-list{
  list-style: disc;
  margin: 0;
  padding-left: 1.5rem;
  text-align: left;
  max-width: 720px;
}
.ahx-note-list li{
  font-size: 13px;
  color: #64748b !important;
  line-height: 1.5;
  margin-bottom: 4px;
}

/* aktifkan scroll horizontal di pembungkus tabel */
.ahx-lb-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
/* buat tabel sedikit lebih lebar dari layar agar bisa di-scroll */
.ahx-lb-wrap .ahx-table{
  min-width: 560px;
  width: 100%;
}
/* Judul leaderboard di tengah */
.ahx-leaderboard h3 {
  text-align: center;
  margin-bottom: 12px;
  font-weight: 700;
}
/* Header tabel dengan warna latar */
.ahx-leaderboard .ahx-table thead th {
  background-color: #1ABC9C;
  color: #fff;
  text-align: center;
  font-weight: 700;
  padding: 10px;
  border-color: #16a085;
}
/* Rata tengah isi tabel biar rapi */
.ahx-leaderboard .ahx-table td {
  text-align: center;
  padding: 8px;
}

/* ===== Leaderboard-only: perkecil ukuran font & rapikan spacing ===== */
.ahx-leaderboard { font-size: 0.9rem; } /* basis kecil untuk area leaderboard saja */
.ahx-leaderboard .ahx-table { font-size: 0.85rem; }
.ahx-leaderboard .ahx-table thead th { font-size: 0.9rem; }
.ahx-leaderboard .ahx-table tbody td { font-size: 0.85rem; }
.ahx-leaderboard .ahx-card { padding:14px; } /* sedikit rapat agar proporsional */
@media (max-width: 480px){
  .ahx-leaderboard { font-size: 0.85rem; }
  .ahx-leaderboard .ahx-table { font-size: 0.8rem; }
  .ahx-leaderboard .ahx-table thead th { padding:8px; }
  .ahx-leaderboard .ahx-table tbody td { padding:6px; }
}

.ahx-finish h3,
.ahx-finish p {
  color: #000 !important;
}
/* ===== Running Section ===== */
.ahx-running,
.ahx-running * {
  color: #000 !important;
}

/* ====== CAMERA BUTTONS: sejajar & kuning di mobile ====== */
/* Susun 2 kolom (50/50), paksa inline style container tunduk */
.ahx-cam{ flex-wrap:wrap !important; justify-content:space-between !important; gap:8px !important; }

/* Dua tombol berdampingan */
.ahx-cam .ahx-btn{
  flex:1 1 calc(50% - 6px);
  max-width:calc(50% - 6px);
  text-align:center;
}

/* Warna kuning untuk kedua tombol di area kamera */
.ahx-cam .ahx-btn,
.ahx-cam .ahx-btn.primary,
.ahx-cam .ahx-btn.ghost{
  background:#f59e0b !important;
  border-color:#f59e0b !important;
  color:#fff !important;
  margin-top:0 !important; /* hilangkan margin agar rata tengah */
}

/* Perkecil ukuran di layar kecil */
@media (max-width: 480px){
  .ahx-cam .ahx-btn{
    padding:10px 12px !important;
    font-size:14px !important;
    border-radius:12px !important;
  }
}

/* Tombol Mulai/Lanjutkan tetap hijau (brand) */
.ahx-start-btn{
  background:var(--brand,#1ABC9C) !important;
  border-color:var(--brand,#1ABC9C) !important;
  color:#fff !important;
}

.ahx-q iframe,
.ahx-q audio{
  display:block;
  max-width:100%;
  width:100%;
  margin:10px 0;
  border:0;
  border-radius:8px;
  box-shadow:0 2px 6px rgba(0,0,0,.08);
}
