:root {
  color-scheme: dark;
  --bg: #0f1110;
  --panel: rgba(22, 26, 24, 0.7);
  --panel-2: rgba(35, 42, 38, 0.58);
  --line: rgba(216, 209, 195, 0.1);
  --text: #f5f1e8;
  --muted: #aab2ad;
  --soft: #d8d1c3;
  --green: #39d98a;
  --cyan: #48c7d8;
  --yellow: #f4d35e;
  --coral: #ff8a5b;
  --red: #ff4f6d;
  --accent: #39d98a;
  --accent-contrast: #07110b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  --soft-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
}

body[data-theme="cyan"] {
  --accent: var(--cyan);
  --accent-contrast: #061012;
}

body[data-theme="rose"] {
  --accent: var(--red);
  --accent-contrast: #fff4f6;
}

body[data-theme="gold"] {
  --accent: var(--yellow);
  --accent-contrast: #111007;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  scrollbar-width: none;
  background: var(--bg);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 8%, rgba(57, 217, 138, 0.11), transparent 330px),
    radial-gradient(circle at 90% 18%, rgba(255, 79, 109, 0.08), transparent 340px),
    linear-gradient(180deg, rgba(72, 199, 216, 0.045), transparent 420px),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(245, 241, 232, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 241, 232, 0.018) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 72%);
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px clamp(14px, 3vw, 38px) 48px;
}

.topbar,
.admin-heading,
.list-heading,
.form-actions,
.item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: -22px calc(clamp(14px, 3vw, 38px) * -1) 22px;
  padding: 14px clamp(14px, 3vw, 38px);
  background: rgba(15, 17, 16, 0.72);
  border-bottom: 1px solid rgba(216, 209, 195, 0.07);
  backdrop-filter: blur(16px);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--accent-contrast);
  background:
    linear-gradient(140deg, color-mix(in srgb, var(--accent), #fff 18%), var(--accent));
  box-shadow: 0 0 30px color-mix(in srgb, var(--accent), transparent 68%);
  border-radius: 8px;
  font-weight: 860;
}

.brand small,
.eyebrow {
  display: block;
  color: color-mix(in srgb, var(--accent), #f5f1e8 28%);
  font-size: 0.76rem;
  font-weight: 780;
  text-transform: uppercase;
}

.brand strong {
  display: block;
  margin-top: 1px;
  font-size: 1.12rem;
}

.admin-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: var(--soft);
  text-decoration: none;
  background: rgba(24, 28, 26, 0.52);
  border: 1px solid rgba(216, 209, 195, 0.1);
  border-radius: 8px;
}

.top-menu {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.menu-button {
  display: inline-grid;
  gap: 5px;
  place-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--text);
  background: rgba(24, 28, 26, 0.62);
  border: 1px solid rgba(216, 209, 195, 0.12);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transition: transform 160ms ease, opacity 160ms ease;
}

.menu-button.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-button.is-open span:nth-child(2) {
  opacity: 0;
}

.menu-button.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.top-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 178px;
  padding: 8px;
  background: rgba(18, 21, 20, 0.94);
  border: 1px solid rgba(216, 209, 195, 0.13);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(18px);
  animation: menuIn 150ms ease both;
}

.top-menu-panel a {
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 0 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 760;
}

.top-menu-panel a:hover {
  background: rgba(245, 241, 232, 0.08);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: clamp(18px, 4vw, 46px);
  align-items: center;
  min-height: 50vh;
}

.direct-reveal .hero-panel {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
  min-height: 24vh;
  text-align: center;
}

.hero-copy h1,
.admin-login h1,
.admin-heading h1 {
  margin: 6px 0 0;
  font-size: clamp(2.2rem, 7vw, 5rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  max-width: 520px;
  margin: 16px 0 0;
  color: var(--soft);
  font-size: 1.08rem;
  line-height: 1.55;
}

.hero-copy p:empty {
  display: none;
}

.direct-reveal .hero-copy p:last-child {
  margin-inline: auto;
}

.code-card,
.gift-card,
.admin-login,
.gift-form,
.gift-list-panel,
.gift-list-item {
  background: var(--panel);
  border: 1px solid rgba(216, 209, 195, 0.095);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

.code-card,
.admin-login,
.gift-form,
.gift-list-panel {
  padding: 18px;
}

.code-card,
.admin-login form,
.gift-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 730;
}

input,
textarea,
select {
  width: 100%;
  color: var(--text);
  background: rgba(12, 14, 14, 0.52);
  border: 1px solid rgba(216, 209, 195, 0.1);
  border-radius: 8px;
  outline: 0;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(72, 199, 216, 0.13);
}

.primary-button,
.ghost-button,
.danger-button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 760;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.primary-button {
  color: var(--accent-contrast);
  background: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent), transparent 36%);
}

