:root {
  --primary: #ff78aa;
  --primary-rgb: 255, 120, 170;
  --secondary: #fff2f7;
  --accent: #7be7d4;
  --accent-rgb: 123, 231, 212;
  --gold: #ffd47e;
  --ink: #2a1320;
  --muted: rgba(42, 19, 32, 0.68);
  --glass: rgba(255, 255, 255, 0.2);
  --glass-strong: rgba(255, 255, 255, 0.32);
  --glass-line: rgba(255, 255, 255, 0.48);
  --shadow: 0 24px 70px rgba(157, 55, 96, 0.24);
  --blur: 22px;
  --radius: 8px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family:
    Inter,
    "PingFang SC",
    "HarmonyOS Sans SC",
    "Microsoft YaHei",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at 16% 14%, rgba(255, 209, 232, 0.88), transparent 30vw),
    radial-gradient(circle at 84% 10%, rgba(123, 231, 212, 0.32), transparent 24vw),
    linear-gradient(135deg, #170914 0%, #381629 35%, #ffedf4 100%);
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

body.is-loading {
  overflow: hidden;
}

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

button {
  border: 0;
}

img,
video,
canvas {
  display: block;
}

::selection {
  background: rgba(var(--primary-rgb), 0.34);
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  gap: 22px;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 147, 188, 0.18), transparent 28%),
    #050207;
  color: #fff;
  opacity: 1;
  transition:
    opacity 900ms ease,
    visibility 900ms ease;
}

.loader.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loader__halo {
  position: absolute;
  width: min(66vw, 360px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 125, 174, 0.24), transparent 62%),
    conic-gradient(from 90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  filter: blur(2px);
  animation: loaderSpin 8s linear infinite;
}

.loader__mark {
  position: relative;
  z-index: 1;
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 0 28px rgba(255, 255, 255, 0.12),
    0 0 42px rgba(var(--primary-rgb), 0.54);
  color: #fff4f9;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(255, 154, 193, 0.95);
}

.loader__bar {
  position: relative;
  z-index: 1;
  width: min(320px, 72vw);
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.loader__bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fff, var(--primary), var(--accent));
  box-shadow: 0 0 16px rgba(255, 128, 176, 0.86);
  transition: width 260ms ease;
}

.loader p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
}

.background-media,
.background-image,
.background-tint,
.canvas-layer,
.petal-layer {
  position: fixed;
  inset: 0;
}

.background-media {
  z-index: -6;
  overflow: hidden;
  background: #0d050b;
}

.background-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 800ms ease;
}

.background-media video.is-visible {
  opacity: 0.42;
}

.background-image {
  background-position: center;
  background-size: cover;
  opacity: 0.3;
  mix-blend-mode: screen;
  transition: opacity 600ms ease;
}

.background-tint {
  background:
    radial-gradient(circle at 45% 18%, rgba(255, 255, 255, 0.24), transparent 22rem),
    radial-gradient(circle at 12% 86%, rgba(var(--accent-rgb), 0.22), transparent 18rem),
    linear-gradient(135deg, rgba(18, 6, 18, 0.86) 0%, rgba(76, 22, 50, 0.58) 42%, rgba(255, 238, 246, 0.72) 100%);
}

body.accepted .background-tint {
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.68), transparent 23rem),
    radial-gradient(circle at 18% 82%, rgba(var(--accent-rgb), 0.22), transparent 17rem),
    linear-gradient(135deg, rgba(255, 245, 250, 0.94) 0%, rgba(255, 218, 232, 0.88) 48%, rgba(255, 255, 255, 0.92) 100%);
}

.canvas-layer {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.canvas-layer--stars {
  z-index: -4;
}

.canvas-layer--effects {
  z-index: 22;
}

.petal-layer {
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -8vh;
  width: 14px;
  height: 20px;
  border-radius: 82% 18% 72% 28%;
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.82), transparent 28%),
    linear-gradient(135deg, rgba(255, 165, 196, 0.96), rgba(255, 92, 144, 0.64));
  box-shadow: 0 0 18px rgba(255, 104, 157, 0.32);
  opacity: 0.72;
  transform-origin: center;
  animation-name: petalFall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.cursor-light {
  position: fixed;
  z-index: 25;
  left: 0;
  top: 0;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.44), rgba(var(--primary-rgb), 0.18) 32%, transparent 68%);
  mix-blend-mode: screen;
  transition: opacity 300ms ease;
}

