/* ============ DM Tavern — quality-of-life styles ============ */

kbd { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 4px; border: 1px solid var(--border-2); background: var(--surface-3); font-family: var(--body); font-size: 11px; line-height: 18px; color: var(--muted); text-align: center; }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold-2); cursor: pointer; font-size: 12.5px; }
.link-btn:hover { text-decoration: underline; }

/* search button + palette */
.search-btn { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--muted); font-size: 13px; cursor: pointer; }
.search-btn:hover { border-color: var(--gold); color: var(--ink); }
.search-btn .ic { width: 14px; height: 14px; }
@media (max-width: 980px) { .search-btn kbd, .search-btn span { display: none; } }
#palette { position: fixed; inset: 0; z-index: 130; background: rgba(5,4,4,.6); backdrop-filter: blur(2px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: fadeIn .12s; }
.pal-box { width: 100%; max-width: 620px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.7); overflow: hidden; }
.pal-input { width: 100%; border: 0; border-bottom: 1px solid var(--border); background: transparent; padding: 16px 18px; font-size: 17px; color: var(--ink); outline: none; }
.pal-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.pal-list li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 6px; cursor: pointer; }
.pal-list li.on { background: var(--surface-3); box-shadow: inset 2px 0 0 var(--crimson-2); }
.pal-list li.none { display: block; color: var(--dim); cursor: default; }
.pal-list .pk { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
.pal-list .pl { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-list .ps { font-size: 12.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.pal-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--dim); }
.table.keys td:first-child { white-space: nowrap; }

/* notifications */
.notes-dd { width: 380px; }
.notes-hd { display: flex; justify-content: space-between; align-items: center; }
.note-filters { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px 8px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.note-filters .chip { font-size: 12px; padding: 2px 9px; }

/* undo toast, drafts */
.toast.undo { display: flex; align-items: center; gap: 14px; border-left-color: var(--crimson-2); }
.draft-note { margin: 0 0 14px; padding: 8px 12px; border-radius: 6px; background: rgba(201,164,92,.1); border: 1px solid rgba(201,164,92,.3); font-size: 13px; color: var(--gold-2); }

/* tooltips (conditions etc.) */
[data-tip] { position: relative; }
[data-tip]:not([data-tip=""]):hover::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 260px; z-index: 50;
  padding: 8px 10px; border-radius: 6px; background: #0e0c0d; border: 1px solid var(--border-2); color: var(--ink); font-family: var(--body); font-style: normal; font-size: 12.5px; line-height: 1.4; text-align: left; white-space: normal; box-shadow: 0 10px 24px rgba(0,0,0,.6); pointer-events: none; }
.cond[data-tip] { cursor: help; }

/* time zones, story links */
.tz-note { font-size: 12.5px; color: var(--gold-2); margin-top: 2px; }
.story-link { color: inherit; text-decoration: underline; text-decoration-color: rgba(141,42,30,.5); text-underline-offset: 3px; }
.log-card.secret .story-link { text-decoration-color: rgba(240,166,152,.6); }
.story-link:hover { color: #8d2a1e; }

/* sidebar groups collapse */
.nav-group-label { background: none; border: 0; display: flex; align-items: center; justify-content: space-between; width: 100%; cursor: pointer; text-align: left; }
.nav-group-label .caret { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-right: 4px; opacity: .6; transition: transform .2s; }
.nav-group.shut .caret { transform: rotate(-45deg); }
.nav-group-label:hover { color: var(--muted); }
@media (max-width: 980px) { .nav-group-label { display: none; } }

/* checklist */
.checklist { border-color: rgba(201,164,92,.35); margin-bottom: 18px; }
.cl-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-bottom: 12px; }
.cl-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--crimson), var(--gold)); }
.cl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.cl li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.cl li.ok { color: var(--dim); text-decoration: line-through; }
.cl-box { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border-2); color: var(--ok); font-size: 11px; flex: none; }
.cl li.ok .cl-box { border-color: var(--ok); }

