:root{
  --bg:#0b0b0f; --panel:#12121a; --muted:#9aa0aa; --text:#f3f5f7;
  --line:#232334; --accent:#6d5efc; --accent2:#3aa0ff; --ok:#3ddc97; --danger:#ff4d6d;
  --gold:#ffd166;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  position:relative;
  min-height:100vh;
}
/* Parchment: image on body with dark overlay so it always paints; panels slightly transparent so it shows through */
body.parchment-bg{
  background-image:linear-gradient(rgba(11,11,15,0.72),rgba(11,11,15,0.72)),url("assets/parchment_background.png");
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  background-color:#0b0b0f;
}
body:not(.parchment-bg){ background:var(--bg); }
header{padding:16px;border-bottom:1px solid var(--line);background:rgba(0,0,0,.35);position:sticky;top:0;z-index:10}
header .wrap{max-width:1100px;margin:0 auto;display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;align-items:center}
.headerReturnBtn{display:inline-block;padding:8px 14px;border-radius:999px;font-weight:700;font-size:13px;color:var(--text);background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.2);text-decoration:none;white-space:nowrap}
.headerReturnBtn:hover{background:rgba(255,255,255,.14)}
main{max-width:1100px;margin:0 auto;padding:16px;display:grid;grid-template-columns:1.1fr .9fr;gap:14px}
@media(max-width:940px){main{grid-template-columns:1fr}}
.card{background:rgba(18,18,26,0.88);border:1px solid var(--line);border-radius:18px;padding:14px}
h2{margin:0 0 8px;font-size:16px}
.sub{margin:0 0 12px;color:var(--muted);font-size:13px;line-height:1.35}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media(max-width:560px){.grid{grid-template-columns:1fr}}
.field{border:1px solid var(--line);border-radius:14px;padding:10px;background:rgba(0,0,0,.18)}
.label{margin:0 0 8px;color:#ffeb3b;font-size:12px;font-weight:700}
.row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}

button{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.06);
  color:var(--text);
  padding:9px 10px;
  border-radius:999px;
  font-weight:800;
  font-size:13px;
  cursor:pointer
}
button:hover{background:rgba(255,255,255,.10)}
button:disabled{opacity:.55;cursor:not-allowed}
button.selected{border-color:rgba(109,94,252,.55);background:rgba(109,94,252,.18)}
button.secondary.selected{border-color:rgba(58,160,255,.55);background:rgba(58,160,255,.16)}

.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.primary{background:linear-gradient(90deg,rgba(109,94,252,.9),rgba(58,160,255,.8))}
.ok{background:rgba(61,220,151,.12);border-color:rgba(61,220,151,.25)}
.danger{background:rgba(255,77,109,.12);border-color:rgba(255,77,109,.25)}

input[type="text"], select{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.22);
  color:var(--text);
  outline:none
}
#drinkName{border:1px solid #fff}

.twoCol{display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media(max-width:560px){.twoCol{grid-template-columns:1fr}}

.canvasBox{
  border:1px dashed rgba(255,255,255,.16);
  border-radius:18px;
  padding:12px;
  background:rgba(0,0,0,.18);
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:center
}
canvas.share{
  width:100%;
  max-width:360px;
  height:auto;
  border-radius:14px;
  background:
    radial-gradient(420px 220px at 40% 30%, rgba(109,94,252,.10), transparent 60%),
    radial-gradient(420px 220px at 70% 80%, rgba(58,160,255,.08), transparent 60%),
    rgba(255,255,255,.02)
}

.mini{color:var(--muted);font-size:12px}
.highlight,.sub .highlight{font-weight:800;color:var(--gold) !important;}
.toast{
  margin-top:10px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.18);
  color:var(--muted);
  font-size:12px;
  line-height:1.35
}

