:root {
  color-scheme: light;
  --bg: #fbf7f1;
  --surface: rgba(255, 255, 255, 0.96);
  --surface-strong: #ffffff;
  --ink: #171224;
  --muted: #6d6687;
  --line: rgba(116, 95, 177, 0.11);
  --purple: #6f43ea;
  --purple-deep: #4e2db4;
  --purple-soft: #efe8ff;
  --green: #5bb66f;
  --green-soft: #e8f7ea;
  --yellow: #f6c54f;
  --yellow-soft: #fff5d8;
  --blue: #62c7df;
  --blue-soft: #eaf9ff;
  --red: #d75e79;
  --pink: #ef7198;
  --shadow: 0 22px 54px rgba(102, 67, 188, 0.14);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 0% 0%, rgba(111, 67, 234, 0.18), transparent 28rem),
    radial-gradient(circle at 100% 20%, rgba(98, 199, 223, 0.18), transparent 24rem),
    linear-gradient(180deg, #fffdfa 0%, #f7f0ff 100%);
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

[hidden] { display: none !important; }

.auth-shell {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #fffdfa, #f1eaff);
}

.auth-shell.authenticated { display: none; }
.auth-card { width: min(100%, 29rem); margin: 1rem auto; padding: 1.1rem; }
.auth-card img { width: 100%; height: 12rem; object-fit: cover; border-radius: 20px; margin: 1rem 0; }
.auth-card h1 { margin: .25rem 0 1rem; font-size: 2rem; }
.auth-brand { text-align: center; }
.auth-form { display: grid; gap: .9rem; }
.auth-form label, .settings-field { display: grid; gap: .35rem; color: var(--muted); font-size: .85rem; font-weight: 800; }
.auth-form input, .settings-field input {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: .85rem;
  background: #fff; color: var(--ink);
}
.auth-switch { display: block; margin: 1rem auto 0; }
.danger-link { color: var(--red); margin-top: 1rem; }
.admin-users { display: grid; gap: .7rem; margin-top: 1rem; }
.admin-user { padding: .8rem; border: 1px solid var(--line); border-radius: 16px; }
.admin-user-head, .admin-user-actions { display: flex; gap: .5rem; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.admin-user-actions button { border: 0; border-radius: 999px; padding: .45rem .7rem; font-weight: 800; }

.phone-shell {
  min-height: 100vh;
  width: min(100%, 31rem);
  margin: 0 auto;
  padding: max(0.8rem, env(safe-area-inset-top)) 0.9rem max(6rem, env(safe-area-inset-bottom) + 4.9rem);
}

.app-shell {
  position: relative;
}

.screen {
  display: none;
  animation: fade-up 240ms ease;
}

.screen.active {
  display: block;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.homebar {
  margin-bottom: 1rem;
}

.simplebar {
  align-items: flex-end;
  margin-bottom: 1rem;
  min-width: 0;
  overflow: hidden;
}

.compactbar {
  margin-bottom: 0.8rem;
}

.avatar-button,
.icon-button,
.back-button,
.help-button {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 24px rgba(102, 67, 188, 0.12);
  color: var(--purple);
  font-size: 1.1rem;
}

.brand {
  font-size: 1.05rem;
  font-weight: 900;
}

.brand span {
  color: var(--purple);
}

.hero-eyebrow,
.metric-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.hero-copy {
  margin-bottom: 1rem;
}

.hero-copy h1,
.section-title h1,
.section-title h2 {
  margin: 0;
  letter-spacing: 0;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 9vw, 3.15rem);
  line-height: 0.95;
  max-width: 10ch;
}

.hero-text,
.section-title p,
.card p,
.saved-grid-meta,
.challenge-row span,
.badge-card small {
  color: var(--muted);
  line-height: 1.45;
}

.hero-card,
.mini-card,
.tip-card,
.score-card,
.recommendation,
.badges-card,
.challenges-card,
.stats-panel,
.last-analysis,
.scene-card {
  padding: 1rem;
}

.hero-card {
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
  background:
    linear-gradient(180deg, rgba(124, 219, 255, 0.55), rgba(255, 255, 255, 0.95) 48%),
    linear-gradient(135deg, #f0f7ff, #fff4dc);
}

.hero-card h2,
.mini-card h3,
.tip-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.hero-card-copy {
  width: calc(100% - 4rem);
}

.circle-cta {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: 2.9rem;
  height: 2.9rem;
  border: 0;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--purple);
  font-size: 1.15rem;
  font-weight: 900;
}

.scene {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 10.5rem;
  border-radius: 20px;
  background: linear-gradient(180deg, #dff3ff, #fff8ec);
}

.scene.beach {
  margin-top: 0.7rem;
}

.scene.winter {
  height: 11rem;
}

.scene.harbor,
.scene.london {
  width: 6.6rem;
  height: 4.9rem;
  border-radius: 18px;
}

.scene.sticker {
  flex: 0 0 6.6rem;
  width: 6.6rem;
  max-width: 6.6rem;
  height: 4.9rem;
}

.scene-illustration {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quick-grid,
.dual-cards,
.insight-grid,
.summary-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.mini-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  min-height: 8.2rem;
}

.mini-icon {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 18px;
  background: var(--purple-soft);
  font-size: 1.35rem;
}

.tip-card,
.last-analysis,
.stats-panel,
.badges-card,
.challenges-card,
.scene-card,
.score-card,
.recommendation,
.saved-grid {
  margin-top: 0.95rem;
}

.tip-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.9rem;
  align-items: center;
}

.tip-icon,
.tip-bear {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 999px;
}

.tip-icon {
  background: var(--yellow-soft);
}

.tip-bear {
  background: #f6efe5;
}

.section-title,
.section-title.tight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.section-title p {
  margin: 0.25rem 0 0;
}

.linkish {
  border: 0;
  background: transparent;
  color: var(--purple);
  font-weight: 800;
}

.balls-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ball {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
  color: #fff;
}

.ball:nth-child(1) { background: #f1c74f; color: #5c4600; }
.ball:nth-child(2) { background: #f4ab39; color: #633a00; }
.ball:nth-child(3) { background: #67c279; }
.ball:nth-child(4) { background: #5aa8f0; }
.ball:nth-child(5) { background: #5bb66f; }
.ball.chance,
.ball:last-child { background: var(--purple); }

.dual-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.85rem;
}

.dual-metrics strong,
.metric-card strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.05rem;
}

.progress-dots {
  display: flex;
  gap: 0.4rem;
}

.progress-dots span {
  display: block;
  width: 2rem;
  height: 0.22rem;
  border-radius: 999px;
  background: #e6ddfb;
}

.progress-dots span.active {
  background: var(--purple);
}

.number-picker {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.55rem;
}

.pick {
  min-height: 2.8rem;
  border: 1px solid rgba(115, 92, 189, 0.16);
  border-radius: 17px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 800;
}

.pick.active {
  background: linear-gradient(180deg, #80d095, #49a86a);
  color: #fff;
}

.chance-picker-wrap {
  margin-top: 1rem;
}

.chance-picker {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.chance-pick {
  min-height: 2.2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--pink);
  font-weight: 800;
}

.chance-pick.active {
  background: var(--pink);
  color: #fff;
}

.selection-strip {
  margin-top: 1rem;
}

.primary-action {
  width: 100%;
  min-height: 3.45rem;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--purple), var(--purple-deep));
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 18px 26px rgba(95, 62, 195, 0.22);
}

.primary-action.secondary {
  margin-top: 1rem;
}

.form-error {
  min-height: 1.35rem;
  margin: 0.55rem 0 0;
  color: var(--red);
  font-weight: 800;
}

.confetti-bar {
  height: 1.2rem;
  margin-bottom: 0.55rem;
  border-radius: 999px;
  background:
    radial-gradient(circle at 7% 52%, #f0cb53 0 0.18rem, transparent 0.19rem),
    radial-gradient(circle at 18% 28%, #6f43ea 0 0.18rem, transparent 0.19rem),
    radial-gradient(circle at 34% 44%, #5cb975 0 0.18rem, transparent 0.19rem),
    radial-gradient(circle at 52% 22%, #f36e9b 0 0.18rem, transparent 0.19rem),
    radial-gradient(circle at 69% 58%, #66c8df 0 0.18rem, transparent 0.19rem),
    radial-gradient(circle at 83% 26%, #f6c54f 0 0.18rem, transparent 0.19rem),
    radial-gradient(circle at 93% 64%, #5cb975 0 0.18rem, transparent 0.19rem);
}

.big-score {
  display: flex;
  align-items: flex-end;
  gap: 0.2rem;
  color: var(--green);
}

.big-score strong {
  font-size: 2.7rem;
  line-height: 0.92;
}

.category-pane {
  text-align: right;
}

.category-pane strong {
  color: var(--green);
  font-size: 1.15rem;
}

.insight-grid {
  margin-top: 0.95rem;
}

.engine-section {
  margin-top: 1rem;
}

.engine-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.engine-card {
  width: 100%;
  padding: 0.9rem;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.engine-card:hover {
  transform: translateY(-2px);
}

.engine-card:focus-visible {
  outline: 3px solid rgba(106, 61, 232, 0.25);
  outline-offset: 3px;
}

.engine-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.engine-icon {
  font-size: 1.35rem;
}

.engine-weight {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.engine-card h3 {
  min-height: 2.4em;
  margin: 0.6rem 0 0.35rem;
  font-size: 0.88rem;
}

.engine-score strong {
  font-size: 1.75rem;
}

.engine-score span {
  color: var(--muted);
  font-size: 0.8rem;
}

.engine-meter {
  height: 0.38rem;
  margin: 0.55rem 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--purple-soft);
}

.engine-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--green));
}

.engine-more {
  display: flex;
  justify-content: space-between;
  margin-top: 0.7rem;
  color: var(--purple);
  font-size: 0.72rem;
  font-weight: 800;
}

.strategy-disclaimer {
  margin: 0.7rem 0 1rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
  text-align: center;
}

.score-formula {
  margin-top: 0.8rem;
  padding: 0.85rem 1rem;
  text-align: center;
}

.score-formula strong {
  display: block;
  font-size: 0.82rem;
}

.score-formula p {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.45rem;
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.details-intro {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.engine-modal[hidden] {
  display: none;
}

.engine-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 1rem;
}

.engine-modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(20, 15, 35, 0.48);
  backdrop-filter: blur(5px);
}

.engine-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 30rem);
  padding: 1.35rem;
  border-radius: 1.6rem;
  background: #fff;
  box-shadow: 0 24px 70px rgba(27, 17, 58, 0.24);
  animation: engine-modal-in 180ms ease-out;
}

.engine-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.8rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 1.5rem;
  cursor: pointer;
}

.engine-modal-heading {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-right: 2.25rem;
}

.engine-modal-icon {
  font-size: 1.8rem;
}

.engine-modal-kicker {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.engine-modal-heading h2 {
  margin: 0.15rem 0 0;
  font-size: 1.25rem;
}

.engine-modal-score {
  margin-top: 1rem;
}

.engine-modal-score strong {
  font-size: 2.25rem;
}

.engine-modal-score span,
.engine-modal-card small {
  color: var(--muted);
}

.engine-modal-card p {
  margin: 1rem 0 0.6rem;
  line-height: 1.55;
}

.engine-modal-card small {
  display: block;
  line-height: 1.45;
}

.modal-open {
  overflow: hidden;
}

@keyframes engine-modal-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 560px) {
  .engine-grid {
    grid-template-columns: 1fr;
  }

  .engine-card h3 {
    min-height: auto;
  }
}

.insight-card {
  padding: 0.95rem;
  text-align: center;
}

.insight-card h3 {
  margin: 0 0 0.2rem;
  font-size: 0.98rem;
}

.insight-value {
  display: block;
  color: var(--green);
  font-size: 0.94rem;
  font-weight: 800;
}

.insight-icon {
  display: block;
  margin-top: 0.65rem;
  font-size: 1.7rem;
}

.details-panel[hidden] {
  display: none;
}

.rules-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.95rem;
}

.rule-card {
  padding: 1rem;
  border-left: 0.35rem solid var(--green);
}

.rule-card.notice {
  border-left-color: var(--yellow);
}

.rule-card.warning {
  border-left-color: var(--red);
}

.rule-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.rule-score {
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--purple-soft);
  color: var(--purple);
  font-weight: 900;
}

.suggestions-panel ul {
  margin: 0.75rem 0 0;
  padding-left: 1rem;
}

.tab-pills {
  display: flex;
  gap: 0.55rem;
  margin-bottom: 0.95rem;
}

.tab-pill {
  min-height: 2.35rem;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-weight: 800;
}

.tab-pill.active {
  background: var(--purple);
  color: #fff;
}

.stat-row,
.saved-grid,
.challenge-row {
  display: grid;
  gap: 0.45rem;
}

.stat-row + .stat-row,
.saved-grid + .saved-grid,
.challenge-row + .challenge-row {
  margin-top: 0.8rem;
}

.stat-head,
.saved-grid-head,
.challenge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.rank-chip {
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 900;
  color: #fff;
}

.rank-chip.hot { background: var(--green); }
.rank-chip.cold { background: var(--pink); }

.bar-track {
  height: 0.4rem;
  border-radius: 999px;
  background: #efeaf8;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7fd58f, #5dc6d8);
}

.bar-fill.cold {
  background: linear-gradient(90deg, #ef8fab, #d55f80);
}

.saved-grid {
  padding: 1rem;
}

.saved-grid-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.saved-grid strong.score-good {
  color: var(--green);
}

.saved-grid strong.score-mid {
  color: #bc8b1b;
}

.saved-grid strong.score-low {
  color: var(--red);
}

.account-card,
.settings-card {
  margin-top: 0.95rem;
  padding: 1rem;
}

.settings-form,
.settings-block {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.settings-field {
  display: grid;
  gap: 0.35rem;
}

.settings-field span,
.settings-row strong {
  font-size: 0.9rem;
  font-weight: 800;
}

.settings-field input {
  min-height: 2.85rem;
  padding: 0 0.9rem;
  border: 1px solid rgba(115, 92, 189, 0.16);
  border-radius: 16px;
  background: var(--surface-strong);
  color: var(--ink);
}

.settings-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.settings-data {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.settings-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: #f3eefc;
  color: var(--purple-deep);
  font-size: 0.78rem;
  font-weight: 800;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.upload-row {
  align-items: flex-end;
}

.file-input {
  display: block;
  width: 100%;
  margin-top: 0.7rem;
  color: var(--muted);
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: #f3eefc;
}

.segment {
  min-width: 3rem;
  min-height: 2.2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segment.active {
  background: var(--purple);
  color: #fff;
}

.primary-action.compact {
  min-height: 2.9rem;
  font-size: 0.95rem;
}

.secondary-button {
  width: auto;
  min-width: 9rem;
  padding: 0 1rem;
}

.form-feedback {
  min-height: 1.25rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.metric-card {
  text-align: center;
  padding: 1rem;
}

.metric-icon {
  display: block;
  font-size: 1.7rem;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.75rem;
}

.badge-progress {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(71, 85, 105, 0.12);
}

.badge-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb74d, #ff7a59);
}

.badge-card.locked .badge-progress span {
  background: #aeb7c4;
}

.password-form {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid rgba(71, 85, 105, 0.12);
}

.password-form h3 {
  margin: 0;
}

.switch-control {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 52px;
  height: 30px;
  cursor: pointer;
}

.switch-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd3dc;
  transition: background 180ms ease;
}

.switch-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
  transition: transform 180ms ease;
}

.switch-control input:checked + .switch-slider {
  background: #36b37e;
}

.switch-control input:checked + .switch-slider::after {
  transform: translateX(22px);
}

.switch-control input:focus-visible + .switch-slider {
  outline: 3px solid rgba(54, 179, 126, 0.25);
  outline-offset: 2px;
}

.badge-card {
  padding: 0.9rem 0.7rem;
  text-align: center;
  border-radius: 22px;
  background: #faf8ff;
}

.badge-card.locked {
  opacity: 0.6;
}

.badge-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.45rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff0a7, #ffd86d);
  font-size: 1.35rem;
}

.badge-card.locked .badge-icon {
  background: #ece8f2;
}

.challenge-list {
  margin-top: 0.75rem;
}

.challenge-progress {
  height: 0.45rem;
  border-radius: 999px;
  background: #efeaf8;
  overflow: hidden;
}

.challenge-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #66c8df);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
  width: min(calc(100% - 1.4rem), 29rem);
  padding: 0.55rem;
  transform: translateX(-50%);
  border: 1px solid rgba(115, 92, 189, 0.13);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(77, 43, 172, 0.18);
}

.nav-item {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.25rem 0;
}

.nav-item span {
  font-size: 1.05rem;
}

.nav-item small {
  font-size: 0.68rem;
  font-weight: 800;
}

.nav-item.active {
  color: var(--purple);
}

.nav-item-primary span {
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  margin-top: -1.25rem;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--purple), var(--purple-deep));
  color: #fff;
  box-shadow: 0 12px 24px rgba(95, 62, 195, 0.25);
}

.screen .sticker {
  flex: 0 0 auto;
}

.simplebar h1 {
  min-width: 0;
  flex: 1 1 auto;
  max-width: calc(100% - 7.4rem);
  font-size: clamp(1.75rem, 7vw, 2.3rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 860px) {
  .phone-shell {
    width: min(100%, 30rem);
    padding-left: 0;
    padding-right: 0;
  }

  .app-shell {
    display: block;
  }
}

.selectable-grid {
  position: relative;
  padding-top: 3.15rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.selectable-grid.selected-for-play {
  border-color: rgba(70, 160, 122, 0.7);
  box-shadow: 0 12px 30px rgba(43, 118, 91, 0.14);
  transform: translateY(-1px);
}

.grid-select-control {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: inline-flex;
  cursor: pointer;
}

.grid-select-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.grid-select-control span {
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  border: 2px solid #d6ddd8;
  border-radius: 0.55rem;
  background: #fff;
  transition: 150ms ease;
}

.grid-select-control input:checked + span {
  border-color: #3d9c72;
  background: #3d9c72;
}

.grid-select-control input:checked + span::after {
  content: "✓";
  color: #fff;
  font-weight: 900;
  line-height: 1;
}

.played-selection-bar {
  position: sticky;
  top: 0.75rem;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border-color: rgba(70, 160, 122, 0.35);
  background: rgba(247, 255, 250, 0.96);
  backdrop-filter: blur(12px);
}

.played-selection-bar[hidden] {
  display: none;
}

.played-grid-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.85rem;
  background: #effaf3;
  color: #287153;
  font-size: 0.82rem;
}

.played-grid-status span {
  color: #527065;
}

.played-modal-card {
  max-width: 31rem;
}

.played-date-field {
  display: grid;
  gap: 0.45rem;
  margin: 1.25rem 0 0.5rem;
  font-weight: 800;
  color: #293b34;
}

.played-date-field input {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #d6dfda;
  border-radius: 0.85rem;
  background: #fff;
  color: #25362f;
  font: inherit;
}

.played-gain-note {
  display: block;
  margin: 0.2rem 0 1rem;
  color: #6a7872;
  line-height: 1.45;
}

@media (max-width: 620px) {
  .played-selection-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .played-grid-status {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
  }
}
