/* Groomsman Games — player side. Mobile-first. */
:root {
  --bg: #0d1117;
  --card: #161d27;
  --card2: #1c2531;
  --gold: #e6b84c;
  --gold-dim: #a8862f;
  --text: #e8edf3;
  --muted: #8a97a6;
  --accent: #4cc2e6;
  --danger: #e65c5c;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.screen { display: none; min-height: 100dvh; }
.screen.active { display: block; }

/* Login */
#login-screen.active { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.gg-mark {
  width: 84px; height: 84px; margin: 0 auto 16px;
  border: 3px solid var(--gold); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; color: var(--gold); letter-spacing: 1px;
}
.gg-mark.small { width: 38px; height: 38px; font-size: 14px; border-width: 2px; margin: 0; }
.login-card h1 { font-size: 26px; letter-spacing: 0.5px; }
.login-card .sub { color: var(--muted); margin: 8px 0 24px; }
#login-form input {
  width: 100%; padding: 14px; font-size: 20px; text-align: center;
  text-transform: uppercase; letter-spacing: 2px;
  background: var(--card); color: var(--text);
  border: 1px solid #2a3543; border-radius: var(--radius);
}
#login-form input:focus { outline: 2px solid var(--gold-dim); }
#login-form button {
  width: 100%; margin-top: 12px; padding: 14px; font-size: 17px; font-weight: 700;
  background: var(--gold); color: #14100a; border: none; border-radius: var(--radius);
}
#login-form button:active { transform: scale(0.98); }
.error { color: var(--danger); margin-top: 12px; font-size: 14px; }

