/* =====================================================================
   ForeverCasuals — "cozy tavern at dusk" theme
   Mobile-first. Dark warm stone, parchment text, a guild-chosen accent.
   ===================================================================== */
:root {
  --bg: #14110f;
  --bg-2: #1b1714;
  --panel: #211c18;
  --panel-2: #2a231e;
  --line: #3b312a;
  --line-soft: #2f2722;
  --text: #f1e8d8;
  --muted: #b5a893;
  --faint: #857a69;
  --accent: #e2b257;            /* overridden per guild */
  --ember: #e0763a;
  --tank: #5ea4ea;
  --heal: #63d08a;
  --dps:  #ea6352;
  --ok: #63d08a;
  --warn: #f0b94b;
  --bad: #ea6352;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px -12px rgba(0,0,0,.7);
  --font-head: "Cinzel", "Georgia", serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bottomnav-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.55 var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 15% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    radial-gradient(900px 600px at 110% 10%, rgba(224,118,58,.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
}
@media (min-width: 900px) { body { padding-bottom: 0; } }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: color-mix(in srgb, var(--accent) 80%, white); }
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; letter-spacing: .01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); }
h2 { font-size: clamp(1.2rem, 3.4vw, 1.55rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 20px; padding-bottom: 40px; min-height: 60vh; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: var(--accent); color: #1a1208; padding: 8px 14px; border-radius: 8px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .88rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------- Top bar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner { display: flex; align-items: center; gap: 14px; max-width: 1180px; margin: 0 auto; padding: 10px 16px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.brand-crest { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 1.08rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--accent); }
.brand-sub { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mainnav { display: none; gap: 2px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.mainnav a { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-weight: 700; font-size: .92rem; white-space: nowrap; }
.mainnav a:hover { color: var(--text); background: var(--panel); }
.mainnav a.active { color: var(--text); background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--accent); }
.usermenu { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.navmore summary { list-style: none; cursor: pointer; color: var(--muted); padding: 8px 10px; border-radius: 8px; font-weight: 700; font-size: .92rem; white-space: nowrap; }
.navmore summary::-webkit-details-marker { display: none; }
.navmore summary:hover { color: var(--text); background: var(--panel); }
.navmore summary.active { color: var(--text); background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--accent); }
.mainnav { align-items: center; }
.brand-name { max-width: 240px; }
@media (min-width: 1140px) {
  .mainnav { display: flex; flex-wrap: nowrap; }
  .usermenu { margin-left: 8px; }
  .menu-btn { display: none !important; }
}
@media (min-width: 760px) { .ctx-platform .mainnav { display: flex; } .ctx-platform .menu-btn { display: none !important; } .ctx-platform .usermenu { margin-left: 8px; } }
@media (min-width: 900px) and (max-width: 1139px) { .ctx-guild .bottomnav { display: grid; } body.ctx-guild { padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); } }

.menu-btn, .icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; font-size: 1.1rem;
}
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.avatar {
  list-style: none; cursor: pointer; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; color: #1b1309;
  background: linear-gradient(145deg, var(--accent), var(--ember));
}
.avatar::-webkit-details-marker { display: none; }
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; z-index: 50;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 6px;
}
.dropdown-menu a, .dropdown-menu button {
  display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; color: var(--text);
  text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--panel-2); }
.dropdown-head { padding: 8px 12px; color: var(--muted); font-size: .85rem; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }

.motd { background: color-mix(in srgb, var(--accent) 16%, var(--bg-2)); border-bottom: 1px solid var(--line-soft); font-size: .92rem; }
.motd .wrap { padding: 8px 16px; }
.motd strong { color: var(--accent); }

/* ---------------------------------------------------------------- Drawer + bottom nav (mobile) */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer[hidden] { display: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); animation: fade .15s ease; }
.drawer-panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(320px, 86vw); overflow-y: auto;
  background: var(--bg-2); border-left: 1px solid var(--line); padding: 12px; animation: slide .18s ease;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 12px; }
