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

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

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

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

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

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

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

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

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

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

.dus-2048-submetrics { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; font-size: 0.75rem; color: #595e47; }
.dus-2048-submetric-item strong { color: #4d590c; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Status */
.dus-2048-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-2048-status.is-merge { background: #e4ead0; color: #36420b; font-weight: 700; }
.dus-2048-status.is-solved { background: #fef3c7; color: #78350f; font-weight: 700; }

/* Papan & Grid Ubin 2048 */
.dus-2048-board-shell { position: relative; width: 100%; max-width: 390px; margin: 0 auto; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; border: 2.5px solid #55610f; background: #dfe3c8; box-shadow: 0 6px 18px -4px rgba(85, 97, 15, 0.12); touch-action: none; }
.dus-2048-board { --grid-size: 4; position: absolute !important; inset: 0 !important; display: grid !important; grid-template-columns: repeat(var(--grid-size), minmax(0, 1fr)) !important; grid-template-rows: repeat(var(--grid-size), minmax(0, 1fr)) !important; gap: 8px !important; padding: 10px !important; width: 100% !important; height: 100% !important; margin: 0 !important; cursor: grab; }
.dus-2048-board:active { cursor: grabbing; }
.dus-2048-board[data-size="5"] { gap: 6px !important; padding: 8px !important; }

.dus-2048-tile { width: 100%; height: 100%; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; background: #e9ecd7; border: 1px solid rgba(85, 97, 15, 0.12); color: transparent; transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease; }
.dus-2048-tile.has-val { box-shadow: 0 2px 6px rgba(38, 46, 36, 0.1); }

/* Ukuran Font Adaptif Berdasarkan Ukuran Grid & Panjang Digit */
.dus-2048-board[data-size="3"] .dus-2048-tile { font-size: clamp(1.45rem, 6vw, 2rem); }
.dus-2048-board[data-size="4"] .dus-2048-tile { font-size: clamp(1.2rem, 5vw, 1.65rem); }
.dus-2048-board[data-size="5"] .dus-2048-tile { font-size: clamp(0.95rem, 4vw, 1.3rem); }

.dus-2048-tile.len-3 { font-size: clamp(1.05rem, 4.3vw, 1.42rem) !important; }
.dus-2048-tile.len-4 { font-size: clamp(0.88rem, 3.5vw, 1.18rem) !important; }
.dus-2048-tile.len-5 { font-size: clamp(0.74rem, 2.9vw, 0.98rem) !important; }

.dus-2048-board[data-size="5"] .dus-2048-tile.len-3 { font-size: clamp(0.85rem, 3.4vw, 1.12rem) !important; }
.dus-2048-board[data-size="5"] .dus-2048-tile.len-4 { font-size: clamp(0.72rem, 2.8vw, 0.94rem) !important; }
.dus-2048-board[data-size="5"] .dus-2048-tile.len-5 { font-size: clamp(0.62rem, 2.3vw, 0.78rem) !important; }

/* Palet Warna Ubin Khas DUS (Krem, Zaitun, Amber & Emas) */
.dus-2048-tile[data-val="2"]    { background: #fcfcf8; color: #262e24; border-color: #d5d8be; }
.dus-2048-tile[data-val="4"]    { background: #f2f4e3; color: #262e24; border-color: #c3cba6; }
.dus-2048-tile[data-val="8"]    { background: #e3ead0; color: #36420b; border-color: #aeb984; }
.dus-2048-tile[data-val="16"]   { background: #d0dcb0; color: #2a3408; border-color: #96a666; }
.dus-2048-tile[data-val="32"]   { background: #fef3c7; color: #78350f; border-color: #f59e0b; }
.dus-2048-tile[data-val="64"]   { background: #fde68a; color: #78350f; border-color: #d97706; }
.dus-2048-tile[data-val="128"]  { background: #f59e0b; color: #ffffff; border-color: #d97706; }
.dus-2048-tile[data-val="256"]  { background: #d97706; color: #ffffff; border-color: #b45309; }
.dus-2048-tile[data-val="512"]  { background: #b45309; color: #ffffff; border-color: #92400e; }
.dus-2048-tile[data-val="1024"] { background: #6b7a14; color: #fefce8; border-color: #4d590c; box-shadow: 0 3px 10px rgba(107, 122, 20, 0.3); }
.dus-2048-tile[data-val="2048"] { background: linear-gradient(135deg, #6b7a14 0%, #d97706 100%); color: #ffffff; border-color: #f59e0b; box-shadow: 0 4px 14px rgba(217, 119, 6, 0.4); }
.dus-2048-tile.is-super         { background: linear-gradient(135deg, #262e24 0%, #55610f 100%); color: #fef3c7; border-color: #d97706; box-shadow: 0 4px 14px rgba(38, 46, 36, 0.35); }

/* Animasi Muncul & Gabung Ubin */
@keyframes dus2048Spawn {
  0% { transform: scale(0.35); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes dus2048Merge {
  0% { transform: scale(1); }
  45% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.dus-2048-tile.is-new { animation: dus2048Spawn 0.16s cubic-bezier(0.22, 1, 0.36, 1); }
.dus-2048-tile.is-merged { animation: dus2048Merge 0.2s cubic-bezier(0.22, 1, 0.36, 1); }

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

.dus-2048-footer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 2px; }
.dus-2048-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-2048-btn-olive:hover { background: #58650f; }
.dus-2048-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; width: 100%; touch-action: manipulation; }
.dus-2048-btn-outline:hover { background: #f4f5ea; }

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

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

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