.gallery{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
@media(max-width:980px){.gallery{grid-template-columns:repeat(2,1fr)}}
@media(max-width:560px){.gallery{grid-template-columns:1fr}}
.galleryPagination{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;margin-top:16px;padding:8px 0}
.galleryPagination button{padding:8px 14px;border-radius:999px;border:1px solid rgba(255,255,255,.15);background:rgba(255,255,255,.06);color:var(--text);font-weight:700;font-size:13px;cursor:pointer}
.galleryPagination button:hover{background:rgba(255,255,255,.12)}
.galleryPagination button.active{border-color:var(--accent);background:rgba(109,94,252,.25)}
.galleryPagination button:disabled{opacity:.5;cursor:not-allowed}
.tile{border:1px solid var(--line);border-radius:16px;background:rgba(0,0,0,.18);overflow:hidden}
.tile img{width:100%;display:block}
.meta{padding:10px;display:flex;flex-direction:column;gap:8px}
.title{font-weight:950;font-size:14px}
.desc{font-size:12px;color:var(--muted);line-height:1.3}
.voteRow{display:flex;justify-content:space-between;align-items:center;gap:8px}
a{color:#b8b3ff;text-decoration:none}
a:hover{text-decoration:underline}
.pill{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.05);
  padding:2px 8px;
  border-radius:999px;
  font-size:11px;
  font-weight:800;
  color:rgba(255,255,255,.75);
}

/* ===== Base Art (cartoony can + glass) ===== */
.baseArt{
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  background:
    radial-gradient(520px 200px at 30% 20%, rgba(109,94,252,.18), transparent 60%),
    radial-gradient(520px 200px at 70% 80%, rgba(58,160,255,.14), transparent 60%),
    rgba(0,0,0,.20);
  padding:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:140px;
}
.baseArt svg{width:100%;max-width:380px;height:auto}
.baseArtLabel{font-weight:950;letter-spacing:.2px;font-size:13px;fill:rgba(255,255,255,.92)}
.baseArtSub{font-weight:800;font-size:11px;fill:rgba(255,255,255,.65)}
.baseArtGlow{filter: drop-shadow(0 18px 28px rgba(0,0,0,.35));}

/* ===== D20 Overlay (3D) ===== */
#d20Overlay{
  position:fixed; inset:0;
  background:rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
  display:flex; align-items:center; justify-content:center;
  z-index:9999;
}
.d20Panel{
  width:min(620px, 92vw);
  border:1px solid rgba(255,255,255,.14);
  border-radius:22px;
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  padding:18px 16px;
  text-align:center;
  position:relative;
}
.d20Title{font-weight:950;letter-spacing:.2px;margin-bottom:10px}
.d20Stage{
  height:300px;
  border-radius:18px;
  background:
    radial-gradient(520px 220px at 50% 10%, rgba(109,94,252,.16), transparent 60%),
    radial-gradient(520px 220px at 50% 110%, rgba(58,160,255,.12), transparent 60%),
    rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.08);
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}
#d20Canvas{width:100%;height:100%;display:block}
.d20ResultLine{font-size:14px;color:rgba(255,255,255,.80);margin-top:10px;min-height:22px}
.d20Hint{font-size:12px;color:rgba(255,255,255,.55);margin-top:6px}
.d20Actions{display:flex;gap:10px;justify-content:center;margin-top:12px;flex-wrap:wrap}
.d20Dismiss{
  padding:9px 14px;border-radius:999px;font-weight:950;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
}
.d20Dismiss:hover{background:rgba(255,255,255,.10)}
.d20Dismiss:disabled{opacity:.5;cursor:not-allowed}
.d20CritGlow .d20Panel{
  border-color: rgba(255, 209, 102, .35);
  box-shadow:
    0 0 0 3px rgba(255, 209, 102, .10),
    0 20px 60px rgba(0,0,0,.45);
}

/* ===== Events page – calendar iframe container ===== */
.events-main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.calendar-card {
  background: rgba(18, 18, 26, 0.88);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.calendar-wrap {
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(109, 94, 252, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.calendar-wrap iframe { display: block; width: 100%; border: none; }

