:root {
  color-scheme: dark;
  --bg: #151229;
  --panel: #25203e;
  --gold: #e5c381;
  --cream: #f8f0e3;
  --muted: #c2b8cf;
  --line: #ffffff1c;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--cream);
  font: 16px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background: radial-gradient(ellipse at 50% -5%,#423052 0,transparent 48%),radial-gradient(circle at 10% 30%,#ffffff0b 1px,transparent 1.5px),radial-gradient(circle at 80% 18%,#e9c98822 1px,transparent 1.5px),var(--bg);
  background-size: auto,93px 93px,137px 137px;
  min-height: 100vh;
}

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

button {
  cursor: pointer;
}

button: focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

#app {
  max-width: 560px;
  margin: auto;
  padding: calc(24px + env(safe-area-inset-top)) 22px calc(38px + env(safe-area-inset-bottom));
  min-height: 100vh;
}

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

h1,h2,h3 {
  font-family: "Cormorant Garamond",Georgia,serif;
  font-weight: 600;
  line-height: 1.05;
}

h1 {
  font-size: 46px;
}

h2 {
  font-size: 32px;
}

h3 {
  font-size: 25px;
}

p {
  color: var(--muted);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  color: var(--gold);
  font-family: Georgia,serif;
  font-size: 20px;
}

.brand-mark {
  letter-spacing: .02em;
}

.brand-mark span {
  font-size: 13px;
  margin-right: 6px;
}

.text-button,.back {
  border: 0;
  background: none;
  color: var(--gold);
  padding: 8px 0;
}

.back {
  margin-bottom: 20px;
}

.intro {
  text-align: center;
  padding: 18px 0 30px;
}

.intro .moon {
  font-size: 46px;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 15px;
}

.intro p {
  margin: 12px auto 0;
  max-width: 310px;
}

.form {
  display: grid;
  gap: 17px;
}

label {
  display: grid;
  gap: 7px;
  color: #e9dfe9;
  font-size: 14px;
  font-weight: 600;
}

input,select,textarea {
  width: 100%;
  border: 1px solid #ffffff26;
  border-radius: 13px;
  background: #211c38;
  color: var(--cream);
  padding: 14px 15px;
  min-height: 51px;
}

textarea {
  resize: vertical;
  min-height: 95px;
}

input[type=date] {
  color-scheme: dark;
}

.primary,.secondary {
  border: 0;
  border-radius: 15px;
  padding: 15px 20px;
  min-height: 54px;
  font-weight: 700;
  width: 100%;
}

.primary {
  background: linear-gradient(110deg,#f1d49a,#c79a5d);
  color: #251a24;
  box-shadow: 0 8px 28px #0003;
}

.secondary {
  background: #ffffff0b;
  color: var(--cream);
  border: 1px solid #ffffff2b;
}

.note {
  text-align: center;
  font-size: 12px;
  color: #a99cb5;
  margin-top: 24px;
}

.greeting p {
  margin-top: 7px;
}

.zodiac {
  display: inline-block;
  border: 1px solid #d7b67766;
  color: var(--gold);
  padding: 5px 12px;
  border-radius: 30px;
  font-size: 13px;
  margin-top: 15px;
}

.fortune-card {
  position: relative;
  overflow: hidden;
  margin: 28px 0 25px;
  padding: 27px 24px;
  border: 1px solid #d9b87861;
  border-radius: 24px;
  background: radial-gradient(circle at 90% 15%,#876d8a77,transparent 45%),linear-gradient(135deg,#463451,#29223f);
  width: 100%;
  text-align: left;
  color: var(--cream);
  min-height: 194px;
}

.fortune-card .cup {
  display: block;
  font-size: 46px;
  margin-bottom: 11px;
}

.fortune-card strong {
  font: 600 31px/1.1 'Cormorant Garamond',Georgia,serif;
  display: block;
}

.fortune-card small {
  display: block;
  color: #e1cda9;
  margin-top: 7px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 27px 0 14px;
}

.coming {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 8px;
}

.coming div {
  padding: 16px 8px;
  border: 1px solid var(--line);
  background: #ffffff07;
  border-radius: 14px;
  text-align: center;
  color: #bdb1c5;
  font-size: 13px;
}

.coming span {
  display: block;
  font-size: 23px;
  margin-bottom: 4px;
}

.coming small {
  display: block;
  font-size: 10px;
  color: #9b8fa6;
}

.empty {
  padding: 20px 0;
  font-size: 14px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 13px 0;
}

.history-open {
  flex: 1;
  text-align: left;
  background: none;
  border: 0;
  color: var(--cream);
  padding: 3px 0;
}

.history-open strong,.history-open small {
  display: block;
}

.history-open small {
  color: var(--muted);
}

.delete {
  background: none;
  border: 0;
  color: #d7b3b2;
  padding: 10px;
}

.screen-title {
  margin-bottom: 22px;
}

.screen-title p {
  margin-top: 9px;
}

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

.slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 142px;
  border: 1px dashed #d7b67788;
  border-radius: 17px;
  background: #ffffff08;
  overflow: hidden;
  text-align: center;
  color: var(--gold);
  font-size: 14px;
}

.slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .65;
}

