@font-face {
  font-family: "Big Shoulders Display";
  src: url("fonts/big-shoulders-display.woff2") format("woff2");
  font-weight: 600 900;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;

  --chalk: #f3f6f1;
  --paper: #fbfdfa;
  --mint: #9ee6cf;
  --mint-soft: #dcf3ea;
  --mint-line: #c9e7db;
  --teal: #14706a;
  --deep: #0b2f2c;
  --ink: #10211f;
  --muted: #4c625e;
  --orange: #ff6b1a;
  --orange-ink: #a83d02;
  --orange-soft: #ffe3d2;
  --pink: #f6a59a;

  --font-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius-card: 20px;
  --radius-chip: 999px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
}

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

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

body {
  background: var(--chalk);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 6px;
}

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

/* ---------- Stage: mobile fills the screen, desktop frames a phone ---------- */

.stage {
  height: 100%;
}

.pitch,
.device-status {
  display: none;
}

.device,
.device-bezel {
  height: 100%;
}

@media (min-width: 900px) and (min-height: 660px) {
  body {
    overflow: auto;
    background:
      radial-gradient(circle at 72% 50%, transparent 0 318px, rgb(20 112 106 / .1) 319px 321px, transparent 322px 380px, rgb(20 112 106 / .07) 381px 383px, transparent 384px),
      var(--chalk);
  }

  .stage {
    min-height: 100%;
    display: grid;
    grid-template-columns: minmax(300px, 440px) auto;
    justify-content: center;
    align-items: center;
    gap: clamp(48px, 8vw, 128px);
    padding: 32px 48px;
  }

  .pitch {
    display: block;
  }

  .device {
    position: relative;
    height: min(844px, calc(100dvh - 64px));
    aspect-ratio: 400 / 856;
  }

  .device::before {
    content: "";
    position: absolute;
    inset: 12% -26% 8%;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--mint) 0, rgb(158 230 207 / .55) 55%, transparent 100%);
  }

  .device-bezel::before,
  .device-bezel::after {
    content: "";
    position: absolute;
    width: 4px;
    background: #2a3d3a;
  }

  .device-bezel::before {
    left: -3px;
    top: 18%;
    height: 54px;
    border-radius: 3px 0 0 3px;
    box-shadow: 0 70px 0 0 #2a3d3a;
  }

  .device-bezel::after {
    right: -3px;
    top: 24%;
    height: 84px;
    border-radius: 0 3px 3px 0;
  }

  .device-bezel {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 12px;
    border-radius: 60px;
    background: linear-gradient(150deg, #34504c, #172826 40%, #24403c);
    box-shadow:
      inset 0 0 0 1.5px rgb(255 255 255 / .14),
      0 2px 0 #0a1a18,
      0 40px 80px -30px rgb(11 47 44 / .55),
      0 18px 30px -18px rgb(11 47 44 / .4);
  }

  .device-status {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 5;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 34px 0 46px;
    color: var(--ink);
    font-weight: 650;
    font-size: 15px;
    pointer-events: none;
  }

  .device-island {
    width: 112px;
    height: 32px;
    border-radius: 20px;
    background: #050c0b;
  }

  .device-icons {
    display: flex;
    gap: 6px;
    align-items: center;
  }

  .app {
    border-radius: 48px;
    padding-top: 46px;
  }
}

/* ---------- Desktop pitch ---------- */

.pitch-mascot {
  width: 112px;
  margin-bottom: 20px;
}

.pitch-eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal);
}

.pitch-title {
  margin-top: 6px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(88px, 10vw, 136px);
  line-height: .82;
  letter-spacing: -.01em;
  text-transform: uppercase;
  color: var(--deep);
}

.pitch-title::after {
  content: "";
  display: inline-block;
  width: .16em;
  height: .16em;
  margin-left: .05em;
  border-radius: 50%;
  background: var(--orange);
}

.pitch-lede {
  margin-top: 24px;
  max-width: 36ch;
  font-size: 17px;
  color: var(--ink);
}