.ghost-button {
  color: var(--text);
  background: rgba(32, 37, 35, 0.62);
  border: 1px solid rgba(216, 209, 195, 0.12);
}

.danger-button {
  color: #ffd5dc;
  background: rgba(255, 79, 109, 0.11);
  border: 1px solid rgba(255, 79, 109, 0.52);
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.64;
  transform: none !important;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--soft);
  line-height: 1.4;
}

.gift-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 44px);
  align-items: center;
  min-height: 50vh;
  margin-top: 18px;
  padding: clamp(12px, 2vw, 24px);
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 38%, color-mix(in srgb, var(--accent), transparent 84%), transparent 260px),
    rgba(16, 17, 17, 0.24);
  border: 1px solid rgba(216, 209, 195, 0.07);
  border-radius: 8px;
}

.gift-stage.is-real {
  overflow: visible;
}

.gift-stage::after {
  content: "";
  position: absolute;
  inset: -40%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(105deg, transparent 36%, rgba(245, 241, 232, 0.18), transparent 62%);
  transform: translateX(-40%) rotate(8deg);
}

.gift-stage.is-shimmering::after {
  animation: stageSweep 2300ms ease-in-out infinite;
}

.gift-box {
  position: relative;
  z-index: 2;
  width: min(360px, 80vw);
  aspect-ratio: 1;
  justify-self: center;
  cursor: pointer;
  transform-origin: 50% 72%;
  transition: filter 260ms ease;
  animation: giftIdle 3900ms ease-in-out infinite;
}

.gift-box::before,
.gift-box::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0;
}

.gift-box::before {
  inset: 8%;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 34%);
  border-radius: 50%;
  transform: scale(0.78);
}

.gift-box::after {
  left: 50%;
  top: 40%;
  width: 10px;
  height: 10px;
  background: #f5f1e8;
  border-radius: 50%;
  box-shadow:
    -84px -42px 0 -2px var(--accent),
    92px -28px 0 -2px var(--yellow),
    -58px 72px 0 -2px var(--cyan),
    74px 64px 0 -2px var(--coral);
  transform: translate(-50%, -50%) scale(0.4);
}

.gift-stage.is-opening .gift-box::before,
.gift-stage.is-unlocked .gift-box::before {
  animation: magicRing 1700ms ease-out infinite;
}

.gift-stage.is-opening .gift-box::after,
.gift-stage.is-tapped .gift-box::after {
  animation: boxSpark 900ms ease-out both;
}

.gift-body,
.gift-lid,
.gift-bow,
.gift-ribbon,
.gift-glow,
.gift-shadow,
.gift-body-shine {
  position: absolute;
  border-radius: 8px;
}

.gift-body {
  left: 12%;
  right: 12%;
  bottom: 11%;
  height: 49%;
  background:
    linear-gradient(120deg, rgba(245, 241, 232, 0.16), transparent 34%),
    linear-gradient(140deg, color-mix(in srgb, var(--accent), #fff 12%), color-mix(in srgb, var(--cyan), var(--accent) 36%));
  border: 1px solid rgba(245, 241, 232, 0.24);
  box-shadow: inset 0 -28px 50px rgba(0, 0, 0, 0.18);
}

.gift-lid {
  left: 7%;
  right: 7%;
  top: 29%;
  height: 17%;
  z-index: 4;
  background:
    linear-gradient(120deg, rgba(245, 241, 232, 0.95), rgba(216, 209, 195, 0.86));
  transform-origin: 18% 100%;
  transition: transform 980ms cubic-bezier(0.16, 1, 0.3, 1), filter 980ms ease;
}

.gift-ribbon {
  left: 44.5%;
  top: 26%;
  bottom: 11%;
  z-index: 5;
  width: 11%;
  background:
    linear-gradient(90deg, rgba(245, 241, 232, 0.16), transparent 42%),
    rgba(16, 17, 17, 0.84);
}

.gift-bow {
  top: 18%;
  z-index: 6;
  width: 29%;
  height: 20%;
  border: 14px solid rgba(245, 241, 232, 0.9);
  background: transparent;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.22));
}

.gift-bow-left {
  left: 23%;
  transform: rotate(-18deg) skewX(-8deg);
  border-radius: 70% 28% 58% 42%;
}

.gift-bow-right {
  right: 23%;
  transform: rotate(18deg) skewX(8deg);
  border-radius: 28% 70% 42% 58%;
}

