:root {
  --bg: #0b0910;
  --bg-2: #13101b;
  --card: rgba(24, 20, 34, 0.86);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #ece8f4;
  --muted: #a39cb5;
  --accent: #c9a5ff;
  --accent-ink: #1b0f2e;
  --good: #7ee2a8;
  --bad: #ff8a8a;
  --edlc: #b06cff;
  --cbtcg: #f5e642;
  --cbtcg-cyan: #5ef0ff;
  --dagger: #e8c27a;
  --radius: 14px;
  --ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(176, 108, 255, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(62, 242, 255, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------------- wordmark ---------------- */
.wordmark {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  font-size: 18px;
  background: linear-gradient(100deg, var(--edlc) 0%, #f2ecff 45%, var(--dagger) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wordmark.big { font-size: clamp(34px, 7vw, 46px); font-weight: 900; letter-spacing: 0.16em; text-align: center; line-height: 1.1; }

/* ---------------- buttons and fields ---------------- */
button { cursor: pointer; border: 0; }
.primary {
  background: linear-gradient(180deg, #dcc2ff, var(--accent));
  color: var(--accent-ink);
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(201, 165, 255, 0.25);
}
.primary:disabled { opacity: 0.6; cursor: progress; }
.ghost {
  background: transparent;
  border: 1px solid var(--line-2);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
}
.ghost:hover { border-color: var(--accent); }
.ghost.small { padding: 6px 10px; font-size: 13px; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
input:not([type=checkbox]) {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px; /* 16px stops iOS from zooming into the field */
  font-weight: 500;
  color: var(--text);
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
label.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; font-size: 14px; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.error, .note { margin: 0; font-size: 14px; color: var(--good); }
.error, .note.bad { color: var(--bad); }
.muted { color: var(--muted); margin: 0; }
.badge {
  display: inline-block; vertical-align: middle;
  font: 700 11px/1 var(--ui); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 7px; border-radius: 6px; background: rgba(201, 165, 255, 0.16); color: var(--accent);
}
.lang { display: flex; gap: 4px; justify-content: center; }
.lang button { background: none; padding: 4px 8px; border-radius: 6px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; }
.lang button[aria-pressed="true"] { color: var(--text); background: rgba(255, 255, 255, 0.08); }

/* ---------------- sign-in: three slanted panels behind a card ---------------- */
.login { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; overflow: hidden; }
.triptych { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr 1fr; }
.triptych .panel { position: relative; overflow: hidden; margin: 0 -6vw; }
.triptych .panel img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.05); animation: drift 30s ease-in-out infinite alternate; }
.triptych .edlc { clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%); z-index: 1; }
.triptych .cbtcg { clip-path: polygon(22% 0, 100% 0, 78% 100%, 0 100%); z-index: 2; }
.triptych .daggerheart { clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%); z-index: 1; }
.triptych .cbtcg img { object-position: 45% 30%; }
.triptych::after {
  content: ''; position: absolute; inset: 0; z-index: 3;
  background:
    radial-gradient(ellipse at center, rgba(11, 9, 16, 0.55) 0%, rgba(11, 9, 16, 0.85) 60%, rgba(11, 9, 16, 0.96) 100%);
}
@keyframes drift { from { transform: scale(1.06) translateY(0); } to { transform: scale(1.12) translateY(-2%); } }
@media (prefers-reduced-motion: reduce) { .triptych .panel img { animation: none; } }
.login-card {
  position: relative; z-index: 4;
  width: min(400px, 100%);
  display: grid; gap: 16px;
  padding: 32px 28px 22px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.tagline { margin: -6px 0 4px; text-align: center; font-family: 'Spectral', serif; font-style: italic; color: var(--muted); font-size: 16px; }
.next-hint { margin: 0; text-align: center; font-size: 13px; color: var(--accent); }
.fine { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
@media (max-width: 640px) {
  .triptych { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr 1fr; }
  .triptych .panel { margin: -5vh 0; }
  .triptych .edlc { clip-path: polygon(0 0, 100% 0, 100% 80%, 0 100%); }
  .triptych .cbtcg { clip-path: polygon(0 20%, 100% 0, 100% 80%, 0 100%); }
  .triptych .daggerheart { clip-path: polygon(0 20%, 100% 0, 100% 100%, 0 100%); }
}

/* ---------------- top bar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 20px;
  padding: 12px max(16px, env(safe-area-inset-left)) 12px max(16px, env(safe-area-inset-right));
  background: rgba(11, 9, 16, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { text-decoration: none; padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.topbar nav a:hover { color: var(--text); }
.topbar nav a.active { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.who { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; text-decoration: none; }
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--edlc), #5b3a9a);
  font-weight: 700; font-size: 13px; color: #fff;
}
.avatar.xl { width: 56px; height: 56px; font-size: 22px; }
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 8px 12px; }
  .topbar nav { order: 3; flex-basis: 100%; }
  .who { margin-left: auto; }
  .who .name { display: none; }
}

/* ---------------- tables ---------------- */
.home { max-width: 1240px; margin: 0 auto; padding: 40px 16px 64px; }
.home h1 { margin: 0; font: 600 clamp(26px, 4vw, 36px)/1.2 'Cormorant Garamond', serif; letter-spacing: 0.01em; }
.home .sub { margin: 6px 0 28px; color: var(--muted); }
.tiles { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
.tiles.n2 { grid-template-columns: repeat(2, 1fr); }
.tiles.n1 { grid-template-columns: minmax(0, 520px); }
@media (max-width: 900px) { .tiles, .tiles.n2 { grid-template-columns: 1fr; } }

.tile {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  text-decoration: none;
  isolation: isolate;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  container-type: inline-size; /* titles size to the tile's width (cqi) */
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
@media (max-width: 900px) { .tile { aspect-ratio: 16 / 11; } }
@media (min-width: 901px) { .tiles.n1 .tile, .tiles.n2 .tile { aspect-ratio: 4 / 3; } }
@media (max-width: 560px) { .tile { aspect-ratio: 5 / 6; } }
.tile .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 0.8s ease; }
.tile .shade { position: absolute; inset: 0; z-index: -1; }
.tile:hover, .tile:focus-visible { transform: translateY(-4px); }
.tile:hover .art, .tile:focus-visible .art { transform: scale(1.05); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.tile .words { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 26px 24px; display: grid; gap: 4px; }
.tile .kicker, .tile .title, .tile .blurb, .tile .enter { display: block; }
.tile .blurb { margin-top: 8px; font-size: 14px; line-height: 1.45; color: rgba(255, 255, 255, 0.82); max-width: 36ch; }
.tile .enter {
  margin-top: 14px; justify-self: start;
  font-weight: 700; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.10); border: 1px solid rgba(255, 255, 255, 0.22);
  transition: background 0.3s ease, color 0.3s ease;
}

/* Échos de la Corruption: gothic capitals with a violet glow over the ruined castle */
.tile.edlc .art { object-position: 50% 40%; }
.tile.edlc .shade { background: linear-gradient(180deg, rgba(20, 8, 32, 0.05) 30%, rgba(14, 6, 22, 0.75) 65%, rgba(10, 4, 16, 0.97) 100%); }
.tile.edlc .kicker { font: 500 14px/1 'Cinzel', serif; letter-spacing: 0.45em; text-transform: uppercase; color: #d9c2ff; }
.tile.edlc .title {
  font: 900 clamp(24px, calc((100cqi - 56px) / 8.8), 46px)/1 'Cinzel', serif; letter-spacing: 0.06em; text-transform: uppercase;
  color: #f4ecff;
  text-shadow: 0 0 18px rgba(176, 108, 255, 0.85), 0 0 46px rgba(176, 108, 255, 0.45);
}
.tile.edlc .rule { height: 1px; margin-top: 10px; width: 120px; background: linear-gradient(90deg, var(--edlc), transparent); }
.tile.edlc .blurb { font-family: 'Spectral', serif; font-style: italic; font-size: 15px; }
.tile.edlc:hover { border-color: rgba(176, 108, 255, 0.6); box-shadow: 0 24px 60px rgba(176, 108, 255, 0.25); }
.tile.edlc:hover .enter { background: var(--edlc); color: #fff; border-color: transparent; }

/* Night City Table: the CBTCG page's splash title (Big Shoulders Display, its yellow, the red and cyan split) */
.tile.cbtcg { clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 0 100%); border-radius: 18px 0 18px 18px; }
.tile.cbtcg .art { object-position: 45% 25%; }
.tile.cbtcg .shade {
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(4, 16, 22, 0) 30%, rgba(4, 12, 18, 0.8) 60%, rgba(3, 8, 12, 0.97) 100%);
}
.tile.cbtcg .mark {
  font: 900 clamp(40px, calc((100cqi - 56px) / 4.05), 120px)/0.86 'Big Shoulders Display', 'Rajdhani', sans-serif; /* NIGHT CITY is 3.95em wide */
  text-transform: uppercase; letter-spacing: -0.005em; white-space: nowrap;
  color: var(--cbtcg);
  text-shadow: 0.025em 0.015em 0 rgba(255, 59, 92, 0.55), -0.02em 0.012em 0 rgba(94, 240, 255, 0.4), 0 0 40px rgba(0, 0, 0, 0.55);
}
.tile.cbtcg .mark span { display: block; font-size: 0.3em; line-height: 1; margin-bottom: 0.08em; }
.tile.cbtcg .rule { height: 3px; margin-top: 10px; width: 64px; background: var(--cbtcg); }
.tile.cbtcg .blurb { font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 15.5px; }
.tile.cbtcg .enter { font-family: 'Rajdhani', sans-serif; font-size: 14px; border-radius: 0; clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%); padding-right: 20px; }
.tile.cbtcg:hover { box-shadow: 0 24px 60px rgba(245, 230, 66, 0.16); }
.tile.cbtcg:hover .enter { background: var(--cbtcg); color: #111; border-color: transparent; }

/* Daggerheart: its logo, gold ornament and old-style serif over the travellers on the cliff */
.tile.daggerheart .art { object-position: 38% 50%; }
.tile.daggerheart .shade { background: linear-gradient(180deg, rgba(20, 16, 10, 0) 22%, rgba(24, 18, 12, 0.6) 45%, rgba(20, 15, 10, 0.88) 66%, rgba(16, 12, 8, 0.98) 100%); }
/* the logo is 487x51 px: past about 240 css px wide it softens on 2x screens */
.tile.daggerheart .mark { display: block; width: min(86%, 340px); height: auto; filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.7)); }
.tile.daggerheart .rule {
  height: 10px; margin-top: 8px; width: 150px;
  background:
    radial-gradient(circle at 50% 50%, var(--dagger) 0 3px, transparent 3.5px),
    linear-gradient(90deg, transparent, var(--dagger) 30%, transparent 46%, transparent 54%, var(--dagger) 70%, transparent) center / 100% 1px no-repeat;
}
.tile.daggerheart .blurb { font-family: 'Cormorant Garamond', serif; font-size: 17px; font-weight: 500; }
.tile.daggerheart:hover { border-color: rgba(232, 194, 122, 0.55); box-shadow: 0 24px 60px rgba(232, 194, 122, 0.18); }
.tile.daggerheart:hover .enter { background: var(--dagger); color: #20160a; border-color: transparent; }

/* ---------------- account and members ---------------- */
.page { max-width: 720px; margin: 0 auto; padding: 32px 16px 64px; display: grid; gap: 18px; }
.page.wide { max-width: 1240px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h1 { margin: 0; font-size: 22px; }
.card h2 { margin: 0 0 14px; font-size: 17px; }
.identity { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.identity > div { flex: 1; min-width: 180px; }
.stack { display: grid; gap: 14px; }
.stack .primary, .stack .ghost { justify-self: start; }
.card.stack h2 { margin: 0; }
.row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.row label { flex: 1; min-width: 180px; }
.row.end { justify-content: flex-end; }
dialog.card { color: var(--text); width: min(420px, calc(100% - 32px)); background: var(--bg-2); }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px); }

.members-head { display: flex; gap: 16px; align-items: start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.members-head h2 { margin-bottom: 4px; }
.members-head > div { flex: 1; min-width: 240px; }
.search { max-width: 240px; }
.members { display: grid; }
.mrow {
  display: grid; align-items: center; gap: 14px;
  grid-template-columns: minmax(170px, 1.2fr) repeat(3, minmax(170px, 1fr)) 150px; /* fixed last column: each row is its own grid */
  padding: 12px 4px; border-top: 1px solid var(--line);
}
.mhead { border-top: 0; padding-top: 0; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.site-h { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.site-h small { grid-column: 2; text-transform: none; letter-spacing: 0; font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.edlc { background: var(--edlc); }
.dot.cbtcg { background: var(--cbtcg); }
.dot.daggerheart { background: var(--dagger); }
.mname { display: flex; gap: 10px; align-items: center; }
.mact { justify-self: end; }
.mname small { display: block; color: var(--muted); font-size: 12px; }
.cell { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.seg button { background: transparent; padding: 6px 9px; font-size: 12px; font-weight: 600; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: rgba(201, 165, 255, 0.18); color: var(--text); }
.state { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; }
.state.on { color: var(--good); }
.state.on::before { background: var(--good); }
.state.off { color: var(--muted); }
.state.off::before { background: transparent; border: 1px solid var(--muted); }
@media (max-width: 1000px) {
  .mhead { display: none; }
  .mrow { grid-template-columns: 1fr; gap: 10px; padding: 16px 0; }
  .cell::before { content: attr(data-site-name); flex-basis: 100%; font-size: 12px; font-weight: 700; color: var(--muted); }
  .mact { justify-self: start; }
  .search { max-width: none; }
}

.lead { margin: 0; text-align: center; font-size: 14px; color: var(--text); }
.fine.left { text-align: left; }
.linkish { background: none; color: var(--muted); font-size: 13px; font-weight: 600; justify-self: center; padding: 2px 6px; }
.linkish:hover { color: var(--text); }
.badge.temp { background: rgba(255, 200, 120, 0.14); color: #ffc878; }
.with-btn { display: flex; gap: 8px; align-items: center; }
.with-btn input { flex: 1; min-width: 0; font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
