:root {
  --bg: #f4ecdc;
  --bg-deep: #e5cf9e;
  --panel: rgba(255, 251, 243, 0.9);
  --panel-strong: rgba(255, 248, 235, 0.98);
  --text: #2d2418;
  --muted: #6f6455;
  --border: rgba(117, 92, 58, 0.2);
  --accent: #a4591f;
  --accent-strong: #c77c1f;
  --coin: #c8841f;
  --coin-bright: #efbf58;
  --glass: rgba(235, 247, 255, 0.26);
  --cream: #fff6e6;
  --shadow: 0 18px 60px rgba(87, 58, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(255, 224, 145, 0.45), transparent 30%),
    radial-gradient(circle at right 15%, rgba(255, 247, 222, 0.6), transparent 18%),
    radial-gradient(circle at bottom left, rgba(194, 123, 31, 0.18), transparent 24%),
    linear-gradient(180deg, #fbf7ee 0%, var(--bg) 55%, #ecdcbc 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

.page-shell {
  width: min(72rem, 100%);
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.app-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(117, 92, 58, 0.16);
}

.app-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.hero,
.panel {
  border: 1px solid var(--border);
  border-radius: 1.6rem;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  background:
    linear-gradient(135deg, rgba(255, 249, 238, 0.96), rgba(253, 241, 214, 0.92)),
    var(--panel);
}

.hero__copy-block {
  display: grid;
  gap: 0.9rem;
}

.hero h1,
.panel h2,
.jar-status__count,
.preset-pill__value {
  font-family: Georgia, "Iowan Old Style", serif;
}

.hero h1,
.panel h2,
.eyebrow,
.jar-status__label,
.status-line {
  margin: 0;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 0.95;
}

.hero__copy,
.panel__hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.preset-builder,
.admin-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: end;
}

.layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.05fr 0.95fr;
}

.panel {
  padding: 1.25rem;
}

.panel--jar,
.panel--wide {
  grid-column: 1 / -1;
}

.panel--admin {
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.94), rgba(247, 239, 224, 0.92));
}

.panel--jar {
  background:
    radial-gradient(circle at top, rgba(255, 241, 206, 0.7), transparent 55%),
    var(--panel-strong);
}

.jar-stage {
  display: grid;
  gap: 1.25rem;
  align-items: center;
}

.jar-card {
  width: 100%;
  display: grid;
  gap: 0.8rem;
  justify-items: center;
}

.action-stage {
  display: grid;
  gap: 0.9rem;
}

