:root {
  --indigo: #4f46e5;
  --indigo-dark: #3730a3;
  --gold: #f59e0b;
  --ink: #1e1b4b;
  --muted: #5b5678;
  --line: #e4e0f2;
  --card: #ffffff;
  --bg: #f6f4ff;
  --danger: #b42318;
  --ok: #157f3d;
  --ok-soft: #ecfdf3;
  --bad-soft: #fef3f2;
  --radius: 16px;
  --shadow: 0 10px 28px rgba(55, 48, 163, 0.1);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: #7eb86f;
}
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
}

img { max-width: 100%; height: auto; }

a { color: var(--indigo-dark); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: #000;
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
}
.skip-link:focus { left: 0; }

.container {
  width: min(880px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  background: linear-gradient(120deg, var(--indigo-dark) 0%, var(--indigo) 70%, #7c3aed 140%);
  color: #fff;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
  text-decoration: none;
}

.brand-spot {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.35);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.15rem; }
.brand-sub { font-size: 0.78rem; opacity: 0.85; }

.nav-toggle {
  min-height: 44px;
  min-width: 44px;
  border: 1px solid rgba(255,255,255,0.35);
  background: transparent;
  color: #fff;
  border-radius: 10px;
  font: inherit;
  padding: 0 0.8rem;
}

.site-nav {
  display: none;
  width: 100%;
  flex-direction: column;
  gap: 0.35rem;
}

.site-nav.is-open,
.site-nav:focus-within { display: flex; }

.site-nav a {
  color: #fff;
  text-decoration: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.6rem;
  border-radius: 10px;
}

.site-nav a.is-active,
.site-nav a:hover { background: rgba(255,255,255,0.12); }

.nav-badge {
  background: var(--gold);
  color: #1e1b4b;
  border-radius: 999px;
  padding: 0 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.site-main { padding: 1.25rem 0 2.5rem; }
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1.25rem 0 2rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

h1 { margin: 0 0 0.4rem; font-size: 1.7rem; }
h2 { margin: 0 0 0.5rem; font-size: 1.15rem; }

.page-head { margin-bottom: 1rem; }
.section-title { margin: 1.75rem 0 0.6rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--indigo);
  margin: 0 0 0.35rem;
}
.lead { font-size: 1.05rem; }
.help, .meta, .crumb { color: var(--muted); font-size: 0.92rem; }
.crumb { margin: 0 0 0.6rem; }
.empty { color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  margin: 0.85rem 0;
}

.form-card { max-width: 28rem; }
.hero { margin-bottom: 1rem; }
.hero-card {
  background: var(--card);
  border-radius: 20px;
  padding: 1.4rem 1.3rem 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.grid-2 {
  display: grid;
  gap: 0.85rem;
}
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

.alert {
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  margin: 0 0 1rem;
}
.alert-error { background: var(--bad-soft); color: var(--danger); }
.alert-success, .alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-info { background: #eef2ff; color: var(--indigo-dark); }

.form-group { margin: 0 0 0.85rem; }
label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
input, textarea {
  width: 100%;
  font: inherit;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  min-height: 44px;
}
textarea { min-height: 5.5rem; resize: vertical; }

.stack { display: flex; flex-direction: column; gap: 0.75rem; }
.btn-row { display: flex; gap: 0.5rem; align-items: center; margin: 0.75rem 0; }
.btn-row.wrap { flex-wrap: wrap; }
[hidden] { display: none !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.55rem 1rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  color: #fff;
  background: var(--indigo);
}
.btn-primary { background: var(--indigo); color: #fff; }
.btn-secondary { background: #7c3aed; color: #fff; }
.btn-outline {
  background: #fff;
  color: var(--indigo-dark);
  border-color: var(--line);
}
.btn-ghost {
  background: transparent;
  color: inherit;
  border-color: transparent;
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { min-height: 40px; padding: 0.35rem 0.75rem; font-size: 0.92rem; }
.site-nav .btn-ghost { color: #fff; }

.btn-google {
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  font-weight: 600;
  width: 100%;
  max-width: 22rem;
}
.btn-google:hover { background: #f8f9fa; }
.google-g { flex: 0 0 auto; }

.deck-list {
  display: grid;
  gap: 0.75rem;
}
.deck-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  min-height: 88px;
}
.deck-card h2 { margin-bottom: 0.25rem; }
.deck-card:hover { border-color: var(--indigo); }

.card-list { list-style: none; padding: 0; margin: 1rem 0; }
.card-front { font-weight: 700; margin: 0 0 0.35rem; }
.card-back { color: var(--muted); margin: 0 0 0.5rem; }

.flip-wrap {
  margin: 1rem 0;
  perspective: 1400px;
  perspective-origin: 50% 45%;
  isolation: isolate;
}
.flip-card {
  width: 100%;
  min-height: 220px;
  border: 0;
  border-radius: 20px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  display: block;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.flip-card:focus { outline: none; }
.flip-card:focus-visible {
  outline: 3px solid var(--indigo);
  outline-offset: 3px;
}
.flip-inner {
  display: grid;
  min-height: 220px;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0.12, 0.2, 1);
}
.flip-card.is-back .flip-inner { transform: rotateY(180deg); }
.flip-card.no-anim .flip-inner { transition: none; }
.flip-face {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 220px;
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(0deg) translateZ(1px);
  -webkit-transform: rotateY(0deg) translateZ(1px);
}
.flip-front { background: #fff; }
.flip-back {
  background: #fffbeb;
  transform: rotateY(180deg) translateZ(1px);
  -webkit-transform: rotateY(180deg) translateZ(1px);
}
.flip-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--indigo);
  font-weight: 700;
}
.flip-text { font-size: 1.25rem; font-weight: 650; white-space: pre-wrap; flex: 1; }
.flip-hint { color: var(--muted); font-size: 0.85rem; }
@media (prefers-reduced-motion: reduce) {
  .flip-inner { transition: none; }
}

.choice-list { display: flex; flex-direction: column; gap: 0.55rem; }
.choice {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  min-height: 48px;
  cursor: pointer;
  background: #fff;
}
.choice:has(input:checked) {
  border-color: var(--indigo);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}
.choice input { width: auto; min-height: 22px; margin-top: 0.2rem; }

.score-hero {
  background: var(--card);
  border-radius: 20px;
  padding: 1.4rem;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.score-hero h1 { font-size: 2.4rem; }

.review-list { list-style: none; padding: 0; }
.review.is-ok { background: var(--ok-soft); }
.review.is-bad { background: var(--bad-soft); }
.prompt { font-size: 1.15rem; }

.people-list { display: flex; flex-direction: column; gap: 0.65rem; }
.person { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--indigo-dark);
  margin-left: 0.3rem;
  text-transform: uppercase;
}
.pill-pending { background: #fff7ed; color: #9a3412; }
.pill-active { background: var(--ok-soft); color: var(--ok); }
.pill-disabled { background: var(--bad-soft); color: var(--danger); }

.quiet-list { padding-left: 1.1rem; }
details.card summary { cursor: pointer; font-weight: 650; }

.sheet-wrap { margin: 1.1rem 0 2rem; }
.sheet-toolbar h2 { margin-bottom: 0.25rem; }
.sheet-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin: 0.6rem 0 0.75rem;
  max-height: min(70vh, 36rem);
}
.sheet {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}
.sheet th, .sheet td {
  border-bottom: 1px solid var(--line);
  padding: 0;
  vertical-align: top;
}
.sheet th {
  background: #eef2ff;
  font-size: 0.82rem;
  text-align: left;
  padding: 0.45rem 0.55rem;
  position: sticky;
  top: 0;
}
.sheet-n { width: 2.4rem; text-align: center !important; color: var(--muted); padding: 0.45rem 0.3rem !important; }
.sheet textarea {
  border: 0;
  border-radius: 0;
  min-height: 52px;
  resize: vertical;
  background: transparent;
}
.sheet tr:focus-within { background: #fffbeb; }

.mascot { display: block; }
.mascot-xs { width: 36px; height: 36px; }
.mascot-md { width: 88px; height: 88px; margin: 0 auto 0.5rem; }
.mascot-lg { width: 140px; height: 140px; }
.spot-hero {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.auth-layout {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1rem;
  align-items: center;
}
@media (max-width: 640px) {
  .auth-layout { grid-template-columns: 1fr; justify-items: center; }
}

@media (min-width: 720px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: flex;
    flex-direction: row;
    width: auto;
    align-items: center;
  }
  .header-inner { flex-wrap: nowrap; }
}

@media (max-width: 480px) {
  .brand-sub { display: none; }
}

/* compact + inviting */
:root {
  --radius: 12px;
  --shadow: 0 6px 0 rgba(55, 48, 163, 0.18), 0 12px 24px rgba(40, 20, 80, 0.18);
}
body {
  line-height: 1.35;
}
.container { width: min(760px, calc(100% - 1.2rem)); }
.header-inner { padding: 0.35rem 0; gap: 0.4rem; }
.brand-spot { width: 34px; height: 34px; border-radius: 50%; }
.brand-text strong { font-size: 1rem; }
.site-main { padding: 0.65rem 0 1.4rem; }
.site-footer { padding: 0.6rem 0 1.1rem; font-size: 0.8rem; }
h1, h1.tight { margin: 0 0 0.25rem; font-size: 1.25rem; }
h2 { font-size: 1rem; margin: 0 0 0.3rem; }
.page-head { margin-bottom: 0.45rem; }
.card { padding: 0.55rem 0.7rem; margin: 0.45rem 0; border: 2px solid #ddd6fe; }
.hero-card, .auth-card, .splash {
  background: linear-gradient(180deg, #fff, #fff7ed);
  border: 2px solid #c4b5fd;
  border-radius: 16px;
  padding: 0.75rem 0.85rem;
  box-shadow: var(--shadow);
}
.splash { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; }
.auth-card { max-width: 22rem; margin: 0 auto; text-align: center; }
.auth-card form { text-align: left; }
.alert { padding: 0.4rem 0.55rem; margin: 0 0 0.5rem; }
.form-group { margin: 0 0 0.45rem; }
input, textarea, select {
  min-height: 44px;
  padding: 0.45rem 0.55rem;
  border: 2px solid #ddd6fe;
  border-radius: 10px;
  font-size: 16px;
}
.stack.tight { gap: 0.4rem; }
.btn-row { margin: 0.35rem 0; gap: 0.4rem; }
.btn {
  min-height: 38px;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  font-weight: 750;
  border: 0;
  box-shadow: 0 3px 0 rgba(30, 20, 70, 0.35);
}
.btn-pic { padding: 0.15rem 0.7rem 0.15rem 0.15rem; gap: 0.35rem; }
.btn-spot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
}
.btn-primary { background: linear-gradient(#8b83ff, #4f46e5); color: #fff; }
.btn-secondary { background: linear-gradient(#d8b4fe, #7c3aed); color: #fff; }
.btn-warm { background: linear-gradient(#fde68a, #f59e0b); color: #3f2a00; }
.btn-outline {
  background: #fff;
  color: var(--indigo-dark);
  border: 2px solid #c4b5fd;
  box-shadow: none;
}
.btn-danger { background: linear-gradient(#fb7185, #e11d48); }
.btn-up { background: linear-gradient(#4ade80, #16a34a); color: #fff; }
.btn-down { background: linear-gradient(#fb7185, #e11d48); color: #fff; }
.btn-sm { min-height: 32px; font-size: 0.85rem; }
.study-tally {
  display: flex;
  gap: 0.75rem;
  font-weight: 750;
  margin: 0 0 0.35rem;
}
.study-tally > span,
.btn-up,
.btn-down {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.thumb-ico { width: 1.1rem; height: 1.1rem; flex: none; }
.tally-up { color: #157f3d; }
.tally-down { color: #b42318; }
.mascot-sm { width: 48px; height: 48px; }
.mascot-md { width: 72px; height: 72px; margin-inline: auto; }
.mascot-lg { width: 96px; height: 96px; }
.fold > summary {
  cursor: pointer;
  font-weight: 750;
  list-style: none;
  min-height: 36px;
  display: flex;
  align-items: center;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: " ▾"; margin-left: auto; opacity: 0.6; }
.nav-drop { position: relative; }
.nav-drop summary {
  list-style: none;
  cursor: pointer;
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  border-radius: 10px;
}
.nav-drop[open] summary { background: rgba(255,255,255,0.12); }
.nav-drop a {
  display: block;
  background: #312e81;
  color: #fff !important;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  margin: 0.15rem 0;
}
.tight-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.row-mini { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; margin: 0.3rem 0; }
.row-mini input { flex: 1; min-width: 8rem; }
.check-row { display: flex; gap: 0.4rem; align-items: center; font-weight: 500; }
.deck-list { display: grid; gap: 0.45rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.deck-card { padding: 0.55rem 0.65rem; min-height: 70px; border-width: 2px; }
.deck-card.mine { background: linear-gradient(#fff, #eef2ff); }
.deck-card.shared { background: linear-gradient(#fff, #fff7ed); }
.section-title { margin: 0.8rem 0 0.35rem; }
.sheet-scroll { max-height: min(55vh, 22rem); margin: 0.35rem 0; }
.sheet textarea { min-height: 38px; }
.flip-card,
.flip-inner,
.flip-face { min-height: 160px; }
.flip-card { padding: 0; border-radius: 16px; }
.flip-face { padding: 0.85rem; border-radius: 16px; }
.score-hero { padding: 0.75rem; }
.people-list.compact .card { margin: 0.35rem 0; }
label { font-weight: 650; font-size: 0.85rem; display: block; }
.crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
}
.auth-card .btn-row { justify-content: center; }
.site-main a:not(.btn):not(.deck-card) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  font-weight: 750;
  text-decoration: none;
  background: #fff;
  color: var(--indigo-dark);
  border: 2px solid #c4b5fd;
}

.park-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #7eb86f url("../img/bg-park-wide.jpg") center / cover no-repeat;
}
@media (max-width: 720px), (display-mode: standalone) {
  .park-bg {
    background-image: url("../img/bg-park-tall.jpg");
    background-position: center top;
  }
}
@media (orientation: landscape) and (max-height: 520px) {
  .park-bg {
    background-image: url("../img/bg-park-wide.jpg");
    background-position: center;
  }
}
.site-header { position: sticky; z-index: 50; }
.site-main, .site-footer { position: relative; z-index: 1; }
.site-main {
  padding-bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
}
.site-footer {
  padding-bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
}
.site-main .container {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 0.7rem 0.8rem 0.9rem;
  box-shadow: 0 10px 30px rgba(40, 60, 20, 0.12);
  border: 1px solid rgba(255,255,255,0.7);
}