.drawer-title { font-family: var(--font-head); font-weight: 800; color: var(--accent); }
.drawer-panel a { display: flex; align-items: center; gap: 12px; padding: 13px 12px; min-height: 48px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 700; }
.drawer-panel a:hover, .drawer-panel a.active { background: var(--panel-2); }
.drawer-panel a.active { box-shadow: inset 3px 0 0 var(--accent); }
.drawer-panel .pill { margin-left: auto; }
.drawer-foot { margin-top: 10px; border-top: 1px solid var(--line-soft); color: var(--muted) !important; }
@keyframes slide { from { transform: translateX(30px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg-2) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.bottomnav a, .bottomnav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font: 700 .72rem var(--font-body); background: none; border: 0; cursor: pointer;
}
.bottomnav .active { color: var(--accent); }
.bottomnav .active .ico { stroke-width: 2.3; }
@media (min-width: 900px) { .bottomnav { display: none; } }

/* ---------------------------------------------------------------- Cards, grids, sections */
.card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, var(--accent) 3%), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  position: relative;
}
.card::before {
  content: ""; position: absolute; inset: 0 18px auto; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 55%, transparent), transparent);
}
.card + .card { margin-top: 16px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-title h2, .card-title h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid > .card + .card { margin-top: 0; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 980px) { .grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 560px) and (max-width: 979px) { .grid-4 { grid-template-columns: 1fr 1fr; } }
.stack > * + * { margin-top: 16px; }
.section { margin-top: 28px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Hero */
.hero {
  position: relative; overflow: hidden; border-radius: 20px; border: 1px solid var(--line);
  padding: clamp(22px, 5vw, 46px);
  background:
    radial-gradient(500px 220px at 85% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%),
    radial-gradient(400px 260px at 0% 100%, rgba(224,118,58,.18), transparent 70%),
    linear-gradient(160deg, #2a221c, #171310);
  box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; right: -40px; bottom: -40px; width: 260px; height: 260px; opacity: .07;
  background: url("../img/logo.svg") center/contain no-repeat; pointer-events: none;
}
.hero h1 { color: var(--text); margin-bottom: .3em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { font-size: clamp(1rem, 2.6vw, 1.15rem); color: var(--muted); max-width: 46em; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .74rem; font-weight: 800; color: var(--accent); margin-bottom: 8px; display: block; }
.welcome-text { white-space: pre-line; }

/* quick tiles */
.tiles { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-top: 16px; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
  display: flex; flex-direction: column; gap: 6px; padding: 16px; min-height: 108px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: transform .12s, border-color .12s;
}
.tile:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--text); }
.tile .ico { width: 28px; height: 28px; color: var(--accent); }
.tile strong { font-family: var(--font-head); font-size: 1rem; }
.tile span { color: var(--muted); font-size: .85rem; }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 11px; border: 1px solid transparent;
  font: 800 .95rem var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 100%, white 8%), color-mix(in srgb, var(--accent) 85%, black));
  color: #1d1408; box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent) 70%, black);
}
.btn:hover { filter: brightness(1.07); color: #1d1408; }
.btn-ghost { background: var(--panel); color: var(--text); border-color: var(--line); box-shadow: none; }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); box-shadow: none; }
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
form.inline { display: inline; }

/* ---------------------------------------------------------------- Forms */
label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .93rem; }
.hint { display: block; color: var(--faint); font-size: .82rem; font-weight: 400; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time],
input[type=url], input[type=search], input[type=color], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  font: 16px var(--font-body); /* 16px stops iOS zoom */
}
input[type=color] { padding: 4px; width: 64px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
::placeholder { color: var(--faint); }
.field { margin-bottom: 16px; }
.field-row { display: grid; gap: 12px; }
@media (min-width: 600px) { .field-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.slug-input { display: flex; align-items: stretch; }
.slug-input input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.slug-input .suffix { display: flex; align-items: center; padding: 0 12px; background: var(--panel-2); border: 1px solid var(--line); border-left: 0; border-radius: 0 10px 10px 0; color: var(--muted); white-space: nowrap; font-size: .9rem; }
.slug-status { min-height: 1.4em; font-size: .88rem; margin-top: 6px; }
.slug-status.ok { color: var(--ok); } .slug-status.bad { color: var(--bad); }
.form-narrow { max-width: 460px; margin: 0 auto; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin: 0 0 16px; }
legend { padding: 0 6px; font-weight: 800; color: var(--accent); }

/* segmented role picker */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 9px 14px; min-height: 44px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--line); cursor: pointer; font-weight: 700;
}
.segmented input:checked + label { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg-2)); }
.segmented input:focus-visible + label { outline: 2px solid var(--accent); }

