/* Tombol Pemicu Modal Universal — Selaras dengan DUS Arena */
.dus-mm-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-mm-trigger-info { display: flex !important; flex-direction: column !important; gap: 3px !important; min-width: 0 !important; }
.dus-mm-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-mm-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-mm-trigger-desc { font-size: 0.82rem !important; color: #525740 !important; margin: 0 !important; padding: 0 !important; line-height: 1.4 !important; }
.dus-mm-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-mm-trigger-btn:hover { background: #58650f !important; color: #ffffff !important; transform: translateY(-1px) !important; }
.dus-mm-trigger-btn svg { flex-shrink: 0 !important; }

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

/* Kanvas Fullscreen Menutupi Seluruh Halaman & Mobile Dock */
.dus-mm-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-mm-modal-overlay.is-active { opacity: 1; visibility: visible; }

/* Wrapper Utama Game */
.dus-mm-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-mm-wrap * { box-sizing: border-box; }

.dus-mm-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.dus-mm-brand { min-width: 0; }
.dus-mm-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-mm-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-mm-top-right { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }

.dus-mm-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-mm-timer-box svg { flex-shrink: 0; }

.dus-mm-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-mm-action-icon-btn:hover { background: #dfe4c9; color: #26291b; }
.dus-mm-action-icon-btn.dus-mm-close-modal { background: #6b7a14; color: #ffffff; border-color: #6b7a14; }
.dus-mm-action-icon-btn.dus-mm-close-modal:hover { background: #58650f; }

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

/* Tab Tingkat Kesulitan */
.dus-mm-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: #e8ebd5; padding: 4px; border-radius: 10px; }
.dus-mm-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-mm-tab:hover { color: #26291b; }
.dus-mm-tab.is-active { background: #6b7a14; color: #ffffff; box-shadow: 0 2px 6px rgba(85, 97, 15, 0.25); }

/* Metrik */
.dus-mm-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.dus-mm-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.78rem; color: #535b32; font-weight: 600; }
.dus-mm-metric-pill strong { font-size: 0.9rem; font-weight: 800; color: #262e24; font-variant-numeric: tabular-nums; }

/* Status */
.dus-mm-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-mm-status.is-warn { background: #fef2f2; color: #991b1b; font-weight: 700; }
.dus-mm-status.is-solved { background: #fef3c7; color: #78350f; font-weight: 700; cursor: pointer; }

/* Papan Mastermind — Latar Anyaman Arsitektural & Cincin Sandi Olive-Gold */
.dus-mm-board-shell {
  position: relative;
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  height: 396px;
  border-radius: 12px;
  overflow: hidden;
  border: 2.5px solid #4d590c;
  background-color: #f1f3e4;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M0 16H32M16 0V32' stroke='%236b7a14' stroke-opacity='0.09' stroke-width='0.8'/%3E%3Ccircle cx='16' cy='16' r='9' fill='none' stroke='%23b48318' stroke-opacity='0.14' stroke-width='0.9' stroke-dasharray='2 2'/%3E%3Ccircle cx='16' cy='16' r='1.4' fill='%2355610f' fill-opacity='0.18'/%3E%3C/svg%3E"),
    radial-gradient(circle at 50% 0%, #fcfdf7 0%, #e6ebd2 100%);
  background-repeat: repeat, no-repeat;
  background-size: 32px 32px, 100% 100%;
  box-shadow: 0 8px 20px -5px rgba(85, 97, 15, 0.16);
  display: flex;
  flex-direction: column;
}

/* Brankas Kode Rahasia di Atas Papan */
.dus-mm-secret-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(90deg, #434d0a 0%, #5e6c11 100%);
  border-bottom: 2px solid #353d08;
  color: #fcfcf8;
  flex-shrink: 0;
}

.dus-mm-secret-label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: #fef3c7;
}

.dus-mm-secret-slots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dus-mm-secret-slot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 1.5px dashed rgba(254, 243, 199, 0.65);
  color: #fef3c7;
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, background-color 0.25s ease;
}

.dus-mm-secret-slot.is-revealed {
  border-style: solid;
  border-color: #ffffff;
  color: #ffffff;
  transform: scale(1.05);
}

/* Daftar Baris Tebakan */
.dus-mm-rows {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dus-mm-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(107, 122, 20, 0.16);
  transition: all 0.16s ease;
}

.dus-mm-row.is-active-row {
  background: rgba(255, 255, 255, 0.94);
  border-color: #808000;
  box-shadow: 0 2px 8px rgba(85, 97, 15, 0.14);
}

.dus-mm-row.is-past-row {
  background: rgba(255, 255, 255, 0.78);
}

.dus-mm-row-num {
  font-size: 0.68rem;
  font-weight: 800;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.dus-mm-row.is-active-row .dus-mm-row-num {
  color: #55610f;
}

.dus-mm-slots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.dus-mm-rows[data-slots="5"] .dus-mm-slots {
  gap: 5px;
}

.dus-mm-slot-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px dashed #b5bc96;
  background: #f8f9f1;
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  outline: none;
  transition: transform 0.12s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.dus-mm-rows[data-slots="5"] .dus-mm-slot-btn {
  width: 25px;
  height: 25px;
  font-size: 0.7rem;
}

.dus-mm-slot-btn:disabled {
  cursor: default;
}

.dus-mm-slot-btn.has-token {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 3px rgba(0, 0, 0, 0.18);
}

.dus-mm-slot-btn.is-cursor {
  border-style: solid;
  border-color: #d97706 !important;
  box-shadow: 0 0 0 2.5px rgba(217, 119, 6, 0.32);
  transform: scale(1.06);
}

.dus-mm-slot-btn.is-locked-slot {
  box-shadow: 0 0 0 2px #6b7a14;
}

/* Matriks Pin Petunjuk */
.dus-mm-clues {
  display: grid;
  grid-template-columns: repeat(2, 9px);
  grid-auto-rows: 9px;
  gap: 3px;
  padding: 3px 4px;
  background: #ecefe0;
  border: 1px solid #d5d8be;
  border-radius: 6px;
}

.dus-mm-clues[data-slots="5"] {
  grid-template-columns: repeat(3, 8px);
  grid-auto-rows: 8px;
  gap: 2.5px;
}

.dus-mm-clue-peg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #cfd5b8;
  border: 1px solid rgba(85, 97, 15, 0.2);
}

.dus-mm-clue-peg.is-exact {
  background: #4d590c;
  border-color: #2f3706;
  box-shadow: 0 0 0 1px rgba(77, 89, 12, 0.25);
}

.dus-mm-clue-peg.is-color {
  background: #f59e0b;
  border-color: #b45309;
}

/* Warna & Identitas 6 Token */
.tok-0 { background: linear-gradient(145deg, #748516 0%, #4e590d 100%) !important; }
.tok-1 { background: linear-gradient(145deg, #f59e0b 0%, #b45309 100%) !important; }
.tok-2 { background: linear-gradient(145deg, #ea580c 0%, #9a3412 100%) !important; }
.tok-3 { background: linear-gradient(145deg, #14b8a6 0%, #0f766e 100%) !important; }
.tok-4 { background: linear-gradient(145deg, #4f46e5 0%, #312e81 100%) !important; }
.tok-5 { background: linear-gradient(145deg, #db2777 0%, #831843 100%) !important; }

/* Palet Pilihan Simbol */
.dus-mm-palette-box {
  background: #ffffff;
  border: 1px solid #d7dcc0;
  border-radius: 10px;
  padding: 7px;
}

.dus-mm-palette {
  --mm-pal-cols: 7;
  display: grid;
  grid-template-columns: repeat(var(--mm-pal-cols), minmax(0, 1fr));
  gap: 5px;
}

.dus-mm-pal-btn {
  height: 38px;
  border-radius: 9px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.14);
  transition: transform 0.1s ease, box-shadow 0.12s ease;
  touch-action: manipulation;
}

.dus-mm-pal-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.dus-mm-pal-btn:active {
  transform: scale(0.95);
}

.dus-mm-pal-btn.is-erase {
  background: #fdfaf2 !important;
  color: #78350f !important;
  border: 1px solid #cbd0b2 !important;
  box-shadow: none;
}

/* Tombol Bantuan & Aksi Bawah */
.dus-mm-tools-row { display: grid; grid-template-columns: 1.25fr 1fr; gap: 7px; }
.dus-mm-tool-btn { display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; padding: 9px 8px; 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-mm-tool-btn.is-primary { background: #4d590c; border-color: #4d590c; color: #ffffff; }
.dus-mm-tool-btn.is-primary:hover:not(:disabled) { background: #3b4408; }
.dus-mm-tool-btn:not(.is-primary):hover:not(:disabled) { background: #ebeed9; }
.dus-mm-tool-btn:disabled { opacity: 0.48; cursor: not-allowed; }

.dus-mm-footer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 2px; }
.dus-mm-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-mm-btn-olive:hover { background: #58650f; }
.dus-mm-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-mm-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-mm-btn-ghost:hover { background: #f4f5ea; color: #262e24; }

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

/* Modal Dalam Papan (Menang & Cara Bermain) */
.dus-mm-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-mm-modal-inner[hidden] { display: none; }
.dus-mm-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-mm-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-mm-modal-title { font-size: 1.05rem; font-weight: 800; color: #4d590c; margin-bottom: 6px; }
.dus-mm-modal-desc { font-size: 0.8rem; color: #525740; margin: 0 0 12px; line-height: 1.45; text-align: left; }
.dus-mm-save-box { background: #f7f8ee; padding: 9px; border-radius: 8px; margin-bottom: 10px; border: 1px solid #dce0c5; text-align: left; }
.dus-mm-label { display: block; font-size: 0.73rem; font-weight: 700; color: #4d590c; margin-bottom: 5px; }
.dus-mm-input-row { display: flex; gap: 6px; justify-content: center; }
.dus-mm-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-mm-btn-gold { padding: 5px 12px; background: #d97706; color: #ffffff; border: none; border-radius: 6px; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.dus-mm-filter-msg { font-size: 0.72rem; color: #b91c1c; margin-top: 4px; min-height: 13px; }

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