/* =====================================================================
   DM Tavern — "Dark Fantasy" theme
   Stone, crimson and aged gold. Engraved serif headings, book-like prose,
   restrained motion. Inspired by the mood of tabletop rulebooks.
   ===================================================================== */
:root {
  --bg: #0d0c0c;
  --bg-2: #141213;
  --panel: rgba(27, 25, 26, .92);
  --panel-solid: #1b191a;
  --panel-2: #242123;
  --line: rgba(201, 164, 92, .16);
  --line-strong: rgba(201, 164, 92, .38);
  --ink: #ece4d6;
  --muted: #aaa093;
  --dim: #71695f;
  --gold: #c9a45c;
  --gold-2: #e3c88f;
  --gold-dark: #7a5a2a;
  --crimson: #b3261e;
  --crimson-2: #d9412f;
  --blood: #6e1714;
  --ok: #78b184;
  --no: #d0644f;
  --wait: #cfa253;
  --parch: #ecdfc3;
  --parch-2: #dccaa3;
  --parch-ink: #2c2117;
  --radius: 4px;
  --shadow: 0 14px 34px rgba(0, 0, 0, .55);
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --ui: "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --prose: "Alegreya", Georgia, "Times New Roman", serif;
  --stone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  --paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.04' numOctaves='4'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .32 0 0 0 0 .16 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23p)'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; font-family: var(--body); font-size: 15px; color: var(--ink); line-height: 1.5;
  background:
    radial-gradient(1400px 520px at 50% -180px, rgba(140, 30, 24, .28), transparent 70%),
    radial-gradient(900px 600px at 100% 100%, rgba(201, 164, 92, .05), transparent 70%),
    var(--stone),
    linear-gradient(180deg, #151314, var(--bg) 60%);
  background-attachment: fixed;
  overflow-x: hidden;
}
#embers { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; opacity: .7; }
#app { position: relative; z-index: 1; }
a { color: var(--gold-2); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(179, 38, 30, .5); color: #fff; }
.ic { width: 16px; height: 16px; vertical-align: -3px; flex: none; }
.ic.tiny { width: 14px; height: 14px; }

/* ============ Nav ============ */
.nav {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px;
  padding: 0 24px; height: 60px; background: linear-gradient(180deg, #121011, #0c0b0b);
  border-bottom: 1px solid #000; box-shadow: 0 2px 0 var(--blood), 0 6px 18px rgba(0,0,0,.6);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand .d20 { width: 32px; height: 36px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.7)); }
.brand-name {
  font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: 2px; text-transform: uppercase;
  background: linear-gradient(180deg, #f1e2bd, var(--gold) 60%, #9a7638); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav-links { display: flex; gap: 2px; height: 100%; }
.nav-links a {
  position: relative; display: flex; align-items: center; padding: 0 14px; color: var(--muted); text-decoration: none;
  font-family: var(--ui); font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--ink); background: rgba(255,255,255,.03); }
.nav-links a.on { color: var(--gold-2); }
.nav-links a.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; background: var(--crimson-2); box-shadow: 0 0 12px rgba(217,65,47,.6); }
.nav-spacer { flex: 1; }
.select {
  appearance: none; background: #161415 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23c9a45c'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 7px 30px 7px 11px; font-size: 13px; max-width: 220px; cursor: pointer; font-family: var(--ui);
}
.select:focus, .input:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,164,92,.18); }
.icon-btn {
  position: relative; width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--radius);
  background: #161415; border: 1px solid var(--line-strong); cursor: pointer; color: var(--gold-2); transition: border-color .2s, background .2s;
}
.icon-btn:hover { border-color: var(--gold); background: #1e1b1c; }
.bell { width: 16px; height: 16px; }
.badge-count {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--crimson); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px #0c0b0b;
  font-family: var(--ui);
}
.ring { animation: none; }

/* ============ Avatars ============ */
.av {
  --c: #8a6f5a; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-family: var(--display); font-weight: 700; font-size: 14px; color: #f3e8d2;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 55%, #3a3436), color-mix(in srgb, var(--c) 35%, #0d0c0c));
  border: 1px solid var(--gold-dark); box-shadow: inset 0 0 0 2px rgba(0,0,0,.35); position: relative; text-shadow: 0 1px 2px #000;
}
.av.lg { width: 58px; height: 58px; font-size: 22px; border-width: 2px; }
.av.sm { width: 26px; height: 26px; font-size: 11px; }
.av .crown { position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 2px solid #0d0c0c; font-size: 0; }
.av.yes { box-shadow: 0 0 0 2px var(--ok); }
.av.no { box-shadow: 0 0 0 2px var(--no); opacity: .7; }
.av.wait { box-shadow: 0 0 0 1px var(--dim); opacity: .5; }
.av-stack { display: flex; }
.av-stack .av { margin-left: -7px; }
.av-stack .av:first-child { margin-left: 0; }
.user-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; padding: 2px; border-radius: 99px; }

/* ============ Layout ============ */
.page { max-width: 1180px; margin: 0 auto; padding: 30px 24px 80px; animation: pageIn .5s ease-out; }
@keyframes pageIn { from { opacity: 0; } }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-family: var(--display); font-weight: 700; font-size: 30px; margin: 0; letter-spacing: 1px; color: var(--ink); text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.page-head p { margin: 4px 0 0; color: var(--muted); font-family: var(--prose); font-size: 17px; font-style: italic; }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.panel {
  position: relative; background: linear-gradient(180deg, rgba(36,33,35,.95), var(--panel)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.03);
}
.panel::before { content: ""; position: absolute; inset: 3px; border: 1px solid rgba(201,164,92,.06); border-radius: 2px; pointer-events: none; }
.panel + .panel { margin-top: 20px; }
.panel h2, .section-title {
  font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-2);
  margin: 0 0 16px; padding-bottom: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-bottom: 1px solid transparent; border-image: linear-gradient(90deg, var(--line-strong), transparent) 1;
}
.panel h2 .sub { font-family: var(--prose); font-style: italic; font-size: 14px; color: var(--muted); letter-spacing: 0; text-transform: none; font-weight: 400; }
.section-title.center { justify-content: center; border-image: linear-gradient(90deg, transparent, var(--line-strong), transparent) 1; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
@media (max-width: 920px) { .two-col { grid-template-columns: 1fr; } }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; border: 1px dashed var(--line); border-radius: var(--radius); font-family: var(--prose); font-size: 16px; font-style: italic; }
.empty .big { display: block; margin-bottom: 4px; }
.empty .big::before { content: "\2766"; font-style: normal; font-size: 26px; color: var(--gold); opacity: .7; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 3px;
  border: 1px solid var(--line-strong); background: linear-gradient(180deg, #2a2628, #1c1a1b); color: var(--ink);
  font-family: var(--ui); font-weight: 700; font-size: 13.5px; letter-spacing: .07em; text-transform: uppercase;
  cursor: pointer; text-decoration: none; transition: border-color .2s, background .2s, box-shadow .2s, color .2s; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 2px 6px rgba(0,0,0,.4);
}
.btn:hover { border-color: var(--gold); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary {
  color: #fff; border: 1px solid #e0533f; background: linear-gradient(180deg, #c42f24, #8d1b16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 4px 14px rgba(140,30,24,.45); text-shadow: 0 1px 1px rgba(0,0,0,.5);
}
.btn.primary:hover { background: linear-gradient(180deg, #d8392c, #a0201a); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 4px 22px rgba(196,47,36,.55); }
.btn.ok { border-color: rgba(120,177,132,.45); color: #c7e6cd; }
.btn.ok:hover { background: rgba(120,177,132,.12); border-color: var(--ok); }
.btn.no { border-color: rgba(208,100,79,.45); color: #f1c3b8; }
.btn.no:hover { background: rgba(208,100,79,.12); border-color: var(--no); }
.btn.ghost { background: transparent; border-color: var(--line); box-shadow: none; }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn.is-on { background: rgba(120,177,132,.16); border-color: var(--ok); }
.btn.is-on.no { background: rgba(208,100,79,.16); border-color: var(--no); }
.link-ddb { display: inline-flex; align-items: center; gap: 5px; font-family: var(--ui); font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--gold); text-decoration: none; }
.link-ddb:hover { color: var(--gold-2); text-decoration: underline; }

/* ============ Login / loading ============ */
.login { min-height: 100vh; display: grid; place-items: center; padding: 40px 16px; text-align: center; }
.login > div { width: 100%; max-width: 880px; min-width: 0; }
.login-hero .d20 { width: 96px; height: 108px; filter: drop-shadow(0 10px 30px rgba(140,30,24,.6)); animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 50% { filter: drop-shadow(0 10px 40px rgba(201,164,92,.45)); } }
.login .tag { color: var(--muted); font-family: var(--prose); font-style: italic; font-size: 19px; }
.who-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.who {
  background: linear-gradient(180deg, #242123, #19171a); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px; transition: border-color .25s, box-shadow .25s; animation: rise .5s ease-out backwards;
}
.who:hover { border-color: var(--gold); box-shadow: 0 0 24px rgba(201,164,92,.18); }
.who b { font-family: var(--display); font-size: 16px; letter-spacing: .04em; }
.who .roles { font-family: var(--ui); font-size: 12px; color: var(--muted); min-height: 30px; letter-spacing: .03em; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.demo-note { margin-top: 24px; font-size: 13px; color: var(--dim); font-family: var(--prose); font-style: italic; }

/* ============ Campaign cards ============ */
.camp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 20px; }
.camp-card {
  position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--panel-solid);
  text-decoration: none; color: var(--ink); display: flex; flex-direction: column; transition: border-color .3s, box-shadow .3s, transform .3s;
  animation: rise .5s ease-out backwards; box-shadow: var(--shadow);
}
.camp-card:hover { border-color: var(--line-strong); box-shadow: 0 18px 40px rgba(0,0,0,.6), 0 0 0 1px rgba(201,164,92,.2); transform: translateY(-2px); }
.banner { position: relative; height: 130px; overflow: hidden; }
.camp-card .banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, var(--panel-solid)); z-index: 2; }
.banner .glyph { position: absolute; right: 16px; top: 14px; width: 54px; height: 54px; color: var(--gold-2); opacity: .9; z-index: 3; filter: drop-shadow(0 2px 6px #000); transition: opacity .4s; }
.banner .glyph svg { width: 100%; height: 100%; }
.camp-card:hover .banner .glyph { opacity: 1; }
.g0 { --g: #8f2a1f; } .g1 { --g: #24486e; } .g2 { --g: #4b2f6b; } .g3 { --g: #285238; } .g4 { --g: #7a5a1e; }
.g5 { --g: #4a4f5c; } .g6 { --g: #7a1a1a; } .g7 { --g: #1d5257; } .g8 { --g: #6b4a2a; } .g9 { --g: #3f3070; }
.camp-body { position: relative; z-index: 3; padding: 2px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; margin-top: -18px; }
.camp-body h3 { font-family: var(--display); font-weight: 700; font-size: 20px; margin: 0; letter-spacing: .02em; }
.camp-body .tl { color: var(--muted); font-family: var(--prose); font-style: italic; font-size: 15px; margin: 0; }
.camp-meta { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.next-chip { font-family: var(--ui); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--gold-2); }
.role-chip { font-family: var(--ui); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; padding: 3px 8px; border-radius: 2px; background: rgba(179,38,30,.2); color: #f0b0a5; border: 1px solid rgba(217,65,47,.45); }
.role-chip.admin { background: rgba(201,164,92,.12); color: var(--gold-2); border-color: rgba(201,164,92,.4); }
.role-chip.player { background: rgba(120,177,132,.1); color: #c7e6cd; border-color: rgba(120,177,132,.35); }
.new-card { display: grid; place-items: center; min-height: 260px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); cursor: pointer; transition: all .25s; background: rgba(0,0,0,.15); font-family: var(--display); letter-spacing: .05em; }
.new-card:hover { color: var(--gold-2); border-color: var(--gold); background: rgba(201,164,92,.04); }
.new-card .plus { font-size: 34px; display: block; font-weight: 400; }

/* ============ Campaign hero ============ */
.hero { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-strong); margin-bottom: 18px; box-shadow: var(--shadow); min-height: 230px; display: flex; }
.hero .hero-body { position: relative; z-index: 3; height: auto; padding: 34px 30px 28px; flex: 1; display: flex; align-items: flex-end; overflow: visible; }
.hero-inner { position: relative; display: flex; gap: 22px; align-items: center; flex-wrap: wrap; width: 100%; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 4vw, 40px); margin: 6px 0 4px; letter-spacing: .03em; text-shadow: 0 2px 18px rgba(0,0,0,.9), 0 0 2px #000; }
.hero .tl { color: #ddd2c0; margin: 0; font-family: var(--prose); font-style: italic; font-size: 17px; text-shadow: 0 1px 8px #000; }
.hero-glyph { width: 74px; height: 74px; color: var(--gold-2); filter: drop-shadow(0 4px 14px #000); }
.hero-glyph svg { width: 100%; height: 100%; }
.countdown { margin-left: auto; text-align: right; padding: 12px 16px; background: rgba(10,9,9,.55); border: 1px solid var(--line-strong); border-radius: var(--radius); backdrop-filter: blur(3px); }
.countdown .lbl { font-family: var(--ui); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.countdown .val { font-family: var(--display); font-size: 28px; font-weight: 700; color: var(--gold-2); text-shadow: 0 0 18px rgba(201,164,92,.35); }
.countdown .when { font-size: 13px; color: #d8ccb9; font-family: var(--ui); letter-spacing: .03em; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line-strong); margin-bottom: 22px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; background: linear-gradient(180deg, transparent, rgba(0,0,0,.2)); }
.tabs a { position: relative; padding: 12px 18px; color: var(--muted); text-decoration: none; font-family: var(--ui); font-weight: 700; font-size: 13.5px; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; transition: color .2s; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--gold-2); }
.tabs a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--crimson-2); }
.tabs .count { font-size: 10.5px; background: var(--crimson); color: #fff; border-radius: 99px; padding: 1px 6px; margin-left: 6px; letter-spacing: 0; }

/* ============ Books: leather-bound tomes ============ */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 18px; }
.book { position: relative; display: flex; flex-direction: column; gap: 8px; animation: rise .45s ease-out backwards; }
.book.hidden { display: none; }
.cover {
  --a: #5a1714; --b: #2e0b0a; position: relative; aspect-ratio: 3 / 4; border-radius: 2px 6px 6px 2px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 22px 14px 18px 18px;
  color: var(--gold-2); text-decoration: none; text-align: center;
  background: var(--paper), radial-gradient(circle at 60% 35%, var(--a), var(--b) 80%);
  box-shadow: inset 7px 0 6px -3px rgba(0,0,0,.6), inset 9px 0 0 rgba(255,255,255,.04), inset 0 0 30px rgba(0,0,0,.55), 0 10px 20px rgba(0,0,0,.55);
  transition: transform .4s ease, box-shadow .4s ease;
}
.cover:hover { transform: translateY(-4px); box-shadow: inset 7px 0 6px -3px rgba(0,0,0,.6), inset 0 0 30px rgba(0,0,0,.5), 0 16px 28px rgba(0,0,0,.6), 0 0 22px rgba(201,164,92,.18); }
.cover .frame { position: absolute; inset: 9px 8px 9px 13px; border: 1px solid rgba(201,164,92,.55); box-shadow: inset 0 0 0 3px rgba(0,0,0,.25), inset 0 0 0 4px rgba(201,164,92,.25); pointer-events: none; }
.cover .sym { position: relative; width: 38px; height: 38px; color: var(--gold); filter: drop-shadow(0 1px 1px #000); margin-top: 6px; }
.cover .sym svg { width: 100%; height: 100%; }
.cover .cat { position: relative; font-family: var(--ui); font-size: 9.5px; text-transform: uppercase; letter-spacing: .18em; color: rgba(227,200,143,.7); order: 3; }
.cover .t { position: relative; font-family: var(--display); font-weight: 700; font-size: 13px; line-height: 1.25; color: var(--gold-2); text-shadow: 0 1px 2px #000; order: 2; padding: 0 2px; }
.cover .ext { display: none; }
.c-core { --a: #5c1813; --b: #240807; }
.c-options { --a: #3b2552; --b: #140c1e; }
.c-setting { --a: #1b4545; --b: #091818; }
.c-adventure { --a: #573818; --b: #1e1307; }
.c-monster { --a: #234528; --b: #0b180d; }
.c-custom { --a: #34373f; --b: #121317; }
.book-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.book-remove {
  position: absolute; top: -8px; left: -8px; z-index: 2; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--panel-solid); color: var(--no); cursor: pointer; opacity: 0; transition: opacity .2s;
}
.book:hover .book-remove { opacity: 1; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.chip { padding: 6px 12px; border-radius: 2px; border: 1px solid var(--line); background: transparent; font-family: var(--ui); font-size: 12.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); cursor: pointer; transition: all .2s; }
.chip:hover { color: var(--ink); border-color: var(--line-strong); }
.chip.on { color: #fff; background: var(--blood); border-color: var(--crimson-2); }
.input, textarea, .field select {
  width: 100%; background: #121011; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 10px 12px; font-size: 14.5px;
  transition: border-color .2s, box-shadow .2s; box-shadow: inset 0 2px 4px rgba(0,0,0,.4);
}
textarea { font-family: var(--prose); font-size: 16px; line-height: 1.5; }
.search { position: relative; flex: 1; min-width: 200px; }
.search .input { padding-left: 34px; }
.search::before { content: ""; position: absolute; left: 12px; top: 50%; width: 11px; height: 11px; border: 2px solid var(--gold); border-radius: 50%; transform: translateY(-62%); opacity: .8; }
.search::after { content: ""; position: absolute; left: 22px; top: 55%; width: 6px; height: 2px; background: var(--gold); transform: rotate(45deg); opacity: .8; }

/* ============ Requests ============ */
.req { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0,0,0,.2); animation: rise .4s ease-out backwards; }
.req + .req { margin-top: 10px; }
.req .mini-cover { width: 46px; flex: none; aspect-ratio: 3/4; border-radius: 1px 4px 4px 1px; background: radial-gradient(circle at 60% 35%, var(--a), var(--b)); box-shadow: inset 3px 0 3px -1px rgba(0,0,0,.6), 0 4px 8px rgba(0,0,0,.5); display: grid; place-items: center; color: var(--gold); padding: 9px; }
.req .mini-cover svg { width: 100%; height: 100%; }
.req .body { flex: 1; min-width: 0; }
.req .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.req .top b { font-family: var(--display); font-size: 15px; }
.req .req-who { font-size: 13px; color: var(--muted); margin: 3px 0 6px; }
.req .reason { font-family: var(--prose); font-size: 16px; font-style: italic; color: #d9cdb9; margin: 0 0 8px; }
.status { font-family: var(--ui); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; padding: 3px 9px; border-radius: 2px; white-space: nowrap; }
.status.pending, .status.open { background: rgba(207,162,83,.12); color: var(--wait); border: 1px solid rgba(207,162,83,.35); }
.status.pending::before, .status.open::before { content: "◆"; margin-right: 6px; font-size: 8px; vertical-align: 1px; animation: blink 2.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.status.approved, .status.confirmed { background: rgba(120,177,132,.12); color: var(--ok); border: 1px solid rgba(120,177,132,.35); }
.status.declined, .status.cancelled { background: rgba(208,100,79,.1); color: var(--no); border: 1px solid rgba(208,100,79,.3); }
.status.countered { background: rgba(255,255,255,.04); color: var(--muted); border: 1px solid var(--line); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ Proposals ============ */
.prop { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 16px 20px; background: rgba(0,0,0,.22); animation: rise .45s ease-out backwards; overflow: hidden; }
.prop + .prop { margin-top: 12px; }
.prop.dimmed { opacity: .5; }
.prop::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--wait); }
.prop.confirmed::before { background: var(--ok); }
.prop.cancelled::before, .prop.countered::before { background: var(--dim); }
.prop-top { display: flex; gap: 16px; align-items: flex-start; }
.date-tile { flex: none; width: 62px; text-align: center; border-radius: 2px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--paper), var(--parch); color: var(--parch-ink); box-shadow: 0 4px 10px rgba(0,0,0,.5); }
.date-tile .m { background: linear-gradient(180deg, #a3261d, #6e1714); font-family: var(--ui); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: 3px 0; color: #f6e6d0; }
.date-tile .d { font-family: var(--display); font-size: 25px; font-weight: 700; padding: 2px 0 0; }
.date-tile .w { font-family: var(--ui); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #6b5a44; padding-bottom: 5px; }
.prop-info { flex: 1; min-width: 0; }
.prop-info .time { font-family: var(--display); font-weight: 700; font-size: 17px; }
.prop-info .by { font-size: 13px; color: var(--muted); margin-top: 2px; }
.prop-info .note { font-family: var(--prose); font-size: 16px; color: #d9cdb9; font-style: italic; margin-top: 6px; }
.camp-tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--ui); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-2); text-decoration: none; margin-bottom: 4px; }
.camp-tag .dot { width: 7px; height: 7px; transform: rotate(45deg); border-radius: 1px; filter: saturate(.7); }
.votes { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.progress { flex: 1; min-width: 120px; height: 6px; border-radius: 1px; background: rgba(255,255,255,.06); overflow: hidden; border: 1px solid rgba(0,0,0,.5); }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #8d1b16, var(--gold)); transition: width .8s ease; }
.votes .count { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-family: var(--ui); letter-spacing: .03em; }
.prop-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.prop-actions .sp { flex: 1; }
.admin-badge { font-family: var(--prose); font-style: italic; font-size: 14px; color: var(--gold-2); }

/* ============ Calendar ============ */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.cal-head h2 { margin: 0 !important; flex: 1; border: 0 !important; padding: 0 !important; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .dow { font-family: var(--ui); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--dim); text-align: center; padding-bottom: 4px; }
.day { min-height: 92px; border-radius: 2px; padding: 6px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.03); cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: background .2s, border-color .2s; }
.day:hover { border-color: var(--line-strong); background: rgba(201,164,92,.04); }
.day.out { opacity: .3; }
.day.past { cursor: default; }
.day .n { font-family: var(--display); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.day.today { border-color: var(--gold); box-shadow: inset 0 0 20px rgba(201,164,92,.1); }
.day.today .n { color: var(--gold-2); }
.ev { font-family: var(--ui); font-size: 11px; letter-spacing: .02em; padding: 3px 6px; border-radius: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; text-decoration: none; display: block; filter: saturate(.55) brightness(.72); border-left: 2px solid rgba(255,255,255,.4); }
.ev:hover { filter: saturate(.7) brightness(.9); }
.ev.open { background: transparent !important; border: 1px dashed currentColor; filter: saturate(.6) brightness(1.1); }
@media (max-width: 640px) { .day { min-height: 58px; padding: 4px; } .ev { font-size: 0; height: 6px; padding: 0; } .cal .dow { font-size: 9px; } }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 14px; font-family: var(--ui); letter-spacing: .03em; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 1px; display: inline-block; filter: saturate(.6) brightness(.8); }

/* ============ Upcoming list ============ */
.up { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 2px; text-decoration: none; color: var(--ink); transition: background .2s; border-bottom: 1px solid rgba(255,255,255,.03); }
.up:hover { background: rgba(201,164,92,.05); }
.up .bar { width: 3px; align-self: stretch; filter: saturate(.6) brightness(.8); }
.up .t { font-family: var(--display); font-weight: 600; font-size: 14.5px; }
.up .s { font-size: 12.5px; color: var(--muted); font-family: var(--ui); letter-spacing: .02em; }
.up .in { margin-left: auto; font-family: var(--ui); font-size: 12px; letter-spacing: .04em; color: var(--gold-2); white-space: nowrap; text-transform: uppercase; }

/* ============ Members ============ */
.member { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(0,0,0,.2); }
.member + .member { margin-top: 8px; }
.member .nm { font-family: var(--display); font-weight: 600; }
.member .sp { flex: 1; }

/* ============ Stats row ============ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { position: relative; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, #232022, #19171a); text-decoration: none; color: var(--ink); transition: border-color .2s; box-shadow: var(--shadow); }
.stat:hover { border-color: var(--line-strong); }
.stat .v { font-family: var(--display); font-weight: 700; font-size: 28px; color: var(--gold-2); }
.stat .l { font-family: var(--ui); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ============ Dropdowns ============ */
.dropdown { position: absolute; right: 0; top: calc(100% + 12px); width: 340px; max-width: calc(100vw - 32px); background: #19171a; border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 24px 60px rgba(0,0,0,.75); padding: 6px; z-index: 40; animation: drop .18s ease-out; transform-origin: top right; }
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } }
.dropdown .item { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 2px; font-size: 14px; color: var(--ink); text-decoration: none; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
.dropdown .item:hover { background: rgba(201,164,92,.07); }
.dropdown .item.unread { background: rgba(179,38,30,.1); }
.dropdown .item .ago { font-size: 11.5px; color: var(--dim); margin-top: 2px; font-family: var(--ui); }
.dropdown .hd { font-family: var(--ui); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); padding: 8px 10px 4px; }
.dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.ndot { flex: none; width: 7px; height: 7px; margin-top: 7px; transform: rotate(45deg); background: var(--dim); }
.ndot.on { background: var(--crimson-2); box-shadow: 0 0 8px var(--crimson-2); }
.rel { position: relative; }

/* ============ Modal ============ */
.backdrop { position: fixed; inset: 0; background: rgba(4,3,3,.78); backdrop-filter: blur(3px); z-index: 60; display: grid; place-items: center; padding: 16px; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  position: relative; width: 100%; max-width: 500px; max-height: calc(100vh - 32px); overflow: auto; border-radius: var(--radius); padding: 28px;
  background: var(--stone), linear-gradient(180deg, #221f21, #171517); border: 1px solid var(--line-strong);
  box-shadow: 0 30px 90px rgba(0,0,0,.85), inset 0 0 0 4px rgba(0,0,0,.3), inset 0 0 0 5px rgba(201,164,92,.12); animation: modalIn .25s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px); } }
.modal h2 { font-family: var(--display); font-weight: 700; margin: 0 0 4px; font-size: 22px; letter-spacing: .04em; color: var(--gold-2); }
.modal .sub { color: var(--muted); margin: 0 0 20px; font-family: var(--prose); font-style: italic; font-size: 16px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-family: var(--ui); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.field label .dim { text-transform: none; letter-spacing: 0; font-weight: 400; }
.field .hint { font-size: 12.5px; color: var(--dim); margin-top: 5px; font-style: italic; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.check-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.check-list label { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink); padding: 7px 9px; border-radius: 2px; border: 1px solid var(--line); cursor: pointer; font-weight: 500; margin: 0; text-transform: none; letter-spacing: 0; font-family: var(--body); }
.check-list input { accent-color: var(--crimson); }
input[type="date"], input[type="time"] { color-scheme: dark; }

/* ============ Toasts + magic ============ */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { background: #1b191a; border: 1px solid var(--line-strong); border-left: 3px solid var(--gold); padding: 12px 16px; border-radius: 2px; box-shadow: var(--shadow); font-size: 14px; max-width: 360px; animation: toastIn .35s ease-out; }
.toast.ok { border-left-color: var(--ok); }
.toast.no { border-left-color: var(--crimson-2); }
.toast.out { animation: toastOut .35s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }
.mote { position: fixed; bottom: -10px; z-index: 90; pointer-events: none; border-radius: 50%; background: #f3d79a; box-shadow: 0 0 8px 2px rgba(227,200,143,.8); animation: moteRise ease-out forwards; opacity: 0; }
@keyframes moteRise { 10% { opacity: 1; } 100% { transform: translate(var(--dx), var(--rise)); opacity: 0; } }
.rune-flash { position: fixed; inset: 0; z-index: 89; pointer-events: none; background: radial-gradient(circle at 50% 100%, rgba(201,164,92,.22), transparent 60%); animation: flash 1.8s ease-out forwards; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
.roll { animation: none; }

.footer { text-align: center; color: var(--dim); font-size: 12.5px; padding: 34px 16px 40px; position: relative; z-index: 1; font-family: var(--prose); font-style: italic; }
.footer::before { content: "\2766"; display: block; font-style: normal; color: var(--gold); opacity: .5; font-size: 18px; margin-bottom: 6px; }

/* ============ Sign-in / invites ============ */
.signin { max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.btn.discord { background: #4e5ad8; border-color: #6b76ee; color: #fff; padding: 12px 16px; font-size: 14px; }
.btn.discord:hover { background: #5d69e6; }
.or { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; font-family: var(--prose); font-style: italic; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.email-row, .invite-row { display: flex; gap: 8px; }
.email-row .input, .invite-row .input { flex: 1; min-width: 0; }
.invite-row .input { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.invite-note { display: inline-block; background: rgba(179,38,30,.15); border: 1px solid rgba(217,65,47,.45); color: #f3cfc4; padding: 8px 14px; border-radius: 2px; margin: 0 0 22px; font-family: var(--prose); font-style: italic; font-size: 16px; }
.invite-panel { border-color: var(--line-strong); }
body.busy, body.busy * { cursor: progress !important; }
body.busy [data-act] { pointer-events: none; }

/* soft re-renders (after a click) shouldn't replay entrance animations */
.no-anim .page, .no-anim .book, .no-anim .prop, .no-anim .req, .no-anim .camp-card, .no-anim .member,
.no-anim .stat, .no-anim .day, .no-anim .who { animation: none; }

@media (max-width: 720px) {
  .nav { padding: 0 12px; gap: 10px; height: auto; min-height: 56px; flex-wrap: wrap; }
  .nav-links { height: 48px; }
  .brand-name { font-size: 15px; letter-spacing: 1px; }
  .nav .select { display: none; }
  .page { padding: 20px 14px 60px; }
  .page-head h1 { font-size: 24px; }
  .countdown { margin-left: 0; text-align: left; }
  .field-row, .check-list { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  #embers { display: none; }
}