.gift-body-shine {
  left: 19%;
  right: 19%;
  bottom: 44%;
  z-index: 3;
  height: 2px;
  background: rgba(245, 241, 232, 0.44);
  opacity: 0.7;
}

.gift-shadow {
  left: 14%;
  right: 14%;
  bottom: 4%;
  height: 14%;
  background: rgba(0, 0, 0, 0.34);
  filter: blur(18px);
}

.gift-glow {
  inset: 17%;
  z-index: 1;
  background: color-mix(in srgb, var(--accent), transparent 46%);
  filter: blur(44px);
  opacity: 0;
  transition: opacity 1100ms ease, transform 1100ms ease;
}

.gift-stage.is-opening .gift-box {
  animation: giftAnticipation 5200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.gift-stage.is-ribbon .gift-ribbon {
  animation: ribbonWarmup 1600ms ease-in-out infinite;
}

.gift-stage.is-ribbon .gift-bow-left {
  animation: bowTugLeft 1500ms ease-in-out infinite;
}

.gift-stage.is-ribbon .gift-bow-right {
  animation: bowTugRight 1500ms ease-in-out infinite;
}

.gift-stage.is-unlocked .gift-glow,
.gift-stage.is-tapped .gift-glow {
  opacity: 0.9;
  transform: scale(1.18);
}

.gift-stage.is-unlocked .gift-glow {
  animation: glowPulse 1400ms ease-in-out infinite;
}

.gift-stage.is-opened .gift-lid {
  transform: translateY(-142px) translateX(-34px) rotate(-32deg);
  filter: drop-shadow(0 18px 34px color-mix(in srgb, var(--accent), transparent 70%));
}

.gift-stage.is-opened .gift-glow {
  opacity: 1;
  transform: scale(1.45);
}

.gift-stage.is-opened .gift-bow {
  animation: bowRelease 1450ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.gift-stage.is-opened .gift-ribbon {
  animation: ribbonSnap 1300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.gift-stage.is-spark.is-opened .gift-box {
  animation: sparkShake 1500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.gift-stage.is-quiet .gift-box {
  filter: saturate(0.88);
}

.gift-card {
  position: relative;
  z-index: 3;
  padding: clamp(18px, 4vw, 30px);
  text-align: center;
  animation: cardIn 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.gift-card > .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(100%, 300px);
  margin: 16px auto 0;
}

.gift-card h2 {
  margin: 6px 0 0;
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  line-height: 1;
}

.gift-note,
#giftMessage {
  color: var(--soft);
  line-height: 1.6;
  white-space: pre-wrap;
}

.reveal-status {
  min-height: 24px;
  margin: 12px 0;
  color: color-mix(in srgb, var(--accent), #f5f1e8 35%);
  font-weight: 780;
  letter-spacing: 0;
}

.reveal-status:empty {
  display: none;
}

.prep-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  margin-inline: auto;
  width: min(100%, 520px);
}

.prep-copy {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  color: var(--soft);
  font-weight: 760;
}

.prep-copy span {
  min-width: 0;
}

.prep-copy span:empty {
  display: none;
}

.prep-copy strong {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.prep-meter {
  height: 18px;
  padding: 4px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(245, 241, 232, 0.08), rgba(245, 241, 232, 0.025)),
    rgba(10, 12, 12, 0.46);
  border: 1px solid rgba(216, 209, 195, 0.16);
  border-radius: 999px;
}

.prep-meter span {
  display: block;
  width: 0%;
  height: 100%;
  background:
    linear-gradient(90deg, var(--accent), var(--cyan), var(--yellow));
  border-radius: inherit;
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent), transparent 42%);
  transition: width 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.open-slider {
  --slide-progress: 0%;
  position: relative;
  height: 64px;
  margin-top: 18px;
  margin-inline: auto;
  width: min(100%, 520px);
  overflow: hidden;
  user-select: none;
  touch-action: none;
  background:
    linear-gradient(180deg, rgba(245, 241, 232, 0.08), rgba(245, 241, 232, 0.025)),
    rgba(10, 12, 12, 0.66);
  border: 1px solid rgba(216, 209, 195, 0.16);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(245, 241, 232, 0.035);
}

.open-slider:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent), transparent 50%);
  outline-offset: 3px;
}

.slider-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--slide-progress);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent), transparent 4%), color-mix(in srgb, var(--cyan), #f5f1e8 10%));
  box-shadow: 0 0 34px color-mix(in srgb, var(--accent), transparent 54%);
}

.slider-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--soft);
  font-weight: 820;
  pointer-events: none;
}

