:root {
  color-scheme: dark;
  --bg: #05090b;
  --panel: #0a1114;
  --panel-2: #0e191c;
  --ink: #f5faf7;
  --muted: #8c9a9a;
  --line: rgba(102, 255, 196, .18);
  --line-strong: rgba(102, 255, 196, .42);
  --tile: #10191c;
  --green: #20e69a;
  --green-2: #00b875;
  --red: #ff6b5f;
  --yellow: #f4d35e;
  --shadow: 0 24px 80px rgba(0, 0, 0, .46);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background:
    radial-gradient(circle at 50% -160px, rgba(32, 230, 154, .24), transparent 360px),
    radial-gradient(circle at 100% 20%, rgba(32, 230, 154, .10), transparent 300px),
    var(--bg);
}

body {
  margin: 0;
  min-height: 100svh;
  background: transparent;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  width: min(520px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  border-inline: 1px solid rgba(255, 255, 255, .06);
  background:
    linear-gradient(180deg, rgba(13, 24, 26, .88), rgba(5, 9, 11, .96)),
    var(--bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.6), transparent 75%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  min-height: 66px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  background: rgba(5, 9, 11, .86);
  backdrop-filter: blur(18px);
  padding: env(safe-area-inset-top) 12px 0;
}

.wordmark {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: .12em;
}

.wordmark img {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  box-shadow: 0 0 28px rgba(32, 230, 154, .28);
}

.icon-button,
.install-button,
.warning-button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  font-weight: 900;
}

.icon-button {
  width: 36px;
  font-size: 1.05rem;
}

.install-button {
  justify-self: end;
  border-color: var(--line);
  padding: 0 10px;
  color: var(--green);
  font-size: .76rem;
}

.warning-button {
  justify-self: end;
  width: 36px;
  font-size: 1.05rem;
}

main {
  position: relative;
  padding: 14px 14px 30px;
}

.summary-strip,
.player-card,
.score-card {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.player-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .025));
}

.score-card {
  gap: 8px;
}

.score-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 11px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .025));
}

.summary-strip {
  grid-template-columns: repeat(3, 1fr);
}

.summary-strip div {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .025));
  text-align: center;
}

.micro-label,
.summary-strip span,
.card-head span {
  color: var(--muted);
  font-size: .69rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.player-card strong,
.score-row strong,
.summary-strip strong {
  font-size: 1.08rem;
}

.small-action,
.text-action,
.secondary-action {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  color: var(--green);
  font-weight: 900;
}

.small-action {
  min-height: 36px;
  padding: 0 12px;
}

.text-action {
  min-height: 30px;
  padding: 0 10px;
  font-size: .75rem;
}

.secondary-action {
  min-height: 50px;
  width: 100%;
  color: var(--ink);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(64px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 14px;
  background: rgba(255, 255, 255, .035);
}

.segmented.wide {
  grid-template-columns: repeat(3, 1fr);
}

.segment {
  min-height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 900;
}

.segment.active {
  background: var(--green);
  color: #02100b;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 14px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 16px;
  background: rgba(255, 255, 255, .035);
}

.tab {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
  line-height: 1.05;
  padding: 0 6px;
}

.tab.active {
  background: linear-gradient(135deg, var(--green), var(--green-2));
  color: #02100b;
  box-shadow: 0 10px 28px rgba(32, 230, 154, .26);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.daily-card,
.month-card,
#leaderboard,
#people,
#signup {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .068), rgba(255, 255, 255, .028)),
    var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 18px 48px rgba(0, 0, 0, .22);
}

.daily-card {
  position: relative;
  text-align: center;
  overflow: hidden;
}

.subcopy {
  position: relative;
  margin-top: 8px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 800;
}

.daily-card::before {
  content: "";
  position: absolute;
  inset: -120px 30% auto;
  height: 220px;
  border-radius: 50%;
  background: rgba(32, 230, 154, .18);
  filter: blur(40px);
}

.hero-lockup,
.ticker-preview,
.pick-form,
.message,
h1 {
  position: relative;
}

.hero-lockup {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.hero-lockup img {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  box-shadow: 0 0 48px rgba(32, 230, 154, .28);
}

.kicker {
  margin: 0;
  color: var(--green);
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.75rem, 7vw, 2.45rem);
  line-height: 1.02;
  letter-spacing: -.02em;
}

.ticker-preview {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 54px));
  justify-content: center;
  gap: 7px;
  margin: 24px auto 18px;
}

