/* ============ DM Tavern — Combat, Atlas, Shops, tiers, d20 roll ============ */

.check-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; }
.check-line input { accent-color: var(--crimson); width: 16px; height: 16px; }
.icon-x.light { color: var(--muted); font-family: var(--ui); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.icon-x.light:hover { color: var(--gold-2); background: rgba(201,164,92,.08); }
.secret-chip { display: inline-block; font-family: var(--ui); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 2px 7px; border-radius: 2px; color: #f0a698; border: 1px dashed rgba(217,65,47,.6); background: rgba(110,23,20,.25); }
.live-dot { display: inline-block; width: 8px; height: 8px; margin-left: 7px; border-radius: 50%; background: var(--crimson-2); box-shadow: 0 0 0 0 rgba(217,65,47,.7); animation: livePulse 1.8s infinite; vertical-align: 1px; }
@keyframes livePulse { 70% { box-shadow: 0 0 0 7px rgba(217,65,47,0); } 100% { box-shadow: 0 0 0 0 rgba(217,65,47,0); } }
.plus-chip.legend { color: #e9d7ff; border-color: #9d7bd8; background: rgba(110,70,170,.18); }

/* ---------- Combat ---------- */
.combat-banner { position: relative; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 18px 22px; margin-bottom: 20px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--stone), linear-gradient(90deg, #1d1718, #141112); box-shadow: var(--shadow); overflow: hidden; }
.combat-banner.on { border-color: rgba(217,65,47,.6); background: var(--stone), radial-gradient(ellipse at 0% 50%, rgba(140,30,24,.45), transparent 60%), linear-gradient(90deg, #221515, #141112); }
.combat-banner.on::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 40px rgba(179,38,30,.25); animation: warGlow 3s ease-in-out infinite; }
@keyframes warGlow { 50% { box-shadow: inset 0 0 60px rgba(179,38,30,.4); } }
.cb-round { text-align: center; padding-right: 22px; border-right: 1px solid var(--line-strong); }
.cb-round .lbl, .cb-now .lbl { display: block; font-family: var(--ui); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.cb-round .val { font-family: var(--display); font-weight: 800; font-size: 34px; color: var(--gold-2); line-height: 1; }
.cb-now { flex: 1; min-width: 200px; }
.cb-now .actor { font-family: var(--display); font-weight: 700; font-size: 24px; color: var(--ink); }
.cb-now .actor.dim { font-family: var(--prose); font-style: italic; font-weight: 400; font-size: 16px; color: var(--muted); }
.combat-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .combat-cols { grid-template-columns: 1fr; } }
.cb-btns { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.cb-head, .cb-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 56px 150px auto; gap: 12px; align-items: center; }
.cb-head { padding: 0 12px 8px; font-family: var(--ui); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.cb-row { position: relative; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(0,0,0,.22); animation: rise .4s backwards; transition: border-color .25s, background .25s; }
.cb-row + .cb-row { margin-top: 6px; }
.cb-row.pc { border-left: 3px solid rgba(120,177,132,.6); }
.cb-row.monster { border-left: 3px solid rgba(217,65,47,.6); }
.cb-row.npc { border-left: 3px solid rgba(201,164,92,.6); }
.cb-row.active { border-color: var(--gold); background: linear-gradient(90deg, rgba(201,164,92,.14), rgba(0,0,0,.2)); box-shadow: 0 0 22px rgba(201,164,92,.15); }
.cb-row.down { opacity: .45; filter: grayscale(.8); }
.cb-row.down .cb-name { text-decoration: line-through; text-decoration-color: rgba(217,65,47,.7); }
.cb-init { width: 44px; height: 44px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--gold-2);
  background: radial-gradient(circle at 40% 35%, #2c2124, #120d0e); border: 1px solid var(--gold-dark); }
.cb-row .cb-init { transform: none; border-radius: 50%; }
.cb-name { font-family: var(--display); font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.turn-mark { font-family: var(--ui); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #fff; background: var(--crimson); padding: 2px 7px; border-radius: 2px; box-shadow: 0 0 10px rgba(217,65,47,.6); }
.kind-chip { font-family: var(--ui); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 1px 6px; border-radius: 2px; border: 1px solid var(--line); color: var(--muted); }
.kind-chip.pc { color: #c7e6cd; border-color: rgba(120,177,132,.4); }
.kind-chip.monster { color: #f0b0a5; border-color: rgba(217,65,47,.4); }
.cb-conds { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.cond { font-family: var(--prose); font-style: italic; font-size: 13px; padding: 0 7px; border-radius: 2px; background: rgba(110,70,170,.2); border: 1px solid rgba(157,123,216,.4); color: #ddd0f5; }
.cond-add { font-family: var(--ui); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; background: none; border: 1px dashed var(--line); color: var(--dim); border-radius: 2px; padding: 0 6px; cursor: pointer; }
.cond-add:hover { color: var(--gold-2); border-color: var(--gold); }
.cb-ac { position: relative; width: 44px; height: 48px; display: grid; place-items: center; color: var(--gold); }
.cb-ac .shield { position: absolute; inset: 0; width: 100%; height: 100%; }
.cb-ac span { position: relative; font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--ink); margin-top: -2px; }
.cb-hp .hpbar { height: 8px; border-radius: 1px; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.08); overflow: hidden; }
.cb-hp .hpbar i { display: block; height: 100%; background: linear-gradient(90deg, #3f7a4b, #78b184); transition: width .6s ease; }
.cb-hp .hpbar.mid i { background: linear-gradient(90deg, #8a6420, #cfa253); }
.cb-hp .hpbar.low i { background: linear-gradient(90deg, #6e1714, #d9412f); }
.cb-hp .hpnum { font-family: var(--ui); font-size: 13px; color: var(--muted); margin-top: 3px; }
.cb-hp .hpnum b { font-family: var(--display); font-size: 16px; color: var(--ink); }
.hpword { font-family: var(--prose); font-style: italic; font-size: 16px; color: var(--ok); }
.hpword.wounded { color: var(--wait); } .hpword.bloodied { color: #e08a5a; } .hpword.neardeath, .hpword.down { color: var(--no); }
.cb-ctrl { display: flex; gap: 5px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.hp-amt { width: 62px !important; padding: 6px 8px !important; font-size: 14px !important; text-align: center; }
@media (max-width: 760px) {
  .cb-head { display: none; }
  .cb-row { grid-template-columns: 46px minmax(0, 1fr) 48px; }
  .cb-hp { grid-column: 2 / 4; }
  .cb-ctrl { grid-column: 1 / 4; justify-content: flex-start; }
  .cb-round { border: 0; padding: 0; }
}

/* ---------- Atlas: maps ---------- */
.map-tabs { display: inline-flex; gap: 6px; margin-left: auto; text-transform: none; letter-spacing: 0; }
.map-tabs .chip { font-size: 11.5px; padding: 4px 10px; }
.map-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.map-tools .sp { flex: 1; }
.placing-note { flex-basis: 100%; margin: 2px 0 0; font-family: var(--prose); font-style: italic; color: var(--gold-2); }
.drag-hint { flex-basis: 100%; margin: 0; font-size: 12.5px; font-style: italic; }
.map-wrap { position: relative; border-radius: 2px; overflow: hidden; border: 1px solid var(--line-strong); box-shadow: inset 0 0 0 4px rgba(0,0,0,.4), 0 14px 34px rgba(0,0,0,.6); background: #0b0a0a; }
.map { position: relative; line-height: 0; }
.map img { width: 100%; height: auto; display: block; user-select: none; -webkit-user-drag: none; }
.map::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 80px rgba(0,0,0,.45); }
.map.placing { cursor: crosshair; }
.map.placing::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; outline: 2px dashed var(--gold); outline-offset: -8px; animation: blink 1.6s infinite; }
.pin { position: absolute; z-index: 2; transform: translate(-50%, -100%); background: none; border: 0; padding: 0; cursor: pointer; line-height: 1; }
.map.editable .pin { cursor: grab; }
.pin.dragging { cursor: grabbing; z-index: 5; }
.pin-head {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: radial-gradient(circle at 35% 30%, #c42f24, #6e1714); border: 2px solid #e9d4a0; box-shadow: 0 4px 10px rgba(0,0,0,.7); transition: transform .2s;
}
.pin-head .ic { transform: rotate(45deg); width: 15px; height: 15px; color: #f6ead0; }
.pin.shop .pin-head { background: radial-gradient(circle at 35% 30%, #c9a45c, #7a5a2a); border-color: #fbf1d8; }
.pin.shop .pin-head .ic { color: #2a1a0a; }
.pin.secret .pin-head { background: radial-gradient(circle at 35% 30%, #4a4550, #1a181c); border-style: dashed; }
.pin:hover .pin-head, .pin.open .pin-head { transform: rotate(-45deg) scale(1.18); }
.pin.open .pin-head { box-shadow: 0 0 0 4px rgba(233,212,160,.35), 0 4px 12px rgba(0,0,0,.7); }
.pin .tip {
  position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%) translateY(4px); width: max-content; max-width: 240px;
  padding: 10px 12px; border-radius: 2px; text-align: left; line-height: 1.35; pointer-events: none; opacity: 0; transition: opacity .2s, transform .2s;
  color: var(--parch-ink); background: var(--paper), linear-gradient(180deg, #f4ead2, var(--parch-2)); box-shadow: 0 10px 24px rgba(0,0,0,.6); z-index: 6;
}
.pin .tip::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; transform: translateX(-50%) rotate(45deg); background: var(--parch-2); }
.pin .tip b { display: block; font-family: var(--display); font-size: 14px; color: #3a2414; }
.pin .tip i { display: block; font-family: var(--ui); font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #8d2a1e; margin: 1px 0 3px; }
.pin .tip span { display: block; font-family: var(--prose); font-style: italic; font-size: 14.5px; }
.pin:hover .tip, .pin:focus-visible .tip { opacity: 1; transform: translateX(-50%) translateY(0); }
.pin-detail { display: flex; gap: 16px; align-items: flex-start; margin-top: 14px; padding: 18px; border-radius: 2px; color: var(--parch-ink); animation: rise .3s;
  background: var(--paper), radial-gradient(ellipse at 30% 20%, #f4ead2, var(--parch) 55%, var(--parch-2)); box-shadow: 0 12px 28px rgba(0,0,0,.6), inset 0 0 40px rgba(120,80,30,.25); }
.pd-icon { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #f6ead0; background: radial-gradient(circle at 35% 30%, #a3261d, #4a0f0c); border: 2px solid #b8924f; }
.pd-icon .ic { width: 26px; height: 26px; }
.pd-body { flex: 1; min-width: 0; }
.pd-type { font-family: var(--ui); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #8d2a1e; }
.pd-body h3 { font-family: var(--display); font-size: 22px; margin: 2px 0 4px; color: #3a2414; }
.pd-note { font-family: var(--prose); font-style: italic; font-size: 16px; margin: 0; color: #5a4632; }
.pd-lore { font-family: var(--prose); font-size: 16.5px; line-height: 1.55; }
.pd-lore p { margin: 8px 0 0; }
.pd-shops { font-family: var(--prose); font-size: 15px; margin: 10px 0 0; }
.pd-shops a, .pin-detail a { color: #8d2a1e; }
.pd-actions { display: flex; flex-direction: column; gap: 6px; }
.pin-detail .btn { background: rgba(255,255,255,.35); color: #3a2414; border-color: rgba(122,90,42,.5); box-shadow: none; }
.pin-detail .btn.no { color: #8d2a1e; }
@media (max-width: 640px) { .pin-detail { flex-direction: column; } .pd-actions { flex-direction: row; flex-wrap: wrap; } .pin-head { width: 24px; height: 24px; } }

/* ---------- Atlas: locations ---------- */
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.loc-card { display: flex; gap: 14px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(135deg, rgba(201,164,92,.05), rgba(0,0,0,.25)); animation: rise .45s backwards; transition: border-color .2s; }
.loc-card:hover { border-color: var(--line-strong); }
.loc-card.secret { border-style: dashed; border-color: rgba(217,65,47,.45); background: linear-gradient(135deg, rgba(110,23,20,.18), rgba(0,0,0,.25)); }
.loc-icon { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--gold-2); border: 1px solid var(--gold-dark); background: radial-gradient(circle at 35% 30%, #2a2124, #100c0d); box-shadow: 0 0 0 3px #0d0c0c, 0 0 0 4px rgba(201,164,92,.25); }
.loc-icon .ic { width: 24px; height: 24px; }
.loc-body { flex: 1; min-width: 0; }
.loc-type { font-family: var(--ui); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--crimson-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.loc-body h3 { font-family: var(--display); font-size: 19px; margin: 2px 0 2px; }
.loc-note { font-family: var(--prose); font-style: italic; font-size: 16px; color: var(--gold-2); margin: 0; }
.lore { margin-top: 8px; }
.lore summary { cursor: pointer; font-family: var(--ui); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.lore summary:hover { color: var(--gold-2); }
.lore p { font-family: var(--prose); font-size: 16px; line-height: 1.55; color: #d9cdb9; margin: 8px 0 0; }
.loc-shops { font-family: var(--prose); font-size: 15px; margin: 8px 0 0; color: var(--muted); }
.type-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.type-pick input { display: none; }
.type-pick span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 2px; border: 1px solid var(--line); cursor: pointer; color: var(--muted); transition: all .15s; }
.type-pick span .ic { width: 22px; height: 22px; }
.type-pick em { font-style: normal; font-family: var(--ui); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.type-pick span:hover { border-color: var(--line-strong); color: var(--ink); }
.type-pick input:checked + span { border-color: var(--gold); color: var(--gold-2); background: rgba(201,164,92,.1); }

/* ---------- Shops ---------- */
.shop.secret { border-style: dashed; border-color: rgba(217,65,47,.45); }
.shop-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.shop-sign { flex: none; width: 56px; height: 56px; display: grid; place-items: center; color: #2a1a0a; border-radius: 3px;
  background: var(--paper), radial-gradient(circle at 35% 30%, #e9d4a0, #a07a3c); border: 2px solid #5a3f1c; box-shadow: 0 6px 14px rgba(0,0,0,.5); transform: rotate(-3deg); }
.shop-sign .ic { width: 28px; height: 28px; }
.shop-title { flex: 1; min-width: 220px; }
.shop-title h3 { font-family: var(--display); font-weight: 700; font-size: 22px; margin: 0; color: var(--gold-2); }
.shop-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-family: var(--prose); font-style: italic; font-size: 15.5px; color: var(--muted); }
.shop-meta a { color: var(--gold-2); }
.shop-note { font-family: var(--prose); font-size: 16px; color: #d9cdb9; margin: 6px 0 0; }
.shop-actions { justify-content: flex-end; }
.ledger { width: 100%; margin-top: 16px; border-collapse: collapse; color: var(--parch-ink); border-radius: 2px; overflow: hidden;
  background: var(--paper), linear-gradient(180deg, #efe4c8, var(--parch-2)); box-shadow: 0 8px 20px rgba(0,0,0,.5), inset 0 0 30px rgba(120,80,30,.2); }
.ledger th { font-family: var(--ui); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #8d2a1e; text-align: left; padding: 10px 14px; border-bottom: 2px solid rgba(122,90,42,.45); }
.ledger td { padding: 10px 14px; border-bottom: 1px solid rgba(122,90,42,.22); vertical-align: top; }
.ledger tr:last-child td { border-bottom: 0; }
.it-name { font-family: var(--display); font-weight: 700; font-size: 15px; }
.it-name a { color: #3a2414; text-decoration: none; }
.it-name a:hover { color: #8d2a1e; }
.ddb-mark { display: inline-block; margin-left: 6px; font-family: var(--ui); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #8d2a1e; border: 1px solid rgba(141,42,30,.4); padding: 0 5px; border-radius: 2px; vertical-align: 2px; }
.it-price { font-family: var(--display); font-weight: 700; white-space: nowrap; color: #6b4a14; }
.it-note { font-family: var(--prose); font-style: italic; font-size: 15px; color: #5a4632; }
.it-ctrl { white-space: nowrap; text-align: right; }
.ledger .icon-x.light { color: #7a6650; }
@media (max-width: 640px) { .ledger th:nth-child(3), .ledger td:nth-child(3) { display: none; } }

/* ---------- Tiers ---------- */
.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 20px; }
.tier { position: relative; text-align: center; padding: 26px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, #221f21, #171517); box-shadow: var(--shadow); animation: rise .5s backwards; }
.tier.plus { border-color: rgba(201,164,92,.45); }
.tier.legend { border-color: rgba(157,123,216,.55); background: radial-gradient(ellipse at 50% 0%, rgba(110,70,170,.25), transparent 60%), linear-gradient(180deg, #221f26, #161419); }
.tier.current { box-shadow: 0 0 0 2px var(--gold), var(--shadow); }
.tier-name { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-2); }
.tier.legend .tier-name { color: #e2d3ff; }
.tier-price { font-family: var(--display); font-weight: 700; font-size: 26px; margin: 8px 0 4px; }
.tier p { font-family: var(--prose); font-style: italic; color: var(--muted); font-size: 16px; }
.compare .lg { background: rgba(110,70,170,.1); color: #e2d3ff; font-weight: 600; }

/* ---------- d20 easter egg ---------- */
.brand .d20, .crest-wrap .d20, .login-hero .d20 { cursor: pointer; transition: transform .3s; }
.brand .d20:hover, .crest-wrap .d20:hover { transform: rotate(-8deg) scale(1.08); }
.d20-roll { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; align-content: center; gap: 18px; background: radial-gradient(circle, rgba(0,0,0,.35), rgba(0,0,0,.8)); animation: fadeIn .25s; cursor: pointer; }
.d20-roll.out { animation: fadeOut .4s forwards; }
@keyframes fadeOut { to { opacity: 0; } }
.roll-die { width: 200px; height: 200px; animation: tumble 1.15s cubic-bezier(.25,.8,.3,1) forwards; filter: drop-shadow(0 20px 40px rgba(0,0,0,.8)); }
.die-svg { width: 100%; height: 100%; overflow: visible; }
.die-num { font-family: var(--display); font-weight: 800; font-size: 22px; fill: #f3e2b8; }
@keyframes tumble {
  0% { transform: translateY(-60vh) rotate(-540deg) scale(.4); }
  60% { transform: translateY(20px) rotate(40deg) scale(1.05); }
  78% { transform: translateY(-14px) rotate(-12deg) scale(1); }
  100% { transform: translateY(0) rotate(0) scale(1); }
}
.roll-label { text-align: center; opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .4s; }
.landed .roll-label { opacity: 1; transform: none; }
.roll-label b { display: block; font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-2); text-shadow: 0 2px 16px #000; }
.roll-label span { font-family: var(--prose); font-style: italic; font-size: 18px; color: #d9cdb9; }
.nat20 { background: radial-gradient(circle, rgba(201,164,92,.35), rgba(0,0,0,.85) 70%); }
.nat20 .roll-die { animation: tumble 1.15s cubic-bezier(.25,.8,.3,1) forwards, glory 1.6s 1.15s ease-out; }
.nat20 .die-svg polygon:first-child { stroke: #fff2c8; }
.nat20 .die-num { fill: #fff6d8; }
@keyframes glory { 0% { filter: drop-shadow(0 0 0 rgba(255,230,160,0)); transform: scale(1); } 30% { filter: drop-shadow(0 0 60px rgba(255,230,160,1)); transform: scale(1.18); } 100% { filter: drop-shadow(0 0 24px rgba(255,230,160,.6)); transform: scale(1.05); } }
.nat20::before { content: ""; position: absolute; width: 900px; height: 900px; background: repeating-conic-gradient(from 0deg, rgba(255,230,160,.18) 0 6deg, transparent 6deg 18deg); border-radius: 50%; -webkit-mask: radial-gradient(circle, #000 20%, transparent 65%); mask: radial-gradient(circle, #000 20%, transparent 65%); animation: rays 6s linear infinite, fadeIn .6s; }
@keyframes rays { to { transform: rotate(360deg); } }
.nat20 .roll-label b { color: #fff3cf; text-shadow: 0 0 24px rgba(255,220,140,.9), 0 2px 10px #000; }
.nat1 { background: radial-gradient(circle, rgba(110,23,20,.45), rgba(0,0,0,.92) 70%); }
.nat1 .die-svg polygon:first-child { stroke: #d9412f; }
.nat1 .die-num { fill: #ff8a78; }
.nat1 .roll-die { animation: tumble 1.15s cubic-bezier(.25,.8,.3,1) forwards, shatter .5s 1.15s ease-out; }
@keyframes shatter { 0% { transform: rotate(0); } 20% { transform: rotate(-9deg) translateX(-6px); } 40% { transform: rotate(7deg) translateX(5px); } 60% { transform: rotate(-4deg); } 100% { transform: rotate(-3deg) translateY(6px); } }
.nat1::after { content: ""; position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(115deg, transparent 49.6%, rgba(217,65,47,.55) 50%, transparent 50.4%),
  linear-gradient(60deg, transparent 49.7%, rgba(217,65,47,.4) 50%, transparent 50.3%); animation: fadeIn .2s 1.15s backwards; }
.nat1 .roll-label b { color: #ff7a66; text-shadow: 0 0 20px rgba(217,65,47,.8), 0 2px 10px #000; }
body.quake #app { animation: quake .6s; }
@keyframes quake { 10%, 90% { transform: translate(-2px, 1px); } 20%, 80% { transform: translate(4px, -2px); } 30%, 50%, 70% { transform: translate(-6px, 2px); } 40%, 60% { transform: translate(6px, -1px); } }

.no-anim .cb-row, .no-anim .loc-card, .no-anim .shop, .no-anim .tier { animation: none; }

/* plans page: what each plan adds */
.tier-perks { list-style: none; margin: 14px 0 16px; padding: 0; text-align: left; display: grid; gap: 7px; font-size: 13.5px; color: var(--ink); }
.tier-perks li { position: relative; padding-left: 20px; line-height: 1.35; }
.tier-perks li::before { content: "✔"; position: absolute; left: 0; top: 0; color: var(--ok); font-weight: 700; font-size: 12px; }
.tier-perks li.base { color: var(--muted); font-style: italic; }
.tier-perks li.base::before { content: "◆"; color: var(--gold); font-size: 9px; top: 3px; }
.every-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 22px; font-size: 14px; color: var(--muted); }
.every-list li { position: relative; padding-left: 20px; }
.every-list li::before { content: "✔"; position: absolute; left: 0; color: var(--ok); font-weight: 700; font-size: 12px; }
.compare-wrap h2 { margin-bottom: 6px; }
.compare tr.sec td { text-align: left; padding: 16px 12px 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-2); border-bottom: 1px solid var(--line); background: none; }
.compare .inc-list { display: inline-block; font-size: 12.5px; line-height: 1.45; font-weight: 500; }
.compare .inc-list b { color: var(--gold-2); }
.tier-grid .tier { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; margin: 0; gap: 0; }
.tier-grid .tier > p { margin: 6px 0 0; }
.tier-grid .tier > .btn, .tier-grid .tier > .have-plus { margin-top: auto; align-self: center; }
.tier-grid .tier > p { min-height: 2.6em; }

/* ---------- owner dashboard ---------- */
.own-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.own-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.own-tile.live { border-color: rgba(90, 200, 120, .35); }
.own-l { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.own-tile b { font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.own-s { font-size: 12.5px; color: var(--dim); }
.own-dot { width: 8px; height: 8px; border-radius: 50%; background: #5ac878; box-shadow: 0 0 0 0 rgba(90,200,120,.6); animation: ownPulse 2s infinite; }
@keyframes ownPulse { 70% { box-shadow: 0 0 0 7px rgba(90,200,120,0); } 100% { box-shadow: 0 0 0 0 rgba(90,200,120,0); } }
.own-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.own-cols .panel + .panel { margin-top: 0; }
@media (max-width: 760px) { .own-cols { grid-template-columns: 1fr; } }
.own-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow: auto; }
.own-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.own-list li:last-child { border-bottom: 0; }
.owner-page > .panel { margin-top: 16px; }
.own-chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 18px; }
.own-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.own-bar i { position: relative; width: 100%; max-width: 34px; background: var(--gold, #d4a24c); border-radius: 4px 4px 0 0; min-height: 3px; opacity: .85; }
.own-bar:hover i { opacity: 1; }
.own-bar em { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-size: 10.5px; font-style: normal; color: #5ac878; white-space: nowrap; }
.own-bar span { font-size: 11px; color: var(--dim); }

/* ---------- campaign week planner ---------- */
.planner { padding-bottom: 14px; }
.pl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pl-title h2 { margin: 0; }
.pl-nav { display: flex; gap: 6px; }
.pl-nav .btn.sm.ghost { min-width: 36px; font-size: 18px; line-height: 1; }
.pl-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 12px; font-size: 12.5px; color: var(--muted, #bbb); align-items: center; }
.pl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pl-legend .lg { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.lg.locked { background: #3fa862; }
.lg.vote { border: 2px dashed #e0a43a; background: rgba(224,164,58,.18); }
.lg.played { background: #4a4a52; }
.lg.off { background: repeating-linear-gradient(135deg, #555 0 3px, transparent 3px 6px); border: 1px solid #555; }
.pl-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.pl-grid { display: grid; grid-template-columns: 62px repeat(7, minmax(84px, 1fr)); min-width: 660px; }
.pl-corner { border-bottom: 1px solid var(--border); position: sticky; top: 0; }
.pl-day { text-align: center; padding: 8px 4px 7px; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); display: flex; flex-direction: column; line-height: 1.15; font-size: 12px; color: var(--muted, #bbb); }
.pl-day b { font-size: 20px; color: var(--text, #eee); font-variant-numeric: tabular-nums; }
.pl-day.today { background: rgba(212,162,76,.1); }
.pl-day.today b { color: var(--gold, #d4a24c); }
.pl-hours { display: grid; grid-template-rows: repeat(var(--rows), var(--rh)); }
.pl-hours span { font-size: 11px; color: var(--dim); text-align: right; padding: 3px 8px 0 0; border-top: 1px solid rgba(255,255,255,.05); }
.pl-col { border-left: 1px solid var(--border); position: relative; }
.pl-col.today { background: rgba(212,162,76,.05); }
.pl-col.past { background: rgba(0,0,0,.18); }
.pl-cells { position: relative; display: grid; grid-template-rows: repeat(var(--rows, 14), var(--rh)); }
.pl-cell { display: block; border: 0; border-top: 1px solid rgba(255,255,255,.05); background: none; padding: 0; margin: 0; min-height: var(--rh); }
button.pl-cell { cursor: pointer; }
button.pl-cell:hover { background: rgba(212,162,76,.12); }
button.pl-cell:focus-visible { outline: 2px solid var(--gold, #d4a24c); outline-offset: -2px; }
.pl-ev { position: absolute; z-index: 1; border-radius: 6px; padding: 4px 6px; text-align: left; overflow: hidden; display: flex; flex-direction: column; gap: 1px; font: inherit; font-size: 11.5px; line-height: 1.25; cursor: pointer; border: 0; color: #fff; transition: transform .12s, box-shadow .12s; }
.pl-ev:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.4); z-index: 2; }
.pl-ev b { font-size: 12px; }
.pl-ev span { opacity: .9; }
.pl-ev em { opacity: .8; font-style: normal; font-size: 11px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pl-ev.locked { background: linear-gradient(180deg, #46b46b, #2f8a50); box-shadow: inset 3px 0 0 var(--cc, #fff); }
.pl-ev.vote { background: rgba(224,164,58,.2); border: 2px dashed #e0a43a; color: #ffe2a8; }
.pl-ev.played { background: #3c3c44; color: #c8c8d0; }
.pl-ev.off { background: repeating-linear-gradient(135deg, rgba(120,120,120,.25) 0 5px, transparent 5px 10px); border: 1px solid #555; color: #999; text-decoration: line-through; }
.pl-you { position: absolute; top: 3px; right: 4px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.pl-you.yes { background: #3fa862; color: #fff; }
.pl-you.no { background: #b8322f; color: #fff; }
.pl-you.ask { background: #e0a43a; color: #2a1a00; animation: plAsk 1.8s ease-in-out infinite; }
@keyframes plAsk { 50% { transform: scale(1.18); } }
.pl-now { position: absolute; left: 0; right: 0; height: 2px; background: #ff5a4a; z-index: 3; pointer-events: none; }
.pl-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #ff5a4a; }
.prop.pl-flash { animation: plFlash 1.4s ease-out; }
@keyframes plFlash { 0%, 30% { box-shadow: 0 0 0 3px var(--gold, #d4a24c); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .pl-you.ask, .prop.pl-flash { animation: none; } }
.pl-ev:has(.pl-you) { padding-right: 20px; }
.pl-cells { touch-action: pan-x; user-select: none; -webkit-user-select: none; }
.pl-cell.sel { background: rgba(212,162,76,.42) !important; box-shadow: inset 2px 0 0 var(--gold, #d4a24c), inset -2px 0 0 var(--gold, #d4a24c); }
.pl-sel-tip { position: absolute; left: 50%; transform: translateX(-50%); z-index: 4; background: #1b1610; border: 1px solid var(--gold, #d4a24c); color: #ffe2a8; font-size: 11px; padding: 2px 7px; border-radius: 999px; white-space: nowrap; pointer-events: none; }

/* ---------- friends and messages ---------- */
.friends-btn { position: relative; display: inline-grid; place-items: center; }
.badge-count.static { position: static; margin-left: auto; }
.fr-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.fr-layout .panel + .panel { margin-top: 0; }
.fr-side h2 { font-size: 15px; margin: 4px 0 10px; }
.fr-side h2:not(:first-child) { margin-top: 18px; }
.fr-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; color: inherit; text-decoration: none; }
.fr-row:hover { background: rgba(255,255,255,.04); }
.fr-row.on { background: rgba(212,162,76,.12); }
.fr-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.fr-txt .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-req { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.fr-req .sp, .fr-thread-head .sp { flex: 1; }
.fr-thread { display: flex; flex-direction: column; min-height: 460px; padding: 0; overflow: hidden; }
.fr-empty { margin: auto; text-align: center; padding: 30px; max-width: 360px; }
.fr-back { display: none; padding: 10px 16px 0; font-size: 14px; }
.fr-thread-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dm-list { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; max-height: 60vh; min-height: 300px; }
.fr-hello { margin: auto; }
.dm { max-width: 75%; display: flex; flex-direction: column; }
.dm p { margin: 0; padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; line-height: 1.4; }
.dm span { font-size: 10.5px; color: var(--dim); margin: 2px 6px 0; }
.dm.me { align-self: flex-end; align-items: flex-end; }
.dm.me p { background: #8a2a1e; color: #fff; border-bottom-right-radius: 4px; }
.dm.them { align-self: flex-start; }
.dm.them p { background: rgba(255,255,255,.07); border-bottom-left-radius: 4px; }
.dm-day { align-self: center; font-size: 11px; color: var(--dim); margin: 10px 0 4px; }
.dm-form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); align-items: flex-end; }
.dm-form textarea { flex: 1; resize: none; min-height: 40px; max-height: 140px; background: var(--surface-2, rgba(255,255,255,.04)); color: inherit; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font: inherit; }
@media (max-width: 760px) {
  .fr-layout { grid-template-columns: 1fr; }
  .fr-layout.has-open .fr-side { display: none; }
  .fr-layout:not(.has-open) .fr-thread { display: none; }
  .fr-back { display: block; }
}
