/* Own The Name — The Dungeon v2. Self-contained (does not use styles.css).
   Rules: no infinite animations (esp. logo — crashed WebKit), never overflow:hidden on html/body. */
@font-face { font-family: "Oswald"; src: url("assets/fonts/Oswald-var-latin.woff2") format("woff2"); font-weight: 200 700; font-display: swap; }
@font-face { font-family: "Great Vibes"; src: url("assets/fonts/GreatVibes-400-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #070707; --bg2: #0d0c0a; --panel: #121110; --panel2: #191714; --line: rgba(212,175,105,.16); --line2: rgba(255,255,255,.08);
  --gold: #d4af69; --gold-hi: #efd694; --gold-lo: #9a7534; --ink: #f4efe6; --mute: #a59d90; --dim: #6f685e;
  --ok: #8fd19e; --err: #ff8a7a;
  --radius: 16px; --radius-sm: 10px;
  --head: "Oswald", "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --script: "Great Vibes", "Snell Roundhand", cursive;
  --side-w: 248px; --rail-w: 340px; --top-h: 68px; --tabs-h: 64px; --dock-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); color-scheme: dark; scroll-padding-top: calc(var(--top-h) + 12px); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--body); overflow-x: clip; -webkit-font-smoothing: antialiased; }
@supports not (overflow-x: clip) { body { overflow-x: hidden; } }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
[hidden] { display: none !important; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 14px; height: 14px; }
.gold { color: var(--gold); }

/* ── boot gate ── */
#hub-boot-gate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--bg); color: var(--mute); font-family: var(--head); letter-spacing: .14em; text-transform: uppercase; font-size: 13px; }
body.session-ready #hub-boot-gate { display: none; }
body.session-ready #hub-boot-gate:has(.gate-inner) { display: grid; }
.gate-inner { max-width: 420px; padding: 28px; text-align: center; text-transform: none; letter-spacing: 0; font-family: var(--body); color: var(--ink); font-size: 15px; }
.gate-sub { color: var(--mute); }
.gate-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* ── type ── */
.dg-kicker { margin: 0 0 6px; font: 600 11px/1.2 var(--head); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.dg-h1 { margin: 0; font: 600 clamp(30px, 4vw, 44px)/1.04 var(--head); letter-spacing: .02em; text-transform: uppercase; }
.dg-h2 { margin: 0; font: 600 20px/1.2 var(--head); letter-spacing: .06em; text-transform: uppercase; }
.dg-h2 small { font: 400 13px var(--body); letter-spacing: 0; text-transform: none; color: var(--mute); margin-left: 6px; }
.dg-h3, .dg-card h3 { margin: 18px 0 10px; font: 600 15px/1.25 var(--head); letter-spacing: .08em; text-transform: uppercase; }
.dg-card > h3:first-child, .dg-card .dg-row-head h3 { margin-top: 0; }
.dg-sub { margin: 6px 0 0; color: var(--mute); }
.dg-fine { margin: 12px 0 0; font-size: 12px; color: var(--dim); }
.dg-empty { color: var(--mute); padding: 18px 0; margin: 0; }
.dg-gap { margin: 14px 0; }
.dg-status { margin: 8px 0 0; min-height: 1.2em; font-size: 13px; color: var(--mute); }
.dg-status.ok { color: var(--ok); } .dg-status.error { color: var(--err); }
.dg-flash { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--panel); }
.dg-flash.error { border-color: rgba(255,138,122,.4); color: var(--err); } .dg-flash.ok { color: var(--gold-hi); }
.dg-link { color: var(--gold); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.dg-link:hover { color: var(--gold-hi); }
.dg-link-btn { color: var(--gold); font-weight: 600; min-height: 32px; padding: 0 4px; }

/* ── buttons ── */
.dg-cta { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 999px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo)); color: #120d04; font: 700 14px/1 var(--head); letter-spacing: .14em; text-transform: uppercase;
  box-shadow: 0 10px 30px rgba(212,175,105,.25), inset 0 1px 0 rgba(255,255,255,.4); transition: transform .15s ease, box-shadow .15s ease; }
.dg-cta:hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(212,175,105,.35), inset 0 1px 0 rgba(255,255,255,.4); }
.dg-cta.sm { min-height: 44px; padding: 0 18px; font-size: 13px; letter-spacing: .1em; }
.dg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.03);
  color: var(--ink); font: 600 13px/1 var(--body); transition: border-color .15s, background .15s; white-space: nowrap; }