.cursor-light.is-visible {
  opacity: 0.82;
}

.toast-root {
  position: fixed;
  z-index: 50;
  left: 50%;
  top: 22%;
  display: grid;
  gap: 10px;
  width: min(320px, calc(100vw - 40px));
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: var(--radius);
  color: #fff;
  background: rgba(34, 13, 25, 0.44);
  box-shadow: 0 16px 42px rgba(68, 18, 39, 0.25);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  text-align: center;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.34);
  animation: toastIn 280ms ease both;
}

.toast.is-leaving {
  animation: toastOut 320ms ease both;
}

.accepted-badge {
  position: fixed;
  z-index: 70;
  left: 50%;
  top: 50%;
  width: min(520px, calc(100vw - 44px));
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08)),
    rgba(255, 92, 146, 0.34);
  box-shadow:
    0 26px 80px rgba(255, 89, 148, 0.36),
    inset 0 0 30px rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  text-align: center;
  font-size: clamp(26px, 7vw, 46px);
  font-weight: 900;
  line-height: 1.25;
  text-shadow:
    0 0 18px rgba(255, 255, 255, 0.84),
    0 0 38px rgba(255, 105, 164, 0.72);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.heart-settings {
  position: fixed;
  z-index: 80;
  left: max(18px, env(safe-area-inset-left, 0px) + 18px);
  top: max(18px, var(--safe-top) + 18px);
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  box-shadow:
    0 12px 34px rgba(183, 58, 104, 0.24),
    0 0 24px rgba(var(--primary-rgb), 0.38),
    inset 0 0 20px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  cursor: pointer;
  animation: floatButton 4s ease-in-out infinite;
}

.heart-settings span,
.heart-settings span::before,
.heart-settings span::after {
  display: block;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #fff, var(--primary));
}

.heart-settings span {
  position: relative;
  transform: rotate(45deg);
  border-radius: 3px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.72));
}

.heart-settings span::before,
.heart-settings span::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.heart-settings span::before {
  left: -9px;
  top: 0;
}

.heart-settings span::after {
  left: 0;
  top: -9px;
}

.heart-settings:active {
  transform: scale(0.92);
}

.app-shell {
  position: relative;
  z-index: 5;
  min-height: 100vh;
}

.view {
  display: none;
  min-height: 100vh;
  padding: calc(26px + var(--safe-top)) max(24px, env(safe-area-inset-right, 0px) + 24px) calc(32px + var(--safe-bottom)) max(24px, env(safe-area-inset-left, 0px) + 24px);
}

.view.is-active {
  display: grid;
}

.intro-view {
  place-items: center;
}

.intro-card {
  width: min(780px, 100%);
  display: grid;
  justify-items: center;
  gap: 24px;
  padding: clamp(30px, 7vw, 74px) clamp(22px, 6vw, 78px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.19), rgba(255, 255, 255, 0.07)),
    rgba(255, 255, 255, 0.1);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  text-align: center;
}

.intro-kicker,
.memory-kicker,
.panel-eyebrow {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

body.accepted .panel-eyebrow,
body.accepted .memory-kicker {
  color: rgba(120, 45, 78, 0.72);
}

.intro-title {
  min-height: clamp(82px, 16vw, 128px);
  margin: 0;
  color: #fff;
  font-size: clamp(44px, 11vw, 86px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: 0;
  text-shadow:
    0 0 20px rgba(255, 255, 255, 0.82),
    0 0 44px rgba(255, 112, 166, 0.72);
  animation: breatheText 3.6s ease-in-out infinite;
}

.intro-title::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 0.78em;
  margin-left: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.88);
  vertical-align: -0.08em;
  animation: caretBlink 850ms steps(2, jump-none) infinite;
}

