/* ตั๋วดันเจี้ยน (js/dgticket.js): the line under a dungeon page's enter button and the ticket window.
   The button carries its own obsidian + gold look so it reads on every book skin (light or dark pages). */
#ui .dgtk-row { display: flex; justify-content: center; margin-top: 8px; }
#bdg .dgtk-row { margin-top: 8px; }
#ui .dgtk-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 16px 6px 8px; border-radius: 12px; cursor: pointer;
  border: 2px solid #d9a443; background: linear-gradient(180deg, #3a2752, #1c1328); box-shadow: 0 0 0 1px #2a1d0c, inset 0 1px 0 rgba(255, 230, 170, 0.25), 0 4px 12px rgba(0, 0, 0, 0.35);
  color: #fff3d6 !important; -webkit-text-fill-color: #fff3d6 !important; font-family: var(--thai, 'Mali', sans-serif); text-align: left; }
#ui .dgtk-btn > img { width: 40px; height: 40px; object-fit: contain; flex: none; }
#ui .dgtk-btn > span { display: flex; flex-direction: column; line-height: 1.3; }
#ui .dgtk-btn b { font-size: 0.98rem; font-weight: 800; color: #ffe39a !important; -webkit-text-fill-color: #ffe39a !important; }
#ui .dgtk-btn small { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; color: #e2d4b4 !important; -webkit-text-fill-color: #e2d4b4 !important; }
#ui .dgtk-btn small img { width: 16px; height: 16px; }
#ui .dgtk-btn.primary { background: linear-gradient(180deg, #6a3fa0, #34205a); border-color: #ffd27a; }
#ui .dgtk-btn:not(:disabled):hover { filter: brightness(1.12); }
#ui .dgtk-btn:disabled { cursor: default; opacity: 0.7; filter: grayscale(0.4); }
#ui .dgtk-have { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 4px; border-radius: 999px; cursor: pointer;
  border: 1px solid #b98a3a; background: #241830; color: #f0e2c0 !important; -webkit-text-fill-color: #f0e2c0 !important; font-size: 0.8rem; }
#ui .dgtk-have img { width: 26px; height: 26px; object-fit: contain; }

/* ---- the window */
#dgtk { position: fixed; inset: 0; z-index: 962; display: grid; place-items: center; background: rgba(6, 4, 12, 0.6); pointer-events: auto; }
#dgtk[hidden] { display: none; }
#dgtk .dgtk-box { position: relative; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
  padding: 18px 20px 16px; border-radius: 16px; font-family: var(--thai, 'Mali', sans-serif); color: #f2ead6;
  background: radial-gradient(ellipse at 50% 0%, rgba(176, 120, 255, 0.18), transparent 60%), linear-gradient(180deg, rgba(30, 22, 40, 0.98), rgba(12, 10, 20, 0.98));
  border: 2px solid #8a6a2e; box-shadow: 0 0 0 1px #2a1d0c, inset 0 0 0 1px rgba(255, 216, 130, 0.12), 0 18px 40px rgba(0, 0, 0, 0.6); }
#dgtk .close-x { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid rgba(217, 164, 67, 0.8); background: #1c160e; color: #ffd98a; font: 700 14px/1 sans-serif; cursor: pointer; }
#dgtk .dgtk-head { display: flex; align-items: center; gap: 14px; padding-right: 34px; }
#dgtk .dgtk-head .tslot { width: 76px; height: 76px; flex: none; display: grid; place-items: center; border-radius: 12px; cursor: pointer;
  background: radial-gradient(circle at 50% 40%, rgba(176, 120, 255, 0.35), rgba(20, 14, 30, 0.9)); border: 2px solid #d9a443; }
