:root {
  --bg: #0a080c;
  --card: #1f1f1f;
  --card2: #17151c;
  --text: #ffffff;
  --muted: #9a9a9a;
  --gold: #fbb74a;
  --danger: #ff5a5a;
  --line: rgba(255, 255, 255, 0.1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tab-h: 58px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

#app {
  min-height: 100vh;
  padding-bottom: calc(16px + var(--safe-bottom));
}
.boot { padding: 48px 20px; color: var(--muted); text-align: center; }

.shell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  position: sticky;
  top: 0;
  background: linear-gradient(var(--bg), rgba(10, 8, 12, 0.94));
  backdrop-filter: blur(8px);
  z-index: 25;
  border-bottom: 1px solid transparent;
}
.shell-top .brand {
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.04em;
  font-size: 15px;
}
.shell-top .brand span { color: var(--gold); }

.hamburger {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card2);
  color: #fff;
  display: inline-grid;
  place-items: center;
  gap: 4px;
  padding: 0;
}
.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
}
.drawer.hidden { display: none; }
.drawer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}
.drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 88vw);
  background: #121016;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 16px;
  z-index: 1;
  box-shadow: 12px 0 40px rgba(0,0,0,0.45);
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.drawer-nav {
  display: grid;
  gap: 4px;
  flex: 1;
}
.drawer-nav a {
  color: #ddd;
  padding: 14px 12px;
  border-radius: 12px;
  font-weight: 650;
}
.drawer-nav a.active,
.drawer-nav a:hover {
  background: rgba(251, 183, 74, 0.12);
  color: var(--gold);
}
.drawer-foot {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.drawer-foot .btn {
  margin-bottom: 4px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px 10px;
  position: sticky;
  top: 62px;
  background: var(--bg);
  z-index: 20;
}
.topbar h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}
.topbar .brand { font-weight: 800; color: #fff; letter-spacing: 0.04em; }
.topbar .brand span { color: var(--gold); }
.icon-btn, .text-btn {
  background: none;
  border: 0;
  color: var(--gold);
  font-weight: 600;
  padding: 8px 4px;
}
.text-btn.danger { color: var(--danger); }
.claim-link {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-align: left;
}
.claim-link.muted {
  color: var(--muted);
  text-decoration: none;
}
.action-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  z-index: 2000;
}
.action-menu {
  width: min(420px, 100%);
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.action-menu-title {
  padding: 14px 16px 8px;
  color: var(--muted);
  font-size: 13px;
}
.action-menu-item {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--gold);
  font-size: 16px;
  font-weight: 600;
  text-align: left;
}
.action-menu-item.danger { color: var(--danger); }
.action-menu-item.muted { color: var(--muted); }

.screen { padding: 0 16px 24px; max-width: 720px; margin: 0 auto; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

.card, .list-item {
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.list-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  transition: background 0.15s;
}
.list-item:hover { background: #221f28; }
.list-item .title {
  font-weight: 650;
  font-size: 16px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.list-item .desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.list-item .meta {
  margin-top: 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
}
.avatar, .thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: #2a2a2a;
  flex: 0 0 auto;
}
.thumb.sm { width: 36px; height: 36px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(251, 183, 74, 0.15);
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
}
.badge.count {
  background: #e53935;
  color: #fff;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  background: var(--gold);
  color: #111;
}
.btn.secondary {
  background: var(--card);
  color: #fff;
  border: 1px solid var(--line);
}
.btn.danger { background: var(--danger); color: #fff; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: default; }

.field {
  display: grid;
  gap: 6px;
}
.field label {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.field input, .field select, .field textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: #fff;
  padding: 12px 14px;
}
.field textarea { min-height: 96px; resize: vertical; }
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--card);
  padding: 4px;
  border-radius: 12px;
}
.seg button {
  border: 0;
  border-radius: 10px;
  padding: 10px;
  background: transparent;
  color: #fff;
  font-weight: 600;
}
.seg button.active {
  background: var(--gold);
  color: #111;
}

.tabbar { display: none !important; }

.social-row {
  display: grid;
  gap: 10px;
}
.btn.google {
  background: #fff;
  color: #222;
}
.btn.apple {
  background: #111;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
}
#google-btn-host {
  min-height: 44px;
  display: flex;
  justify-content: center;
}
#apple-btn-host {
  min-height: 44px;
}

@media (min-width: 900px) {
  #app { padding-bottom: 24px; }
  .drawer-panel { width: 320px; }
}

.empty, .error, .info-banner {
  padding: 16px;
  border-radius: 12px;
  background: var(--card2);
  border: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}