/* ---------------------------------------------------------------- Flash */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; margin-bottom: 14px; border: 1px solid; font-weight: 600; }
.flash-success { background: color-mix(in srgb, var(--ok) 12%, var(--panel)); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.flash-error { background: color-mix(in srgb, var(--bad) 12%, var(--panel)); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.flash-info { background: color-mix(in srgb, var(--accent) 10%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.flash-x { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 2px 6px; }

/* ---------------------------------------------------------------- Badges, pills, roles, classes */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 800; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill-hot { background: var(--ember); color: #1b1006; border-color: transparent; }
.pill-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.pill-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.pill-bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.pill-accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.type-raid { color: #f29b5c; } .type-dungeon { color: #78b9f2; } .type-social { color: #e7a6d6; } .type-pvp { color: #ef6b6b; } .type-other { color: var(--muted); }

.role { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; flex: none; vertical-align: middle; }
.role svg { width: 15px; height: 15px; fill: currentColor; }
.role-tank { color: var(--tank); background: color-mix(in srgb, var(--tank) 16%, transparent); }
.role-heal { color: var(--heal); background: color-mix(in srgb, var(--heal) 16%, transparent); }
.role-dps  { color: var(--dps);  background: color-mix(in srgb, var(--dps) 16%, transparent); }
.role.lg { width: 34px; height: 34px; } .role.lg svg { width: 19px; height: 19px; }
.cname { font-weight: 800; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }

/* ---------------------------------------------------------------- Tables (become cards on phones) */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--ok); } .neg { color: var(--bad); }
@media (max-width: 719px) {
  .tbl.stackable thead { display: none; }
  .tbl.stackable, .tbl.stackable tbody, .tbl.stackable tr, .tbl.stackable td { display: block; width: 100%; }
  .tbl.stackable tr { background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
  .tbl.stackable td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .tbl.stackable td::before { content: attr(data-label); color: var(--faint); font-size: .8rem; font-weight: 700; text-align: left; }
  .tbl.stackable td.cell-main { font-size: 1.05rem; text-align: left; justify-content: flex-start; }
  .tbl.stackable td.cell-main::before { display: none; }
  .tbl.stackable .num { text-align: right; }
}

/* ---------------------------------------------------------------- Lists (events, groups) */
.list { list-style: none; margin: 0; padding: 0; }
.list > li + li { border-top: 1px solid var(--line-soft); }
.list-item { display: flex; gap: 14px; align-items: center; padding: 12px 0; text-decoration: none; color: var(--text); }
a.list-item:hover .li-title { color: var(--accent); }
.datebox { flex: none; width: 54px; text-align: center; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); padding: 5px 0; line-height: 1.1; }
.datebox .m { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 800; }
.datebox .d { display: block; font-family: var(--font-head); font-size: 1.35rem; font-weight: 800; }
.li-body { flex: 1; min-width: 0; }
.li-title { font-weight: 800; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-meta { font-size: .85rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.li-side { flex: none; display: flex; gap: 6px; align-items: center; }
.empty { text-align: center; color: var(--muted); padding: 22px 10px; }
.empty .big { font-size: 2rem; display: block; margin-bottom: 6px; }

/* role need meter */
.needs { display: inline-flex; gap: 4px; align-items: center; }
.need { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; font-size: .85rem; }
.need.filled { opacity: .35; }

/* ---------------------------------------------------------------- Party planner */
.group-card { display: flex; flex-direction: column; gap: 12px; }
.slots { display: grid; gap: 8px; }
.slot { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); border: 1px dashed var(--line); min-height: 48px; }
.slot.filled { border-style: solid; }
.slot .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .open-label { color: var(--faint); font-style: italic; flex: 1; }
.day-head { font-family: var(--font-head); font-size: 1.05rem; color: var(--accent); margin: 22px 0 10px; display: flex; align-items: center; gap: 10px; }
.day-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; scrollbar-width: none; }
.tabs a, .tabs button { flex: none; padding: 9px 14px; min-height: 42px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-weight: 800; font-size: .9rem; cursor: pointer; font-family: var(--font-body); }
.tabs .active { color: #1d1408; background: var(--accent); border-color: var(--accent); }

/* ---------------------------------------------------------------- Calendar */
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.cal-nav h2 { margin: 0; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line-soft); gap: 1px; }
.cal-dow { background: var(--bg-2); padding: 8px; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); text-align: center; }
.cal-day { background: var(--panel); min-height: 118px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.cal-day.other { background: var(--bg-2); opacity: .55; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-num { font-weight: 800; font-size: .85rem; color: var(--muted); }
.cal-day.today .cal-num { color: var(--accent); }
.cal-item { display: block; font-size: .78rem; line-height: 1.25; padding: 4px 6px; border-radius: 6px; text-decoration: none; color: var(--text); background: var(--bg-2); border-left: 3px solid var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item:hover { color: var(--text); background: var(--panel-2); }
.cal-item.raid { border-color: #f29b5c; } .cal-item.dungeon { border-color: #78b9f2; } .cal-item.social { border-color: #e7a6d6; }
.cal-item.pvp { border-color: #ef6b6b; } .cal-item.group { border-color: var(--heal); } .cal-item.game { font-style: italic; }
.cal-item .t { color: var(--muted); font-weight: 700; margin-right: 3px; }
.cal-dname { display: none; }
@media (max-width: 759px) {
  /* phones: the month grid becomes an agenda list of days that have something on */
  .cal { display: block; background: none; border: 0; }
  .cal-dow { display: none; }
  .cal-day { min-height: 0; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; padding: 10px 12px; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .cal-day.empty-day, .cal-day.other { display: none; }
  .cal-num { width: 100%; font-size: .95rem; }
  .cal-dname { display: inline; }
  .cal-item { width: 100%; font-size: .9rem; padding: 8px 10px; white-space: normal; }
}
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .82rem; color: var(--muted); margin-top: 12px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }

/* ---------------------------------------------------------------- Event page */
.event-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); margin-bottom: 14px; }
.event-meta b { color: var(--text); }
.signup-cols { display: grid; gap: 14px; }
@media (min-width: 720px) { .signup-cols { grid-template-columns: repeat(3, 1fr); } }
.signup-col h3 { display: flex; align-items: center; gap: 8px; }
.who-list { list-style: none; padding: 0; margin: 0; }
.who-list li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.who-list li:last-child { border-bottom: 0; }
.who-list .st { margin-left: auto; }
.attend-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.attend-row .nm { flex: 1 1 160px; min-width: 0; font-weight: 800; }
.attend-row .segmented label { padding: 7px 10px; min-height: 40px; font-size: .85rem; }

/* ---------------------------------------------------------------- GPP */
.gpp-podium { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; }
.podium { text-align: center; padding: 14px 8px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); }
.podium .place { font-family: var(--font-head); font-size: 1.5rem; color: var(--accent); }
.podium .pts { font-size: 1.3rem; font-weight: 800; }
.rules { display: grid; gap: 10px; }
@media (min-width: 640px) { .rules { grid-template-columns: 1fr 1fr; } }
.rule { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line-soft); }
.rule .v { font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; min-width: 64px; text-align: center; }
.bar { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--ember)); border-radius: inherit; }

/* ---------------------------------------------------------------- Roster */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filters input[type=search] { flex: 1 1 200px; }
.filters select { width: auto; flex: 0 1 160px; }
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { flex: 1 1 120px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line-soft); }
.stat b { display: block; font-family: var(--font-head); font-size: 1.5rem; color: var(--accent); }
.stat span { color: var(--muted); font-size: .82rem; }

/* ---------------------------------------------------------------- Mods */
.mod-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .mod-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .mod-grid { grid-template-columns: repeat(3, 1fr); } }
.mod { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line-soft); }
.mod h3 { margin: 0; font-family: var(--font-body); font-weight: 800; }
.mod p { margin: 0; color: var(--muted); font-size: .9rem; flex: 1; }
.mod-foot { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-top: 6px; }
.mod.avoid { border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.feature-mod { display: grid; gap: 16px; align-items: center; }
@media (min-width: 760px) { .feature-mod { grid-template-columns: 1fr auto; } }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 14px 44px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--accent); color: var(--accent); font-weight: 800; }
code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; background: var(--bg-2); border: 1px solid var(--line-soft); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
pre.code, pre.debug { padding: 12px; overflow-x: auto; white-space: pre-wrap; }
.keybox { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px; border-radius: 10px; background: var(--bg-2); border: 1px dashed var(--accent); }
.keybox code { font-size: .95rem; border: 0; background: none; }