.slot span {
  position: relative;
  text-shadow: 0 1px 5px #000;
}

.slot .plus {
  font-size: 30px;
  line-height: 1;
}

.slot input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.hint {
  font-size: 13px;
  margin: 14px 0 26px;
}

.subheading {
  font-weight: 600;
  margin: 23px 0 10px;
}

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

.chip {
  border: 1px solid #ffffff24;
  background: #ffffff09;
  color: #e9dfe9;
  border-radius: 30px;
  padding: 9px 14px;
}

.chip.active {
  background: #d7b677;
  color: #241c29;
  border-color: #d7b677;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: 25px;
}

.error {
  color: #ffbcb9;
  font-size: 14px;
  margin-top: 12px;
}

.waiting {
  min-height: 65vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.waiting .spinner {
  font-size: 82px;
  animation: sway 2.4s ease-in-out infinite;
}

.waiting h1 {
  margin: 25px 0 10px;
}

.gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 14px;
  margin: 20px -22px;
  padding: 0 22px 12px;
}

.photo {
  position: relative;
  flex: 0 0 100%;
  aspect-ratio: 4 / 5;
  scroll-snap-align: center;
  border-radius: 18px;
  overflow: hidden;
  background: #26213d;
}

.photo svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.photo rect {
  fill: #f1d29312;
  stroke: #f3cd83;
  stroke-width: 2;
  filter: drop-shadow(0 0 3px #f8d88b);
  animation: appear .6s both;
}

.photo .hit {
  fill: transparent;
  stroke: none;
  cursor: pointer;
}

.photo .selected {
  stroke: #fff;
  stroke-width: 4;
}

.tag {
  position: absolute;
  visibility: hidden;
  max-width: 70%;
  background: #e6c27e;
  color: #261d2a;
  border: 0;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: appear .6s both;
}

.zoom-toggle {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  border: 1px solid #ffffff55;
  border-radius: 999px;
  padding: 6px 10px;
  background: #17132cdd;
  color: #fff6e9;
  font-size: 12px;
}

.zoom-toggle:disabled {
  opacity: 0.6;
}

.result-copy {
  margin-top: 23px;
}

.result-copy>p {
  margin-top: 15px;
  line-height: 1.8;
}

.reading-card {
  background: #ffffff08;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 20px;
  margin-top: 14px;
}

.reading-card h3 {
  color: var(--gold);
  margin-bottom: 9px;
}

.reading-card p {
  line-height: 1.75;
}

.symbols {
  margin-top: 26px;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 3;
  background: #080611aa;
  display: flex;
  align-items: end;
  justify-content: center;
}

.sheet[hidden] {
  display: none;
}

.sheet-card {
  position: relative;
  background: #302642;
  border: 1px solid #d7b67755;
  border-radius: 24px 24px 0 0;
  padding: 25px 24px calc(28px + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  overflow: auto;
}

.sheet-card h2 {
  color: var(--gold);
  margin-bottom: 20px;
}

.sheet-card h3 {
  font: 600 14px -apple-system,sans-serif;
  color: var(--cream);
  margin: 17px 0 4px;
}

.close {
  position: absolute;
  right: 20px;
  top: 18px;
  background: #ffffff12;
  border: 0;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: white;
  font-size: 20px;
}

@keyframes sway {
  0%,100% {
    transform: rotate(-9deg);
  }

  50% {
    transform: rotate(9deg);
  }

}

@keyframes appear {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }

}

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

}