.info-banner { text-align: left; color: #ddd; }
.error { color: #ffb4b4; border-color: rgba(255,90,90,0.35); }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse at top, rgba(251, 183, 74, 0.12), transparent 55%),
    var(--bg);
}
.login-card {
  width: min(420px, 100%);
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 22px;
  display: grid;
  gap: 14px;
}
.login-card h1 {
  margin: 0;
  text-align: center;
  font-size: 28px;
}
.login-card .sub {
  text-align: center;
  color: var(--muted);
  margin: 0 0 8px;
}

.section-title {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.roles {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.roles label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
}
.chip.active { background: var(--gold); color: #111; border-color: var(--gold); }

.prog-grid {
  display: grid;
  gap: 8px;
}
.prog-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: var(--card2);
  border-radius: 10px;
  border: 1px solid var(--line);
}
.marks { display: flex; gap: 4px; }
.mark {
  min-width: 22px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 4px;
  background: #333;
  color: #777;
}
.mark.on { background: rgba(251,183,74,0.25); color: var(--gold); }

.ext-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.ext-link {
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ext-link:hover { color: #ffd08a; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: grid;
  place-items: end center;
  z-index: 50;
  padding: 16px;
}
.modal {
  width: min(520px, 100%);
  background: #16141a;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  max-height: 85vh;
  overflow: auto;
}
.modal h2 { margin: 0 0 12px; font-size: 18px; }

.page-doc { padding-bottom: 40px; }
.doc {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px 20px 40px;
  line-height: 1.55;
  color: #ddd;
}
.doc h1, .doc h2 { color: #fff; }
.doc a { color: var(--gold); }


/* ---- Group roster: mirrors the iOS leaderboard row ---- */
.roster { display: grid; }
.roster-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s;
}
.roster-item:hover { background: rgba(255, 255, 255, 0.03); }
.roster-figure { position: relative; flex: 0 0 auto; }
.roster-avatar {
  width: 58px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
  background: #2a2a2a;
  display: block;
}
.roster-rank {
  position: absolute;
  top: -4px;
  left: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 3px;
  border-radius: 4px;
  background: #fff;
  color: #111;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.roster-main { min-width: 0; }
.roster-name {
  font-weight: 800;
  font-size: 17px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roster-sub { font-size: 13px; color: #e6e6e6; margin-top: 1px; }
.roster-ilvl {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 1px;
}
/* Stand-in for the iOS sword glyph, drawn so no icon font is needed. */
.ilvl-mark {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  background: var(--muted);
  clip-path: polygon(100% 0, 100% 28%, 42% 86%, 30% 100%, 12% 82%, 26% 70%, 84% 12%, 72% 0);
}
.roster-rating { font-size: 12px; font-weight: 600; color: var(--gold); margin-top: 1px; }
.roster-updated { font-size: 11px; color: var(--muted); margin-top: 3px; }
.roster-del { flex: 0 0 auto; color: var(--danger); font-size: 15px; line-height: 1; }

/* ---- Mythic+ / raid progression squares ---- */
.prog { display: flex; gap: 8px; flex: 0 0 auto; }
.prog-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  gap: 2px;
}
.pcell {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid transparent;
}
.pcell.dun { background: rgba(46, 158, 107, 0.1); color: #fff; }
.pcell.dun.on { background: rgba(46, 158, 107, 0.16); border-color: #2e9e6b; }
.pcell.raid.off { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.16); }
.pcell.p-m { color: #e8b04b; border-color: #e8b04b; background: rgba(232, 176, 75, 0.12); }
.pcell.p-h { color: #9a86e0; border-color: #9a86e0; background: rgba(154, 134, 224, 0.12); }
.pcell.p-n { color: #37c2d4; border-color: #37c2d4; background: rgba(55, 194, 212, 0.12); }
.pcell.p-l { color: #c0c0c0; border-color: #8a8a8a; background: rgba(255, 255, 255, 0.06); }

.prog-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin: 14px 0 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-item .pcell { font-style: normal; }

@media (max-width: 420px) {
  .roster-avatar { width: 48px; height: 48px; }
  .roster-name { font-size: 15px; }
  .pcell { width: 15px; height: 15px; font-size: 9px; }
  .prog { gap: 6px; }
}

/* ---- Schedule / Party Detail styling ---- */
.schedule-checkin {
  margin: 18px 0 8px;
  padding: 14px 0 4px;
  border-top: 1px solid var(--line);
}
.inv-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
}
.inv-kicker {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 6px;
}
.inv-card h2 {
  font-size: 26px;
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}
.inv-copy {
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.45;
  font-size: 14px;
}
.inv-copy strong { color: var(--text); }
.inv-btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  background: var(--gold);
  color: #1a1408 !important;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none !important;
  margin-top: 8px;
  box-sizing: border-box;
}
.inv-btn:disabled { opacity: 0.6; cursor: wait; }
.inv-btn-ghost {
  background: transparent;
  color: var(--gold) !important;
  border: 1px solid var(--line);
}
.inv-btn-apple {
  background: #000;
  color: #fff !important;
  border: 1px solid var(--line);
}
.inv-muted { color: var(--muted); font-size: 13px; }
.inv-section {
  margin: 18px 0 8px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 700;
}
.inv-list { display: grid; gap: 8px; }
.inv-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 10px 12px;
  transition: background 0.15s;
}
.inv-row:hover {
  background: rgba(255,255,255,0.04);
}
.inv-title { font-weight: 700; font-size: 15px; }
.inv-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.inv-badge {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(251, 183, 74, 0.12);
  border: 1px solid rgba(251, 183, 74, 0.35);
  padding: 4px 10px;
  border-radius: 8px;
}
.inv-form { display: grid; gap: 10px; }
.inv-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.inv-form select,
.inv-form input[type="text"] {
  background: #0b120e;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  width: 100%;
}
.inv-actions { display: grid; gap: 8px; margin-top: 12px; }