#dgtk .dgtk-head .tslot img { width: 68px; height: 68px; object-fit: contain; }
#dgtk .dgtk-head > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#dgtk .dgtk-head b { font-size: 1.35rem; font-weight: 800; line-height: 1.45; color: #ffe2a0; }
#dgtk .dgtk-head small { font-size: 0.84rem; color: #cbbf9f; line-height: 1.45; }
#dgtk .dgtk-head i { font-style: normal; font-size: 0.9rem; color: #e8dcc0; }
#dgtk .dgtk-head i b { font-size: 1.05rem; color: #fff; }
#dgtk .dgtk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#dgtk .dgtk-list li { display: grid; grid-template-columns: 40px 1fr auto auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 216, 130, 0.22); }
#dgtk .dgtk-list li.out { border-color: rgba(255, 210, 122, 0.6); background: rgba(176, 120, 255, 0.1); }
#dgtk .dgtk-list li.none { display: block; text-align: center; color: #cbbf9f; font-size: 0.88rem; }
#dgtk .dgtk-list li > img { width: 40px; height: 40px; object-fit: contain; }
#dgtk .dgtk-list li > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
#dgtk .dgtk-list li > span b { font-size: 0.98rem; color: #fff2cc; }
#dgtk .dgtk-list li > span small { font-size: 0.78rem; color: #b9ad8f; }
#dgtk .dgtk-list li > em { font-style: normal; font-size: 0.8rem; color: #cfc4a8; white-space: nowrap; }
#dgtk .dgtk-list li > em b { font-size: 1rem; color: #9be37b; }
#dgtk .dgtk-list li > em.zero b { color: #ff8a7a; }
#dgtk .dgtk-list li .btn { white-space: nowrap; }
#dgtk .dgtk-all { align-self: center; border: 0; background: none; color: #ffd27a; font: 600 0.86rem var(--thai, sans-serif); cursor: pointer; text-decoration: underline; }
#dgtk .dgtk-shop { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(200, 182, 255, 0.08); border: 1px solid rgba(200, 182, 255, 0.35); }
#dgtk .dgtk-sl { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px; }
#dgtk .dgtk-sl > img { width: 34px; height: 34px; object-fit: contain; }
#dgtk .dgtk-sl > span { display: flex; flex-direction: column; line-height: 1.4; }
#dgtk .dgtk-sl b { color: #e6dcff; font-size: 0.95rem; }
#dgtk .dgtk-sl small { color: #c2b8d8; font-size: 0.78rem; }
#dgtk .dgtk-sl u { text-decoration: none; color: #ffd27a; }
#dgtk .dgtk-buy { min-height: 40px; padding: 6px 16px; font-weight: 800; }
#dgtk .dgtk-why { flex-basis: 100%; margin: 0; text-align: right; font-size: 0.8rem; color: #ff9a8a; }
@media (max-width: 560px) {
  #dgtk .dgtk-list li { grid-template-columns: 34px 1fr auto; }
  #dgtk .dgtk-list li > em { grid-column: 2; }
  #dgtk .dgtk-list li .btn { grid-column: 3; grid-row: 1 / span 2; }
}
/* (a disabled button keeps readable text: the book skins' grey .btn:disabled was light on light) */
#dgtk .btn:disabled, #dgtk .btn[disabled] { opacity: 1; filter: none; cursor: default; background: #2a2333 !important; border: 1px solid rgba(255, 216, 130, 0.25) !important; box-shadow: none !important;
  color: #a99d84 !important; -webkit-text-fill-color: #a99d84 !important; }
/* (the book skins paint .btn / .btn.primary gold with strong rules: the ticket button keeps its own obsidian + violet) */
#ui .dgtk-btn, #ui .dgtk-btn:hover { background: linear-gradient(180deg, #3a2752, #1c1328) !important; border: 2px solid #d9a443 !important; text-shadow: none !important; }
#ui .dgtk-btn.primary, #ui .dgtk-btn.primary:hover { background: linear-gradient(180deg, #6a3fa0, #34205a) !important; border-color: #ffd27a !important; }
#ui .dgtk-btn:disabled { background: #2a2333 !important; border-color: rgba(255, 216, 130, 0.3) !important; }