.intro-title.is-done::after {
  display: none;
}

.intro-confession {
  max-width: 560px;
  min-height: 48px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(15px, 2.8vw, 18px);
  line-height: 1.9;
}

.choice-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 64px;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}

.choice-actions.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 580ms ease,
    transform 580ms ease;
  pointer-events: auto;
}

.choice-actions.is-visible .choice-button--reject:not(.is-hidden) {
  display: inline-grid;
  visibility: visible;
  opacity: 1;
}

.choice-button {
  position: relative;
  min-width: 132px;
  height: 50px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    opacity 220ms ease;
}

.choice-button:active {
  transform: scale(0.96);
}

.choice-button--agree {
  background: linear-gradient(135deg, #ff77aa, #ff4f8f);
  box-shadow:
    0 16px 42px rgba(255, 84, 141, 0.42),
    0 0 24px rgba(255, 255, 255, 0.2);
  font-weight: 800;
}

.choice-button__glow {
  position: absolute;
  inset: -34% auto auto -30%;
  width: 46%;
  height: 170%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.64), transparent);
  transform: rotate(18deg);
  animation: buttonSheen 2.9s ease-in-out infinite;
}

.choice-button--agree span:last-child,
.choice-button--reject span {
  position: relative;
  z-index: 1;
}

.choice-button--reject {
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.choice-button--reject.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.memory-view {
  align-content: start;
  gap: 24px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.memory-header,
.memory-hero,
.memory-content {
  width: 100%;
}

.memory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 10px;
}

.memory-header h2 {
  margin: 5px 0 0;
  color: #671f42;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1.1;
  letter-spacing: 0;
  text-shadow: 0 12px 36px rgba(255, 101, 158, 0.22);
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 999px;
  color: #7e2a4d;
  background: rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  white-space: nowrap;
}

.header-heart {
  color: var(--primary);
  text-shadow: 0 0 14px rgba(255, 88, 145, 0.68);
  animation: heartPulse 1.8s ease-in-out infinite;
}

.memory-hero {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(230px, 0.7fr);
  gap: 16px;
}

.glass-panel {
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.22)),
    var(--glass);
  box-shadow:
    0 20px 58px rgba(188, 73, 119, 0.17),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}

.time-panel,
.countdown-panel,
.photo-panel,
.quote-panel,
.music-panel {
  padding: clamp(16px, 2.6vw, 24px);
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 15px;
}

.time-unit {
  display: grid;
  gap: 5px;
  min-width: 0;
  min-height: 76px;
  place-items: center;
  border-radius: var(--radius);
  color: #742449;
  background: rgba(255, 255, 255, 0.42);
}