.action-card {
  padding: 1.15rem;
  border-radius: 1.35rem;
  border: 1px solid rgba(117, 92, 58, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 250, 239, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.action-card--primary h2 {
  margin: 0.35rem 0 0.45rem;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.action-card__note {
  margin: 0.85rem 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
}

.jar-status__label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

.jar-status__count {
  font-size: clamp(3.3rem, 10vw, 5.4rem);
  line-height: 1;
}

.jar {
  position: relative;
  width: min(18rem, 72vw);
  height: 21rem;
  border-radius: 3rem 3rem 2.4rem 2.4rem;
  border: 4px solid rgba(173, 140, 101, 0.45);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.1)),
    linear-gradient(180deg, rgba(221, 237, 247, 0.2), rgba(255, 243, 221, 0.18));
  overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.jar::before {
  content: "";
  position: absolute;
  top: -1.1rem;
  left: 18%;
  width: 64%;
  height: 1.9rem;
  border-radius: 999px;
  border: 4px solid rgba(173, 140, 101, 0.45);
  background: rgba(251, 241, 222, 0.9);
}

.jar__coins {
  position: absolute;
  inset: auto 0 0;
  min-height: 24%;
  padding: 0.8rem 0.7rem 0.9rem;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-content: end;
  gap: 0.28rem;
  background:
    linear-gradient(180deg, transparent 0%, rgba(223, 171, 70, 0.05) 44%, rgba(200, 140, 36, 0.16) 100%);
}

.jar__coin {
  position: relative;
  aspect-ratio: 1;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 30%, var(--coin-bright), var(--coin) 60%, #8d5510 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35);
  animation: coin-pop 240ms ease;
}

.jar__coin::after {
  content: attr(data-mark);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.38rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: rgba(62, 56, 48, 0.72);
}

.jar__coin--dime {
  transform: scale(0.88);
  background:
    radial-gradient(circle at 30% 30%, #f4f5f8, #cfd4db 58%, #8f98a3 100%);
}

.jar__coin--quarter {
  transform: scale(1.08);
  background:
    radial-gradient(circle at 30% 30%, #fafbfd, #d9dee6 58%, #939daa 100%);
}

.jar__coin--quarter::after {
  font-size: 0.42rem;
}

.jar__shine {
  position: absolute;
  inset: 1.1rem auto 2rem 1.35rem;
  width: 18%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0));
  opacity: 0.7;
}

.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
}

.status-line {
  color: var(--muted);
  min-height: 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.96rem;
}

.mini-stats {
  display: grid;
  gap: 0.7rem;
}

.mini-stat {
  display: grid;
  gap: 0.16rem;
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  border: 1px solid rgba(117, 92, 58, 0.12);
  background: rgba(255, 255, 255, 0.55);
}

.mini-stat strong {
  font-size: 0.95rem;
}

.mini-stat span {
  color: var(--muted);
  font-size: 0.88rem;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: start;
  margin-bottom: 1rem;
}

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

.field--grow {
  flex: 1 1 16rem;
}

.field--small {
  flex: 0 0 7rem;
}

label {
  color: var(--muted);
  font-size: 0.92rem;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(117, 92, 58, 0.24);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:hover,
select:hover {
  border-color: rgba(117, 92, 58, 0.34);
}

.button {
  border-radius: 999px;
  padding: 0.82rem 1.1rem;
  background: var(--accent);
  color: #fff8ed;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

.button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(239, 191, 88, 0.45);
  outline-offset: 2px;
}

.button--hero {
  width: min(24rem, 100%);
  padding: 1rem 1.4rem;
  font-size: 1.2rem;
  background:
    linear-gradient(180deg, #d38d2a, #a55b1c);
  box-shadow: 0 10px 24px rgba(145, 87, 24, 0.22);
}

.button--secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border: 1px solid rgba(117, 92, 58, 0.22);
}

.button--ghost {
  background: transparent;
  color: var(--muted);
}

.admin-actions .button {
  flex: 0 0 auto;
}

.suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.85rem 0 1rem;
}

.suggestion-chip {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(117, 92, 58, 0.16);
  color: #5b4b37;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

.suggestion-chip:hover,
.suggestion-chip:focus-visible {
  transform: translateY(-1px);
  background: var(--cream);
}

.preset-list,
.activity-list {
  display: grid;
  gap: 0.75rem;
}

.preset-item,
.activity-item {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.9rem 1rem;
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(117, 92, 58, 0.14);
}

.preset-item__copy,
.activity-item__copy {
  display: grid;
  gap: 0.18rem;
}

.preset-item__title,
.activity-item__title,
.empty-state strong {
  font-weight: 700;
}

.preset-item__meta,
.activity-item__meta,
.empty-state {
  color: var(--muted);
}

.activity-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.activity-item__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.2rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: rgba(200, 132, 31, 0.12);
  color: #7e4b11;
  font-weight: 700;
}

.preset-item__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.preset-pill__value {
  color: var(--accent);
  font-size: 1.3rem;
}

.button--small {
  padding: 0.68rem 0.9rem;
}

.button--danger {
  background: #844325;
}

.empty-state {
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.44);
  border: 1px dashed rgba(117, 92, 58, 0.2);
}

body.is-celebrating .jar {
  transform: translateY(-3px) scale(1.015);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.18),
    0 18px 34px rgba(180, 121, 29, 0.18);
}

body.is-celebrating .jar-status__count {
  color: #8c5310;
  transform: scale(1.03);
}

@keyframes coin-pop {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 860px) {
  .layout {
    grid-template-columns: 1.15fr 0.85fr;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .jar-stage {
    grid-template-columns: minmax(18rem, 24rem) minmax(18rem, 1fr);
  }

  .panel:nth-of-type(2) {
    grid-column: 1;
  }

  .panel:nth-of-type(3) {
    grid-column: 2;
  }
}

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

  .panel,
  .panel--jar,
  .panel--wide {
    grid-column: auto;
  }

  .admin-actions .button {
    flex: 1 1 12rem;
  }

  .button--hero {
    width: 100%;
  }
}
