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

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

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

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

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

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

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

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

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

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

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

/* Papan Nonogram Berpola Editorial */
.dus-ng-board-shell {
  position: relative;
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  border: 2.5px solid #4d590c;
  background-color: #f3f5e7;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath d='M10 1L19 10L10 19L1 10Z' fill='none' stroke='%236b7a14' stroke-opacity='0.14' stroke-width='0.9'/%3E%3Ccircle cx='10' cy='10' r='1.1' fill='%23808000' fill-opacity='0.2'/%3E%3C/svg%3E"),
    linear-gradient(150deg, #fcfcf8 0%, #eaedd9 100%);
  background-repeat: repeat, no-repeat;
  background-size: 20px 20px, 100% 100%;
  box-shadow: 0 8px 20px -5px rgba(85, 97, 15, 0.16);
}

.dus-ng-grid-root {
  --ng-size: 7;
  --ng-col-clue-rows: 3;
  --ng-row-clue-cols: 3;
  position: absolute !important;
  inset: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(46px, calc(var(--ng-row-clue-cols) * 16px + 8px)) minmax(0, 1fr) !important;
  grid-template-rows: minmax(46px, calc(var(--ng-col-clue-rows) * 14px + 8px)) minmax(0, 1fr) !important;
  width: 100% !important;
  height: 100% !important;
  padding: 6px !important;
  gap: 4px !important;
  margin: 0 !important;
}

.dus-ng-corner {
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(107, 122, 20, 0.14), rgba(128, 128, 0, 0.06));
  border: 1px solid rgba(107, 122, 20, 0.22);
}

.dus-ng-col-clues {
  display: grid !important;
  grid-template-columns: repeat(var(--ng-size), minmax(0, 1fr)) !important;
  gap: 2px !important;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #cfd5b6;
  border-radius: 7px;
  padding: 3px;
}

.dus-ng-col-clue-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
  font-size: clamp(0.56rem, 1.8vw, 0.7rem);
  font-weight: 800;
  color: #3f480b;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  border-radius: 4px;
  transition: opacity 0.18s ease, background-color 0.18s ease;
}

.dus-ng-col-clue-cell.is-done {
  opacity: 0.42;
  background: rgba(107, 122, 20, 0.1);
}

.dus-ng-row-clues {
  display: grid !important;
  grid-template-rows: repeat(var(--ng-size), minmax(0, 1fr)) !important;
  gap: 2px !important;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #cfd5b6;
  border-radius: 7px;
  padding: 3px;
}

.dus-ng-row-clue-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding-right: 4px;
  font-size: clamp(0.58rem, 1.9vw, 0.72rem);
  font-weight: 800;
  color: #3f480b;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  border-radius: 4px;
  transition: opacity 0.18s ease, background-color 0.18s ease;
}

.dus-ng-row-clue-cell.is-done {
  opacity: 0.42;
  background: rgba(107, 122, 20, 0.1);
}

.dus-ng-board {
  display: grid !important;
  grid-template-columns: repeat(var(--ng-size), minmax(0, 1fr)) !important;
  grid-template-rows: repeat(var(--ng-size), minmax(0, 1fr)) !important;
  gap: 2px !important;
  background: rgba(255, 255, 255, 0.62);
  border: 1.5px solid #6b7a14;
  border-radius: 7px;
  padding: 3px;
}

.dus-ng-cell {
  position: relative;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(107, 122, 20, 0.28);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.86);
  padding: 0;
  margin: 0;
  cursor: pointer;
  touch-action: manipulation;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.dus-ng-cell:hover {
  background: #f5f7e8;
  border-color: #808000;
}

.dus-ng-cell:active {
  transform: scale(0.94);
}

.dus-ng-cell.is-filled {
  background: linear-gradient(145deg, #748516 0%, #4e590d 100%);
  border-color: #3f480b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 3px rgba(63, 72, 11, 0.25);
}

.dus-ng-cell.is-cross::after {
  content: " d7";
  font-size: clamp(0.75rem, 2.8vw, 1.05rem);
  font-weight: 800;
  color: #808000;
  line-height: 1;
}

.dus-ng-cell.is-error {
  border-color: #dc2626 !important;
  background: #fef2f2 !important;
  box-shadow: inset 0 0 0 1.5px #dc2626;
}

.dus-ng-cell.is-solved {
  background: linear-gradient(145deg, #6b7a14 0%, #46500a 100%) !important;
  border-color: #fef3c7 !important;
}

/* Saklar Kuas Isi / Tanda Kosong */
.dus-ng-brush-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: #e8ebd5; padding: 4px; border-radius: 10px; }
.dus-ng-brush-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 8px; border: none; border-radius: 7px; background: transparent; color: #4d590c; font-size: 0.78rem; font-weight: 700; cursor: pointer; transition: all 0.15s ease; touch-action: manipulation; }
.dus-ng-brush-btn.is-active { background: #ffffff; color: #262e24; box-shadow: 0 2px 6px rgba(85, 97, 15, 0.16); }
.dus-ng-swatch { width: 12px; height: 12px; border-radius: 3px; background: linear-gradient(145deg, #748516, #4e590d); border: 1px solid #3f480b; display: inline-block; }
.dus-ng-cross-mark { font-size: 0.95rem; font-weight: 800; color: #808000; line-height: 1; }

/* Tombol Bantuan & Aksi Bawah */
.dus-ng-tools-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.dus-ng-tool-btn { display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; padding: 8px 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-ng-tool-btn:hover:not(:disabled) { background: #ebeed9; }
.dus-ng-tool-btn:disabled { opacity: 0.5; cursor: not-allowed; }

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

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

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

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

.dus-ng-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-ng-btn-ghost:hover { background: #f4f5ea; color: #262e24; }
.dus-ng-status.is-solved { cursor: pointer; }
