:root {
  --bg: #fff7ec;
  --card: #ffffff;
  --text: #24170f;
  --muted: #735f52;
  --orange: #f47b20;
  --green: #1fa463;
  --line: #eadbc9;
  --shadow: 0 12px 30px rgba(71, 40, 16, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #fff0d8 0, var(--bg) 45%, #fff 100%);
  color: var(--text);
}
button, input { font: inherit; }
.page { max-width: 960px; margin: 0 auto; padding: 22px 14px 36px; }
.hero { text-align: center; padding: 10px 8px 18px; }
.badge { display: inline-block; padding: 7px 13px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-weight: 700; }
h1 { margin: 14px 0 4px; font-size: clamp(2.2rem, 10vw, 4.5rem); line-height: .95; letter-spacing: -0.05em; }
p { margin: 8px 0; color: var(--muted); font-size: 1.05rem; }
.countdown { margin: 16px auto 0; width: fit-content; padding: 12px 18px; border-radius: 18px; background: #24170f; color: #fff; font-weight: 800; box-shadow: var(--shadow); }
.card, .status-card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.auth-card { padding: 20px; max-width: 460px; margin: 0 auto 18px; }
.auth-card h2 { margin: 0 0 4px; font-size: 1.6rem; }
.muted { color: var(--muted); }
.form { display: grid; gap: 12px; margin-top: 16px; }
label { display: grid; gap: 6px; font-weight: 800; }
input { width: 100%; min-height: 54px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 16px; background: #fffdf9; font-size: 1.1rem; }
input:focus { outline: 3px solid rgba(244, 123, 32, .2); border-color: var(--orange); }
.primary-btn { min-height: 58px; border: 0; border-radius: 17px; background: var(--text); color: white; font-weight: 900; font-size: 1.15rem; }
.error { min-height: 22px; color: #b42318; font-weight: 700; margin-top: 10px; }
.hidden { display: none !important; }
.game.locked { opacity: .55; pointer-events: none; }
.welcome { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 2px 4px 12px; color: var(--muted); font-weight: 800; }
.link-btn { border: 0; background: transparent; color: var(--muted); text-decoration: underline; font-weight: 800; }
.cups { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cup-card { position: relative; min-height: 430px; padding: 18px 10px; border: 3px solid transparent; border-radius: 28px; background: #fff; box-shadow: var(--shadow); cursor: pointer; overflow: hidden; touch-action: manipulation; user-select: none; }
.cup-card:active { transform: scale(.985); }
.cup-card.orange { border-color: rgba(244,123,32,.35); }
.cup-card.green { border-color: rgba(31,164,99,.35); }
.cup-wrap { height: 250px; display: grid; place-items: end center; margin-top: 4px; }
.cup { position: relative; width: min(140px, 34vw); height: 220px; border: 7px solid #31231a; border-top: 0; border-radius: 0 0 34px 34px; background: rgba(255,255,255,.62); overflow: hidden; }
.cup::before { content: ""; position: absolute; inset: 0; border-radius: 0 0 25px 25px; box-shadow: inset 0 0 18px rgba(0,0,0,.16); z-index: 3; pointer-events: none; }
.fill { position: absolute; left: 0; right: 0; bottom: 0; height: 4%; transition: height .18s ease; }
.orange-fill { background: linear-gradient(#ffad5c, var(--orange)); }
.green-fill { background: linear-gradient(#89d67f, var(--green)); }
.fill::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.42); }
.shine { position: absolute; top: 24px; left: 22px; width: 20px; height: 125px; border-radius: 999px; background: rgba(255,255,255,.45); z-index: 4; }
.cup-card h2 { margin: 18px 0 4px; font-size: clamp(1.15rem, 5vw, 1.7rem); }
.ml { font-size: clamp(1.8rem, 8vw, 3.2rem); font-weight: 950; letter-spacing: -0.04em; }
.tap-label { margin: 12px auto 0; width: fit-content; padding: 10px 16px; border-radius: 999px; color: #fff; font-weight: 950; }
.orange .tap-label { background: var(--orange); }
.green .tap-label { background: var(--green); }
.status-card { margin-top: 14px; padding: 16px; text-align: center; font-size: 1.05rem; }
#leaderText { font-size: 1.25rem; font-weight: 950; margin-bottom: 8px; }
.rules { color: var(--muted); }
.tap-msg { min-height: 24px; margin-top: 8px; font-weight: 800; color: var(--muted); }
@media (max-width: 680px) {
  .page { padding-left: 10px; padding-right: 10px; }
  .cups { gap: 9px; }
  .cup-card { min-height: 375px; border-radius: 22px; padding: 14px 6px; }
  .cup-wrap { height: 215px; }
  .cup { height: 190px; border-width: 6px; }
}
.prize-line {
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text);
  font-weight: 800;
}

.promo-line {
  margin: 10px auto 0;
  max-width: 620px;
  font-size: 0.95rem;
  line-height: 1.4;
  opacity: 0.95;
}
.leaderboard-card {
  margin-top: 14px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.leaderboard-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.leaderboard-head h2 {
  margin: 0 0 2px;
  font-size: 1.45rem;
}
.leaderboard-head p {
  margin: 0;
}
.my-rank {
  padding: 9px 12px;
  border-radius: 999px;
  background: #fff7ec;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}
.leaderboard-list {
  display: grid;
  gap: 8px;
}
.leader-row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: #fffdf9;
  border: 1px solid var(--line);
}
.rank {
  font-weight: 950;
  color: var(--muted);
}
.player-name {
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-taps {
  font-weight: 950;
}
.empty-board {
  padding: 14px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}
@media (max-width: 680px) {
  .leaderboard-head {
    display: grid;
  }
  .my-rank {
    width: fit-content;
    white-space: normal;
  }
  .leader-row {
    grid-template-columns: 44px 1fr;
  }
  .player-taps {
    grid-column: 2;
    color: var(--muted);
  }
}

.my-team-card {
  margin: 0 0 14px;
  padding: 16px;
  border-radius: 24px;
  background: #fff;
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}
.my-team-label {
  color: var(--muted);
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .8rem;
}
.my-team-text {
  margin-top: 4px;
  font-size: clamp(1.35rem, 6vw, 2.15rem);
  font-weight: 950;
  letter-spacing: -0.035em;
}
.my-team-details {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}
.my-team-card.team-orange {
  border-color: rgba(244,123,32,.45);
  background: linear-gradient(180deg, #fff, #fff1df);
}
.my-team-card.team-green {
  border-color: rgba(31,164,99,.45);
  background: linear-gradient(180deg, #fff, #effff5);
}
.my-team-card.team-mixed {
  background: linear-gradient(90deg, #fff4e7, #f0fff6);
}