.letter-tile {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 13px;
  background: rgba(255, 255, 255, .035);
  color: var(--ink);
  font-size: 1.28rem;
  font-weight: 950;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.letter-tile.filled {
  border-color: rgba(32, 230, 154, .58);
  background: rgba(32, 230, 154, .10);
}

.letter-tile.locked {
  border-color: rgba(32, 230, 154, .82);
  background: linear-gradient(135deg, var(--green), var(--green-2));
  color: #02100b;
  box-shadow: 0 8px 22px rgba(32, 230, 154, .18);
}

.pick-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 9px;
  max-width: 372px;
  margin: 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

input {
  min-height: 52px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  background: rgba(2, 9, 10, .72);
  color: var(--ink);
  padding: 0 12px;
  text-align: center;
  text-transform: uppercase;
  font-size: 1.12rem;
  font-weight: 950;
  letter-spacing: .06em;
  outline: none;
}

input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(32, 230, 154, .12);
}

input:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: .58;
}

select {
  min-height: 52px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  background: rgba(2, 9, 10, .72);
  color: var(--ink);
  padding: 0 12px;
  font-size: 1rem;
  font-weight: 850;
  outline: none;
}

select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(32, 230, 154, .12);
}

.lock-button {
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--green), var(--green-2));
  color: #02100b;
  padding: 0 16px;
  font-weight: 950;
  box-shadow: 0 12px 30px rgba(32, 230, 154, .24);
}

.message {
  min-height: 24px;
  margin-top: 14px;
  color: var(--muted);
  font-size: .94rem;
  font-weight: 800;
}

.lock-status,
.server-stamp,
.micro-status {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 850;
  line-height: 1.4;
}

.lock-status {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 10px auto 0;
  border: 1px solid rgba(32, 230, 154, .18);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(32, 230, 154, .07);
  color: var(--green);
}

.live-note {
  position: relative;
  margin-top: 6px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
}

.reward-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.reward-row div {
  display: grid;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 14px;
  padding: 10px 6px;
  background: rgba(255, 255, 255, .035);
}

.reward-row span,
.leader-note,
.account-form label,
.leader-preview span,
.social-grid label span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.reward-row strong {
  color: var(--ink);
  font-size: 1.08rem;
}

.server-stamp {
  position: relative;
  margin-top: 10px;
}

.game-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.utility-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, .03);
}

.utility-card.full {
  grid-template-columns: 1fr;
}

.utility-card strong,
.utility-card p {
  display: block;
}

.utility-card p {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 800;
}

.utility-card textarea {
  grid-column: 1 / -1;
  min-height: 82px;
  resize: none;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 14px;
  background: rgba(2, 9, 10, .72);
  color: var(--ink);
  padding: 10px;
  font: 850 .82rem/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.mini-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.mini-form input {
  min-height: 42px;
  font-size: .9rem;
}

.compact {
  margin-bottom: 0;
}

.toggle-list {
  display: grid;
  gap: 8px;
}

.toggle-list label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 850;
}

.toggle-list input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--green);
}

.gain {
  color: var(--green);
}

.loss {
  color: var(--red);
}

.month-card {
  margin-top: 14px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.card-head strong {
  font-size: 1rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.day-cell {
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
  color: var(--muted);
  font-size: clamp(.57rem, 2vw, .72rem);
  font-weight: 900;
  overflow: hidden;
  text-align: center;
}

.day-cell strong,
.day-cell span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-cell.picked {
  border-color: rgba(32, 230, 154, .82);
  background: linear-gradient(135deg, rgba(32, 230, 154, .95), rgba(0, 184, 117, .95));
  color: #02100b;
}

.day-cell.picked span {
  color: #02100b;
}

.day-cell.pending {
  border-color: rgba(244, 211, 94, .8);
  background: rgba(244, 211, 94, .14);
  color: var(--yellow);
}

.day-cell.pending span {
  color: var(--yellow);
}

.leaderboard {
  display: grid;
  gap: 7px;
}

.friend-board {
  margin-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  padding-top: 16px;
}

.leader-note {
  margin: -5px 0 12px;
}

.leader-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 15px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, .032);
}