.pitch-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 32px 0 0;
  padding-top: 20px;
  border-top: 2px solid var(--deep);
}

.pitch-facts dt {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 40px;
  line-height: 1;
  color: var(--deep);
}

.pitch-facts dd {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.pitch-fineprint {
  margin-top: 28px;
  max-width: 40ch;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- App frame ---------- */

.app {
  position: relative;
  flex: 1;
  height: 100%;
  overflow: hidden;
  background: var(--chalk);
  isolation: isolate;
}

.app-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--deep);
  text-decoration: none;
}

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

.brand-word {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  letter-spacing: .01em;
  text-transform: uppercase;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--deep);
}

.icon-button:hover {
  background: var(--mint-soft);
}

.view {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 16px 24px;
  scrollbar-width: thin;
}

.view:focus {
  outline: none;
}

/* ---------- Tab bar ---------- */

.tabbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--mint-line);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 48px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
}

.tab svg {
  width: 24px;
  height: 24px;
}

.tab[aria-current="page"] {
  color: var(--deep);
}

.tab[aria-current="page"] svg {
  color: var(--teal);
}

.tab-log {
  color: var(--deep);
}

.tab-log-disc {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-top: -26px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--deep);
  box-shadow: 0 0 0 5px var(--paper), 0 10px 20px -6px rgb(255 107 26 / .7);
  transition: transform .2s var(--ease-bounce);
}

.tab-log-disc svg {
  width: 26px;
  height: 26px;
}

.tab-log:hover .tab-log-disc {
  transform: translateY(-2px) rotate(90deg);
}

/* ---------- Shared bits ---------- */

.view-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 40px;
  line-height: .95;
  text-transform: uppercase;
  color: var(--deep);
}

.view-title:focus {
  outline: none;
}

.view-sub {
  margin-top: 6px;
  color: var(--muted);
}

.section-label {
  margin: 24px 0 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--teal);
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: var(--deep);
  background: var(--avatar, var(--mint));
}

.avatar-rat {
  background: var(--deep);
  padding: 3px;
}

.points {
  font-family: var(--font-display);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.points-negative {
  color: var(--orange-ink);
}

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius-chip);
  background: var(--mint-soft);
  color: var(--teal);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
}

.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 16px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: .03em;
  text-transform: uppercase;
  transition: transform .15s var(--ease-out), background-color .15s;
}

.button-primary {
  background: var(--orange);
  color: var(--deep);
}

.button-primary:hover {
  background: #ff7d36;
}

.button-primary:active,
.button-secondary:active {
  transform: scale(.97);
}

.button-primary[aria-disabled="true"] {
  background: var(--mint-line);
  color: var(--muted);
  cursor: not-allowed;
}

.button-secondary {
  background: var(--mint-soft);
  color: var(--deep);
}

.button-secondary:hover {
  background: var(--mint);
}

.button-quiet {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Feed ---------- */

.challenge {
  position: relative;
  overflow: hidden;
  padding: 16px 18px 18px;
  border-radius: 24px;
  background: var(--deep);
  color: var(--chalk);
}

.challenge::after {
  content: "";
  position: absolute;
  right: -46px;
  top: -46px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 14px solid rgb(158 230 207 / .12);
  box-shadow: inset 0 0 0 18px rgb(158 230 207 / .06);
}

.challenge-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.challenge-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mint);
}

.challenge-day {
  flex: none;
  white-space: nowrap;
  font-size: 12.5px;
  color: rgb(243 246 241 / .75);
}