/* campaign style: fonts, scenes */
.camp-page .camp-id h1, .camp-page .section-h { font-family: var(--camp-font, var(--display)); }
.camp-page .btn.primary { background: var(--crimson); border-color: var(--crimson); }
.camp-page .btn.primary:hover { background: var(--crimson-2); border-color: var(--crimson-2); }
.camp-page .chip.on { background: var(--ink); }
.accent-dot { width: 30px; height: 30px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 2px rgba(0,0,0,.3); }
.font-sample { font-size: 16px; color: var(--ink); text-align: center; line-height: 1.2; padding: 4px 2px; min-height: 40px; display: grid; place-items: center; }
[data-scene="dawn"] .scene .sky { background: linear-gradient(180deg, #2a2a4a 0%, #6a4a6a 45%, #e08a5a 85%, #f3c47a 100%) !important; }
[data-scene="dawn"] .scene .ridge.far { fill: #4a3048; } [data-scene="dawn"] .scene .ridge.mid { fill: #2e1e30; } [data-scene="dawn"] .scene .stars { opacity: .15; }
[data-scene="storm"] .scene .sky { background: linear-gradient(180deg, #0a0c10 0%, #1c2228 50%, #2a3038 100%) !important; }
[data-scene="storm"] .scene .moon { display: none; } [data-scene="storm"] .scene .stars { display: none; }
[data-scene="storm"] .scene .fog { opacity: .7; }
[data-scene="forest"] .scene .sky { background: linear-gradient(180deg, #050b08 0%, #0f2418 60%, #1e3a24 100%) !important; }
[data-scene="forest"] .scene .ridge.far { fill: #0e2015; } [data-scene="forest"] .scene .ridge.mid { fill: #08140c; }
[data-scene="underdark"] .scene .sky { background: radial-gradient(ellipse at 50% 100%, rgba(120,60,200,.35), transparent 60%), linear-gradient(180deg, #050307, #120a1c) !important; }
[data-scene="underdark"] .scene .moon, [data-scene="underdark"] .scene .stars { display: none; }
[data-scene="underdark"] .scene .ridge.far { fill: #1a0f26; transform: scaleY(-1); transform-origin: top; top: 0; bottom: auto; }
[data-scene="snow"] .scene .sky { background: linear-gradient(180deg, #1a2230 0%, #3a4a60 60%, #8a9ab0 100%) !important; }
[data-scene="snow"] .scene .ridge.far { fill: #c8d4e0; opacity: .5; } [data-scene="snow"] .scene .ridge.mid { fill: #9aaabb; } [data-scene="snow"] .scene .ridge.near { fill: #e6eef5; }
[data-scene="snow"] .camp-header .scene.hero-scene::after { background: linear-gradient(90deg, rgba(10,9,9,.9), rgba(10,9,9,.55) 55%, rgba(10,9,9,.15)); }

/* weather (Legend) */
.weather { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.page-weather { position: fixed; z-index: 0; opacity: .55; }
.camp-page > *:not(.page-weather):not(.dice-fab) { position: relative; z-index: 1; }
.weather i { position: absolute; top: -10%; left: var(--x); animation: var(--anim, fall) var(--dur) linear var(--delay) infinite; }
.w-snow i { width: calc(4px * var(--s)); height: calc(4px * var(--s)); border-radius: 50%; background: #fff; opacity: .8; --anim: snow; }
@keyframes snow { to { transform: translate(40px, 260px); } }
.page-weather.w-snow i { --anim: snowPage; } @keyframes snowPage { to { transform: translate(60px, 110vh); } }
.w-embers i { top: auto; bottom: -10%; width: calc(4px * var(--s)); height: calc(4px * var(--s)); border-radius: 50%; background: #ffb02e; box-shadow: 0 0 6px 2px rgba(255,106,31,.7); --anim: emberUp; }
@keyframes emberUp { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(-30px, -240px); opacity: 0; } }
.page-weather.w-embers i { --anim: emberUpPage; } @keyframes emberUpPage { 0% { opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(-60px, -110vh); opacity: 0; } }
.w-rain i { width: 1px; height: calc(18px * var(--s)); background: linear-gradient(transparent, rgba(180,200,230,.7)); --anim: rain; }
@keyframes rain { to { transform: translate(-30px, 280px); } }
.page-weather.w-rain i { --anim: rainPage; } @keyframes rainPage { to { transform: translate(-60px, 110vh); } }
.w-rain::after { content: ""; position: absolute; inset: 0; background: rgba(220,232,255,.35); opacity: 0; animation: lightning 9s infinite; }
@keyframes lightning { 0%, 92%, 96%, 100% { opacity: 0; } 93%, 95% { opacity: 1; } }
.w-fireflies i { top: calc(30% + var(--i) * 2%); width: 4px; height: 4px; border-radius: 50%; background: #e8ff8a; box-shadow: 0 0 8px 3px rgba(220,255,120,.6); --anim: firefly; animation-direction: alternate; }
@keyframes firefly { 0% { transform: translate(0, 0); opacity: .2; } 50% { opacity: 1; } 100% { transform: translate(40px, -30px); opacity: .3; } }
.w-leaves i { width: calc(10px * var(--s)); height: calc(6px * var(--s)); border-radius: 0 80% 0 80%; background: #b5651d; opacity: .85; --anim: leaf; }
.w-leaves i:nth-child(3n) { background: #c9a43a; } .w-leaves i:nth-child(4n) { background: #8a2e1a; }
@keyframes leaf { 0% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(40px, 130px) rotate(180deg); } 100% { transform: translate(-10px, 270px) rotate(360deg); } }
.page-weather.w-leaves i { --anim: leafPage; } @keyframes leafPage { to { transform: translate(80px, 110vh) rotate(540deg); } }
.w-aurora i { top: 0; left: -30%; width: 160%; height: 70%; background: linear-gradient(100deg, transparent 25%, rgba(60,255,180,.22) 40%, rgba(120,140,255,.2) 55%, transparent 70%); filter: blur(14px); --anim: aurora; animation-direction: alternate; }
.weather-ic { display: block; width: 44px; height: 30px; border-radius: 6px; background: var(--surface-3); position: relative; overflow: hidden; }
.weather-ic.w-snow { background: radial-gradient(2px 2px at 20% 30%, #fff, transparent), radial-gradient(2px 2px at 60% 60%, #fff, transparent), radial-gradient(2px 2px at 80% 20%, #fff, transparent), #2a3a4a; }
.weather-ic.w-embers { background: radial-gradient(2px 2px at 30% 70%, #ffb02e, transparent), radial-gradient(2px 2px at 70% 40%, #ff6a1f, transparent), #2a1410; }
.weather-ic.w-rain { background: repeating-linear-gradient(105deg, transparent 0 6px, rgba(180,200,230,.5) 6px 7px), #1a2028; }
.weather-ic.w-fireflies { background: radial-gradient(3px 3px at 30% 50%, #e8ff8a, transparent), radial-gradient(3px 3px at 70% 30%, #e8ff8a, transparent), #0f1a10; }
.weather-ic.w-leaves { background: radial-gradient(4px 3px at 30% 40%, #b5651d, transparent), radial-gradient(4px 3px at 65% 70%, #c9a43a, transparent), #1e1a10; }
.weather-ic.w-aurora { background: linear-gradient(100deg, #0a1020 20%, rgba(60,255,180,.5) 45%, rgba(120,140,255,.5) 60%, #0a1020 80%); }
.locked-line { opacity: .5; }

/* session mode */
.session-page .camp-main .section-h { margin-bottom: 12px; }
.session-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.session-grid .panel + .panel { margin-top: 0; }
.sm-combat { grid-column: span 2; }
.sm-ref { grid-column: span 3; }
@media (max-width: 1100px) { .session-grid { grid-template-columns: 1fr 1fr; } .sm-combat { grid-column: span 2; } .sm-ref { grid-column: span 2; } }
@media (max-width: 700px) { .session-grid { grid-template-columns: 1fr; } .sm-combat, .sm-ref { grid-column: auto; } }
.mini-init { list-style: none; margin: 0; padding: 0; }
.mini-init li { display: grid; grid-template-columns: 34px minmax(0, 1fr) 54px 64px auto; gap: 10px; align-items: center; padding: 7px 8px; border-top: 1px solid var(--border); font-size: 14px; }
.mini-init li:first-child { border-top: 0; }
.mini-init li.on { background: rgba(201,164,92,.08); box-shadow: inset 3px 0 0 var(--gold); }
.mini-init li.down { opacity: .45; text-decoration: line-through; }
.mini-init b { text-align: center; }
.mini-init .n { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-init li.monster .n { color: #f0b0a5; }
.mini-init .ac, .mini-init .hp { font-size: 12.5px; color: var(--muted); }
.mini-init .cd { display: flex; gap: 4px; flex-wrap: wrap; }
.hero-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) 46px 60px auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.hero-row:first-of-type { border-top: 0; }
.hero-row .hn { display: flex; flex-direction: column; font-weight: 500; min-width: 0; }
.hero-row .ac { font-size: 12.5px; color: var(--muted); }
.hp-mini { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.hp-mini i { display: block; height: 100%; background: #5f9a6b; } .hp-mini i.mid { background: #cfa253; } .hp-mini i.low { background: #c4502a; }
.roll-log.compact .roll { padding: 6px 0; } .roll-log.compact .roll-total { font-size: 18px; } .roll-log.compact .roll-when { display: none; }
.npc-mini { border-top: 1px solid var(--border); padding: 6px 0; }
.npc-mini:first-of-type { border-top: 0; }
.npc-mini summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.npc-mini p { font-size: 13.5px; color: var(--muted); margin: 6px 0 0 34px; }
.medal.sm { width: 26px; height: 26px; font-size: 10.5px; border-width: 1px; }
.sm-notes textarea { min-height: 180px; }
.cond-ref { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 20px; margin: 0; }
.cond-ref dt { font-weight: 600; font-size: 13.5px; margin-top: 6px; }
.cond-ref dd { margin: 0; font-size: 13px; color: var(--muted); }
.tpl-opts { margin-top: 8px; }