.leader-row.me {
  border-color: var(--line-strong);
  background: rgba(32, 230, 154, .08);
}

.rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .055);
  color: var(--green);
  font-weight: 950;
}

.person strong,
.person span {
  display: block;
}

.person span,
.leader-picks {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.leader-return {
  justify-self: end;
  font-weight: 950;
}

.people-layout {
  display: grid;
  justify-items: center;
  gap: 18px;
}

canvas {
  width: min(100%, 300px);
  height: auto;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, .28));
}

.legend {
  display: grid;
  width: 100%;
  gap: 8px;
}

.legend-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 12px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
  font-size: .86rem;
  font-weight: 850;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 5px;
}

.legend-item strong {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty-state {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
}

.signup-card {
  display: grid;
  gap: 18px;
  text-align: center;
}

.signup-card img {
  justify-self: center;
  width: 84px;
  height: 84px;
  border-radius: 24px;
  box-shadow: 0 0 48px rgba(32, 230, 154, .28);
}

.signup-card p {
  color: var(--muted);
  line-height: 1.55;
}

.account-form {
  display: grid;
  gap: 10px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, .03);
}

.form-title {
  display: grid;
  gap: 3px;
}

.form-title strong {
  color: var(--ink);
  font-size: .95rem;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 8px;
}

.social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.social-grid label {
  display: grid;
  gap: 6px;
}

.social-icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.social-icon {
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 16px;
  background: rgba(255, 255, 255, .04);
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 950;
}

.social-icon.active {
  border-color: var(--green);
  background: rgba(32, 230, 154, .14);
  color: var(--green);
}

.muted-icon {
  color: var(--muted);
}

.leader-preview {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(32, 230, 154, .06);
}

.leader-preview a {
  color: var(--green);
  font-size: .95rem;
  font-weight: 900;
  text-decoration: none;
}

.leader-preview a:not(.disabled-link):hover,
.leader-link:hover {
  text-decoration: underline;
}

.leader-preview .disabled-link {
  color: var(--muted);
  pointer-events: none;
}

.leader-link {
  color: var(--green);
  text-decoration: none;
}

.profile-social-link {
  display: block;
  margin-top: 2px;
  color: var(--green);
  font-size: .78rem;
  font-weight: 850;
  text-decoration: none;
}

.profile-social-link.disabled-link {
  color: var(--muted);
  pointer-events: none;
}

dialog {
  width: min(330px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 0;
  background: var(--panel-2);
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(0, 0, 0, .68);
}

dialog form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

dialog h2 {
  font-size: 1.4rem;
}

dialog p {
  color: var(--muted);
  line-height: 1.5;
}

dialog textarea {
  min-height: 132px;
  resize: none;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 14px;
  background: rgba(2, 9, 10, .72);
  color: var(--ink);
  padding: 12px;
  font: 850 .88rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.toast-stack {
  position: fixed;
  right: max(14px, calc((100vw - 520px) / 2 + 14px));
  bottom: 16px;
  z-index: 20;
  display: grid;
  gap: 8px;
  width: min(320px, calc(100vw - 28px));
}

.toast {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 12px;
  background: rgba(10, 17, 20, .96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .34);
}

.toast strong {
  color: var(--ink);
  font-size: .95rem;
}

.toast span {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.35;
}

@media (max-width: 540px) {
  .app-shell {
    border-inline: 0;
  }

  main {
    padding-inline: 10px;
  }

  .daily-card,
  .month-card,
  #leaderboard,
  #people,
  #signup {
    padding: 14px;
    border-radius: 22px;
  }

  .wordmark span {
    font-size: .92rem;
  }

  .wordmark img {
    width: 34px;
    height: 34px;
  }

  .hero-lockup img {
    width: 66px;
    height: 66px;
    border-radius: 20px;
  }
}

@media (max-width: 380px) {
  .topbar {
    grid-template-columns: 42px 1fr 62px;
  }

  .wordmark {
    gap: 7px;
    letter-spacing: .08em;
  }

  .install-button {
    padding-inline: 7px;
    font-size: .72rem;
  }

  .ticker-preview {
    gap: 5px;
  }

  .pick-form,
  .inline-form,
  .social-grid {
    grid-template-columns: 1fr;
  }

  .tab {
    font-size: .66rem;
    padding-inline: 2px;
  }
}