.challenge-stats {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.challenge-stat strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 38px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.challenge-stat span {
  font-size: 12px;
  color: rgb(243 246 241 / .75);
}

.challenge-stat-accent strong {
  color: var(--orange);
}

.chase {
  margin-top: 14px;
}

.chase-text {
  font-size: 13px;
  color: rgb(243 246 241 / .9);
}

.chase-bar {
  position: relative;
  height: 10px;
  margin-top: 8px;
  border-radius: 6px;
  background: rgb(158 230 207 / .18);
}

.chase-fill {
  height: 100%;
  border-radius: 6px;
  background: var(--mint);
  transition: width .6s var(--ease-out);
}

.filters {
  display: flex;
  gap: 8px;
  margin: 18px -16px 6px;
  padding: 2px 16px 8px;
  overflow-x: auto;
  scroll-padding-inline: 16px;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  min-height: 38px;
  padding: 0 15px;
  border: 1.5px solid var(--mint-line);
  border-radius: var(--radius-chip);
  background: var(--paper);
  color: var(--deep);
  font-size: 13.5px;
  font-weight: 650;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--teal);
}

.chip[aria-pressed="true"] {
  border-color: var(--deep);
  background: var(--deep);
  color: var(--chalk);
}

.chip-count {
  margin-left: 4px;
  opacity: .65;
  font-variant-numeric: tabular-nums;
}

.posts {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post {
  padding: 14px 14px 10px;
  border-radius: var(--radius-card);
  background: var(--paper);
  box-shadow: 0 1px 0 var(--mint-line), 0 8px 24px -18px rgb(11 47 44 / .35);
}

.post-fresh {
  animation: post-in .5s var(--ease-out);
}

@keyframes post-in {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(.98);
  }
}

.post-head {
  display: flex;
  gap: 10px;
  align-items: center;
}

.post-who {
  flex: 1;
  min-width: 0;
}

.post-name {
  font-weight: 700;
}

.post-meta {
  font-size: 12.5px;
  color: var(--muted);
}

.post-points {
  font-size: 26px;
  line-height: 1;
  color: var(--deep);
}

.post-points small {
  font-size: 14px;
  margin-left: 1px;
}

.post-title {
  margin-top: 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.02;
  text-transform: uppercase;
  color: var(--deep);
  overflow-wrap: anywhere;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-mod {
  background: var(--orange-soft);
  color: var(--orange-ink);
}

.post-note {
  margin-top: 10px;
  overflow-wrap: anywhere;
}

.proof {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--deep);
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.proof-label {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgb(158 230 207 / .6);
}

.proof-error {
  background: var(--orange-soft);
  color: #6e2700;
}

.proof-error .proof-label {
  color: var(--orange-ink);
}

.proof-line-add {
  color: #c8f7e6;
}

.proof-line-add::before {
  content: "+ ";
  color: var(--mint);
}

.proof-line-del {
  color: #ffb48a;
}

.proof-line-del::before {
  content: "− ";
}

.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.reaction {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  min-width: 44px;
  padding: 0 11px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-chip);
  background: var(--chalk);
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--deep);
}

.reaction:hover {
  border-color: var(--mint-line);
}

.reaction[aria-pressed="true"] {
  border-color: var(--teal);
  background: var(--mint-soft);
}

.reaction-emoji {
  font-size: 16px;
}

.reaction-pop .reaction-emoji {
  animation: pop .4s var(--ease-bounce);
}

@keyframes pop {
  40% {
    transform: scale(1.5) rotate(-12deg);
  }
}

.empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
}

.empty-rat {
  width: 96px;
  opacity: .9;
}

.feed-foot {
  margin-top: 20px;
  font-size: 12px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Leaderboard ---------- */

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
  padding: 4px;
  border-radius: 14px;
  background: var(--mint-soft);
}

.segmented button {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: none;
  font-weight: 650;
  color: var(--teal);
}

.segmented button[aria-pressed="true"] {
  background: var(--paper);
  color: var(--deep);
  box-shadow: 0 1px 3px rgb(11 47 44 / .15);
}

.podium {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  align-items: end;
  gap: 8px;
  margin-top: 22px;
}

.podium-spot {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  text-align: center;
}

.podium-spot .avatar {
  width: 48px;
  height: 48px;
}

.podium-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 13.5px;
}

.podium-block {
  width: 100%;
  display: grid;
  align-content: start;
  justify-items: center;
  padding-top: 8px;
  border-radius: 14px 14px 4px 4px;
  background: var(--mint);
  color: var(--deep);
}

