@font-face {
  font-family: "Nunito Ice";
  src: url("/shared/assets/fonts/nunito-latin-wght.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --ink: #352d3d;
  --muted: #746b7b;
  --canvas: #fff8f2;
  --surface: rgb(255 255 255 / 82%);
  --surface-solid: #fff;
  --line: #eadfd8;
  --pink: #f58dac;
  --pink-deep: #c9517b;
  --pink-soft: #ffe0e9;
  --mint: #8edfc8;
  --vanilla: #ffe5a3;
  --blueberry: #ada5ec;
  --cone: #d99a59;
  --cone-light: #f4c681;
  --danger: #b4233b;
  --shadow: 0 24px 70px rgb(87 53 82 / 13%);
  font-family: "Nunito Ice", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
a { color: inherit; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, p { margin-top: 0; }

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

.public-page {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 15%, rgb(255 224 233 / 85%), transparent 28rem),
    radial-gradient(circle at 85% 80%, rgb(142 223 200 / 44%), transparent 30rem),
    var(--canvas);
}

.public-page::before,
.public-page::after {
  position: fixed;
  z-index: -1;
  width: 19rem;
  height: 19rem;
  border: 1px solid rgb(201 81 123 / 12%);
  border-radius: 50%;
  content: "";
}

.public-page::before { top: -9rem; right: -6rem; }
.public-page::after { bottom: -11rem; left: -5rem; }

.ice-stage {
  display: flex;
  width: min(100% - 32px, 760px);
  min-height: 100vh;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
  padding: 64px 0 54px;
  text-align: center;
}

.public-header { margin-bottom: 34px; }
.eyebrow {
  margin-bottom: 6px;
  color: var(--pink-deep);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.public-header h1 {
  margin-bottom: 0;
  font-size: clamp(2.25rem, 8vw, 4.6rem);
  font-weight: 880;
  letter-spacing: -.055em;
  line-height: .95;
}

.ice-cream {
  display: flex;
  min-height: 220px;
  align-items: center;
  flex-direction: column;
  justify-content: flex-end;
  margin: 8px 0 34px;
  filter: drop-shadow(0 22px 18px rgb(96 55 79 / 17%));
}

.scoop-stack {
  position: relative;
  z-index: 2;
  display: flex;
  width: 184px;
  flex-direction: column;
  transform: translateY(18px);
}

.scoop-row {
  position: relative;
  height: 52px;
  flex: 0 0 52px;
}

.scoop {
  position: relative;
  z-index: 3;
  display: block;
  width: 112px;
  height: auto;
  flex: 0 0 auto;
  margin: 0;
  filter: drop-shadow(0 7px 5px rgb(91 41 66 / 16%));
  animation: scoop-arrive 450ms cubic-bezier(.2, .8, .2, 1) both;
}

.scoop-row > .scoop {
  position: absolute;
  top: 0;
  z-index: auto;
}

.scoop--left {
  left: 4px;
  transform: translateY(-8px);
}

.scoop--right {
  right: 4px;
  transform: translateY(8px);
}

.cone-assembly {
  position: relative;
  width: 136px;
  height: 247px;
  flex: 0 0 auto;
}

.cone {
  position: absolute;
  top: 40px;
  left: 0;
  display: block;
  width: 100%;
  height: auto;
}

.cone--back { z-index: 1; }

.scoop--base {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 3;
  margin: 0;
  transform: translateX(-50%);
}

.cone--front {
  z-index: 5;
  filter: drop-shadow(0 10px 7px rgb(91 52 25 / 16%));
}

.ice-cream--balanced .cone-assembly { opacity: .72; }

.balance-sentence {
  appearance: none;
  max-width: 660px;
  padding: 0;
  border: 0;
  margin-bottom: 0;
  background: transparent;
  color: inherit;
  cursor: default;
  font-family: inherit;
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 770;
  letter-spacing: -.025em;
  line-height: 1.25;
  user-select: none;
}

.balance-sentence:focus-visible { outline: 3px solid rgb(245 141 172 / 35%); outline-offset: 5px; }

@keyframes scoop-arrive {
  from { opacity: 0; }
  to { opacity: 1; }
}

.admin-page {
  min-height: 100vh;
  background:
    linear-gradient(rgb(255 248 242 / 92%), rgb(255 248 242 / 92%)),
    radial-gradient(circle at 20% 20%, var(--pink-soft), transparent 22rem);
}

.admin-bar {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 max(20px, calc((100vw - 1100px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 70%);
  backdrop-filter: blur(14px);
}

.brand {
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 880;
  letter-spacing: -.035em;
  text-decoration: none;
}

.admin-bar nav { display: flex; align-items: center; gap: 18px; }
.admin-bar nav form { margin: 0; }
.admin-bar > a:not(.brand),
.admin-bar nav a,
.link-button {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: .86rem;
  font-weight: 700;
  text-decoration: none;
}
.admin-bar a:hover,
.link-button:hover { color: var(--pink-deep); }

.admin-shell {
  width: min(100% - 32px, 1100px);
  margin: 0 auto;
  padding: 46px 0 80px;
}

.form-shell {
  width: min(100% - 32px, 680px);
  margin: 0 auto;
  padding: 56px 0 80px;
}

.admin-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.admin-heading h1,
.form-shell h1 {
  margin-bottom: 0;
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  font-weight: 850;
  letter-spacing: -.045em;
  line-height: 1.05;
}

.balance-pill {
  margin: 0;
  padding: 10px 16px;
  border: 1px solid rgb(201 81 123 / 16%);
  border-radius: 999px;
  background: var(--pink-soft);
  color: #8e3457;
  font-size: .88rem;
  font-weight: 780;
  text-align: center;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel + .panel { margin-top: 28px; }
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 21px 24px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 48%);
}
.panel-heading .eyebrow { margin-bottom: 3px; }
.panel-heading h2,
.panel-heading h1 { margin: 0; font-size: 1.18rem; font-weight: 820; letter-spacing: -.025em; }

.mini-scoop {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50% 50% 45% 45%;
  background: radial-gradient(circle at 32% 27%, #fff 0 4px, transparent 5px), var(--pink);
  box-shadow: inset -5px -6px 10px rgb(119 37 68 / 10%);
}

.entry-form { display: grid; gap: 20px; padding: 24px; }
.direction-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.direction-fieldset legend,
.entry-form > label > span,
.form-grid label > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .79rem;
  font-weight: 780;
}
.entry-form label small { font-weight: 600; }
.direction-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.direction-option { position: relative; cursor: pointer; }
.direction-option input { position: absolute; opacity: 0; pointer-events: none; }
.direction-option > span {
  display: flex;
  min-height: 72px;
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface-solid);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.direction-option strong { font-size: 1rem; }
.direction-option small { margin-top: 2px; color: var(--muted); font-size: .78rem; }
.direction-option input:checked + span { border-color: var(--pink); box-shadow: 0 0 0 3px rgb(245 141 172 / 18%); }
.direction-option:hover > span { transform: translateY(-1px); }
.direction-option input:focus-visible + span { outline: 3px solid rgb(245 141 172 / 32%); outline-offset: 2px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.entry-form input[type="number"],
.entry-form input[type="date"],
.entry-form input[type="text"] {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-solid);
  color: var(--ink);
  outline: none;
}
.entry-form input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgb(245 141 172 / 18%); }

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}
.primary-button { justify-self: start; background: var(--pink-deep); color: #fff; box-shadow: 0 8px 22px rgb(201 81 123 / 23%); }
.primary-button:hover { background: #b64269; transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--line); background: var(--surface-solid); color: var(--ink); }
.danger-button { background: var(--danger); color: #fff; }
.primary-button:focus-visible,
.secondary-button:focus-visible,
.danger-button:focus-visible { outline: 3px solid rgb(245 141 172 / 35%); outline-offset: 3px; }

.form-error {
  margin: 20px 24px 0;
  padding: 11px 14px;
  border: 1px solid rgb(180 35 59 / 24%);
  border-radius: 10px;
  background: rgb(180 35 59 / 7%);
  color: var(--danger);
  font-size: .88rem;
  font-weight: 700;
}

.entry-count {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--pink-soft);
  color: var(--pink-deep);
  font-size: .78rem;
  font-weight: 850;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: .68rem; font-weight: 830; letter-spacing: .08em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgb(255 224 233 / 16%); }
.scoop-count {
  display: inline-flex;
  min-width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 50%;
  background: var(--pink-soft);
  color: var(--pink-deep);
  font-weight: 850;
}
.note-cell { max-width: 300px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.actions { white-space: nowrap; text-align: right; }
.actions a { color: var(--muted); font-size: .78rem; font-weight: 720; text-decoration: none; }
.actions a + a { margin-left: 12px; }
.actions a:hover { color: var(--pink-deep); text-decoration: underline; }
.actions .danger-link:hover { color: var(--danger); }

.empty-state { display: grid; min-height: 210px; place-items: center; align-content: center; color: var(--muted); }
.empty-state p { margin: 14px 0 0; font-size: .9rem; }
.empty-cone {
  width: 46px;
  height: 58px;
  background: repeating-linear-gradient(55deg, transparent 0 8px, var(--cone-light) 9px 11px), var(--cone);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  opacity: .75;
}
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.confirmation-panel { padding: 32px; }
.confirmation-panel h1 { margin-bottom: 20px; }
.confirmation-note { padding: 13px 15px; border-left: 3px solid var(--pink); background: var(--pink-soft); font-style: italic; }
.warning { color: var(--danger); font-size: .86rem; font-weight: 750; }
.confirmation-panel .form-actions { margin-top: 26px; }

@media (max-width: 700px) {
  .ice-stage { padding-top: 78px; }
  .public-header { margin-bottom: 24px; }
  .admin-bar { min-height: 58px; padding: 0 14px; }
  .admin-bar nav { gap: 12px; }
  .admin-bar nav a { display: none; }
  .admin-shell { width: min(100% - 24px, 1100px); padding: 30px 0 52px; }
  .form-shell { width: min(100% - 24px, 680px); padding: 30px 0 52px; }
  .admin-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
  .balance-pill { width: 100%; }
  .panel { border-radius: 14px; }
  .panel-heading { padding: 18px; }
  .entry-form { padding: 18px; }
  .form-error { margin: 16px 18px 0; }
  .direction-options,
  .form-grid { grid-template-columns: 1fr; }
  table { min-width: 740px; }
  .confirmation-panel { padding: 24px 20px; }
}

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

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f6edf5;
    --muted: #b9abba;
    --canvas: #17121a;
    --surface: rgb(36 29 39 / 90%);
    --surface-solid: #241d27;
    --line: #493d4b;
    --pink-soft: #472534;
    --pink-deep: #ff9cba;
    --danger: #ff8294;
    --shadow: 0 24px 70px rgb(0 0 0 / 24%);
  }
  .public-page { background: radial-gradient(circle at 18% 15%, rgb(105 45 71 / 48%), transparent 28rem), radial-gradient(circle at 85% 80%, rgb(42 99 84 / 35%), transparent 30rem), var(--canvas); }
  .admin-page { background: linear-gradient(rgb(23 18 26 / 90%), rgb(23 18 26 / 90%)), radial-gradient(circle at 20% 20%, #472534, transparent 22rem); }
  .admin-bar { background: rgb(30 23 33 / 75%); }
  .panel-heading { background: rgb(49 38 52 / 55%); }
  .balance-pill { color: #ffb1c9; }
  .primary-button { color: #24151b; background: #ff94b5; }
  .primary-button:hover { background: #ffacc5; }
  .danger-button { color: #2c1016; background: #ff8294; }
  .form-error { color: #ff9baa; background: rgb(255 130 148 / 8%); }
}
