:root {
  color-scheme: light;
  --ink: #07152f;
  --muted: #506070;
  --line: #d9e5d5;
  --surface: #f5faf3;
  --card: #ffffff;
  --navy: #002776;
  --blue: #1f63c7;
  --red: #009c3b;
  --pale-blue: #fff8d6;
  --shadow: 0 14px 32px rgba(0, 39, 118, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  background: #e8f4e8;
  overflow-x: hidden;
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(0, 156, 59, 0.18) 0 14%, transparent 14% 28%, rgba(255, 223, 0, 0.32) 28% 42%, transparent 42% 56%, rgba(0, 39, 118, 0.14) 56%),
    linear-gradient(180deg, #f8fff7 0%, #ffffff 42%, #e8f4e8 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: 100%;
  max-width: 460px;
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 24px);
  overflow-x: hidden;
}

.app-shell > * {
  max-width: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 9px;
}

.brand-block {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
}

.brand-mark {
  width: 124px;
  height: 124px;
  flex: 0 0 auto;
  border-radius: 16px;
  object-fit: cover;
  filter: drop-shadow(0 8px 12px rgba(10, 49, 97, 0.18));
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.62rem;
  line-height: 1;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.12rem;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(10, 49, 97, 0.18);
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 20px rgba(20, 42, 35, 0.08);
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.account-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(10, 49, 97, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.account-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.account-status > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.account-status > div > strong,
.account-status > div > span {
  display: block;
}

.account-status strong {
  color: var(--navy);
  font-size: 1.08rem;
  line-height: 1.08;
}

.signed-in-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  border: 1px solid rgba(0, 158, 61, 0.2);
  border-radius: 8px;
  padding: 5px 9px;
  background: linear-gradient(135deg, rgba(0, 158, 61, 0.12), rgba(255, 205, 0, 0.16));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  font-size: 1.18rem;
  font-weight: 950;
  letter-spacing: 0;
}

.signed-in-flag {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.signed-in-flag:empty {
  display: none;
}

.signed-in-flag .fan-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
}

.signed-in-text {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-status strong .fan-flag {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.fan-flag .flag {
  font-size: 1.05em;
}

.fan-flag .flag-image {
  display: inline-block;
  width: 1.28em;
  height: 0.86em;
  vertical-align: -0.08em;
}

.account-status > div > span,
.status-line {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

#accountSubtitle {
  overflow-wrap: anywhere;
}

.welcome-countdown {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(0, 158, 61, 0.16);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(239, 245, 252, 0.88), rgba(255, 255, 255, 0.9));
}

.welcome-countdown-title {
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.15;
}

.welcome-countdown-units {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.welcome-countdown-units span {
  display: grid;
  min-width: 0;
  gap: 2px;
  border: 1px solid rgba(10, 49, 97, 0.1);
  border-radius: 8px;
  padding: 7px 5px;
  background: rgba(255, 255, 255, 0.76);
  text-align: center;
}

.welcome-countdown-units strong {
  color: var(--navy);
  font-size: 1.18rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.welcome-countdown-units small,
.welcome-countdown-match {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.welcome-countdown-units small {
  overflow-wrap: anywhere;
}

.welcome-countdown-match {
  display: block;
  overflow-wrap: anywhere;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.account-grid label:first-child {
  grid-column: 1 / -1;
}

.account-grid > label:not(.is-hidden) {
  grid-column: 1 / -1;
}

.language-picker:not(.is-hidden) {
  display: grid;
  grid-column: 1 / -1;
  gap: 6px;
}

.language-picker > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.language-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.language-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.88);
  font-weight: 900;
  line-height: 1;
}

.language-option:focus-visible {
  outline: 2px solid rgba(0, 39, 118, 0.42);
  outline-offset: 2px;
}

.language-option.is-active {
  border-color: rgba(0, 156, 59, 0.34);
  background: rgba(0, 156, 59, 0.11);
  box-shadow: inset 0 0 0 1px rgba(0, 156, 59, 0.12);
}

.language-flag {
  font-size: 1.25rem;
  line-height: 1;
}

.language-native-select {
  display: none;
}

.account-status .language-picker:not(.is-hidden) {
  display: grid;
  flex: 0 0 auto;
  grid-column: auto;
  gap: 0;
}

.account-status .language-picker > span {
  display: none;
}

.account-status .language-options {
  display: flex;
  gap: 6px;
}

.account-status .language-option {
  width: 42px;
  min-height: 34px;
  padding: 0;
}

.account-status .language-option span:not(.language-flag) {
  display: none;
}

.account-status .language-flag {
  font-size: 1.18rem;
}

.competition-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.competition-actions {
  display: flex;
  gap: 8px;
}

.invite-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(10, 49, 97, 0.12);
  border-radius: 8px;
  background: rgba(239, 245, 252, 0.82);
}

.invite-panel strong,
.invite-panel span {
  display: block;
}

.invite-panel span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.invite-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.invite-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 850;
  text-decoration: none;
}

.invite-link img {
  width: 24px;
  height: 24px;
}

.invite-link-whatsapp {
  color: #063b1f;
  background: #dff8e8;
  border: 1px solid rgba(37, 211, 102, 0.42);
}

.invite-link-teams {
  color: #ffffff;
  background: #5059c9;
  border: 1px solid rgba(80, 89, 201, 0.42);
}

.invite-link-teams img {
  padding: 3px;
  border-radius: 6px;
  background: #ffffff;
}

.invite-link-teams span {
  color: #ffffff;
}

.ghost-action {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--navy);
  background: #ffffff;
  font-weight: 850;
}

.status-line {
  margin: -2px 0 0;
  overflow-wrap: anywhere;
}

.is-hidden {
  display: none !important;
}

.score-strip div {
  min-width: 0;
  padding: 13px 10px;
  border: 1px solid rgba(10, 49, 97, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.score-strip span,
.score-strip small {
  display: block;
  text-align: center;
}

.score-strip span {
  font-size: 1.28rem;
  font-weight: 850;
}

.score-strip small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.tabs {
  position: sticky;
  top: env(safe-area-inset-top);
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 14px;
  padding: 5px;
  border: 1px solid rgba(10, 49, 97, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.tab {
  min-width: 0;
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  padding: 0 6px;
  color: var(--muted);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.tab.is-active {
  color: #ffffff;
  background: var(--navy);
  box-shadow: 0 8px 14px rgba(10, 49, 97, 0.22);
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
}

.search-toolbar {
  grid-template-columns: minmax(0, 1fr) 170px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

select,
input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
}

.primary-action {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 15px;
  color: #ffffff;
  background: var(--red);
  font-weight: 850;
}

.card-list {
  display: grid;
  gap: 10px;
}

.match-card,
.leader-card {
  border: 1px solid rgba(21, 33, 29, 0.09);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.match-card {
  padding: 14px;
}

.match-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.match-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.venue-line {
  margin-top: -6px;
  margin-bottom: 12px;
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.fixture {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  margin-bottom: 13px;
}

.team {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  font-size: 1rem;
  font-weight: 850;
}

.team-name-home {
  justify-content: flex-start;
}

.team-name-away {
  justify-content: flex-end;
  text-align: right;
}

.team-flag-home,
.team-flag-away {
  justify-content: center;
}

.team-away {
  justify-content: flex-end;
  text-align: right;
}

.flag {
  flex: 0 0 auto;
  font-size: 2.64rem;
  line-height: 1;
}

.flag-image {
  display: block;
  width: 2.9rem;
  height: 1.95rem;
  object-fit: cover;
  background: #ffffff;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(10, 49, 97, 0.12);
}

.versus {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--navy);
  background: var(--pale-blue);
  font-size: 0.72rem;
  font-weight: 900;
}

.score-entry {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 8px;
}

.score-entry input {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 850;
}

.score-entry span {
  padding-bottom: 13px;
  color: var(--muted);
  font-weight: 900;
}

.points-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-top: 12px;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--navy);
  background: #eef4fb;
  font-size: 0.78rem;
  font-weight: 850;
}

.pick-view {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--pale-blue);
}

.pick-view strong,
.pick-view span {
  display: block;
}

.pick-view strong {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.pick-view span {
  color: var(--navy);
  font-weight: 900;
}

.pick-view.is-hidden-pick {
  background: #f4f6fa;
}

.pick-view.is-hidden-pick span {
  color: var(--muted);
}

.match-status {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--pale-blue);
}

.match-status.is-compact {
  margin-top: 10px;
  padding: 9px 10px;
}

.match-status strong,
.match-status span {
  display: block;
}

.match-status strong {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.match-status span {
  color: var(--navy);
  font-weight: 900;
}

.match-status.is-live {
  background: rgba(186, 12, 47, 0.1);
}

.match-status.is-live strong,
.match-status.is-live span {
  color: var(--red);
}

.match-status.is-halftime {
  background: rgba(255, 205, 0, 0.2);
}

.match-status.is-halftime strong,
.match-status.is-halftime span {
  color: #765a00;
}

.match-status.is-final {
  background: rgba(10, 49, 97, 0.1);
}

.match-status.is-past {
  background: #f4f6fa;
}

.sync-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.sync-meta.is-warning {
  color: var(--red);
}

.pick-view.is-official-result {
  background: rgba(10, 49, 97, 0.08);
}

.inline-action {
  width: fit-content;
  min-height: 36px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 900;
  padding: 7px 12px;
}

.leaderboard-head {
  margin-bottom: 12px;
}

.leaderboard-head.compact-head {
  margin-bottom: 10px;
}

.leaderboard-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

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

.score-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.score-table-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 56px 58px 72px;
  align-items: center;
  min-height: 54px;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 9px 10px;
  color: var(--navy);
  font-weight: 850;
}

.score-table-row:first-child {
  border-top: 0;
}

.score-table-head {
  min-height: 38px;
  background: var(--navy);
  color: #ffffff;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.score-table-row span:not(.rank),
.score-table-row strong {
  min-width: 0;
}

.score-table-row .leader-name {
  overflow-wrap: anywhere;
}

.leader-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 12px;
}

.rank {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--red);
  font-weight: 900;
}

.leader-name {
  display: block;
  font-weight: 850;
}

.leader-identity {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 7px;
  min-width: 0;
}

.leader-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 24px;
  min-height: 20px;
  border-radius: 6px;
  background: rgba(239, 245, 252, 0.9);
}

.leader-flag .fan-flag {
  display: inline-flex;
  align-items: center;
}

.leader-player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-detail {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.leader-points {
  color: var(--navy);
  font-size: 1.16rem;
  font-weight: 900;
}

.score-table-head .leader-points {
  color: #ffffff;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.rules-grid article {
  min-height: 106px;
  padding: 14px;
  border: 1px solid rgba(21, 33, 29, 0.09);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.rules-grid strong,
.rules-grid span {
  display: block;
}

.rules-grid strong {
  color: var(--red);
  font-size: 2rem;
  line-height: 1;
}

.rules-grid span {
  margin-top: 10px;
  color: var(--ink);
  font-weight: 800;
}

.note {
  margin-top: 12px;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 12px;
  color: #14345d;
  background: #eef4fb;
  font-size: 0.9rem;
  line-height: 1.42;
}

dialog {
  width: min(calc(100% - 28px), 420px);
  border: 0;
  border-radius: 12px;
  padding: 0;
  color: var(--ink);
  background: transparent;
}

dialog::backdrop {
  background: rgba(13, 24, 20, 0.45);
}

.dialog-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}

.dialog-card menu {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 2px 0 0;
  padding: 0;
}

.dialog-card menu button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #ffffff;
  font-weight: 800;
}

.dialog-card menu .primary-action {
  border: 0;
  background: var(--red);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.empty {
  padding: 20px;
  border: 1px dashed #bdc8c3;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  text-align: center;
  font-weight: 750;
}

@media (max-width: 430px) {
  html,
  body {
    position: relative;
    max-width: 100vw;
  }

  .app-shell {
    width: 100vw;
    max-width: 100vw;
    padding: calc(env(safe-area-inset-top) + 10px) 10px calc(env(safe-area-inset-bottom) + 18px);
  }

  .topbar {
    gap: 10px;
    padding: 5px 0 6px;
  }

  .brand-block {
    gap: 10px;
  }

  .brand-mark {
    width: 104px;
    height: 104px;
  }

  .eyebrow {
    margin-bottom: 2px;
    font-size: 0.68rem;
  }

  h1 {
    font-size: 1.34rem;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .account-panel {
    gap: 10px;
    padding: 10px;
  }

  .account-status {
    gap: 8px;
  }

  .account-status strong {
    font-size: 1rem;
  }

  .welcome-countdown {
    gap: 8px;
    padding: 9px;
  }

  .welcome-countdown-units {
    gap: 5px;
  }

  .welcome-countdown-units span {
    padding: 6px 3px;
  }

  .welcome-countdown-units strong {
    font-size: 1.04rem;
  }

  .welcome-countdown-units small,
  .welcome-countdown-match {
    font-size: 0.62rem;
  }

  .signed-in-name {
    font-size: 1.06rem;
    padding: 5px 8px;
  }

  .ghost-action,
  .primary-action,
  select,
  input {
    min-height: 40px;
  }

  .score-strip {
    gap: 7px;
    margin-bottom: 10px;
  }

  .score-strip div {
    padding: 10px 8px;
  }

  .score-strip span {
    font-size: 1.14rem;
  }

  .tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 12px;
    padding: 4px;
  }

  .tab {
    min-height: 36px;
  }

  .toolbar {
    gap: 8px;
  }

  .match-card {
    padding: 12px;
  }

  .fixture {
    column-gap: 6px;
  }

  .team {
    font-size: 0.92rem;
  }

  .flag {
    font-size: 2.25rem;
  }

  .flag-image {
    width: 2.48rem;
    height: 1.67rem;
  }

  .versus {
    width: 30px;
    height: 30px;
  }

  .rules-grid {
    grid-template-columns: 1fr;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .toolbar .primary-action {
    grid-column: span 2;
  }

  .account-grid,
  .competition-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .app-shell {
    padding-inline: 8px;
  }

  h1 {
    font-size: 1.22rem;
  }

  .team {
    font-size: 0.86rem;
  }
}
