/* Leo Mafia — noir & gold */
:root {
  --black: #09090a;
  --graphite: #131315;
  --panel: #1a1a1d;
  --panel-hi: #222226;
  --line: rgba(255, 255, 255, 0.07);
  --line-gold: rgba(214, 170, 72, 0.32);
  --text: #f3efe6;
  --muted: #8f8f96;
  --dim: #5f5f66;
  --gold: #d6aa48;
  --gold-hi: #f5daa0;
  --gold-lo: #96701f;
  --gold-grad: linear-gradient(135deg, #f7deA0 0%, #d6aa48 48%, #9a7322 100%);
  --serif: "Cinzel", "Trajan Pro", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 15px/1.45 var(--sans);
  color: var(--text);
  background:
    radial-gradient(90% 42% at 50% -6%, rgba(214, 170, 72, 0.16), transparent 72%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 15px),
    var(--black);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; padding: 60px 0; }
h1, h2, h3, p { margin: 0; }
h2 { font: 600 22px/1.2 var(--serif); letter-spacing: 0.03em; }
a { color: var(--gold); text-decoration: none; }

/* section labels: gold serif caps followed by a hairline */
h3 {
  display: flex; align-items: center; gap: 10px; margin: 0 0 6px;
  font: 600 11px/1 var(--serif); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold);
}
h3::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-gold), transparent); }