.time-unit strong {
  font-size: clamp(22px, 4vw, 34px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.time-unit span {
  color: rgba(99, 36, 65, 0.68);
  font-size: 12px;
}

.time-unit.is-changing strong {
  animation: numberPop 320ms ease both;
}

.countdown-value {
  margin-top: 16px;
  color: #762548;
  font-size: clamp(23px, 4vw, 38px);
  font-weight: 900;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.memory-content {
  display: grid;
  grid-template-columns: minmax(320px, 1.16fr) minmax(280px, 0.84fr);
  gap: 16px;
  align-items: stretch;
}

.photo-panel {
  min-height: 470px;
  grid-row: span 2;
}

.quote-panel,
.music-panel {
  min-height: 226px;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-heading h3 {
  margin: 4px 0 0;
  color: #662241;
  font-size: 22px;
  line-height: 1.2;
}

.panel-actions,
.music-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.music-play {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #762548;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.icon-button:hover,
.music-play:hover {
  background: rgba(255, 255, 255, 0.66);
  transform: translateY(-1px);
}

.photo-stage {
  position: relative;
  width: 100%;
  height: clamp(310px, 44vw, 520px);
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 24% 20%, rgba(var(--accent-rgb), 0.22), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.42), rgba(255, 190, 215, 0.28));
  cursor: zoom-in;
}

.photo-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition:
    opacity 380ms ease,
    transform 600ms ease;
}

.photo-stage:hover img {
  transform: scale(1.055);
}

.photo-caption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: block;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: var(--radius);
  color: #fff;
  background: rgba(44, 16, 29, 0.34);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-align: left;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.photo-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.photo-dot {
  width: 26px;
  height: 6px;
  border-radius: 999px;
  background: rgba(109, 39, 70, 0.22);
  cursor: pointer;
  transition:
    width 220ms ease,
    background 220ms ease;
}

.photo-dot.is-active {
  width: 44px;
  background: var(--primary);
  box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.44);
}

.quote-text {
  min-height: 120px;
  margin: 0;
  color: #622241;
  font-size: clamp(22px, 3.8vw, 34px);
  font-weight: 800;
  line-height: 1.55;
  text-shadow: 0 14px 36px rgba(255, 106, 161, 0.2);
}

.quote-text .typed-cursor {
  color: var(--primary);
}

.track-meta {
  display: grid;
  gap: 4px;
  margin: 16px 0 14px;
  color: #682340;
}

.track-meta strong {
  font-size: 19px;
}

.track-meta span {
  color: rgba(94, 35, 61, 0.68);
  font-size: 13px;
}

.music-controls {
  width: 100%;
}

.music-controls input,
.volume-control input {
  width: 100%;
  accent-color: var(--primary);
}

.volume-control {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: rgba(94, 35, 61, 0.74);
  font-size: 13px;
}

.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 90;
  visibility: hidden;
  pointer-events: none;
}

.settings-panel.is-open {
  visibility: visible;
  pointer-events: auto;
}

.settings-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 7, 14, 0.28);
  opacity: 0;
  transition: opacity 260ms ease;
}

.settings-panel.is-open .settings-panel__backdrop {
  opacity: 1;
}

.settings-drawer {
  position: absolute;
  left: max(14px, env(safe-area-inset-left, 0px) + 14px);
  top: max(14px, var(--safe-top) + 14px);
  bottom: max(14px, var(--safe-bottom) + 14px);
  width: min(456px, calc(100vw - 28px));
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.32)),
    rgba(255, 241, 247, 0.56);
  box-shadow: 0 30px 90px rgba(104, 36, 64, 0.3);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transform: translateX(calc(-100% - 28px));
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.settings-panel.is-open .settings-drawer {
  transform: translateX(0);
}

.settings-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 20px 14px;
}

.settings-header h2 {
  margin: 4px 0 0;
  color: #64213e;
  font-size: 26px;
}

.settings-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 20px 14px;
  scrollbar-width: none;
}

.settings-tabs::-webkit-scrollbar {
  display: none;
}

.settings-tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: rgba(100, 33, 62, 0.72);
  background: rgba(255, 255, 255, 0.34);
  cursor: pointer;
}

.settings-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #ff5d99);
  box-shadow: 0 8px 22px rgba(var(--primary-rgb), 0.28);
}

.settings-content {
  overflow-y: auto;
  padding: 0 20px 22px;
}

.settings-section {
  display: grid;
  gap: 14px;
}

.setting-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.34);
}

.setting-card h3 {
  margin: 0;
  color: #64213e;
  font-size: 16px;
}

.settings-note {
  margin: 0;
  color: rgba(93, 31, 58, 0.68);
  font-size: 12px;
  line-height: 1.65;
}

