:root {
  --bg: #020617;
  --bg-soft: #07111f;
  --card: #08192b;
  --card-soft: #0d1c2f;
  --summary: #031b22;
  --ink: #f8fafc;
  --muted: #94a3b8;
  --line: #24455d;
  --teal: #14b8a6;
  --brand: #2dd4bf;
  --safe: #22c55e;
  --gold: #fbbf24;
  --green-deep: #05602f;
  --red-deep: #b91c1c;
  --pending-bg: #3d2816;
  --pending-text: #fed7aa;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 50% -8rem, rgba(20, 184, 166, 0.12), transparent 18rem),
    linear-gradient(135deg, #020617 0%, #07111f 52%, #0f172a 100%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.phone-shell {
  width: min(100%, 560px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 12px calc(126px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 8;
  min-height: 94px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.98) 0%, rgba(2, 6, 23, 0.92) 72%, rgba(2, 6, 23, 0) 100%);
  backdrop-filter: blur(12px);
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 19px;
  color: var(--ink);
  background: #08192b;
  border: 1px solid var(--line);
  font-weight: 900;
  font-size: 20px;
  display: grid;
  place-items: center;
}

.brand-block {
  text-align: center;
  min-width: 0;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex: 0 0 auto;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-safe {
  color: var(--safe);
}

.brand-pick {
  color: #ffffff;
}

.brand-bets {
  color: var(--teal);
}

.brand-block p {
  margin-top: 4px;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 800;
}

.account-panel {
  position: fixed;
  top: calc(106px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: min(calc(100% - 24px), 536px);
  max-height: calc(100dvh - 126px - env(safe-area-inset-bottom));
  overflow: auto;
  padding: 13px;
  border: 1px solid #374e68;
  border-radius: 10px;
  background: var(--card-soft);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.54);
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.plan-pill,
.status-pill,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 900;
}

.plan-pill {
  min-height: 28px;
  padding: 0 12px;
  color: #031b22;
  background: #e0fceb;
}

.plan-pill.premium {
  background: #fff5d6;
  color: #f97316;
}

.premium-line {
  margin-top: 8px;
  color: #becbdb;
  font-size: 13px;
  font-weight: 800;
}

.auth-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #374e68;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #08192b;
  font-weight: 800;
}

input:focus {
  outline: 2px solid rgba(20, 184, 166, 0.26);
  border-color: var(--teal);
}

.password-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
}

.password-wrap button {
  min-height: 44px;
  border-radius: 8px;
  color: var(--ink);
  background: #08192b;
  border: 1px solid var(--line);
}

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

.action-button {
  min-height: 42px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--teal);
  font-weight: 900;
}

.action-button.ghost {
  color: var(--ink);
  background: #08192b;
  border: 1px solid var(--line);
}

.action-button.danger {
  width: 100%;
  margin-top: 12px;
  background: var(--red-deep);
}

.install-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 30px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(20, 184, 166, 0.44);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(3, 27, 34, 0.98), rgba(8, 25, 43, 0.96));
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.42);
}

.install-card img {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  object-fit: cover;
}

.install-card strong {
  display: block;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 900;
}

.install-card p {
  margin-top: 2px;
  color: #b8c6d8;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.install-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  color: #031b22;
  background: #37e5d5;
  font-size: 12px;
  font-weight: 950;
}

.install-dismiss {
  width: 30px;
  height: 30px;
  border-radius: 15px;
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.12);
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
}

.ios-install-card {
  grid-template-columns: 42px minmax(0, 1fr) 30px;
  border-color: rgba(251, 191, 36, 0.38);
  background: linear-gradient(135deg, rgba(38, 30, 12, 0.96), rgba(8, 25, 43, 0.96));
}

.ios-install-card strong {
  color: #fff7d6;
}

.ios-install-card p {
  color: #fde68a;
}

.plan-tabs {
  position: sticky;
  top: 98px;
  z-index: 7;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #08192b;
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.45);
}

.plan-tab {
  min-height: 48px;
  border-radius: 9px;
  color: #cbd5e1;
  background: transparent;
  font-weight: 900;
}

.plan-tab.active {
  color: #051218;
  background: linear-gradient(135deg, #2ed9cc, #37e5d5);
}

.content-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
  padding: 10px 4px 0;
}