.slider-thumb {
  position: absolute;
  top: 7px;
  left: clamp(7px, calc(var(--slide-progress) - 25px), calc(100% - 57px));
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  background:
    linear-gradient(140deg, #f5f1e8, color-mix(in srgb, var(--accent), #f5f1e8 48%));
  border: 1px solid rgba(245, 241, 232, 0.66);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  transition: left 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.gift-stage.is-sliding .slider-thumb {
  transition: none;
}

.slider-thumb::before,
.slider-thumb::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-top: 2px solid #111;
  border-right: 2px solid #111;
  transform: rotate(45deg);
}

.slider-thumb::before {
  margin-left: -8px;
  opacity: 0.62;
}

.slider-thumb::after {
  margin-left: 8px;
}

.gift-stage.is-prepared .prep-meter span {
  animation: preparedPulse 1200ms ease-in-out infinite;
}

.gift-content {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  text-align: center;
  animation: revealContent 1160ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.prank-followup {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 14px;
  background: rgba(245, 241, 232, 0.055);
  border: 1px solid rgba(216, 209, 195, 0.12);
  border-radius: 8px;
}

.prank-followup p {
  margin: 0;
  color: var(--soft);
  font-weight: 780;
}

.gift-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.gift-images img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.confetti-layer {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  left: 33%;
  top: 50%;
  width: var(--size);
  height: calc(var(--size) * 1.55);
  background: var(--color);
  border-radius: 2px;
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: confettiFly var(--duration) cubic-bezier(0.12, 0.82, 0.22, 1) var(--delay) both;
}

.sparkle-piece {
  position: absolute;
  left: 31%;
  top: 49%;
  width: var(--size);
  height: var(--size);
  z-index: 8;
  background: var(--color);
  border-radius: 50%;
  box-shadow: 0 0 18px var(--color);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.35);
  animation: sparklePop var(--duration) cubic-bezier(0.16, 1, 0.3, 1) var(--delay) both;
}

.sparkle-piece:nth-child(2n) {
  border-radius: 2px;
}

.confetti-piece:nth-child(3n) {
  border-radius: 50%;
}

.confetti-piece:nth-child(4n) {
  height: 3px;
}

.admin-login {
  width: min(440px, 100%);
  margin: 12vh auto 0;
}

.admin-login h1 {
  font-size: clamp(2rem, 6vw, 3.8rem);
}

.admin-dashboard {
  display: grid;
  gap: 18px;
}

.admin-heading h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.compact-row {
  align-items: end;
}

.toggle-setting {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 42px;
}

.wide-toggle {
  padding: 10px 12px;
  background: rgba(245, 241, 232, 0.035);
  border: 1px solid rgba(216, 209, 195, 0.09);
  border-radius: 8px;
}

.toggle-setting input {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

.prank-admin-fields {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: rgba(245, 241, 232, 0.04);
  border: 1px solid rgba(216, 209, 195, 0.09);
  border-radius: 8px;
}

.gift-list-panel {
  display: grid;
  gap: 12px;
}

.list-heading h2 {
  margin: 0;
}

.list-heading span {
  display: grid;
  place-items: center;
  min-width: 34px;
  min-height: 30px;
  color: var(--accent-contrast);
  background: var(--accent);
  border-radius: 8px;
  font-weight: 820;
}

.gift-list {
  display: grid;
  gap: 12px;
}

.gift-list-item {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.gift-list-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.gift-list-main h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.gift-list-main p,
.qr-row span,
.empty-message {
  margin: 4px 0 0;
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 7px;
  background: var(--red);
  border-radius: 50%;
}

.status-dot.is-active {
  background: var(--green);
}

.share-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.share-box input {
  min-width: 0;
  text-overflow: ellipsis;
}

.item-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.qr-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.qr-row img {
  width: 86px;
  height: 86px;
  padding: 6px;
  background: #f5f1e8;
  border-radius: 8px;
}

.is-hidden {
  display: none !important;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes stageSweep {
  0%,
  34% {
    opacity: 0;
    transform: translateX(-40%) rotate(8deg);
  }
  50% {
    opacity: 1;
  }
  74%,
  100% {
    opacity: 0;
    transform: translateX(42%) rotate(8deg);
  }
}

@keyframes preparedPulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.35);
  }
}

@keyframes revealContent {
  from {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes giftIdle {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-7px) rotate(-0.7deg);
  }
}

@keyframes giftAnticipation {
  0% {
    transform: translateY(0) rotate(0) scale(1);
  }
  12% {
    transform: translateY(-4px) rotate(-1deg) scale(1.01);
  }
  27% {
    transform: translateY(2px) rotate(1.2deg) scale(0.995);
  }
  46% {
    transform: translateY(-7px) rotate(-1.4deg) scale(1.025);
  }
  63% {
    transform: translateY(1px) rotate(1deg) scale(1.01);
  }
  78% {
    transform: translateY(-12px) rotate(-2deg) scale(1.045);
  }
  91% {
    transform: translateY(3px) rotate(1.4deg) scale(1.015);
  }
  100% {
    transform: translateY(0) rotate(0) scale(1);
  }
}

@keyframes magicRing {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }
  20% {
    opacity: 0.82;
  }
  100% {
    opacity: 0;
    transform: scale(1.34);
  }
}

