:root {
  --bg: #101623;
  --bg2: #0b101b;
  --card: #1a2233;
  --card2: #212c42;
  --accent: #e8b34b;
  --accent-ink: #141a08;
  --white: #ffffff;
  --muted: #93a0b4;
  --ink: #eef1f6;
  --green: #35b07f;
  --line: rgba(255,255,255,0.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.app { max-width: 560px; margin: 0 auto; padding-bottom: 110px; }

.topbar {
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--accent); color: #101623;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; letter-spacing: 0.5px;
}

.brand-name { font-weight: 800; font-size: 18px; }
.brand-sub { color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.35; }

.share-btn {
  padding: 10px 18px; flex: none;
  background: rgba(232,179,75,0.10); color: var(--accent);
  border: 1px solid rgba(232,179,75,0.45); border-radius: 999px;
  font-size: 14px; font-weight: 700; cursor: pointer;
}

.install-banner {
  margin: 12px 20px 0; padding: 10px 14px;
  background: var(--card); border: 1px solid rgba(232,179,75,0.35);
  border-radius: 10px; font-size: 13px; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.install-banner button {
  background: none; border: none; color: var(--muted);
  font-size: 18px; cursor: pointer; padding: 4px 8px;
}

main { padding: 4px 0 12px; }

.tab { display: none; }
.tab.active { display: block; }

.game-card {
  margin: 16px 20px 0; padding: 22px 20px;
  background: var(--card); border-radius: 16px;
  border: 1px solid var(--line);
}
.game-card.center { text-align: center; }

.eyebrow {
  color: var(--accent); font-size: 11px; font-weight: 700;
  letter-spacing: 1.4px; text-transform: uppercase;
}
.eyebrow.pad { padding: 18px 20px 0; }

h1 { font-size: 26px; margin: 10px 0 8px; line-height: 1.2; }
h2 { font-size: 16px; margin: 20px 0 8px; color: var(--accent); }

.prompt-text { font-size: 19px; line-height: 1.5; font-weight: 600; margin: 4px 0 10px; }
.coach-line { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0 0 6px; }

.ans-label {
  display: block; margin-top: 16px; font-size: 13px; font-weight: 800;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--ink);
}
.ans-hint { color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 12px; margin-left: 4px; }
textarea {
  width: 100%; margin-top: 6px; padding: 12px 14px;
  border-radius: 12px; border: 1px solid rgba(255,255,255,0.15);
  background: var(--bg2); color: var(--ink); font-size: 16px;
  font-family: inherit; line-height: 1.5; resize: vertical;
}
textarea:focus { outline: none; border-color: var(--accent); }
textarea::placeholder { color: rgba(147,160,180,0.55); }

.done-btn {
  width: 100%; margin-top: 20px; padding: 16px;
  background: var(--accent); color: #101623;
  border: none; border-radius: 14px;
  font-size: 17px; font-weight: 800; cursor: pointer;
}
.done-btn.done { background: var(--green); color: #fff; }

.win-box {
  margin-top: 20px; padding: 14px 16px;
  background: rgba(232,179,75,0.08);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
}
.win-label { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.win-box p { margin: 0; font-size: 14px; line-height: 1.55; }
.tease-line { margin-top: 10px !important; color: var(--muted); font-size: 13px !important; }

.streak-line { text-align: center; margin-top: 14px; color: var(--muted); font-size: 14px; }
.streak-line strong { color: var(--accent); }

.share-nudge {
  margin-top: 16px; padding: 14px 16px;
  background: rgba(232,179,75,0.07);
  border: 1px solid rgba(232,179,75,0.3);
  border-radius: 12px; text-align: center;
}
.share-nudge p { margin: 0 0 10px; font-size: 14px; line-height: 1.5; }
.share-win-btn {
  width: 100%; padding: 13px;
  background: var(--accent); color: #101623;
  border: none; border-radius: 12px;
  font-size: 16px; font-weight: 800; cursor: pointer;
}
.recruit-line {
  margin: 12px 0 0; padding: 10px 12px; border-radius: 12px;
  background: rgba(232,179,75,0.12); color: var(--accent);
  font-size: 14px; font-weight: 700;
}
.board-nudge { margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(232,179,75,0.3); }
.board-nudge p { margin: 0 0 10px; font-size: 14px; line-height: 1.5; }
.board-nudge-btn {
  width: 100%; padding: 12px;
  background: transparent; color: var(--accent);
  border: 2px solid var(--accent); border-radius: 12px;
  font-size: 15px; font-weight: 800; cursor: pointer;
}

.mock-card {
  margin: 16px 20px 0; padding: 20px;
  background: linear-gradient(160deg, #24304a, var(--card));
  border-radius: 16px; border: 2px solid var(--accent);
}
.mock-title { margin: 6px 0 8px; font-size: 20px; line-height: 1.3; color: #fff; }
.mock-line { margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.mock-btn {
  width: 100%; padding: 14px;
  background: var(--accent); color: #101623;
  border: none; border-radius: 12px;
  font-size: 16px; font-weight: 800; cursor: pointer;
}
.mock-btn:disabled { background: var(--green); color: #fff; }
.mock-msg { margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: var(--accent); }

.wall-card {
  margin: 16px 20px 0; padding: 18px 20px;
  background: var(--card); border-radius: 16px;
  border: 1px solid var(--line);
}
.wall-line { margin: 8px 0 12px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.wall-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 0; border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 14px;
}
.wall-day { color: var(--accent); font-weight: 800; min-width: 34px; }
.wall-game { flex: 1; }
.wall-nick { color: var(--muted); font-size: 13px; }

.lead-card {
  margin: 16px 20px 40px; padding: 22px 20px;
  background: linear-gradient(160deg, #232f47, var(--card));
  border-radius: 16px;
  border: 1px solid rgba(232,179,75,0.35);
}
.lead-title { font-size: 19px; font-weight: 800; margin: 0 0 6px; }
.lead-sub { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 14px; }
.lead-form input {
  width: 100%; margin-bottom: 10px; padding: 14px;
  border-radius: 12px; border: 1px solid rgba(255,255,255,0.15);
  background: var(--bg2); color: var(--ink); font-size: 16px;
  font-family: inherit;
}
.lead-form input:focus { outline: none; border-color: var(--accent); }
.lead-btn {
  width: 100%; padding: 15px;
  background: var(--accent); color: #101623;
  border: none; border-radius: 14px;
  font-size: 16px; font-weight: 800; cursor: pointer;
}
.lead-btn:disabled { opacity: 0.6; }
.lead-skip {
  width: 100%; margin-top: 8px; padding: 10px;
  background: none; border: none; color: var(--muted);
  font-size: 14px; cursor: pointer;
}
.lead-msg { margin-top: 10px; font-size: 14px; color: var(--accent); line-height: 1.5; }

/* Streak tab */
.streak-big { font-size: 92px; font-weight: 800; color: var(--accent); line-height: 1; margin-top: 8px; }
.streak-word { font-size: 17px; margin-top: 4px; }
.day-line-big { margin-top: 12px; font-size: 15px; font-weight: 700; color: var(--ink); }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; }
.muted.small { font-size: 13px; }
.muted.center, .small.center { text-align: center; }

.week-dots { display: flex; justify-content: center; gap: 8px; margin: 18px 0 6px; }
.dot {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--muted);
}
.dot.hit { background: var(--accent); border-color: var(--accent); color: #101623; font-weight: 800; }
.dot.today { border-color: var(--accent); }

.total-line { margin-top: 14px; color: var(--muted); font-size: 14px; }
.total-line strong { color: var(--ink); }

.level-badge {
  margin-top: 14px; padding: 12px 16px;
  background: rgba(232,179,75,0.08);
  border: 1px solid rgba(232,179,75,0.3);
  border-radius: 12px;
}
.level-name { color: var(--accent); font-weight: 800; font-size: 18px; }
.level-next { color: var(--muted); font-size: 13px; margin-top: 4px; }

.ladder { margin-top: 20px; text-align: left; }
.ladder-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 14px; color: var(--muted);
}
.ladder-row .lname { flex: 1; font-weight: 700; }
.ladder-row.reached { color: var(--ink); }
.ladder-row.reached .lname { color: var(--accent); }
.ladder-row .lat { font-size: 12px; }

/* Leaderboard */
.lb-sub { margin: 26px 20px 2px; font-size: 17px; }
#uni-list, #lb-list, #rec-list { margin: 0 20px; }
.lb-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: 14px;
  padding: 12px 14px; margin: 8px 0;
  border: 1px solid var(--line);
}
.lb-row.lb-mine { border-color: var(--accent); }
.lb-rank { font-size: 17px; width: 30px; text-align: center; color: var(--accent); font-weight: 700; }
.lb-nick { flex: 1; font-weight: 700; font-size: 15px; }
.lb-uni { display: block; font-weight: 500; font-size: 12px; color: var(--muted); margin-top: 2px; }
.lb-stat { color: var(--muted); font-size: 13px; text-align: right; }
.lb-member {
  background: rgba(232,179,75,0.12); color: var(--accent);
  border-radius: 14px; padding: 12px 14px; margin: 16px 20px 0; font-size: 14px;
}
.lb-join-col { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; }
.lb-join-col input {
  padding: 12px; border-radius: 12px; font-size: 15px;
  background: var(--bg2); border: 1px solid rgba(232,179,75,0.35); color: var(--ink);
  font-family: inherit;
}
.btn-primary {
  background: var(--accent); color: #101623; border: none;
  border-radius: 12px; padding: 12px 18px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.btn-primary:disabled { opacity: 0.6; }

.community { text-align: center; padding: 26px 20px 10px; }
.community p { color: var(--muted); font-size: 13px; margin: 0; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; background: #0b101b;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 40;
}
.tab-btn {
  flex: 1; padding: 16px 0; background: none; border: none;
  color: var(--muted); font-size: 15px; font-weight: 700; cursor: pointer;
}
.tab-btn.active { color: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%) translateY(10px);
  background: #0b101b; color: var(--ink);
  border: 1px solid rgba(232,179,75,0.5); border-radius: 12px;
  padding: 12px 18px; font-size: 14px; max-width: 86%;
  opacity: 0; transition: opacity 0.25s, transform 0.25s;
  pointer-events: none; z-index: 50; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti-piece { position: absolute; top: -14px; border-radius: 2px; animation: confetti-fall linear forwards; }
@keyframes confetti-fall { to { transform: translateY(112vh) rotate(720deg); opacity: 0.85; } }