.dg-btn:hover { border-color: rgba(212,175,105,.5); background: rgba(212,175,105,.08); }
.dg-btn.sm { min-height: 44px; padding: 0 14px; font-size: 12.5px; }
.dg-btn.ghost { border-color: transparent; color: var(--gold); background: transparent; }
.dg-btn.ghost:hover { background: rgba(212,175,105,.08); }
.dg-btn.is-on { background: rgba(212,175,105,.16); border-color: var(--gold); color: var(--gold-hi); }
.dg-icon-btn { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--ink); border: 1px solid transparent; transition: background .15s, border-color .15s; }
.dg-icon-btn:hover { background: rgba(255,255,255,.05); border-color: var(--line2); }
.dg-dot { position: absolute; top: 10px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--bg); }
.dg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dg-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--ink); font-size: 13px; font-weight: 500; transition: border-color .15s, background .15s; }
.dg-chip:hover { border-color: rgba(212,175,105,.5); }
.dg-chip.active { background: var(--gold); border-color: var(--gold); color: #120d04; font-weight: 700; }
.dg-filter { margin: 18px 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.dg-filter::-webkit-scrollbar { display: none; }
.dg-filter .dg-chip { flex: none; }
.dg-pill { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); font: 600 11px var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.dg-tag { position: absolute; left: 8px; top: 8px; padding: 4px 8px; border-radius: 6px; background: rgba(7,7,7,.82); border: 1px solid var(--line); color: var(--gold-hi); font: 600 10px/1 var(--head); letter-spacing: .14em; text-transform: uppercase; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.dg-tag.inline { position: static; display: inline-flex; }
.dg-tag.is-dungeon { background: var(--gold); color: #120d04; border-color: var(--gold); }
.dg-tag.ghost { background: transparent; color: var(--mute); border-color: var(--line2); }
.dg-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.dg-lock-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(212,175,105,.12); border: 1px solid var(--line); color: var(--gold-hi); font: 600 11px var(--head); letter-spacing: .12em; text-transform: uppercase; }
.dg-lock-badge .ico { width: 13px; height: 13px; }
.dg-card { position: relative; background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.dg-empty-card { text-align: left; }
.dg-empty-card h3 { margin-top: 0; }
.dg-skel { flex: none; width: 260px; height: 220px; border-radius: var(--radius); background: linear-gradient(100deg, var(--panel) 30%, var(--panel2) 50%, var(--panel) 70%); }
.dg-skel.wide { width: 100%; height: 96px; margin-bottom: 10px; }

/* ── app layout ── */
.dg-app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.dg-body { min-width: 0; display: flex; flex-direction: column; }
.dg-columns { display: grid; grid-template-columns: minmax(0, 1fr) var(--rail-w); gap: 28px; padding: 8px 32px 40px; align-items: start; }
.dg-main { min-width: 0; }
.view { display: none; min-width: 0; }
.view.active { display: block; }

/* sidebar */
.dg-side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 6px; padding: 22px 16px 18px; border-right: 1px solid var(--line); background: linear-gradient(180deg, #0c0b09, #070707 60%); overflow-y: auto; scrollbar-width: none; }
.dg-side::-webkit-scrollbar { display: none; }
.dg-logo { display: flex; align-items: center; gap: 10px; padding: 2px 4px 22px; }
.dg-logo-img { width: 54px; height: 54px; flex: none; object-fit: contain; filter: drop-shadow(0 0 12px rgba(212,175,105,.5)) drop-shadow(0 0 2px rgba(240,216,152,.55)); } /* static glow only — no animation (WebKit) */
.dg-logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.dg-logo-text b { font: 700 16px var(--head); letter-spacing: .13em; white-space: nowrap; color: var(--gold-hi); text-shadow: 0 0 18px rgba(212,175,105,.35); }
.dg-logo-text small { font: 500 11px var(--head); letter-spacing: .3em; color: var(--mute); margin-top: 4px; }
.dg-nav { display: flex; flex-direction: column; gap: 2px; }
.dg-nav-item { position: relative; display: flex; align-items: center; gap: 14px; min-height: 46px; padding: 0 14px; border-radius: 12px; color: var(--mute); font: 500 14px var(--head); letter-spacing: .12em; text-transform: uppercase; transition: color .15s, background .15s; }
.dg-nav-item:hover { color: var(--ink); background: rgba(255,255,255,.04); }
.dg-nav-item.active { color: var(--gold-hi); background: linear-gradient(90deg, rgba(212,175,105,.18), rgba(212,175,105,.02)); }
.dg-nav-item.active::before { content: ""; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.dg-side-host { margin-top: 6px; }
.dg-os-link { border: 1px dashed var(--line); color: var(--gold); }
.dg-side-note { margin: auto 6px 14px; padding-top: 18px; font-size: 12.5px; line-height: 1.55; color: var(--dim); }
.dg-side-note b { color: var(--gold); font-weight: 600; }
.dg-side-user { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.dg-side-user:hover { border-color: rgba(212,175,105,.4); }
.dg-avatar, #top-avatar { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, var(--gold-hi), var(--gold-lo)); color: #120d04; font: 700 14px var(--head); letter-spacing: .04em; }
#top-avatar { width: 34px; height: 34px; font-size: 12px; }
.dg-side-user-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dg-side-user-copy b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-side-user-copy small { color: var(--gold); font: 500 11px var(--head); letter-spacing: .14em; text-transform: uppercase; margin: 2px 0 6px; }
.dg-xp { display: block; height: 5px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.dg-xp i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); transition: width .4s ease; }
.dg-xp.big { height: 8px; }

/* top bar */
.dg-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; height: var(--top-h); padding: 0 32px; background: rgba(7,7,7,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line2); }
.dg-burger, .dg-top-logo, .dg-search-toggle { display: none; }
.dg-top-logo { align-items: center; gap: 10px; font: 700 14px var(--head); letter-spacing: .2em; color: var(--gold-hi); }
.dg-top-logo img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(212,175,105,.5)) drop-shadow(0 0 2px rgba(240,216,152,.5)); }
.dg-search { position: relative; display: flex; align-items: center; flex: 1; max-width: 560px; min-width: 0; height: 46px; padding: 0 14px; gap: 10px; border-radius: 999px; border: 1px solid var(--line2); background: rgba(255,255,255,.04); color: var(--mute); transition: border-color .15s; }
.dg-search:focus-within { border-color: rgba(212,175,105,.6); }
.dg-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; }
.dg-search input::placeholder { color: var(--dim); }
.dg-search input::-webkit-search-cancel-button { filter: grayscale(1); }
.dg-kbd { font: 500 11px var(--body); color: var(--dim); border: 1px solid var(--line2); border-radius: 6px; padding: 2px 6px; }
.dg-top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.dg-acct { padding: 0; }
.dg-os-pill { display: none; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 999px; border: 1px dashed var(--line); color: var(--gold); font: 600 12px var(--head); letter-spacing: .14em; }
.dg-os-pill .ico { width: 16px; height: 16px; }
.dg-notif { position: absolute; right: 24px; top: calc(var(--top-h) - 6px); width: min(360px, calc(100vw - 24px)); z-index: 60; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: #11100e; box-shadow: 0 24px 60px rgba(0,0,0,.6); }
.dg-notif-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font: 600 14px var(--head); letter-spacing: .1em; text-transform: uppercase; }
.dg-notif-item { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 12px; min-height: 44px; border-radius: 12px; border: 1px solid transparent; }
.dg-notif-item:hover { background: rgba(212,175,105,.08); border-color: var(--line); }
.dg-notif-item b { font-size: 14px; }
.dg-notif-item small { color: var(--mute); font-size: 12.5px; }

/* ── hero ── */
.dg-hero { position: relative; isolation: isolate; overflow: hidden; min-height: 400px; display: flex; align-items: flex-end; padding: 44px 44px 40px; border-radius: 22px; border: 1px solid var(--line); margin: 16px 0 8px; }
.dg-hero-bg { position: absolute; inset: 0; z-index: -1; background:
  linear-gradient(90deg, rgba(7,7,7,.96) 0%, rgba(7,7,7,.78) 34%, rgba(7,7,7,.18) 68%, rgba(7,7,7,.05) 100%),
  linear-gradient(0deg, rgba(7,7,7,.85) 0%, rgba(7,7,7,0) 45%),
  radial-gradient(120% 90% at 78% 30%, rgba(239,214,148,.28), rgba(154,117,52,.10) 45%, transparent 70%),
  url("assets/dungeon/hero-summit.jpg") 70% 40% / cover no-repeat; }
.dg-hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(222,180,100,.42), rgba(154,117,52,.30)); mix-blend-mode: color; }
.dg-hero-copy { position: relative; max-width: 520px; }
.dg-hero .dg-kicker { font-size: 12px; letter-spacing: .34em; }
.dg-hero-title { margin: 2px 0 10px; font: 700 clamp(46px, 6.4vw, 84px)/.92 var(--head); letter-spacing: .03em; text-transform: uppercase;
  background: linear-gradient(180deg, #fff6dc 0%, var(--gold-hi) 40%, var(--gold) 75%, var(--gold-lo) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
.dg-hero-tag { margin: 0 0 16px; font: 500 15px var(--head); letter-spacing: .32em; color: var(--ink); }
.dg-hero-tag span { color: var(--gold); }
.dg-hero-copytext { margin: 0 0 22px; color: #d9d1c3; font-size: 15.5px; max-width: 440px; }
.dg-cta-sub { margin: 10px 0 0; min-height: 1.2em; font-size: 13px; color: var(--mute); }
.dg-script { position: absolute; right: 36px; bottom: 26px; margin: 0; font: 400 clamp(26px, 3vw, 40px)/1 var(--script); color: var(--gold-hi); text-shadow: 0 2px 16px rgba(0,0,0,.65); transform: rotate(-4deg); pointer-events: none; }

/* ── sections / rows ── */
.dg-section { margin-top: 34px; min-width: 0; }
.dg-row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; min-width: 0; }
.dg-row-head.tight { margin-bottom: 10px; }
.dg-row-head h3 { margin: 0; }
.dg-row-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.dg-arrow { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); color: var(--gold-hi); background: rgba(255,255,255,.02); transition: background .15s, opacity .15s; }
.dg-arrow:hover:not(:disabled) { background: rgba(212,175,105,.12); }
.dg-arrow:disabled { opacity: .3; cursor: default; }
.dg-viewall { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px 0 10px; color: var(--gold); font: 600 12px var(--head); letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; }
.dg-viewall:hover { color: var(--gold-hi); }
.dg-scroller { display: flex; gap: 18px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-padding-left: 2px; overscroll-behavior-x: contain; scrollbar-width: none; padding: 2px 2px 8px; -webkit-overflow-scrolling: touch; min-width: 0; }
.dg-scroller::-webkit-scrollbar { display: none; }
.dg-scroller > * { scroll-snap-align: start; flex: none; }

/* book cards */
.dg-book { display: flex; flex-direction: column; width: 150px; min-width: 0; }
.dg-book.lg { width: 178px; }
.dg-book.sm { width: 128px; }
.dg-book-cover { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: linear-gradient(160deg, #2a2216, #0d0b08); border: 1px solid var(--line); box-shadow: 0 14px 30px rgba(0,0,0,.45); transition: transform .2s ease, border-color .2s; }
.dg-book-cover img { width: 100%; height: 100%; object-fit: cover; }
.dg-book:hover .dg-book-cover { transform: translateY(-3px); border-color: rgba(212,175,105,.55); }
.dg-read-badge { position: absolute; right: 8px; top: 8px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #120d04; }
.dg-read-badge .ico { width: 15px; height: 15px; stroke-width: 2.6; }
.dg-book-title { margin-top: 10px; font: 600 14px/1.25 var(--head); letter-spacing: .03em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dg-book-author { margin-top: 2px; font-size: 12.5px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 24px 18px; }
.dg-book-grid .dg-book { width: auto; }

/* episode cards */
.dg-ep { flex: none; width: 260px; display: flex; flex-direction: column; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); overflow: hidden; transition: border-color .2s, transform .2s; min-width: 0; }
.dg-ep:hover { border-color: rgba(212,175,105,.5); transform: translateY(-2px); }
.dg-ep.is-playing { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.dg-ep-art { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; background: radial-gradient(90% 120% at 50% 0%, rgba(212,175,105,.32), rgba(13,11,8,1) 70%); overflow: hidden; }
.dg-ep-art img { width: 100%; height: 100%; object-fit: contain; padding: 14px 0 10px; filter: drop-shadow(0 10px 18px rgba(0,0,0,.6)); }
.dg-ep-num { position: absolute; left: 10px; top: 10px; padding: 4px 8px; border-radius: 6px; background: rgba(7,7,7,.8); color: var(--gold-hi); font: 600 11px/1 var(--head); letter-spacing: .14em; }
.dg-ep-play { position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #120d04; box-shadow: 0 8px 20px rgba(0,0,0,.5); }
.dg-ep-play .ico, .dg-row-play .ico { fill: currentColor; stroke: none; }
.dg-ep-bar, .dg-row-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.12); }
.dg-row-bar { position: static; display: block; margin-top: 8px; border-radius: 999px; overflow: hidden; max-width: 260px; }
.dg-ep-bar i, .dg-row-bar i { display: block; height: 100%; background: var(--gold); }
.dg-ep-copy { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px 16px; min-width: 0; }
.dg-ep-title { font: 600 17px/1.2 var(--head); letter-spacing: .03em; }
.dg-ep-sub { font-size: 13px; color: #d4ccbe; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dg-ep-meta { font-size: 12px; color: var(--dim); }

/* categories */
.dg-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dg-cat { position: relative; isolation: isolate; display: block; aspect-ratio: 16 / 10; min-width: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(140deg, #2a2216, #0b0a08); }
.dg-cat img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; filter: sepia(.35) saturate(.9) brightness(.8); transition: transform .35s ease; }
.dg-cat:hover img { transform: scale(1.05); }
.dg-cat-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(7,7,7,.92), rgba(7,7,7,.15) 70%), linear-gradient(180deg, rgba(212,175,105,.12), transparent); }
.dg-cat-copy { position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; flex-direction: column; }
.dg-cat-copy b { font: 600 18px var(--head); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.dg-cat-copy small { color: var(--gold); font-size: 12px; }
.dg-cat:hover { border-color: rgba(212,175,105,.55); }
.dg-cat-hero { position: relative; isolation: isolate; overflow: hidden; border-radius: 20px; border: 1px solid var(--line); min-height: 220px; display: flex; align-items: flex-end; padding: 28px; margin: 12px 0 20px; }
.dg-cat-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; filter: sepia(.35) brightness(.7); }
.dg-cat-hero-copy p { margin: 6px 0 0; color: #d9d1c3; max-width: 560px; }
.dg-cat-hero-copy .dg-cat-counts { color: var(--gold); font-size: 13px; }

/* ── views ── */
.dg-view-head { padding: 22px 0 6px; }
.dg-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 12px; color: var(--gold); font: 600 12px var(--head); letter-spacing: .16em; text-transform: uppercase; }
.dg-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 16px 0 12px; }
.dg-toolbar .dg-status { margin: 0; }
.dg-spacer { flex: 1; }

/* now playing card */
.dg-now { margin-top: 16px; }
.dg-now-frame { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; margin-bottom: 16px; }
.dg-now-frame iframe, .dg-now-frame #yt-player { width: 100%; height: 100%; display: block; border: 0; }
.dg-now-row { display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.dg-now-cover { width: 72px; height: 108px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.dg-now-meta { min-width: 0; }
.dg-now-title { margin: 0; font: 600 22px/1.15 var(--head); letter-spacing: .03em; }
.dg-now .dg-chips { margin-top: 16px; }
.dg-drawer { margin-top: 14px; padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.35); }
.dg-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font: 600 14px var(--head); letter-spacing: .1em; text-transform: uppercase; }
.dg-drawer p { margin: 0 0 8px; }

/* episode rows */
.dg-eps-list { display: flex; flex-direction: column; gap: 10px; }
.dg-row { border-radius: 14px; border: 1px solid var(--line); background: var(--panel); min-width: 0; transition: border-color .15s; }
.dg-row:hover, .dg-row.is-open { border-color: rgba(212,175,105,.45); }
.dg-row.is-playing { border-color: var(--gold); }
.dg-row-main { display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 10px; min-width: 0; }
.dg-row-art { position: relative; flex: none; width: 64px; height: 96px; border-radius: 8px; overflow: hidden; background: #1a160f; }
.dg-row-art img { width: 100%; height: 100%; object-fit: cover; }
.dg-row-play { position: absolute; inset: auto 6px 6px auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: #120d04; }
.dg-row-play .ico { width: 14px; height: 14px; }
.dg-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; gap: 2px; min-height: 44px; }
.dg-row-num { font: 600 11px var(--head); letter-spacing: .14em; color: var(--gold); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-row-title { font: 600 18px/1.2 var(--head); letter-spacing: .03em; }
.dg-row-punch { font-size: 13.5px; color: #d4ccbe; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-row-meta { font-size: 12px; color: var(--dim); }
.dg-row-more { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--mute); border: 1px solid var(--line2); }
.dg-row-more:hover { color: var(--gold); border-color: var(--line); }
.dg-detail { padding: 4px 16px 16px; display: grid; gap: 12px; border-top: 1px solid var(--line2); margin-top: 2px; padding-top: 14px; }
.dg-detail-block p { margin: 0; color: #d9d1c3; }
.dg-stamps { display: flex; flex-wrap: wrap; gap: 8px; }
.dg-stamp { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.03); text-align: left; }
.dg-stamp small { color: var(--gold); font-variant-numeric: tabular-nums; }
.dg-stamp:hover { border-color: var(--gold); }

/* book detail */
.dg-book-detail { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; margin-top: 12px; align-items: start; }
.dg-bd-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 24px 50px rgba(0,0,0,.6); }
.dg-bd-author { margin: 6px 0 0; color: var(--mute); font-size: 15px; }
.dg-angle { margin: 18px 0 0; padding: 14px 18px; border-left: 3px solid var(--gold); background: rgba(212,175,105,.06); border-radius: 0 12px 12px 0; color: #e6dece; font-size: 15px; }
.dg-angle .dg-kicker { display: block; }
.dg-bd-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.dg-mini-list { display: grid; gap: 8px; }
.dg-mini { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(255,255,255,.02); text-align: left; min-width: 0; }
.dg-mini:hover { border-color: rgba(212,175,105,.45); }
.dg-mini > .ico { color: var(--gold); }
.dg-mini span { display: flex; flex-direction: column; min-width: 0; }
.dg-mini b { font-size: 14px; font-weight: 600; }
.dg-mini small { color: var(--mute); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* people */
.dg-people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 18px; }
.dg-person { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); min-width: 0; min-height: 96px; }
.dg-person:hover { border-color: rgba(212,175,105,.5); }
.dg-person-av { position: relative; flex: none; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, #3a2e1a, #0d0b08); border: 1px solid var(--line); }
.dg-person-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; filter: sepia(.4); }
.dg-person-av b { position: relative; font: 700 18px var(--head); letter-spacing: .04em; color: var(--gold-hi); text-shadow: 0 1px 6px rgba(0,0,0,.8); }
.dg-person-av.lg { width: 96px; height: 96px; }
.dg-person-av.lg b { font-size: 30px; }
.dg-person-copy { display: flex; flex-direction: column; min-width: 0; }
.dg-person-copy b { font: 600 17px var(--head); letter-spacing: .03em; }
.dg-person-copy small { color: var(--gold); font-size: 12px; }
.dg-person-copy em { color: var(--mute); font-size: 13px; font-style: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dg-pd-head { display: flex; gap: 20px; align-items: center; margin: 12px 0 4px; }
.dg-pd-quote { margin: 8px 0 0; color: #e6dece; font-size: 16px; }

/* lessons */
.dg-lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.dg-lesson { display: flex; flex-direction: column; padding: 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); min-width: 0; }
.dg-lesson.is-applied { border-color: var(--gold); }
.dg-lesson-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.dg-lesson h3 { margin: 4px 0 8px; font: 600 17px/1.25 var(--head); letter-spacing: .03em; text-transform: none; }
.dg-lesson p { margin: 0 0 12px; color: #d4ccbe; font-size: 14px; }
.dg-lesson-lock { display: flex; align-items: center; gap: 6px; color: var(--gold) !important; }
.dg-lesson-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }

/* quests */
.dg-quest-summary { margin: 16px 0; }
.dg-qs { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: baseline; }
.dg-qs b { font: 700 30px var(--head); color: var(--gold-hi); }
.dg-qs span { color: var(--mute); }
.dg-qs .dg-xp { grid-column: 1 / -1; margin-top: 8px; }
.dg-quests { display: grid; gap: 10px; }
.dg-quest { display: flex; gap: 14px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); min-width: 0; }
.dg-quest.is-done { border-color: var(--gold); background: linear-gradient(180deg, rgba(212,175,105,.07), var(--panel)); }
.dg-quest-check { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); color: transparent; transition: background .15s, color .15s, border-color .15s; }
.dg-quest-check:hover { border-color: var(--gold); color: var(--gold-lo); }
.dg-quest.is-done .dg-quest-check { background: var(--gold); border-color: var(--gold); color: #120d04; }
.dg-quest-check .ico { stroke-width: 2.6; }
.dg-quest-copy { min-width: 0; flex: 1; }
.dg-quest-copy h3 { margin: 2px 0 6px; font: 600 17px/1.25 var(--head); letter-spacing: .03em; text-transform: none; }
.dg-quest-copy p { margin: 0 0 12px; color: #d4ccbe; font-size: 14px; }
.dg-quest.is-done h3 { color: var(--gold-hi); }

/* opie */
.dg-manifesto { margin: 16px 0; }
.dg-manifesto-lead { font: 600 20px/1.3 var(--head); letter-spacing: .02em; margin: 14px 0 8px; }
.dg-manifesto p { color: #d9d1c3; }
.dg-pay { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.dg-chat { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.dg-chat-log { display: flex; flex-direction: column; gap: 12px; max-height: min(60vh, 560px); min-height: 160px; overflow-y: auto; padding-right: 4px; overscroll-behavior: contain; }
.dg-msg { display: flex; }
.dg-msg.me { justify-content: flex-end; }
.dg-msg.me p { margin: 0; max-width: 80%; padding: 10px 14px; border-radius: 16px 16px 4px 16px; background: var(--gold); color: #120d04; font-weight: 500; }
.dg-msg.opie .dg-answer { max-width: 92%; }
.dg-answer { padding: 12px 14px; border-radius: 16px 16px 16px 4px; background: rgba(255,255,255,.04); border: 1px solid var(--line2); min-width: 0; }
.dg-answer p { margin: 4px 0 0; white-space: pre-wrap; color: #e6dece; font-size: 14px; }
.dg-answer.is-locked { border-color: var(--line); background: rgba(212,175,105,.06); }
.dg-answer.is-locked p { margin-top: 8px; }
.dg-sources { margin: 8px 0 0; padding-left: 18px; color: var(--mute); font-size: 12px; }
.dg-typing { color: var(--mute) !important; }
.dg-ask { display: flex; gap: 8px; align-items: center; min-width: 0; }
.dg-ask input { flex: 1; min-width: 0; height: 48px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line2); background: rgba(255,255,255,.04); color: var(--ink); outline: 0; font-size: 15px; }
.dg-ask input:focus { border-color: rgba(212,175,105,.6); }
.dg-send { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #120d04; }

/* account */
.dg-acct-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.dg-acct-side { display: grid; gap: 16px; min-width: 0; }
.dg-field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.dg-field span { font: 600 11px var(--head); letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
.dg-field input { height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(255,255,255,.04); color: var(--ink); outline: 0; font-size: 16px; min-width: 0; width: 100%; }
.dg-field input:focus { border-color: rgba(212,175,105,.6); }
.dg-field input[readonly] { color: var(--mute); }
.dg-form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.dg-kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line2); }
.dg-kv span { color: var(--mute); } .dg-kv b { text-transform: capitalize; text-align: right; }
.dg-os-acct { margin-top: 14px; }
.dg-search-inline { margin-top: 16px; max-width: none; }
.dg-results h2 { margin-bottom: 12px; }
.dg-results .dg-h2 small { color: var(--gold); }

/* ── right rail ── */
.dg-rail { position: sticky; top: calc(var(--top-h) + 16px); display: flex; flex-direction: column; gap: 16px; padding-top: 16px; min-width: 0; }
.dg-rail .dg-card { padding: 18px; }
.dg-rail h3 { margin: 0; font: 600 16px var(--head); letter-spacing: .1em; text-transform: uppercase; }
.dg-rail-opie { background: radial-gradient(120% 80% at 100% 0%, rgba(212,175,105,.16), transparent 60%), linear-gradient(180deg, var(--panel2), var(--panel)); }
.dg-rail-opie-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.dg-rail-opie-head .dg-lock-badge { margin-top: 4px; }
.dg-opie-orb { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--gold-hi), var(--gold-lo)); color: #120d04; box-shadow: 0 0 24px rgba(212,175,105,.3); }
.dg-rail-greet { margin: 0 0 12px; color: #d9d1c3; font-size: 14px; }
.dg-rail-opie .dg-chips { margin-bottom: 12px; }
.dg-rail-opie .dg-chip { font-size: 12.5px; padding: 0 12px; }
.dg-rail-answer { margin-top: 12px; display: grid; gap: 8px; }
.dg-rail-answer .dg-answer p { font-size: 13.5px; }
.dg-level { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; }
.dg-level-badge { display: grid; place-items: center; flex: none; width: 54px; height: 54px; border-radius: 14px; background: linear-gradient(160deg, var(--gold-hi), var(--gold-lo)); color: #120d04; font: 700 24px var(--head); }
.dg-level-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dg-level-copy b { font: 600 15px var(--head); letter-spacing: .1em; text-transform: uppercase; }
.dg-level-copy small { color: var(--mute); font-size: 12px; }
.dg-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dg-stats li { display: flex; flex-direction: column-reverse; gap: 2px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line2); }
.dg-stats span { font-size: 11.5px; color: var(--mute); line-height: 1.25; }
.dg-stats b { font: 700 24px/1 var(--head); color: var(--gold-hi); }
.dg-activity h3 { margin-bottom: 8px; }
.dg-act-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.dg-act { display: flex; gap: 12px; width: 100%; padding: 10px 6px; min-height: 44px; border-radius: 10px; text-align: left; align-items: flex-start; }
.dg-act:hover { background: rgba(255,255,255,.04); }
.dg-act-ico { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: rgba(212,175,105,.12); color: var(--gold); }
.dg-act-ico .ico { width: 16px; height: 16px; }
.dg-act-txt { display: flex; flex-direction: column; min-width: 0; font-size: 13px; color: #d4ccbe; }
.dg-act-txt b { color: var(--ink); font-weight: 600; }
.dg-act-txt small { color: var(--dim); font-size: 11.5px; margin-top: 2px; }
.dg-empty-li { color: var(--mute); font-size: 13px; padding: 6px 0; }
.dg-build { text-align: center; padding: 26px 20px !important; background: radial-gradient(100% 100% at 50% 100%, rgba(212,175,105,.18), transparent 70%), linear-gradient(180deg, var(--panel2), var(--panel)); }
.dg-build p { margin: 0; font: 500 16px/1.35 var(--head); letter-spacing: .04em; color: #d9d1c3; }
.dg-build p.gold { margin-top: 6px; font-family: var(--script); font-size: 30px; letter-spacing: 0; color: var(--gold-hi); }
.dg-acct-progress .dg-kv b { text-transform: none; }

/* ── footer ── */
.dg-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin: 24px 32px 0; padding: 26px 0 32px; border-top: 1px solid var(--line); }
.dg-foot-logo { display: flex; align-items: center; gap: 10px; font: 700 14px var(--head); letter-spacing: .2em; color: var(--gold-hi); }
.dg-foot-logo img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(212,175,105,.45)); }
.dg-foot-links { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.dg-foot-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--mute); font: 500 13px var(--head); letter-spacing: .14em; text-transform: uppercase; }
.dg-foot-links a:hover { color: var(--gold); }
.dg-foot-fine { margin: 0 0 0 auto; font-size: 12px; color: var(--dim); }

/* ── player dock ── */
.dg-dock { position: fixed; z-index: 50; left: calc(var(--side-w) + 16px); right: 16px; bottom: 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(16,15,13,.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 20px 50px rgba(0,0,0,.6); overflow: hidden; }
.dg-dock.is-playing { border-color: rgba(212,175,105,.5); }
.dg-dock-track { height: 6px; background: rgba(255,255,255,.08); cursor: pointer; position: relative; }
.dg-dock-track::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; bottom: -8px; }
.dg-dock-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); }
.dg-dock-body { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; min-width: 0; }
.dg-dock-meta { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; min-height: 48px; }
.dg-dock-face { width: 36px; height: 52px; object-fit: cover; border-radius: 6px; flex: none; background: #1a160f; }
.dg-dock-copy { display: flex; flex-direction: column; min-width: 0; }
.dg-dock-copy b { font: 600 15px var(--head); letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-dock-copy small { color: var(--mute); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-dock-time { flex: none; font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
.dg-dock-btn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ink); border: 1px solid var(--line2); }
.dg-dock-btn .ico { fill: currentColor; stroke: none; }
.dg-dock-btn.play { width: 48px; height: 48px; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #120d04; border: 0; }
body.has-dock .dg-body { padding-bottom: calc(var(--dock-h) + 32px); }
body.has-dock .dg-rail { max-height: none; }

/* ── toast ── */
.dg-toast { position: fixed; z-index: 70; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(520px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 14px; background: #1c1914; border: 1px solid var(--line); color: var(--ink); font-size: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.55); text-align: center; }
body.has-dock .dg-toast { bottom: calc(var(--dock-h) + 36px); }

/* ── bottom tabs + sheet (hidden on desktop) ── */
.dg-tabs { display: none; }
.dg-sheet { position: fixed; inset: 0; z-index: 90; }
.dg-sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.dg-sheet-panel { position: absolute; left: 0; top: 0; bottom: 0; width: min(320px, 86vw); display: flex; flex-direction: column; padding: 18px 16px calc(18px + var(--safe-b)); background: #0c0b09; border-right: 1px solid var(--line); overflow-y: auto; box-shadow: 20px 0 60px rgba(0,0,0,.5); }
.dg-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dg-sheet-nav { display: flex; flex-direction: column; gap: 2px; }
.dg-sheet-nav a, .dg-os-sheet { display: flex; align-items: center; gap: 14px; min-height: 50px; padding: 0 12px; border-radius: 12px; color: var(--mute); font: 500 15px var(--head); letter-spacing: .12em; text-transform: uppercase; }
.dg-sheet-nav a.active { color: var(--gold-hi); background: rgba(212,175,105,.12); }
.dg-os-sheet { color: var(--gold) !important; border: 1px dashed var(--line); margin-top: 8px; }
#sheet-host-slot { display: contents; }
.dg-sheet .dg-side-note { margin-top: auto; }

/* ════════ responsive ════════ */
@media (max-width: 1439px) { :root { --rail-w: 320px; } .dg-columns { gap: 24px; padding: 8px 24px 40px; } .dg-top { padding: 0 24px; } .dg-foot { margin: 24px 24px 0; } }

/* iPad landscape / small laptop: icon sidebar */
@media (max-width: 1279px) {
  :root { --side-w: 84px; --rail-w: 300px; }
  .dg-side { padding: 18px 10px; align-items: center; }
  .dg-logo { padding: 4px 0 18px; }
  .dg-logo-img { width: 50px; height: 50px; }
  .dg-logo-text, .dg-nav-item span, .dg-side-note, .dg-side-user-copy { display: none; }
  .dg-nav { width: 100%; }
  .dg-nav-item { justify-content: center; padding: 0; min-height: 52px; }
  .dg-nav-item.active::before { left: -10px; }
  .dg-nav-item .ico { width: 22px; height: 22px; }
  .dg-side-host { width: 100%; }
  .dg-side-user { margin-top: auto; padding: 6px; border: 0; background: none; }
  .dg-hero { padding: 36px 32px 34px; min-height: 360px; }
  .dg-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dg-script { right: 24px; bottom: 18px; font-size: 28px; }
  .dg-book-detail { grid-template-columns: 200px minmax(0, 1fr); gap: 24px; }
  .dg-kbd { display: none; }
}

/* iPad portrait + phone: no sidebar, top bar + bottom tabs, rail stacks */
@media (max-width: 1023px) {
  :root { --top-h: 62px; }
  .dg-app { display: block; }
  .dg-side { display: none; }
  .dg-top { padding: 0 12px; gap: 8px; padding-top: env(safe-area-inset-top, 0px); height: calc(var(--top-h) + env(safe-area-inset-top, 0px)); }
  .dg-burger, .dg-top-logo { display: inline-flex; }
  .dg-top-logo span { display: none; }
  .dg-search { max-width: none; }
  .dg-os-pill { display: inline-flex; }
  .dg-notif { right: 12px; }
  .dg-columns { display: block; padding: 4px 20px 24px; }
  .dg-rail { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding-top: 30px; align-items: start; }
  body:not(.on-home) .dg-rail { display: none; }
  .dg-foot { margin: 8px 20px 0; padding-bottom: 24px; }
  .dg-foot-fine { margin: 0; width: 100%; }
  .dg-body { padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 8px); }
  body.has-dock .dg-body { padding-bottom: calc(var(--tabs-h) + var(--dock-h) + var(--safe-b) + 24px); }
  .dg-tabs { position: fixed; z-index: 55; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: rgba(9,9,8,.96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .dg-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 44px; color: var(--dim); font: 500 10.5px var(--head); letter-spacing: .12em; text-transform: uppercase; }
  .dg-tab .ico { width: 22px; height: 22px; }
  .dg-tab.active { color: var(--gold-hi); }
  .dg-dock { left: 10px; right: 10px; bottom: calc(var(--tabs-h) + var(--safe-b) + 8px); }
  .dg-toast { bottom: calc(var(--tabs-h) + var(--safe-b) + 16px); }
  body.has-dock .dg-toast { bottom: calc(var(--tabs-h) + var(--dock-h) + var(--safe-b) + 24px); }
  .dg-hero { margin-top: 12px; }
  .dg-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* phone */
@media (max-width: 639px) {
  :root { --top-h: 58px; --tabs-h: 62px; --dock-h: 64px; }
  body { font-size: 14.5px; }
  .dg-top .dg-search { display: none; }
  .dg-search-toggle { display: inline-grid; margin-left: auto; }
  .dg-top-right { margin-left: 0; gap: 2px; }
  .dg-top-logo span { display: inline; font-size: 13px; letter-spacing: .14em; white-space: nowrap; }
  .dg-top-logo img { width: 36px; height: 36px; }
  .dg-os-pill span { display: none; }
  .dg-os-pill { padding: 0; width: 44px; justify-content: center; }
  .dg-columns { padding: 4px 16px 20px; }
  .dg-hero { min-height: 0; padding: 150px 20px 26px; border-radius: 18px; flex-direction: column; align-items: stretch; }
  .dg-hero-bg { background:
    linear-gradient(0deg, rgba(7,7,7,.97) 0%, rgba(7,7,7,.86) 42%, rgba(7,7,7,.2) 75%, rgba(7,7,7,.05) 100%),
    radial-gradient(120% 70% at 70% 10%, rgba(239,214,148,.28), transparent 70%),
    url("assets/dungeon/hero-summit-sm.jpg") 62% 0% / cover no-repeat; }
  .dg-hero-title { font-size: 52px; }
  .dg-hero-tag { font-size: 12.5px; letter-spacing: .24em; }
  .dg-hero-copytext { font-size: 14.5px; }
  .dg-cta { width: 100%; }
  .dg-script { position: absolute; top: 22px; right: 18px; bottom: auto; font-size: 26px; }
  .dg-section { margin-top: 28px; }
  .dg-row-head .dg-arrow { display: none; }
  .dg-h2 { font-size: 18px; }
  .dg-h2 small { display: block; margin: 2px 0 0; }
  .dg-scroller { gap: 14px; margin: 0 -16px; padding: 2px 16px 8px; scroll-padding-left: 16px; }
  .dg-book.lg { width: 140px; }
  .dg-book { width: 124px; }
  .dg-book.sm { width: 116px; }
  .dg-ep { width: 78vw; max-width: 300px; }
  .dg-skel { width: 78vw; }
  .dg-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dg-cat-copy b { font-size: 15px; }
  .dg-rail { grid-template-columns: minmax(0, 1fr); padding-top: 26px; }
  .dg-book-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 18px 12px; }
  .dg-book-detail { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .dg-bd-cover { width: 170px; }
  .dg-people-grid, .dg-lessons { grid-template-columns: minmax(0, 1fr); }
  .dg-acct-grid { grid-template-columns: minmax(0, 1fr); }
  .dg-row-main { gap: 10px; padding: 8px; }
  .dg-row-art { width: 52px; height: 78px; }
  .dg-row-title { font-size: 16px; }
  .dg-row-punch { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .dg-pd-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .dg-cat-hero { padding: 20px; min-height: 200px; }
  .dg-foot { margin: 8px 16px 0; gap: 8px 16px; }
  .dg-dock-time { display: none; }
  .dg-dock-face { width: 32px; height: 46px; }
  .dg-chat-log { max-height: 55vh; }
  .dg-msg.me p { max-width: 88%; }
  .dg-view-head { padding-top: 16px; }
}
@media (max-width: 1023px) and (min-width: 640px) {
  .dg-acct-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (hover: none) { .dg-ep:hover, .dg-book:hover .dg-book-cover, .dg-cta:hover { transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
body[data-view="opie"] .dg-rail-opie { display: none; }

/* Episodes empty state ("First episode drops soon.") — static, fills the carousel row */
.dg-scroller > .dg-eps-empty { flex: 1 0 100%; max-width: 640px; scroll-snap-align: none; }
.dg-eps-empty { border-color: rgba(212,175,105,.35); background: radial-gradient(120% 140% at 0% 0%, rgba(212,175,105,.12), transparent 60%), linear-gradient(180deg, var(--panel2), var(--panel)); }
.dg-eps-empty h3 { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.01em; color: var(--gold-hi); margin: 0 0 8px; }
.dg-eps-empty .dg-sub { margin: 0; max-width: 46ch; }
.dg-eps-empty .dg-bd-actions { margin-top: 14px; }