.odds-subtabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 14px;
}

.odds-subtab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #cbd5e1;
  background: #08192b;
  font-size: 13px;
  font-weight: 900;
}

.odds-subtab.active {
  color: #051218;
  border-color: var(--teal);
  background: linear-gradient(135deg, #2ed9cc, #37e5d5);
}

.loading {
  width: 48px;
  height: 48px;
  margin: 18px auto;
  border-radius: 50%;
  border: 7px solid rgba(45, 212, 191, 0.15);
  border-top-color: var(--teal);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.status-message {
  margin: 0 0 12px;
  color: #a7b7c9;
  font-size: 12px;
  font-weight: 800;
}

.section-count {
  margin: -4px 4px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 4px 14px;
  font-size: 30px;
  line-height: 1.05;
}

.section-title .section-icon {
  font-size: 30px;
}

.summary-card,
.pick-card,
.empty-card,
.premium-card,
.past-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 25, 43, 0.92);
}

.summary-card,
.pick-card,
.past-details {
  content-visibility: auto;
  contain-intrinsic-size: 1px 260px;
}

.summary-card {
  position: relative;
  margin-bottom: 14px;
  padding: 18px 18px 16px;
  border-color: var(--teal);
  background: var(--summary);
  overflow: visible;
}

.summary-card h2 {
  color: var(--teal);
  font-size: 26px;
}

.summary-card .meta,
.pick-meta,
.past-meta {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.record-line {
  margin: 0;
  font-size: 19px;
  font-weight: 900;
  color: #dbe4ef;
}

.record-line .won,
.result-word.won {
  color: #22c55e;
}

.record-line .lost,
.result-word.lost {
  color: #ef4444;
}

.record-line .pending,
.result-word.pending {
  color: var(--gold);
}

.summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.hit-rate {
  min-width: 70px;
  text-align: right;
  color: var(--teal);
  font-weight: 900;
}

.hit-rate strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.hit-rate span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
}

.odds-box {
  clear: both;
  width: min(100%, 350px);
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  color: var(--ink);
  background: #031b22;
  font-size: 18px;
  font-weight: 900;
}

.pick-list {
  display: grid;
  gap: 12px;
  padding-bottom: 12px;
}

.pick-card {
  padding: 14px 12px 16px;
}

.pick-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.pick-number {
  width: 28px;
  height: 28px;
  border: 1px solid #0d9488;
  border-radius: 7px;
  color: var(--brand);
  background: #074643;
  font-size: 12px;
  font-weight: 900;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.pick-title {
  min-width: 0;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.pick-title .vs {
  color: var(--brand);
}

.status-pill {
  min-height: 24px;
  padding: 0 8px;
  color: var(--pending-text);
  background: var(--pending-bg);
  font-size: 9px;
  white-space: nowrap;
}

.status-pill.won {
  color: #ffffff;
  background: var(--green-deep);
}

.status-pill.lost {
  color: #ffffff;
  background: var(--red-deep);
}

.pick-meta {
  margin-left: 36px;
  font-size: 12px;
}

.bet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
  margin: 16px 8px 0 36px;
}

.bet-text {
  min-width: 0;
  color: var(--brand);
  font-size: 15px;
  font-weight: 900;
}

.prob-line {
  margin: 9px 0 0 36px;
  color: var(--muted);
  font-size: 12px;
}

.copy-chip {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 5px;
  color: #020b1a;
  background: var(--teal);
  border: 2px solid var(--teal);
  font-size: 7px;
  font-weight: 900;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0 36px;
}

.chip {
  min-height: 24px;
  padding: 0 9px;
  color: #05602f;
  background: #e0fceb;
  font-size: 12px;
}

.chip.safety-high,
.chip.confidence-strong {
  color: #05602f;
}

.chip.safety-low,
.chip.confidence-low {
  color: #b91c1c;
  background: #ffe8ed;
}

.chip.pending-chip {
  color: #7c2d12;
  background: #fff5d6;
}

.empty-card,
.premium-card,
.past-card {
  padding: 18px;
}

.empty-card {
  color: var(--muted);
  font-weight: 800;
}

.premium-card {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px;
  border-color: var(--teal);
  background:
    radial-gradient(circle at 80% 0%, rgba(8, 55, 106, 0.7), transparent 13rem),
    linear-gradient(160deg, #020b1a, #031b3d);
}

.premium-card h2 {
  max-width: 420px;
  margin: 0 auto 10px;
  color: #f5f7fa;
  font-size: 22px;
  line-height: 1.18;
  text-align: center;
}

.premium-card-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.premium-benefits {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.premium-benefits li {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 5px 0;
  border-top: 1px solid rgba(20, 184, 166, 0.36);
  color: #e6eef8;
  font-weight: 900;
}

.premium-benefits li:first-child {
  border-top: 0;
}

.premium-check {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #34f5c5;
  background: rgba(20, 184, 166, 0.2);
  font-size: 20px;
  line-height: 1;
}

.upgrade-button {
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  border: 1px solid #2ed9cc;
  border-radius: 12px;
  color: #051218;
  background: linear-gradient(90deg, #2ed9cc, #37e5d5);
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(46, 217, 204, 0.2);
}

.upgrade-button:hover,
.upgrade-button:focus-visible {
  filter: brightness(1.07);
}

.upgrade-button:active {
  transform: translateY(1px);
}

.past-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}

.filter-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #d1d5db;
  background: #0b1222;
  font-weight: 900;
}

.filter-button.active {
  color: var(--teal);
  border: 2px solid var(--teal);
  background: rgba(20, 184, 166, 0.08);
}

.past-list {
  display: grid;
  gap: 12px;
}

.past-entry {
  display: grid;
  gap: 10px;
  content-visibility: auto;
  contain-intrinsic-size: 1px 320px;
}

.past-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.past-card:hover,
.past-entry.expanded .past-card {
  border-color: var(--teal);
  background: rgba(8, 38, 53, 0.96);
}

.past-card-copy {
  min-width: 0;
}

.past-chevron {
  color: var(--teal);
  font-size: 16px;
  font-weight: 900;
}

.past-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--teal);
  font-size: 28px;
}

