/* Groomsman Games — player side. Championship edition. Mobile-first. */
:root {
  --bg: #07090d;
  --bg2: #0c1016;
  --card: #11161f;
  --card2: #161d29;
  --line: #1e2735;
  --gold: #e6b84c;
  --gold-hi: #f5d485;
  --gold-dim: #9a7a2c;
  --text: #eef2f7;
  --muted: #7e8b9c;
  --accent: #4cc2e6;
  --danger: #e65c5c;
  --radius: 16px;
}
* { 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;
}
button { font: inherit; cursor: pointer; touch-action: manipulation; }

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

/* ============ LOGIN ============ */
#login-screen.active {
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, rgba(230,184,76,0.14), transparent 60%),
    var(--bg);
}
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-crest {
  width: 190px; height: 190px; margin: 0 auto 6px; display: block;
  filter: drop-shadow(0 8px 40px rgba(230,184,76,0.35));
  border-radius: 50%;
}
.login-card h1 {
  font-size: 30px; font-weight: 900; letter-spacing: 2px; text-transform: uppercase;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-dim));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.login-card .sub { color: var(--muted); margin: 10px 0 22px; font-size: 13.5px; letter-spacing: 0.4px; }

.login-buttons { max-height: 56dvh; overflow-y: auto; padding: 2px; }
.login-specials { display: flex; gap: 8px; margin-bottom: 12px; }
.login-specials .login-btn {
  flex: 1; padding: 13px 4px; font-size: 15px; font-weight: 900; letter-spacing: 0.5px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 60%, var(--gold-dim));
  color: #191204; border: none; border-radius: 12px;
  box-shadow: 0 4px 18px rgba(230,184,76,0.25);
}
.login-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.login-grid .login-btn {
  padding: 12px 4px; font-size: 13px; font-weight: 700;
  background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
}
.login-btn:active { transform: scale(0.96); }

/* ============ PIN MODAL ============ */
.pin-modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(4,5,8,0.82); backdrop-filter: blur(6px);
}
.pin-card {
  width: 100%; max-width: 340px; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.pin-card h2 {
  font-size: 20px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-dim));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.pin-card .pin-sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
#pin-input {
  width: 100%; text-align: center; font-size: 28px; font-weight: 800; letter-spacing: 10px;
  background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 10px 14px 20px; margin-bottom: 16px; font-family: inherit;
}
#pin-input:focus { outline: none; border-color: var(--gold-dim); }
.pin-card .login-btn.special {
  width: 100%; padding: 13px 4px; font-size: 15px; margin-bottom: 10px;
}
.pin-card .ghost {
  width: 100%; padding: 10px 4px; background: none;
}
.pin-error {
  color: var(--danger); font-size: 13px; margin-top: 12px; font-weight: 600;
}

/* ============ TOP BAR ============ */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(7,9,13,0.88); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(230,184,76,0.22);
}
.topbar-crest { width: 40px; height: 40px; border-radius: 50%; }
.topbar-title { flex: 1; font-weight: 800; font-size: 16px; letter-spacing: 0.3px; }
.ghost {
  background: none; border: 1px solid var(--line); color: var(--muted);
  padding: 7px 14px; border-radius: 10px; font-size: 13px; font-weight: 600;
}

/* ============ HERO ============ */
.hero-wrap {
  position: relative; margin: -0px -0px 0; overflow: hidden;
}
.hero-img { width: 100%; display: block; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,9,13,0.25) 0%, rgba(7,9,13,0) 35%, rgba(7,9,13,0.92) 88%, var(--bg) 100%);
  display: flex; flex-direction: column; justify-content: flex-start; align-items: center;
  padding-top: 6%;
}
.hero-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: 4px; text-transform: uppercase;
  color: var(--gold-hi); text-shadow: 0 2px 12px rgba(0,0,0,0.8);
}
.hero-name {
  font-size: 34px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase;
  text-shadow: 0 2px 18px rgba(0,0,0,0.9); margin-top: 4px;
}
.hero-stats { padding: 0 16px; margin-top: -34px; position: relative; z-index: 2; }
.hero-progress-card {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid rgba(230,184,76,0.3); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.hero-sub { color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: 0.3px; margin-bottom: 8px; }
.hero-sub b { color: var(--gold-hi); }

/* ============ CONTENT ============ */
main { padding: 0 16px calc(32px + env(safe-area-inset-bottom)); }
.view { display: none; }
.view.active { display: block; }
h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 2.5px;
  color: var(--gold-dim); margin: 22px 0 10px; font-weight: 800;
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 10px;
}
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Banner */
.banner {
  margin: 12px 0 0; padding: 12px 14px;
  background: linear-gradient(90deg, rgba(230,184,76,0.16), rgba(230,184,76,0.05));
  border: 1px solid rgba(230,184,76,0.35); border-radius: var(--radius);
  color: var(--gold-hi); font-size: 13.5px; font-weight: 600; line-height: 1.45;
}