main { max-width: 520px; margin: 0 auto; padding: 8px 16px calc(96px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }

/* brand bar */
.brand { max-width: 520px; margin: 0 auto; padding: 16px 16px 6px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.wordmark {
  font: 700 15px/1 var(--serif); letter-spacing: 0.42em; text-transform: uppercase; padding-left: 0.42em;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.crest {
  display: inline-grid; place-items: center; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 30% 25%, #2a2a2e, #101012);
  border: 1px solid var(--line-gold);
  box-shadow: 0 0 0 3px rgba(214, 170, 72, 0.07), 0 0 28px rgba(214, 170, 72, 0.22);
}
.crest.sm { width: 28px; height: 28px; font-size: 15px; }
.crest.lg { width: 104px; height: 104px; font-size: 54px; box-shadow: 0 0 0 6px rgba(214, 170, 72, 0.07), 0 0 60px rgba(214, 170, 72, 0.3); }
/* tint the emoji lion gold so it sits inside the palette */
.crest i { font-style: normal; line-height: 1; filter: grayscale(1) sepia(1) saturate(3.2) brightness(1.2); }

/* bottom nav */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; z-index: 5;
  background: linear-gradient(180deg, rgba(14, 14, 16, 0.86), rgba(9, 9, 10, 0.96));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-gold);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  position: relative; flex: 1; max-width: 130px; background: none; border: 0; color: var(--dim);
  padding: 11px 0 12px; font: 600 10px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; transition: color .2s;
}
.tabs svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tabs button.active { color: var(--gold); }
.tabs button.active::before {
  content: ""; position: absolute; top: -1px; left: 28%; right: 28%; height: 2px; border-radius: 2px;
  background: var(--gold-grad); box-shadow: 0 0 12px rgba(214, 170, 72, 0.7);
}

/* controls */
input, select, textarea {
  width: 100%; background: #0e0e10; color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 14px; font: inherit; font-size: 16px; outline: none; min-width: 0;
  transition: border-color .2s, box-shadow .2s;
}
input, select, textarea { color-scheme: dark; }
textarea { resize: vertical; min-height: 78px; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(214, 170, 72, 0.14); }
::placeholder { color: var(--dim); }
select { appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23d6aa48' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
label { display: block; font: 600 11px/1 var(--serif); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.field { margin-bottom: 14px; }

.btn {
  background: linear-gradient(180deg, var(--panel-hi), var(--panel)); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 18px;
  font: 600 14px/1.2 var(--sans); letter-spacing: 0.04em; cursor: pointer; text-align: center;
  transition: transform .1s, border-color .2s, box-shadow .2s;
}
.btn:hover { border-color: var(--line-gold); }
.btn:active { transform: scale(0.98); }
.btn.primary {
  background: var(--gold-grad); color: #1a1305; border-color: transparent; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px;
  box-shadow: 0 6px 22px rgba(214, 170, 72, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn.primary:hover { box-shadow: 0 8px 28px rgba(214, 170, 72, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.btn.outline { background: rgba(214, 170, 72, 0.08); color: var(--gold-hi); border-color: var(--line-gold); }
.btn.outline:hover { background: rgba(214, 170, 72, 0.15); }
.btn.small { white-space: nowrap; }
.btn.danger { background: transparent; color: var(--muted); }
.btn.danger:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); }
.btn.block { width: 100%; }
.btn.small { padding: 8px 14px; font-size: 12px; }
.btn.primary.small { letter-spacing: 0.06em; }
.btn:disabled { opacity: 0.45; cursor: default; }
.row { display: flex; gap: 8px; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.link { background: none; border: 0; color: var(--gold); padding: 2px 0; font: 600 12px/1 var(--serif); letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; text-align: left; align-self: flex-start; }

/* cards */
.card {
  position: relative; border-radius: var(--radius); padding: 16px;
  background: linear-gradient(180deg, #1d1d20 0%, #151517 100%);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 30px rgba(0, 0, 0, 0.4);
}
.card::before { /* gold hairline across the top edge */
  content: ""; position: absolute; top: -1px; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(214, 170, 72, 0.55), transparent);
}
.card.tap { cursor: pointer; transition: transform .12s, border-color .2s; }
.card.tap:hover { border-color: var(--line-gold); }
.card.tap:active { transform: scale(0.985); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding-top: 4px; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* chips */
.chip {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font: 700 10px/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: rgba(255, 255, 255, 0.03);
}
.chip.gold { color: #1a1305; background: var(--gold-grad); border-color: transparent; }
.chip.outline { color: var(--gold); border-color: var(--line-gold); background: rgba(214, 170, 72, 0.08); }
.chip.grey { color: var(--muted); }

/* segmented control */
.seg { display: flex; background: #0e0e10; border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { flex: 1; background: none; border: 0; color: var(--muted); padding: 9px; border-radius: 9px; font: 600 11px/1 var(--serif); letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; transition: all .2s; }
.seg button.active { background: linear-gradient(180deg, var(--panel-hi), var(--panel)); color: var(--gold); box-shadow: inset 0 0 0 1px var(--line-gold); }

/* hero / register */
.hero { text-align: center; padding: 34px 0 10px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hero h1 {
  font: 700 30px/1 var(--serif); letter-spacing: 0.3em; padding-left: 0.3em; text-transform: uppercase;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); letter-spacing: 0.25em; text-transform: uppercase; font-size: 11px; }
.orn { display: flex; align-items: center; gap: 10px; color: var(--gold); font-size: 10px; }
.orn::before, .orn::after { content: ""; width: 44px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-lo)); }
.orn::after { transform: scaleX(-1); }

/* icons */
.ico { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; flex: none; }
.meta { color: var(--muted); font-size: 13px; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta .ico { color: var(--gold); }

/* game card with date badge */
.game { display: flex; gap: 14px; align-items: stretch; }
.date {
  flex: none; width: 58px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #0e0e10, #151517); border: 1px solid var(--line-gold); padding: 8px 0;
}
.date .dow { font: 600 9px/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.date .day { font: 700 26px/1.1 var(--serif); color: var(--gold-hi); margin: 3px 0 2px; }
.date .mon { font: 600 9px/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.date.past { opacity: 0.7; }
.game-title { font: 600 17px/1.25 var(--serif); letter-spacing: 0.02em; }
.game .body { flex: 1; min-width: 0; }
.meter { height: 4px; border-radius: 2px; background: #0c0c0e; overflow: hidden; margin-top: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.meter > div { height: 100%; background: var(--gold-grad); border-radius: 2px; box-shadow: 0 0 10px rgba(214, 170, 72, 0.5); }
.meter.full > div { background: linear-gradient(90deg, #6d6d73, #a8a8ae); box-shadow: none; }
.seats { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--muted); }
.seats b { color: var(--text); font-weight: 600; }

/* lists */
.list .item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list .item:last-child { border-bottom: 0; padding-bottom: 2px; }
.list .item.tap { cursor: pointer; }
.list .item.tap:active { background: rgba(255, 255, 255, 0.02); }
.list .name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .sub { color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 1px; }
.list .num { font: 600 17px/1 var(--serif); color: var(--gold-hi); font-variant-numeric: tabular-nums; text-align: right; }
.list .num .sub { display: block; font-family: var(--sans); margin-top: 4px; }
.list .item.me { background: linear-gradient(90deg, rgba(214, 170, 72, 0.11), transparent); margin: 0 -16px; padding-left: 16px; padding-right: 16px; box-shadow: inset 2px 0 0 var(--gold); }
.list .item.lead .name { font-size: 16px; }

/* rank badge */
.rank { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; font: 600 12px/1 var(--serif); color: var(--muted); border: 1px solid var(--line); }
.rank.r1 { background: var(--gold-grad); color: #1a1305; border-color: transparent; box-shadow: 0 0 14px rgba(214, 170, 72, 0.45); font-weight: 700; }
.rank.r2 { background: linear-gradient(135deg, #f0f0f2, #9a9aa2 55%, #6b6b72); color: #17171a; border-color: transparent; font-weight: 700; }
.rank.r3 { background: linear-gradient(135deg, #d9a769, #8c5f2c 60%, #6a4419); color: #1c1207; border-color: transparent; font-weight: 700; }

/* avatars */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font: 700 15px/1 var(--serif); color: var(--gold-hi);
  background: radial-gradient(circle at 30% 25%, #2b2b30, #111113); border: 1px solid var(--line-gold);
}
.avatar.lg { width: 72px; height: 72px; font-size: 30px; box-shadow: 0 0 0 4px rgba(214, 170, 72, 0.08), 0 0 34px rgba(214, 170, 72, 0.2); }
.avatar.top { border-color: var(--gold); box-shadow: 0 0 14px rgba(214, 170, 72, 0.25); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 18px 8px; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats .v { font: 700 26px/1 var(--serif); color: var(--text); }
.stats .v.gold { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats .l { margin-top: 8px; font: 600 9px/1 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.pos { color: var(--gold-hi); font-weight: 700; }
.neg { color: var(--muted); font-weight: 700; }

.banner {
  text-align: center; padding: 14px; border-radius: var(--radius); font: 600 13px/1 var(--serif);
  letter-spacing: 0.22em; text-transform: uppercase;
}
.banner.town { background: linear-gradient(180deg, rgba(214, 170, 72, 0.16), rgba(214, 170, 72, 0.05)); border: 1px solid var(--line-gold); color: var(--gold-hi); }
.banner.mafia { background: linear-gradient(180deg, #232326, #141416); border: 1px solid rgba(255, 255, 255, 0.14); color: #d9d9dd; }
.error { color: #d9d9dd; font-size: 13px; min-height: 1.2em; margin-bottom: 8px; }
.error:not(:empty)::before { content: "! "; color: var(--gold); font-weight: 700; }
.notes { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: #cfcbc0; font-size: 14px; }

.toast {
  position: fixed; left: 50%; top: 12px; transform: translate(-50%, -90px); z-index: 10;
  background: rgba(20, 20, 22, 0.96); color: var(--text); border: 1px solid var(--line-gold);
  padding: 11px 18px; border-radius: 12px; max-width: 90vw; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); transition: transform .28s cubic-bezier(.2, .9, .3, 1.2); pointer-events: none; text-align: center;
}
.toast.show { transform: translate(-50%, 0); }

/* onboarding steps */
.steps { display: flex; gap: 6px; justify-content: center; padding: 6px 0 2px; }
.steps span { height: 3px; width: 38px; border-radius: 2px; background: var(--panel-hi); }
.steps span.on { background: var(--gold-grad); box-shadow: 0 0 10px rgba(214, 170, 72, 0.5); }
.hero.compact { padding: 8px 0 0; gap: 10px; }
.hero.compact h1 { font-size: 22px; }

/* rules accordion */
details.rule { padding: 0; }
details.rule summary {
  list-style: none; cursor: pointer; padding: 16px; display: flex; justify-content: space-between; align-items: center;
  font: 600 13px/1 var(--serif); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-hi);
}
details.rule summary::-webkit-details-marker { display: none; }
details.rule summary::after {
  content: ""; width: 7px; height: 7px; margin: -3px 4px 0 0; border-right: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold);
  transform: rotate(45deg); transition: transform .2s;
}
details.rule[open] summary::after { transform: rotate(-135deg); margin-top: 3px; }
details.rule ul { margin: 0; padding: 0 16px 16px; list-style: none; display: flex; flex-direction: column; gap: 11px; }
details.rule li { position: relative; padding-left: 18px; color: #cfcbc0; font-size: 14px; line-height: 1.5; }
details.rule li::before { content: "◆"; position: absolute; left: 0; top: 4px; font-size: 7px; color: var(--gold); }
details.rule li b { color: var(--text); font-weight: 600; }

/* agreement checkbox */
.check { display: flex; gap: 14px; align-items: center; cursor: pointer; padding: 15px 16px; font-size: 14px; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; padding: 0; border: 0; }
.check .box { width: 24px; height: 24px; border-radius: 8px; flex: none; border: 1.5px solid var(--line-gold); background: #0e0e10; display: grid; place-items: center; transition: all .15s; }
.check input:checked + .box { background: var(--gold-grad); border-color: transparent; box-shadow: 0 0 14px rgba(214, 170, 72, 0.4); }
.check input:checked + .box::after { content: ""; width: 6px; height: 11px; border: solid #1a1305; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.foot-note { text-align: center; color: var(--muted); font-size: 12px; padding: 4px 12px; }

/* language switch & rule headings */
.lang-row { display: flex; justify-content: flex-end; }
.seg.lang { width: 104px; padding: 2px; }
.seg.lang button { padding: 6px 0; font: 700 11px/1 var(--sans); letter-spacing: 0.1em; }
details.rule summary .ttl { display: flex; align-items: center; gap: 12px; }
.ico.lg { width: 20px; height: 20px; color: var(--gold); stroke-width: 1.6; }
.banner.gray { background: linear-gradient(180deg, #202023, #131315); border: 1px solid rgba(255, 255, 255, 0.1); color: #b9b9bf; }
select optgroup { color: var(--gold); font-style: normal; background: #131315; }
select option { color: var(--text); background: #131315; }
