:root {
  --boy: #3b82f6;
  --boy-soft: #dbeafe;
  --girl: #ec4899;
  --girl-soft: #fce7f3;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #fdfcfb;
  --card: #ffffff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.05);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px 64px;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 20px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type='text'],
input[type='number'] {
  width: 100%;
  font-size: 1.05rem;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
}

input:focus {
  outline: none;
  border-color: var(--ink);
}

.field {
  margin-bottom: 16px;
}

/* --- Side pickers ---------------------------------------------------------------------------- */

.sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.side-btn {
  border: 2.5px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: 18px 10px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: transform 0.08s ease, border-color 0.15s ease, background 0.15s ease;
}

.side-btn:active {
  transform: scale(0.97);
}

.side-btn .emoji {
  font-size: 1.9rem;
  display: block;
  line-height: 1.2;
}

.side-btn .name {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
}

.side-btn .odds {
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.side-btn[data-side='BOY'].selected {
  border-color: var(--boy);
  background: var(--boy-soft);
}

.side-btn[data-side='GIRL'].selected {
  border-color: var(--girl);
  background: var(--girl-soft);
}

/* --- Buttons --------------------------------------------------------------------------------- */

button.primary {
  width: 100%;
  padding: 15px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: var(--ink);
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

button.primary:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

button.ghost {
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--ink);
  padding: 11px 14px;
  border-radius: 11px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

/* --- Odds board ------------------------------------------------------------------------------ */

.pool-bar {
  display: flex;
  height: 34px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--line);
  margin-bottom: 10px;
}

.pool-bar span {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  transition: flex-basis 0.4s ease;
  overflow: hidden;
  white-space: nowrap;
}

.pool-bar .boy {
  background: var(--boy);
}

.pool-bar .girl {
  background: var(--girl);
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  text-align: center;
}

.stat {
  padding: 10px;
  border-radius: 12px;
  background: #f8fafc;
}

.stat .k {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}

.stat .v {
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stat.boy .v {
  color: var(--boy);
}

.stat.girl .v {
  color: var(--girl);
}

/* --- Lists ----------------------------------------------------------------------------------- */

.bettors {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bettors li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.bettors li:last-child {
  border-bottom: none;
}

.bettors .who {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bettors .amt {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.pill {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 999px;
  color: #fff;
}

.pill.boy {
  background: var(--boy);
}

.pill.girl {
  background: var(--girl);
}

.rank {
  width: 22px;
  color: var(--muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.net {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-width: 74px;
  text-align: right;
}

.net.up {
  color: #059669;
}

.net.down {
  color: #dc2626;
}

.you-row {
  background: #fffbeb;
  border-radius: 10px;
  padding-left: 8px;
  padding-right: 8px;
}

/* --- Banners --------------------------------------------------------------------------------- */

.banner {
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  font-weight: 700;
  margin-bottom: 16px;
}

.banner.locked {
  background: #fef3c7;
  color: #92400e;
}

.banner.boy {
  background: var(--boy);
  color: #fff;
}

.banner.girl {
  background: var(--girl);
  color: #fff;
}

.banner .big {
  display: block;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

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

.error {
  color: #dc2626;
  font-size: 0.9rem;
  margin-top: 10px;
  min-height: 1.2em;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 18px 0;
  font-size: 0.92rem;
}

.hidden {
  display: none !important;
}

.conn {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #dc2626;
  color: #fff;
  text-align: center;
  font-size: 0.82rem;
  padding: 7px;
  font-weight: 600;
}

.payout-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.payout-box {
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  border: 1.5px solid var(--line);
}

.payout-box .k {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--muted);
}

.payout-box .v {
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.payout-box.win {
  border-color: #6ee7b7;
  background: #ecfdf5;
}

.payout-box.win .v {
  color: #059669;
}

/* --- Host visibility toggle ------------------------------------------------------------------ */

.vis-status {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 0.95rem;
}

.vis-status span {
  display: block;
  font-weight: 500;
  font-size: 0.85rem;
  margin-top: 3px;
  opacity: 0.8;
}

.vis-status.off {
  background: #fef3c7;
  color: #92400e;
}

.vis-status.on {
  background: #ecfdf5;
  color: #065f46;
}