/* ---------------------------------------------------------------- Platform home */
.features { display: grid; gap: 14px; margin-top: 24px; }
@media (min-width: 700px) { .features { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { padding: 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.feature .ico { width: 30px; height: 30px; color: var(--accent); margin-bottom: 8px; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; font-size: .94rem; }
.guild-card { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line-soft); text-decoration: none; color: var(--text); }
.guild-card:hover { border-color: var(--accent); color: var(--text); }
.guild-badge { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; color: #1b1309; background: linear-gradient(145deg, var(--gc, var(--accent)), var(--ember)); flex: none; }
.auth-card { max-width: 440px; margin: 10px auto; }

/* ---------------------------------------------------------------- Footer */
.footer { border-top: 1px solid var(--line-soft); margin-top: 30px; padding: 22px 0 30px; color: var(--muted); font-size: .9rem; }
.footer p { margin: 0 0 4px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------------------------------------------------------------- Helping Hands */
.helper-icon { vertical-align: -3px; flex: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.helper-badge { display: inline-flex; align-items: center; gap: 5px; margin: 0 4px; font-size: .78rem; font-weight: 800; color: var(--muted); vertical-align: middle; }
.kudos-card { display: flex; flex-direction: column; gap: 10px; }
.kudos-head { display: flex; gap: 12px; align-items: flex-start; }
.kudos-emoji { font-size: 1.6rem; line-height: 1; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line-soft); flex: none; }
.kudos-head > div { flex: 1; }
.kudos-line { font-size: 1.02rem; line-height: 1.4; }
.kudos-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; color: var(--muted); }
.kudos-facts a { color: var(--muted); }
.kudos-note { margin: 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--bg-2); border-radius: 0 10px 10px 0; font-style: italic; }
.rank-ladder { list-style: none; margin: 0; padding: 0; }
.rank-ladder li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.rank-ladder li:last-child { border-bottom: 0; }
.rank-ladder .st { margin-left: auto; }

/* ---------------------------------------------------------------- Tavern */
.composer textarea { min-height: 84px; border: 0; background: transparent; padding: 4px 0; resize: vertical; font-size: 1.05rem; }
.composer textarea:focus { box-shadow: none; }
.composer-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line-soft); padding-top: 10px; margin-top: 6px; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.media-preview { display: flex; gap: 8px; flex-wrap: wrap; }
.media-preview:empty { display: none; }
.media-preview figure { margin: 0; width: 84px; text-align: center; font-size: .72rem; color: var(--muted); }
.media-preview img, .media-preview .vid { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; background: var(--bg-2); font-size: 1.6rem; }
.media-preview figure.bad img, .media-preview figure.bad .vid { border-color: var(--bad); opacity: .5; }
.rules-box { margin-top: 10px; font-size: .88rem; color: var(--muted); }
.rules-box ul { margin: 6px 0 0; padding-left: 18px; }
.post { display: flex; flex-direction: column; gap: 10px; }
.post-head { display: flex; align-items: flex-start; gap: 10px; }
.post-head > div { flex: 1; min-width: 0; }
.avatar.sm { width: 36px; height: 36px; font-size: .9rem; flex: none; }
.post-menu summary { width: 36px; height: 36px; list-style: none; }
.post-menu summary::-webkit-details-marker { display: none; }
.post-body { white-space: normal; overflow-wrap: anywhere; font-size: 1.02rem; }
.post-media { display: grid; gap: 4px; border-radius: 12px; overflow: hidden; }
.post-media.n2, .post-media.n4 { grid-template-columns: 1fr 1fr; }
.post-media.n3 { grid-template-columns: 1fr 1fr; }
.post-media.n3 > :first-child { grid-column: span 2; }
.post-media img, .post-media video { width: 100%; height: 100%; max-height: 520px; object-fit: cover; display: block; background: #000; }
.post-media.n1 img { object-fit: contain; max-height: 640px; }
.post-media video { object-fit: contain; max-height: 560px; }
.post-media.n2 img, .post-media.n3 img, .post-media.n4 img { aspect-ratio: 1 / 1; }
.reactions { display: flex; gap: 6px; flex-wrap: wrap; }
.react { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 4px 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line-soft); color: var(--text); font: 700 .95rem var(--font-body); cursor: pointer; }
.react span { font-size: .8rem; color: var(--muted); }
.react.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg-2)); }
.comments { border-top: 1px solid var(--line-soft); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.comment { font-size: .93rem; overflow-wrap: anywhere; }
.comment.is-hidden { opacity: .5; }
.comment-form { display: flex; gap: 8px; }
.comment-form input { min-height: 40px; }
.report-box { border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); border-radius: 12px; padding: 14px; background: var(--bg-2); }
.tavern-mini { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--text); }
.tavern-mini:last-child { border-bottom: 0; }
.tavern-mini img, .tavern-mini .ph { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: var(--bg-2); display: grid; place-items: center; font-size: 1.4rem; }
.post-media.n1 { background: var(--bg-2); }
.post-media.n1 img { width: auto; max-width: 100%; height: auto; margin: 0 auto; background: transparent; }