.past-card h3 {
  font-size: 24px;
}

.past-details {
  display: grid;
  gap: 12px;
  padding-left: 10px;
  border-left: 3px solid var(--teal);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 4px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border: 1px solid #12344a;
  border-radius: 22px;
  background: #061624;
  box-shadow: 0 -16px 34px rgba(2, 6, 23, 0.64);
  width: min(calc(100% - 24px), 536px);
  box-sizing: border-box;
}

.bottom-item {
  min-width: 0;
  min-height: 68px;
  border-radius: 16px;
  color: #94a3b8;
  background: transparent;
  font-size: 12px;
  font-weight: 900;
  display: grid;
  place-items: center;
  gap: 4px;
}

.bottom-item span {
  font-size: 24px;
}

.bottom-item.active {
  color: #dffcf9;
  background: #064e42;
}

.bottom-item[hidden] {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  z-index: 10;
  min-width: 180px;
  max-width: calc(100vw - 40px);
  padding: 11px 14px;
  border-radius: 999px;
  color: #031b22;
  background: var(--teal);
  text-align: center;
  font-weight: 900;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.38);
}

.load-more {
  display: grid;
  gap: 10px;
  justify-items: center;
  margin: 14px 0 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(8, 25, 43, 0.7);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.load-more::before {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 4px solid rgba(45, 212, 191, 0.18);
  border-top-color: var(--teal);
  animation: spin 0.9s linear infinite;
}

.load-more.complete::before {
  content: none;
}

.load-more button {
  min-height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  color: #051218;
  background: var(--teal);
  font-weight: 900;
}

.load-more.complete {
  color: var(--teal);
}

@media (min-width: 760px) {
  .phone-shell {
    padding-top: 28px;
  }
}

@media (max-width: 390px) {
  .phone-shell {
    padding-left: 8px;
    padding-right: 8px;
  }

  .section-title {
    font-size: 28px;
  }

  .pick-title {
    font-size: 18px;
  }

  .past-filters {
    gap: 6px;
  }

  .filter-button {
    font-size: 13px;
  }

  .bottom-nav {
    width: min(calc(100% - 16px), 536px);
    gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-radius: 18px;
  }

  .bottom-item {
    min-height: 60px;
    font-size: 11px;
  }

  .bottom-item span {
    font-size: 21px;
  }
}