@keyframes boxSpark {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35) rotate(0);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.8) rotate(24deg);
  }
}

@keyframes ribbonWarmup {
  0%,
  100% {
    filter: brightness(1);
    transform: scaleX(1);
  }
  50% {
    filter: brightness(1.8);
    transform: scaleX(1.12);
  }
}

@keyframes bowTugLeft {
  0%,
  100% {
    transform: rotate(-18deg) skewX(-8deg) translate(0, 0);
  }
  50% {
    transform: rotate(-26deg) skewX(-8deg) translate(-10px, -8px);
  }
}

@keyframes bowTugRight {
  0%,
  100% {
    transform: rotate(18deg) skewX(8deg) translate(0, 0);
  }
  50% {
    transform: rotate(26deg) skewX(8deg) translate(10px, -8px);
  }
}

@keyframes glowPulse {
  0%,
  100% {
    opacity: 0.58;
    transform: scale(1.05);
  }
  50% {
    opacity: 1;
    transform: scale(1.32);
  }
}

@keyframes bowRelease {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-72px) rotate(42deg) scale(0.74);
  }
}

@keyframes ribbonSnap {
  0% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
  100% {
    clip-path: inset(0 0 72% 0);
    opacity: 0.22;
  }
}

@keyframes confettiFly {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.65) rotate(0);
  }
  14% {
    opacity: 1;
  }
  62% {
    opacity: 1;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1) rotate(var(--rotate));
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y) + var(--fall))) scale(0.92) rotate(var(--rotate-end));
  }
}

@keyframes sparklePop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.25) rotate(0);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1) rotate(210deg);
  }
}

@keyframes sparkShake {
  0% {
    transform: rotate(0) scale(1);
  }
  35% {
    transform: rotate(-3deg) scale(1.04);
  }
  70% {
    transform: rotate(3deg) scale(1.02);
  }
  100% {
    transform: rotate(0) scale(1);
  }
}

@media (max-width: 860px) {
  .hero-panel,
  .gift-stage,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: auto;
    padding-top: 10px;
  }

  .admin-heading {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding-bottom: 22px;
  }

  .topbar {
    margin-bottom: 8px;
  }

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

  .brand small {
    font-size: 0.66rem;
  }

  .brand strong {
    font-size: 1rem;
  }

  .admin-link {
    min-height: 36px;
    padding: 0 11px;
  }

  .direct-reveal .hero-panel {
    min-height: auto;
    padding-top: 8px;
  }

  .hero-copy h1,
  .admin-login h1,
  .admin-heading h1 {
    font-size: clamp(2.1rem, 12vw, 3.4rem);
    line-height: 0.98;
  }

  .form-row,
  .share-box,
  .item-actions {
    grid-template-columns: 1fr;
  }

  .form-actions,
  .item-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .gift-box {
    width: min(196px, 58vw);
  }

  .gift-stage {
    gap: 8px;
    margin-top: 8px;
    padding: 10px;
  }

  .gift-card h2 {
    font-size: clamp(1.8rem, 9vw, 2.6rem);
  }

  .gift-note,
  #giftMessage {
    margin-block: 10px;
  }

  .prep-panel {
    margin-top: 12px;
  }

  .gift-card > .primary-button {
    margin-top: 12px;
  }

  .prep-copy {
    align-items: center;
    flex-direction: row;
  }

  .open-slider {
    height: 58px;
  }

  .slider-thumb {
    top: 6px;
    width: 46px;
    height: 46px;
  }

  .sparkle-piece {
    left: 50%;
    top: 34%;
  }

  .code-card,
  .admin-login,
  .gift-form,
  .gift-list-panel,
  .gift-card {
    padding: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gift-box,
  .gift-stage.is-opening .gift-box,
  .gift-stage.is-shimmering::after,
  .gift-stage.is-ribbon .gift-ribbon,
  .gift-stage.is-ribbon .gift-bow-left,
  .gift-stage.is-ribbon .gift-bow-right,
  .gift-stage.is-unlocked .gift-glow,
  .gift-stage.is-prepared .prep-meter span,
  .confetti-piece,
  .sparkle-piece {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}