/* ---------------------------------------------------------------- Goals, Buddies, Builder */
.goal-card { text-decoration: none; color: var(--text); display: block; }
.goal-card:hover { border-color: var(--accent); color: var(--text); }
.goal-bar { position: relative; height: 22px; border-radius: 99px; background: var(--bg-2); border: 1px solid var(--line-soft); overflow: hidden; }
.goal-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--accent), var(--ember)); border-radius: inherit; }
.goal-bar span { position: relative; display: block; text-align: center; font-size: .78rem; font-weight: 800; line-height: 20px; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.goal-bar.sm { height: 14px; margin-top: 4px; } .goal-bar.sm span { font-size: .65rem; line-height: 12px; }
.goal-items { list-style: none; padding: 0; margin: 0; }
.goal-items li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.goal-items li:last-child { border-bottom: 0; }
.goal-items li.done .nm { color: var(--muted); text-decoration: line-through; }
.goal-items .nm { flex: 1; font-weight: 700; }
.tick { background: none; border: 0; font-size: 1.3rem; cursor: pointer; min-width: 36px; min-height: 36px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label { margin: 0; padding: 8px 14px; min-height: 40px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); cursor: pointer; font-weight: 700; font-size: .9rem; }
.chips input:checked + label { background: color-mix(in srgb, var(--accent) 20%, var(--bg-2)); border-color: var(--accent); }
.chips.avoid input:checked + label { background: color-mix(in srgb, var(--bad) 18%, var(--bg-2)); border-color: var(--bad); }
.chips input:focus-visible + label { outline: 2px solid var(--accent); }
.playgrid, .heatmap { border-collapse: separate; border-spacing: 3px; font-size: .78rem; }
.playgrid th, .heatmap th { color: var(--faint); font-weight: 700; white-space: nowrap; padding: 2px 6px; text-align: left; }
.pg-cell { display: block; margin: 0; cursor: pointer; }
.pg-cell input { position: absolute; opacity: 0; }
.pg-cell span { display: block; width: 38px; height: 30px; border-radius: 7px; background: var(--bg-2); border: 1px solid var(--line); }
.pg-cell input:checked + span { background: linear-gradient(145deg, var(--accent), var(--ember)); border-color: transparent; }
.pg-cell input:focus-visible + span { outline: 2px solid var(--accent); }
.heatmap td { width: 40px; height: 28px; text-align: center; border-radius: 6px; font-weight: 800; background: color-mix(in srgb, var(--heal) calc(var(--h, 0) * 85%), var(--bg-2)); color: var(--text); }
.buddy-card { display: flex; flex-direction: column; gap: 8px; }
.match-score { font-family: var(--font-head); font-size: 1.3rem; font-weight: 800; color: var(--accent); }
.why { list-style: none; padding: 0; margin: 0; font-size: .88rem; color: var(--muted); }
.why li { padding: 2px 0; }
.cand-list { list-style: none; padding: 0; margin: 0; }
.cand-list li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.cand-list li.busy { opacity: .55; }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-row:empty { display: none; }
@media (max-width: 480px) {
  .playgrid { border-spacing: 2px; }
  .playgrid th { padding: 2px 3px; font-size: .68rem; }
  .pg-cell span { width: 33px; height: 30px; }
  .heatmap td { width: 32px; }
  .heatmap th { font-size: .68rem; padding: 2px 3px; }
}

/* ---- Game ⇄ Website (copy & paste sync) */
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.big-code { font-size: 1.35rem !important; letter-spacing: .12em; font-weight: 800; color: var(--accent); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
textarea.mono, #paste { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }
.checklist { list-style: none; padding: 0; margin: 0 0 12px; }
.checklist li { padding: 6px 0 6px 28px; position: relative; }
.checklist li::before { content: "✓"; position: absolute; left: 4px; color: var(--ok, #63d08a); font-weight: 800; }
.preview-card { border-color: var(--accent); }
.raw-data { margin-top: 10px; }
.raw-data pre { max-height: 360px; overflow: auto; }

/* ---- Adventurers' Board */
.filter-bar .field-row { align-items: end; }
.filter-bar .btn { margin-right: 8px; }
.segmented.wrap { flex-wrap: wrap; }
.board-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); margin-top: 14px; }
.board-post { display: flex; flex-direction: column; gap: 2px; }
.board-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.board-top .faint { margin-left: auto; }
.board-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-top: auto; padding-top: 10px; }
.board-actions details { flex: 1 1 auto; }
.board-actions summary { list-style: none; cursor: pointer; display: inline-flex; }
.board-actions summary::-webkit-details-marker { display: none; }
.board-report { flex: 0 0 auto !important; margin-left: auto; }
.getting-started .steps li.done::before { content: "✓"; background: color-mix(in srgb, var(--accent) 30%, var(--panel-2)); }
.getting-started .steps li.done { opacity: .75; }

/* ---- brand banner */
.site-banner { display: block; width: 100%; height: auto; margin: 0 auto 18px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.45); }

/* ---- homepage: two paths (solo players / guilds) */
.hub-intro { text-align: center; max-width: 780px; margin: 0 auto 22px; }
.hub-intro h1 { margin-bottom: .3em; }
.paths { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.path { display: flex; flex-direction: column; position: relative; }
.path h2 { margin: .2em 0 .2em; }
.path .checklist { margin-top: 6px; }
.path .row-actions { margin-top: auto; }
.path-icon { font-size: 2rem; line-height: 1; }
.path-solo { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.path-form .field-row { grid-template-columns: 1fr auto; }
.board-mini { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; }
.board-mini:hover { border-color: var(--accent); }
.brand-crest { object-fit: contain; }
.paths > .card { margin: 0; }
.version-note { margin: 0 0 16px; padding: 12px 16px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.version-note.other { border-color: var(--line); background: var(--panel-2); }
.version-note a { white-space: nowrap; margin-left: 4px; }