/* Testing-mode login buttons */
.login-buttons { max-height: 60dvh; overflow-y: auto; }
.login-specials { display: flex; gap: 8px; margin-bottom: 12px; }
.login-specials .login-btn {
  flex: 1; padding: 12px 4px; font-size: 15px; font-weight: 800;
  background: var(--gold); color: #14100a; border: none; border-radius: var(--radius);
}
.login-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.login-grid .login-btn {
  padding: 11px 4px; font-size: 13px; font-weight: 600;
  background: var(--card); color: var(--text);
  border: 1px solid #2a3543; border-radius: var(--radius);
}
.login-btn:active { transform: scale(0.97); }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
  background: rgba(13,17,23,0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid #222c38;
}
.topbar-title { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.rank-chip {
  background: var(--card2); color: var(--gold);
  font-size: 12px; padding: 3px 9px; border-radius: 999px; font-weight: 700;
}
.ghost { background: none; border: 1px solid #2a3543; color: var(--muted); padding: 6px 12px; border-radius: 10px; font-size: 13px; }

/* Banner */
.banner {
  margin: 12px 16px 0; padding: 12px 14px;
  background: linear-gradient(90deg, #2a2210, #1c1a10);
  border: 1px solid var(--gold-dim); border-radius: var(--radius);
  color: var(--gold); font-size: 14px; font-weight: 600;
}

/* Content */
main { padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
.view { display: none; }
.view.active { display: block; }

/* Hero */
.hero { margin: 6px 0 4px; }
.hero-name { font-size: 26px; font-weight: 800; }
.hero-sub { color: var(--muted); font-size: 13px; margin: 8px 0 6px; }

/* Progress bars */
.pbar { height: 6px; background: #232d3a; border-radius: 999px; overflow: hidden; }
.pbar.big { height: 10px; }
.pfill { height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); border-radius: 999px; transition: width .4s; }

/* Game list */
.game-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid #222c38; border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px; color: var(--text); font: inherit;
}
.game-card:active { transform: scale(0.99); }
.game-emoji { font-size: 26px; }
.game-emoji.big { font-size: 40px; }
.game-body { flex: 1; min-width: 0; }
.game-name { font-weight: 700; margin-bottom: 4px; }
.game-meta { margin-bottom: 8px; }
.game-progress-label { color: var(--muted); font-size: 12px; margin-top: 5px; }
.chev { color: var(--muted); font-size: 22px; }
.mine-chip {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; background: #2f2510; color: var(--gold);
}

/* Game detail */
.back { margin-bottom: 12px; }
.detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.detail-name { font-size: 22px; font-weight: 800; }
.detail-meta { margin-top: 6px; }
.my-result { border-color: var(--gold-dim); }
.my-result-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.my-result-val { font-size: 24px; font-weight: 800; color: var(--gold); margin: 6px 0; }
.you-tag { font-size: 11px; font-weight: 800; color: var(--gold); }
.slot.mine { border-color: var(--gold-dim); }
.secret-note { border-color: #3a1c2b; color: #e67ab0; }

/* Bracket */
.bracket-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
.bracket { display: flex; gap: 14px; padding-bottom: 8px; }
.round { min-width: 150px; display: flex; flex-direction: column; justify-content: space-around; gap: 8px; }
.round-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); text-align: center; margin-bottom: 2px; }
.match { background: var(--card); border: 1px solid #222c38; border-radius: 10px; overflow: hidden; }
.match.mine { border-color: var(--gold); }
.match.bye { opacity: 0.65; }
.m-side { padding: 7px 10px; font-size: 13px; font-weight: 600; border-bottom: 1px solid #202a36; }
.m-side:last-child { border-bottom: none; }
.m-side.won { color: var(--gold); font-weight: 800; }
.m-side.me { background: #1d1a12; }
.m-side .tbd, .tbd-bye { color: var(--muted); font-weight: 400; font-style: italic; }
.tbd-bye { padding: 7px 10px; font-size: 12px; }
.m-time { padding: 4px 10px; font-size: 11px; color: var(--accent); background: #14202c; }
.small { font-size: 12px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); margin: 18px 0 10px; }
.card {
  background: var(--card); border: 1px solid #222c38;
  border-radius: var(--radius); padding: 16px; margin-bottom: 10px;
}
.next-card .event-name { font-size: 20px; font-weight: 800; color: var(--gold); }
.next-card .event-time { font-size: 15px; margin-top: 6px; }
.next-card .event-meta { color: var(--muted); font-size: 13px; margin-top: 6px; }
.countdown { font-size: 28px; font-weight: 800; text-align: center; letter-spacing: 1px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-right: 6px; }
.badge.secret { background: #3a1c2b; color: #e67ab0; }
.badge.outdoor { background: #17321f; color: #6fe692; }
.badge.indoor { background: #172a3a; color: var(--accent); }
.badge.all-hands { background: #2f2510; color: var(--gold); }

/* Schedule */
.slot { display: flex; gap: 12px; }
.slot-time { min-width: 74px; color: var(--muted); font-size: 13px; padding-top: 2px; }
.slot-body { flex: 1; }
.slot-body .name { font-weight: 700; }
.slot-body .note { color: var(--muted); font-size: 13px; margin-top: 3px; }
.day-header { font-weight: 800; color: var(--text); margin: 16px 0 8px; font-size: 16px; }

/* Standings */
.standing-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid #222c38;
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px;
}
.standing-row.me { border-color: var(--gold); background: #1d1a12; }
.standing-row .pos { width: 30px; font-weight: 800; color: var(--gold); }
.standing-row .pname { flex: 1; font-weight: 600; }
.standing-row .pts { color: var(--muted); font-weight: 700; }

/* News */
.news-item { border-left: 3px solid var(--gold); }
.news-item .ts { color: var(--muted); font-size: 12px; margin-top: 6px; }
.muted { color: var(--muted); }

/* Tab bar */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex;
  background: rgba(13,17,23,0.95); backdrop-filter: blur(8px);
  border-top: 1px solid #222c38;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-btn {
  flex: 1; padding: 10px 0 8px; background: none; border: none;
  color: var(--muted); font-size: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tab-btn span { font-size: 11px; font-weight: 600; }
.tab-btn.active { color: var(--gold); }