.podium-block .points {
  font-size: 22px;
}

.podium-rank {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 44px;
  line-height: .9;
}

.podium-1 .podium-block {
  height: 132px;
  background: var(--deep);
  color: var(--chalk);
}

.podium-1 .podium-rank {
  color: var(--orange);
}

.podium-2 .podium-block {
  height: 104px;
}

.podium-3 .podium-block {
  height: 84px;
  background: var(--mint-soft);
}

.board {
  display: grid;
  gap: 2px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.board-row {
  display: grid;
  grid-template-columns: 28px 40px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
}

.board-row:nth-child(odd) {
  background: var(--paper);
}

.board-row-me {
  outline: 2px solid var(--orange);
  outline-offset: -2px;
  background: var(--orange-soft) !important;
}

.board-rank {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--muted);
  text-align: center;
}

.board-who {
  min-width: 0;
}

.board-name {
  font-weight: 700;
}

.board-title {
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-points {
  text-align: right;
  font-size: 22px;
  color: var(--deep);
}

.board-points small {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- Rules ---------- */

.rules-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: var(--radius-card);
  background: var(--paper);
  overflow: hidden;
}

.rules-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid var(--chalk);
}

.rules-item:first-child {
  border-top: 0;
}

.rules-item .points {
  flex: none;
  font-size: 20px;
  color: var(--deep);
}

.rules-name {
  min-width: 0;
}

.rules-name small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
}

.rules-cat {
  margin: 20px 0 8px;
  font-weight: 700;
  font-size: 13px;
  color: var(--teal);
}

.callout {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius-card);
  background: var(--mint-soft);
}

.callout .empty-rat {
  flex: none;
  width: 64px;
}

/* ---------- Profile ---------- */

.profile-head {
  display: flex;
  gap: 14px;
  align-items: center;
}

.profile-avatar {
  flex: none;
  width: 76px;
  height: 76px;
  padding: 6px;
  border-radius: 24px;
  background: var(--deep);
}

.profile-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 34px;
  line-height: .95;
  text-transform: uppercase;
  color: var(--deep);
}

.profile-role {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 18px;
}

.stat {
  padding: 10px 6px;
  border-radius: 14px;
  background: var(--paper);
  text-align: center;
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  line-height: 1;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
}

.stat span {
  font-size: 11.5px;
  color: var(--muted);
}

.profile-actions {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 12px;
}

.badges {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.badge {
  position: relative;
  display: grid;
  gap: 4px;
  align-content: start;
  min-height: 132px;
  padding: 12px;
  border-radius: 18px;
  background: var(--deep);
  color: var(--chalk);
  overflow: hidden;
}

.badge-icon {
  font-size: 26px;
  line-height: 1;
}

.badge-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--mint);
}

.badge-desc {
  font-size: 12.5px;
  line-height: 1.35;
  color: rgb(243 246 241 / .82);
}

.badge-locked {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--mint-line);
}

.badge-locked .badge-icon {
  filter: grayscale(1);
  opacity: .45;
}

.badge-locked .badge-name {
  color: var(--deep);
}

.badge-locked .badge-desc {
  color: var(--muted);
}

.badge-progress {
  height: 6px;
  margin-top: 6px;
  border-radius: 4px;
  background: var(--mint-soft);
}

.badge-progress span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--teal);
}

.badge-progress-text {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--teal);
}

.badge-status {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--orange);
}

.disclosure {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--mint-line);
  font-size: 12px;
  color: var(--muted);
}

.disclosure .button-quiet {
  font-size: 12px;
}

/* ---------- Log sheet ---------- */

.sheet-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgb(11 47 44 / .5);
  animation: fade-in .25s ease-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: calc(100% - 40px);
  border-radius: 28px 28px 0 0;
  background: var(--chalk);
  animation: sheet-up .35s var(--ease-out);
}

@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
}