/* Progress bars */
.pbar { height: 7px; background: #1a2230; border-radius: 999px; overflow: hidden; }
.pbar.big { height: 12px; }
.pfill {
  height: 100%; border-radius: 999px; transition: width .5s cubic-bezier(.22,1,.36,1);
  background: linear-gradient(90deg, var(--gold-dim), var(--gold) 60%, var(--gold-hi));
  box-shadow: 0 0 10px rgba(230,184,76,0.5);
}

/* Rules link */
.rules-link {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin: 14px 0 2px; padding: 14px;
  background: linear-gradient(180deg, var(--card2), var(--card));
  color: var(--gold-hi); font-weight: 800; font-size: 14px; letter-spacing: 1px; text-transform: uppercase;
  border: 1px solid rgba(230,184,76,0.35); border-radius: var(--radius);
}
.rules-link:active { transform: scale(0.99); }

/* ============ GAME LIST ============ */
.game-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px; color: var(--text);
  position: relative; overflow: hidden;
}
.game-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--gold), transparent);
  opacity: 0.55;
}
.game-card:active { transform: scale(0.985); }
.game-emoji {
  font-size: 24px; width: 46px; height: 46px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(230,184,76,0.09); border: 1px solid rgba(230,184,76,0.22);
  border-radius: 13px;
}
.game-emoji.big { font-size: 38px; width: 68px; height: 68px; border-radius: 18px; }
.game-body { flex: 1; min-width: 0; }
.game-name { font-weight: 800; font-size: 15.5px; margin-bottom: 5px; letter-spacing: 0.2px; }
.game-meta { margin-bottom: 9px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.game-progress-label { color: var(--muted); font-size: 11.5px; margin-top: 6px; font-weight: 600; }
.chev { color: var(--gold-dim); font-size: 24px; font-weight: 300; }

/* Badges */
.badge {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 0.8px;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
}
.badge.secret { background: rgba(230,122,176,0.12); color: #e67ab0; border: 1px solid rgba(230,122,176,0.3); }
.badge.outdoor { background: rgba(111,230,146,0.1); color: #6fe692; border: 1px solid rgba(111,230,146,0.25); }
.badge.indoor { background: rgba(76,194,230,0.1); color: var(--accent); border: 1px solid rgba(76,194,230,0.25); }
.badge.all-hands { background: rgba(230,184,76,0.12); color: var(--gold); border: 1px solid rgba(230,184,76,0.3); }
.mine-chip {
  display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 10px;
  border-radius: 999px; color: #191204;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
}

/* ============ GAME DETAIL ============ */
.back { margin: 14px 0 12px; }
.detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.detail-name { font-size: 24px; font-weight: 900; letter-spacing: 0.3px; line-height: 1.15; }
.detail-meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.my-result {
  border-color: rgba(230,184,76,0.4);
  background: linear-gradient(180deg, rgba(230,184,76,0.08), var(--card));
}
.my-result-label { color: var(--gold-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 2px; font-weight: 800; }
.my-result-val {
  font-size: 30px; font-weight: 900; margin: 8px 0;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.you-tag { font-size: 11px; font-weight: 800; color: var(--gold); }
.slot { display: flex; gap: 12px; }
.slot.mine { border-color: rgba(230,184,76,0.45); background: linear-gradient(180deg, rgba(230,184,76,0.06), var(--card)); }
.slot-time { min-width: 78px; color: var(--muted); font-size: 12.5px; padding-top: 2px; line-height: 1.5; font-weight: 600; }
.slot-body { flex: 1; }
.slot-body .name { font-weight: 700; font-size: 14.5px; }
.slot-body .note { color: var(--muted); font-size: 13px; margin-top: 4px; }
.day-header { font-weight: 900; color: var(--text); margin: 18px 0 8px; font-size: 16px; letter-spacing: 0.3px; }
.secret-note { border-color: rgba(230,122,176,0.35); color: #e67ab0; font-size: 13.5px; line-height: 1.5; }

/* ============ 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: 152px; display: flex; flex-direction: column; justify-content: space-around; gap: 8px; }
.round-title {
  font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 2px;
  color: var(--gold-dim); text-align: center; margin-bottom: 2px;
}
.match { background: var(--card2); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.match.mine { border-color: var(--gold); box-shadow: 0 0 12px rgba(230,184,76,0.18); }
.match.bye { opacity: 0.55; }
.m-side { padding: 8px 11px; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--line); }
.m-side:last-child { border-bottom: none; }
.m-side.won { color: var(--gold-hi); font-weight: 900; }
.m-side.me { background: rgba(230,184,76,0.1); }
.m-side .tbd, .tbd-bye { color: var(--muted); font-weight: 400; font-style: italic; }
.tbd-bye { padding: 8px 11px; font-size: 12px; }
.m-time { padding: 4px 11px; font-size: 11px; color: var(--accent); background: rgba(76,194,230,0.07); }

/* ============ RULES ============ */
.rules-hero { position: relative; margin: 0 -16px; }
.rules-hero img { width: 100%; display: block; }
.rules-hero .fade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, var(--bg) 96%);
}
.rules-title {
  font-size: 24px; font-weight: 900; margin: -30px 0 16px; position: relative;
  text-align: center; letter-spacing: 1px; text-transform: uppercase;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.rules-card { border-left: 3px solid var(--gold-dim); }
.rules-h { font-weight: 900; margin-bottom: 7px; font-size: 15px; color: var(--gold-hi); letter-spacing: 0.3px; }
.rules-text { color: var(--text); font-size: 14px; line-height: 1.6; }