.settings-publish-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: var(--radius);
  background: rgba(255, 246, 250, 0.82);
  box-shadow: 0 -10px 28px rgba(126, 40, 78, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.settings-publish-bar div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.settings-publish-bar strong {
  color: #64213e;
  font-size: 13px;
}

.settings-publish-bar span {
  overflow-wrap: anywhere;
  color: rgba(93, 31, 58, 0.62);
  font-size: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.file-field span,
.toggle-field span {
  color: rgba(93, 31, 58, 0.78);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select,
.setting-card input[type="text"],
.setting-card input[type="url"],
.setting-card input[type="number"],
.setting-card textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(115, 40, 74, 0.16);
  border-radius: var(--radius);
  outline: none;
  padding: 10px 11px;
  color: #4f1932;
  background: rgba(255, 255, 255, 0.62);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.field textarea,
.setting-card textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.setting-card input:focus,
.setting-card textarea:focus {
  border-color: rgba(var(--primary-rgb), 0.62);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.13);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.toggle-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
}

.switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(100, 33, 62, 0.22);
  transition: background 180ms ease;
}

.switch i::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(78, 28, 52, 0.18);
  transition: transform 180ms ease;
}

.switch input:checked + i {
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.switch input:checked + i::after {
  transform: translateX(22px);
}

.file-field {
  display: grid;
  gap: 8px;
}

.file-field input::file-selector-button {
  min-height: 34px;
  margin-right: 10px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
}

.mini-list {
  display: grid;
  gap: 10px;
}

.mini-item {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.36);
}

.mini-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mini-item__title {
  color: #64213e;
  font-size: 13px;
  font-weight: 800;
}

.tiny-button,
.primary-button,
.danger-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    opacity 160ms ease;
}

.tiny-button:active,
.primary-button:active,
.danger-button:active {
  transform: scale(0.97);
}

.tiny-button {
  color: #692240;
  background: rgba(255, 255, 255, 0.55);
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #ff5a98);
  box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.24);
}

.danger-button {
  color: #a62d52;
  background: rgba(255, 255, 255, 0.52);
}

.tiny-button:disabled,
.primary-button:disabled,
.danger-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.data-output {
  min-height: 150px;
  white-space: pre;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 28px;
  background: rgba(16, 6, 12, 0.72);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 240ms ease,
    visibility 240ms ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: min(1040px, 92vw);
  max-height: 78vh;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  object-fit: contain;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.36);
}

.lightbox p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  text-align: center;
}

.lightbox__close {
  position: absolute;
  right: max(20px, env(safe-area-inset-right, 0px) + 20px);
  top: max(20px, var(--safe-top) + 20px);
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

@keyframes loaderSpin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes petalFall {
  0% {
    transform: translate3d(0, -12vh, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(var(--drift, 40px), 52vh, 0) rotate(180deg);
  }
  100% {
    transform: translate3d(calc(var(--drift, 40px) * -0.5), 112vh, 0) rotate(360deg);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
}

@keyframes floatButton {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

@keyframes breatheText {
  0%,
  100% {
    filter: brightness(1);
    transform: translateY(0);
  }
  50% {
    filter: brightness(1.16);
    transform: translateY(-2px);
  }
}

@keyframes caretBlink {
  50% {
    opacity: 0;
  }
}

@keyframes buttonSheen {
  0%,
  42% {
    transform: translateX(0) rotate(18deg);
  }
  78%,
  100% {
    transform: translateX(360%) rotate(18deg);
  }
}

@keyframes heartPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.18);
  }
}

@keyframes numberPop {
  0% {
    transform: translateY(6px);
    opacity: 0.2;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .memory-hero,
  .memory-content {
    grid-template-columns: 1fr;
  }

  .photo-panel {
    grid-row: auto;
  }
}

@media (max-width: 680px) {
  .view {
    padding: calc(84px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
  }

  .intro-card {
    gap: 18px;
  }

  .choice-actions {
    width: 100%;
    flex-direction: column;
    gap: 12px;
  }

  .choice-button {
    width: min(260px, 100%);
  }

  .memory-header {
    display: grid;
    justify-items: start;
  }

  .header-status {
    max-width: 100%;
  }

  .time-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .settings-publish-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-drawer {
    right: max(14px, env(safe-area-inset-right, 0px) + 14px);
    width: auto;
  }

  .cursor-light {
    display: none;
  }
}

@media (hover: none) and (pointer: coarse) {
  .cursor-light {
    display: none;
  }

  .photo-stage:hover img {
    transform: scale(1.01);
  }
}

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