.sheet-grip {
  width: 40px;
  height: 5px;
  margin: 8px auto 0;
  border-radius: 3px;
  background: var(--mint-line);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 0 18px;
}

.sheet-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 32px;
  text-transform: uppercase;
  color: var(--deep);
}

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 16px 16px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 2px solid var(--mint-line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--muted);
}

.search:focus-within {
  border-color: var(--teal);
}

.search input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  border: 0;
  background: none;
  font-size: 16px;
  outline: none;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-label {
  display: block;
  margin: 18px 0 8px;
  padding: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--teal);
}

.activity-picker,
.modifiers {
  margin-top: 18px;
}

.activity-picker .field-label,
.modifiers .field-label {
  margin-top: 0;
}

.activity-list {
  display: grid;
  gap: 6px;
}

.activity-group {
  margin: 10px 0 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.activity-group:first-child {
  margin-top: 0;
}

.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 14px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--paper);
  cursor: pointer;
}

.option:hover {
  border-color: var(--mint-line);
}

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option:has(input:checked) {
  border-color: var(--deep);
  background: var(--mint-soft);
}

.option:has(input:focus-visible) {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.option-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  line-height: 1.25;
}

.option .points {
  flex: none;
  font-size: 19px;
  color: var(--deep);
}

.option-check {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--mint-line);
  border-radius: 7px;
  background: var(--paper);
  color: transparent;
}

.option input:checked ~ .option-check {
  border-color: var(--deep);
  background: var(--deep);
  color: var(--chalk);
}

.option-mod .option-name small {
  display: block;
  font-weight: 450;
  font-size: 12.5px;
  color: var(--muted);
}

.modifiers #modifier-list {
  display: grid;
  gap: 6px;
}

.activity-empty {
  padding: 16px;
  text-align: center;
  color: var(--muted);
}

textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--mint-line);
  border-radius: 16px;
  background: var(--paper);
  font-size: 16px;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: var(--teal);
}

.note-count {
  margin-top: 4px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}

.sheet-foot {
  display: grid;
  gap: 10px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--mint-line);
  background: var(--paper);
}

.preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 40px;
}

.preview-math {
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--muted);
}

.preview-total {
  flex: none;
  font-size: 38px;
  line-height: 1;
  color: var(--deep);
}

.preview-total.points-negative {
  color: var(--orange-ink);
}

/* ---------- Celebration ---------- */

.celebrate-layer {
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.celebrate {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 22px 20px 20px;
  border-radius: 28px;
  background: var(--chalk);
  text-align: center;
  animation: celebrate-in .45s var(--ease-bounce);
}

@keyframes celebrate-in {
  from {
    opacity: 0;
    transform: scale(.85);
  }
}

.celebrate-rat {
  width: 150px;
  margin: 0 auto;
}

.celebrate-points {
  font-size: 72px;
  line-height: .9;
  color: var(--orange);
  -webkit-text-stroke: 1.5px var(--deep);
}

.celebrate-points.points-negative {
  color: var(--chalk);
}

.celebrate-title {
  margin-top: 6px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--deep);
}

.celebrate-line {
  margin-top: 8px;
  color: var(--muted);
}

.unlocks {
  display: grid;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.unlock {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--deep);
  color: var(--chalk);
}

.unlock strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  text-transform: uppercase;
  color: var(--mint);
}

.unlock span {
  font-size: 12.5px;
}

.unlock-icon {
  font-size: 24px;
}

.celebrate .button-primary {
  width: 100%;
  margin-top: 16px;
}

.rat-lift {
  transform-box: view-box;
  transform-origin: 100px 60px;
}

.celebrate .rat-lift {
  animation: lift 1.1s var(--ease-out) .15s 3;
}

@keyframes lift {
  0%,
  100% {
    transform: translateY(0);
  }

  45% {
    transform: translateY(-14px);
  }
}

/* ---------- Toast ---------- */

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 40;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--deep);
  color: var(--chalk);
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 12px 30px -12px rgb(11 47 44 / .6);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .3s var(--ease-out);
}

.toast-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
