/* Tombol Pemicu Modal Universal — Selaras dengan DUS Arena */
.dus-ct-trigger-card { display: flex !important; align-items: center !important; justify-content: space-between !important; gap: 14px !important; background: linear-gradient(135deg, #fcfcf8 0%, #f4f5ea 100%) !important; border: 1px solid #d5d8be !important; border-radius: 14px !important; padding: 16px 20px !important; margin: 20px 0 !important; box-shadow: 0 4px 15px -3px rgba(85, 97, 15, 0.08) !important; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important; box-sizing: border-box !important; }
.dus-ct-trigger-info { display: flex !important; flex-direction: column !important; gap: 3px !important; min-width: 0 !important; }
.dus-ct-trigger-tag { font-size: 0.65rem !important; font-weight: 800 !important; letter-spacing: 0.08em !important; color: #808000 !important; text-transform: uppercase !important; line-height: 1.3 !important; }
.dus-ct-trigger-title { font-size: 1.1rem !important; font-weight: 800 !important; color: #262e24 !important; margin: 0 !important; padding: 0 !important; line-height: 1.2 !important; }
.dus-ct-trigger-desc { font-size: 0.82rem !important; color: #525740 !important; margin: 0 !important; padding: 0 !important; line-height: 1.4 !important; }
.dus-ct-trigger-btn { display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 6px !important; padding: 10px 18px !important; background: #6b7a14 !important; color: #ffffff !important; border: none !important; border-radius: 9px !important; font-size: 0.85rem !important; font-weight: 700 !important; line-height: 1.2 !important; cursor: pointer !important; transition: background 0.15s ease, transform 0.1s ease !important; white-space: nowrap !important; flex-shrink: 0 !important; text-decoration: none !important; touch-action: manipulation !important; }
.dus-ct-trigger-btn:hover { background: #58650f !important; color: #ffffff !important; transform: translateY(-1px) !important; }
.dus-ct-trigger-btn svg { flex-shrink: 0 !important; }

@media (max-width: 480px) {
  .dus-ct-trigger-card { flex-direction: column !important; align-items: flex-start !important; }
  .dus-ct-trigger-btn { width: 100% !important; }
}

/* Kanvas Fullscreen Menutupi Seluruh Halaman & Mobile Dock */
.dus-ct-modal-overlay { position: fixed !important; inset: 0 !important; width: 100vw !important; height: 100vh !important; height: 100dvh !important; background: linear-gradient(180deg, #fcfcf8 0%, #f4f5ea 100%) !important; z-index: 2147483647 !important; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); margin: 0 !important; box-sizing: border-box; opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0.2s ease; }
.dus-ct-modal-overlay.is-active { opacity: 1; visibility: visible; }

/* Wrapper Utama Game */
.dus-ct-wrap { width: 100%; max-width: 440px; min-height: 100%; padding: 14px 16px calc(24px + env(safe-area-inset-bottom, 0px)); background: transparent; border: none; border-radius: 0; box-shadow: none; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #26291b; box-sizing: border-box; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; display: flex; flex-direction: column; justify-content: space-between; }
.dus-ct-wrap * { box-sizing: border-box; }

.dus-ct-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.dus-ct-brand { min-width: 0; }
.dus-ct-tagline { font-size: 0.65rem; font-weight: 800; letter-spacing: 0.07em; color: #808000; text-transform: uppercase; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dus-ct-heading { font-size: 1.25rem; font-weight: 800; color: #262e24; line-height: 1.15; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dus-ct-top-right { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }

.dus-ct-timer-box { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 10px; background: #ebeed9; color: #4d590c; border: 1px solid #d7dcc0; border-radius: 10px; font-size: 0.86rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; }
.dus-ct-timer-box svg { flex-shrink: 0; }

.dus-ct-action-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; background: #ebeed9; color: #4d590c; border: 1px solid #d7dcc0; border-radius: 10px; cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease; touch-action: manipulation; flex-shrink: 0; }
.dus-ct-action-icon-btn:hover { background: #dfe4c9; color: #26291b; }
.dus-ct-action-icon-btn.dus-ct-close-modal { background: #6b7a14; color: #ffffff; border-color: #6b7a14; }
.dus-ct-action-icon-btn.dus-ct-close-modal:hover { background: #58650f; }

.dus-ct-main { display: flex; flex-direction: column; gap: 12px; }
.dus-ct-right { display: flex; flex-direction: column; gap: 9px; }

/* Tab Tingkat Kesulitan */
.dus-ct-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: #e8ebd5; padding: 4px; border-radius: 10px; }
.dus-ct-tab { padding: 7px 4px; border: none; border-radius: 7px; background: transparent; color: #535b32; font-size: 0.78rem; font-weight: 700; cursor: pointer; transition: all 0.16s ease; touch-action: manipulation; }
.dus-ct-tab:hover { color: #26291b; }
.dus-ct-tab.is-active { background: #6b7a14; color: #ffffff; box-shadow: 0 2px 6px rgba(85, 97, 15, 0.25); }

/* Metrik */
.dus-ct-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.dus-ct-metric-pill { display: flex; align-items: center; justify-content: space-between; background: #ffffff; border: 1px solid #d7dcc0; border-radius: 9px; padding: 7px 11px; font-size: 0.76rem; color: #535b32; font-weight: 600; }
.dus-ct-metric-pill strong { font-size: 0.84rem; font-weight: 800; color: #262e24; font-variant-numeric: tabular-nums; }

/* Status */
.dus-ct-status { font-size: 0.8rem; text-align: center; color: #595e47; min-height: 31px; line-height: 1.35; background: #eff1e2; padding: 6px 10px; border-radius: 8px; transition: all 0.2s ease; }
.dus-ct-status.is-warn { background: #fef2f2; color: #991b1b; font-weight: 700; }
.dus-ct-status.is-solved { background: #fef3c7; color: #78350f; font-weight: 700; cursor: pointer; }

/* Papan Chimp Test — Latar Observatorium Geometri & Matriks Koordinat Olive-Gold */
.dus-ct-board-shell {
  position: relative;
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  border: 2.5px solid #4d590c;
  background-color: #eef1df;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cpolygon points='32,4 60,32 32,60 4,32' fill='none' stroke='%23b48318' stroke-opacity='0.12' stroke-width='0.8'/%3E%3Ccircle cx='32' cy='32' r='3' fill='none' stroke='%236b7a14' stroke-opacity='0.16' stroke-width='0.9'/%3E%3Cpath d='M0 32H10M54 32H64M32 0V10M32 54V64' stroke='%2355610f' stroke-opacity='0.14' stroke-width='0.8'/%3E%3C/svg%3E"),
    radial-gradient(circle at 50% 50%, #fcfdf7 0%, #e1e7c9 100%);
  background-repeat: repeat, no-repeat;
  background-size: 64px 64px, 100% 100%;
  box-shadow: 0 8px 20px -5px rgba(85, 97, 15, 0.16);
  padding: 11px 12px;
}

.dus-ct-stage {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.dus-ct-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.dus-ct-phase-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: #e5e9ce;
  color: #4d590c;
  border: 1px solid #cdd4ad;
}

.dus-ct-phase-badge.is-preview {
  background: #fef3c7;
  color: #b45309;
  border-color: #f59e0b;
}

.dus-ct-phase-badge.is-recall {
  background: #6b7a14;
  color: #ffffff;
  border-color: #6b7a14;
}

.dus-ct-phase-badge.is-good {
  background: #d1fae5;
  color: #065f46;
  border-color: #10b981;
}

.dus-ct-phase-badge.is-bad {
  background: #fee2e2;
  color: #991b1b;
  border-color: #ef4444;
}

.dus-ct-lives {
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  color: #b91c1c;
  font-weight: 800;
}

.dus-ct-lives.is-low {
  animation: dus-ct-heartbeat 1.1s infinite ease-in-out;
}

@keyframes dus-ct-heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.14); }
}

/* Matriks 5x5 Chimp Test */
.dus-ct-board {
  --ct-size: 5;
  flex: 1;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: calc(100% - 36px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(var(--ct-size), minmax(0, 1fr));
  grid-template-rows: repeat(var(--ct-size), minmax(0, 1fr));
  gap: 7px;
}

.dus-ct-cell {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  touch-action: manipulation;
  outline: none;
  transition: transform 0.1s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.dus-ct-cell.is-void {
  border: 1px dashed rgba(107, 122, 20, 0.15);
  background: rgba(255, 255, 255, 0.18);
  cursor: default;
}

.dus-ct-cell.is-visible {
  border: 2px solid #6b7a14;
  background: linear-gradient(160deg, #ffffff 0%, #f1f4e0 100%);
  color: #262e24;
  box-shadow: 0 3px 7px rgba(77, 89, 12, 0.14);
  cursor: pointer;
}

.dus-ct-cell.is-visible:hover {
  border-color: #d97706;
  transform: translateY(-1px);
}

.dus-ct-cell.is-visible.is-first-anchor {
  border-color: #d97706;
  background: radial-gradient(circle at 40% 35%, #fffbeb 0%, #fef3c7 100%);
  color: #92400e;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25), 0 3px 8px rgba(180, 83, 9, 0.18);
}

.dus-ct-cell.is-visible.is-peeking {
  border-color: #0284c7;
  background: linear-gradient(160deg, #f0f9ff 0%, #e0f2fe 100%);
  color: #0369a1;
}

/* Petak Tertutup Setelah Angka 1 Diketuk */
.dus-ct-cell.is-masked {
  border: 2px solid #58650f;
  background: linear-gradient(145deg, #758518 0%, #58650f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 3px 7px rgba(61, 70, 10, 0.22);
  cursor: pointer;
}

.dus-ct-cell.is-masked::after {
  content: "";
  width: 24%;
  height: 24%;
  border-radius: 50%;
  background: rgba(254, 243, 199, 0.45);
}

.dus-ct-cell.is-masked:hover {
  background: linear-gradient(145deg, #82941b 0%, #637211 100%);
  border-color: #d97706;
}

.dus-ct-cell.is-masked:active,
.dus-ct-cell.is-visible:active {
  transform: scale(0.93);
}

/* Angka Sudah Berhasil Diketuk */
.dus-ct-cell.is-cleared {
  border: 1.5px solid #a7be5e;
  background: rgba(236, 242, 212, 0.72);
  color: #6b7a14;
  font-size: 1rem;
  font-weight: 800;
  cursor: default;
}

.dus-ct-cell.is-cleared.is-victory {
  border-color: #059669;
  background: linear-gradient(155deg, #ecfdf5 0%, #a7f3d0 100%);
  color: #065f46;
}

/* Evaluasi Kesalahan */
.dus-ct-cell.is-wrong {
  border: 2px solid #dc2626;
  background: radial-gradient(circle at 40% 35%, #fef2f2 0%, #fee2e2 100%);
  color: #b91c1c;
}

@keyframes dus-ct-pulse-expected {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.dus-ct-cell.is-expected {
  border: 2px solid #059669;
  background: radial-gradient(circle at 40% 35%, #ecfdf5 0%, #a7f3d0 100%);
  color: #065f46;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.45);
  animation: dus-ct-pulse-expected 0.65s infinite ease-in-out;
}

.dus-ct-cell.is-revealed-miss {
  border: 1.5px dashed #8a9464;
  background: rgba(255, 255, 255, 0.82);
  color: #525740;
}

/* Bilah Progres Langkah */
.dus-ct-step-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 6px;
  flex-shrink: 0;
}

.dus-ct-step-seg {
  flex: 1;
  height: 100%;
  border-radius: 99px;
  background: rgba(107, 122, 20, 0.2);
  transition: background-color 0.16s ease;
}

.dus-ct-step-seg.is-active {
  background: #d97706;
}

.dus-ct-step-seg.is-done {
  background: #6b7a14;
}

/* Tombol Bantuan & Aksi Bawah */
.dus-ct-tools-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.dus-ct-tool-btn { display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; padding: 8px 6px; background: #ffffff; border: 1px solid #cbd0b2; border-radius: 9px; font-size: 0.76rem; font-weight: 700; color: #3f4628; cursor: pointer; transition: all 0.15s ease; touch-action: manipulation; }
.dus-ct-tool-btn:hover:not(:disabled) { background: #ebeed9; }
.dus-ct-tool-btn:disabled { opacity: 0.48; cursor: not-allowed; }

.dus-ct-footer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 2px; }
.dus-ct-btn-olive { padding: 10px 12px; background: #6b7a14; color: #ffffff; border: none; border-radius: 9px; font-size: 0.84rem; font-weight: 700; cursor: pointer; width: 100%; touch-action: manipulation; }
.dus-ct-btn-olive:hover { background: #58650f; }
.dus-ct-btn-outline { padding: 10px 12px; background: #ffffff; color: #4d590c; border: 1px solid #b5bc96; border-radius: 9px; font-size: 0.84rem; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.dus-ct-btn-ghost { margin-top: 7px; padding: 7px 10px; background: transparent; color: #595e47; border: 1px solid #d5d8be; border-radius: 8px; font-size: 0.78rem; font-weight: 700; cursor: pointer; width: 100%; touch-action: manipulation; }
.dus-ct-btn-ghost:hover { background: #f4f5ea; color: #262e24; }

@media (min-width: 720px) {
  .dus-ct-modal-overlay { align-items: center; }
  .dus-ct-wrap { max-width: 720px; min-height: auto; padding: 24px; justify-content: center; }
  .dus-ct-top { margin-bottom: 18px; }
  .dus-ct-heading { font-size: 1.4rem; }
  .dus-ct-main { display: grid; grid-template-columns: 360px 1fr; gap: 22px; align-items: stretch; }
  .dus-ct-board-shell { max-width: 360px; }
  .dus-ct-right { justify-content: space-between; }
}

/* Modal Dalam Papan (Menang & Cara Bermain) */
.dus-ct-modal-inner { position: absolute; inset: 0; background: rgba(31, 34, 22, 0.84); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 14px; z-index: 10; }
.dus-ct-modal-inner[hidden] { display: none; }
.dus-ct-modal-card { background: #ffffff; border-radius: 12px; padding: 18px; width: 100%; max-width: 300px; text-align: center; box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25); }
.dus-ct-trophy { width: 36px; height: 36px; margin: 0 auto 6px; border-radius: 50%; background: #fef3c7; color: #d97706; font-size: 1.3rem; display: flex; align-items: center; justify-content: center; }
.dus-ct-modal-title { font-size: 1.05rem; font-weight: 800; color: #4d590c; margin-bottom: 6px; }
.dus-ct-modal-desc { font-size: 0.8rem; color: #525740; margin: 0 0 12px; line-height: 1.45; text-align: left; }
.dus-ct-save-box { background: #f7f8ee; padding: 9px; border-radius: 8px; margin-bottom: 10px; border: 1px solid #dce0c5; text-align: left; }
.dus-ct-label { display: block; font-size: 0.73rem; font-weight: 700; color: #4d590c; margin-bottom: 5px; }
.dus-ct-input-row { display: flex; gap: 6px; justify-content: center; }
.dus-ct-input-row input { width: 112px; text-align: center; font-size: 0.92rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 6px; border: 1.5px solid #6b7a14; border-radius: 6px; outline: none; }
.dus-ct-btn-gold { padding: 5px 12px; background: #d97706; color: #ffffff; border: none; border-radius: 6px; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.dus-ct-filter-msg { font-size: 0.72rem; color: #b91c1c; margin-top: 4px; min-height: 13px; }

/* Panel Rekor Lokal */
.dus-ct-lb-panel { margin-top: 14px; background: #ffffff; border: 1px solid #d5d8be; border-radius: 10px; padding: 10px 12px; text-align: left; }
.dus-ct-lb-header { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; font-weight: 700; color: #4d590c; padding-bottom: 6px; border-bottom: 1px solid #eceee0; margin-bottom: 6px; }
.dus-ct-link-btn { background: none; border: none; color: #9ca3af; font-size: 0.72rem; cursor: pointer; text-decoration: underline; }
.dus-ct-lb-list { font-size: 0.8rem; color: #374151; max-height: 120px; overflow-y: auto; }
.dus-ct-lb-item { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed #eceee0; }
.dus-ct-lb-item:last-child { border-bottom: none; }
.dus-ct-lb-tag { font-size: 0.7rem; background: #eef0df; color: #4d590c; padding: 1px 6px; border-radius: 4px; margin-left: 6px; text-transform: capitalize; }
