/* Birthday Universe — visual styles */
:root {
  color-scheme: dark;
  --bg: #09050c;
  --pink: #f8a3c9;
  --muted: #a99aa9;
  --line: rgba(249, 182, 215, 0.16);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Tahoma, "Noto Sans Thai", Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: #f9edf5;
  font-family: var(--sans);
}
body {
  overflow: hidden;
}
button,
input,
textarea {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
}
button,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 5px;
}
button {
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.45;
  cursor: wait;
}
svg {
  display: block;
  width: 20px;
  height: 20px;
  flex: none;
}
button svg {
  pointer-events: none;
}
.hidden,
[hidden] {
  display: none !important;
}
#universe {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 540px;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(
    ellipse at 50% 60%,
    #210b21 0%,
    #100714 38%,
    #09050c 75%
  );
}
#universe:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  box-shadow: inset 0 0 160px #06030980;
}
#cosmos {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
header {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  right: 0;
  padding: 30px 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f3dfe9;
}
.brand-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border: 1px solid #f3b5d333;
  border-radius: 50%;
  color: #f2a1c8;
}
.brand-mark svg {
  width: 21px;
  height: 21px;
}
.brand-name {
  font: italic 20px var(--serif);
  letter-spacing: 0.2px;
}
.brand-note {
  font-size: 9px;
  letter-spacing: 2.7px;
  color: #a4889c;
  margin-top: 5px;
}
.header-actions {
  display: flex;
  gap: 9px;
}
.pill,
.icon-button {
  border: 1px solid var(--line);
  background: #1d102066;
  backdrop-filter: blur(14px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.2s;
}
.pill:hover,
.icon-button:hover {
  background: #44203e99;
  border-color: #edacd666;
}
.pill {
  border-radius: 28px;
  padding: 11px 17px;
  font-size: 11px;
  color: #e2c6d7;
}
.pill svg {
  width: 16px;
  height: 16px;
}
.icon-button {
  border-radius: 50%;
  width: 39px;
  height: 39px;
  color: #dfbfd3;
}
.icon-button svg {
  width: 16px;
  height: 16px;
}
.intro {
  position: absolute;
  z-index: 2;
  top: 16%;
  left: 20px;
  right: 20px;
  text-align: center;
  pointer-events: none;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 9px;
  letter-spacing: 4.1px;
  color: #e2aac8;
  text-transform: uppercase;
}
.eyebrow:before,
.eyebrow:after {
  content: "";
  width: 25px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e2aac866);
}
.eyebrow:after {
  transform: rotate(180deg);
}
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(42px, 4.7vw, 73px);
  line-height: 1.03;
  letter-spacing: -2px;
  margin: 19px 0 15px;
}
h1 em {
  font-weight: 400;
  color: #eda5ca;
}
.subtitle {
  font-size: 12px;
  line-height: 1.9;
  color: #b69bab;
  letter-spacing: 0.2px;
  margin: 0;
}
.recipient {
  color: #eac0d6;
}
.orbit-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.orbit-item {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform, opacity;
  pointer-events: auto;
  transition:
    filter 0.2s,
    box-shadow 0.2s;
  transform-origin: center;
  opacity: 0;
}
.word {
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 10px 14px;
  background: transparent;
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: 0.2px;
  font-weight: 500;
  color: #f7bfdc;
  text-shadow:
    0 0 12px #ff54ac88,
    0 2px 5px #000;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 8px;
}
.word:before {
  content: "✧";
  font-size: 11px;
  color: #ff81bc;
}
.word:hover,
.word:focus-visible {
  border-color: #f1a1d247;
  background: #260d25d9;
  filter: brightness(1.3);
  z-index: 8 !important;
}
.photo {
  padding: 6px 6px 21px;
  border: 1px solid #e9a2c835;
  border-radius: 7px;
  background: linear-gradient(140deg, #61415070, #180d1eaa);
  box-shadow:
    0 8px 28px #0007,
    0 0 23px #e855a111;
  width: 100px;
  backdrop-filter: blur(8px);
}
.photo img {
  width: 86px;
  height: 92px;
  object-fit: cover;
  display: block;
  border-radius: 3px;
  pointer-events: none;
}
.photo:after {
  content: attr(data-caption);
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  text-align: center;
  font: italic 10px var(--serif);
  letter-spacing: 0.9px;
  color: #f1ccdf;
}
.photo:hover,
.photo:focus-visible {
  box-shadow: 0 0 25px #ff73bd55;
  border-color: #ffbbdc;
  filter: brightness(1.2);
  z-index: 9 !important;
}
.center-note {
  position: absolute;
  z-index: 2;
  top: 82%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  font: italic 16px var(--serif);
  color: #e7b1cc;
  white-space: nowrap;
  opacity: 0.85;
}
.center-note span {
  display: block;
  font: 8px var(--sans);
  letter-spacing: 3.6px;
  margin-top: 9px;
  color: #95778d;
}
.bottom {
  position: absolute;
  bottom: 25px;
  left: 42px;
  right: 42px;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.gesture {
  display: flex;
  gap: 9px;
  align-items: center;
  color: #90788c;
  font-size: 10px;
  line-height: 1.8;
  letter-spacing: 0.2px;
}
.gesture svg {
  width: 17px;
  height: 17px;
  color: #ba90a9;
}
.bottom-center {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  text-align: center;
}
.main-cta {
  border: 1px solid #f1b0d442;
  border-radius: 30px;
  background: linear-gradient(110deg, #ad47732e, #6c34542b);
  box-shadow: 0 0 30px #e56ba00c;
  color: #f5d8e8;
  padding: 14px 23px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  white-space: nowrap;
  transition: 0.25s;
  backdrop-filter: blur(12px);
}
.main-cta:hover {
  background: #6d2f535c;
  border-color: #f1b0d488;
  transform: translateY(-2px);
}
.main-cta svg {
  width: 16px;
  height: 16px;
  color: #e5a2c4;
}
.cta-note {
  margin: 10px 0 0;
  font-size: 8px;
  letter-spacing: 2.2px;
  color: #967b90;
}
.bottom-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.letter-button {
  border: 0;
  background: none;
  padding: 10px 0;
  color: #bfa0b4;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.letter-button:hover {
  color: #ffcae5;
}
.letter-button svg {
  width: 16px;
  height: 16px;
}
.floating-heart {
  position: absolute;
  top: 51%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: none;
  border: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  z-index: 2;
  opacity: 0;
}
.floating-heart:focus-visible {
  opacity: 1;
  background: #eb70b616;
  color: #f7b5d7;
}
.scene-count {
  font-size: 8px;
  letter-spacing: 2px;
  color: #9c7890;
  position: absolute;
  left: 42px;
  bottom: 87px;
  z-index: 4;
}
.scene-count b {
  font-weight: 400;
  color: #d4a5c0;
}
dialog {
  color: #f9edf5;
  border: 1px solid #d588b836;
  background: #140c17;
  padding: 0;
  border-radius: 20px;
  box-shadow: 0 25px 140px #000b;
  max-width: calc(100vw - 30px);
  max-height: calc(100svh - 36px);
}
dialog::backdrop {
  background: #07030bd9;
  backdrop-filter: blur(16px);
}
.dialog-close {
  position: absolute;
  right: 13px;
  top: 13px;
  z-index: 4;
  background: #180c1caa;
  width: 33px;
  height: 33px;
}
.memory-dialog {
  width: 420px;
  overflow: visible;
}
.memory-shell {
  padding: 15px;
  max-height: calc(100svh - 40px);
  overflow: auto;
  border-radius: 19px;
  background: radial-gradient(ellipse at 50% 0, #54213e33, transparent 60%);
}
.memory-image-wrap {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #09060c;
}
.memory-image-wrap img {
  display: block;
  width: 100%;
  max-height: 43svh;
  object-fit: contain;
  min-height: 150px;
  background: #0e0912;
}
.sample-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: #110a15bf;
  color: #d4b1c6;
  border: 1px solid #ffd5ec22;
  border-radius: 15px;
  padding: 5px 9px;
  font-size: 9px;
  backdrop-filter: blur(10px);
}
.memory-copy {
  padding: 24px 18px 12px;
  text-align: center;
}
.tiny {
  font-size: 8px;
  letter-spacing: 3px;
  color: #be8eaa;
  text-transform: uppercase;
}
.memory-copy h2 {
  font: 400 25px var(--serif);
  line-height: 1.5;
  margin: 10px 0;
  color: #f8dbe9;
}
.memory-copy p {
  font-size: 12px;
  color: #c3a7bb;
  line-height: 1.95;
  white-space: pre-wrap;
  margin: 0;
}
.memory-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 4px 2px;
}
.memory-nav .icon-button {
  width: 32px;
  height: 32px;
}
.memory-dots {
  display: flex;
  gap: 7px;
}
.memory-dots button {
  width: 6px;
  height: 6px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: #6d4661;
  position: relative;
}
.memory-dots button:before {
  content: "";
  position: absolute;
  inset: -8px;
}
.memory-dots button.active {
  background: #ffb7db;
  box-shadow: 0 0 9px #f780bd66;
}
.letter-dialog {
  width: 470px;
  padding: 42px 35px;
  max-height: calc(100svh - 40px);
  overflow: auto;
  background:
    radial-gradient(ellipse at 50% 0, #52233c55, transparent 75%), #160e1a;
}
.letter-symbol {
  color: #f8a6d0;
  margin: 0 auto 23px;
  width: 36px;
  height: 36px;
}
.letter-dialog h2 {
  font: italic 36px var(--serif);
  font-weight: 400;
  color: #f7cadf;
  text-align: center;
  margin: 12px 0 25px;
}
.letter-dialog .tiny {
  text-align: center;
}
.letter-body {
  white-space: pre-wrap;
  color: #d8bdce;
  font-size: 13px;
  line-height: 2.2;
}
.letter-sign {
  font: italic 21px var(--serif);
  text-align: right;
  color: #e9a8ca;
  margin: 28px 0 0;
}
.editor-dialog {
  width: 800px;
  overflow: auto;
}
.editor-head {
  padding: 30px 30px 22px;
  border-bottom: 1px solid var(--line);
}
.editor-head h2 {
  font-size: 21px;
  font-weight: 400;
  margin: 9px 0;
}
.editor-head p {
  font-size: 11px;
  line-height: 1.9;
  color: #ae91a6;
  margin: 0;
  max-width: 620px;
}
.editor-form {
  padding: 24px 30px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 11px;
  color: #d2b0c6;
}
.field input,
.field textarea {
  width: 100%;
  background: #0b070f;
  border: 1px solid #e8a8d02b;
  color: #f8e0ee;
  border-radius: 8px;
  padding: 12px;
  outline: none;
  font-size: 12px;
  line-height: 1.7;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  border-color: #df8ab7;
}
.field small {
  font-size: 10px;
  line-height: 1.8;
  color: #9f8096;
}
.section-label {
  margin: 10px 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: #edc5dc;
}
.section-label:after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}
.memory-selector {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 3px 2px 14px;
  margin-bottom: 10px;
}
.select-memory {
  border: 1px solid #dea1c628;
  border-radius: 8px;
  background: #201127;
  padding: 5px;
  flex: 0 0 65px;
  color: #a889a0;
  font-size: 9px;
}
.select-memory img {
  width: 53px;
  height: 45px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  margin-bottom: 5px;
}
.select-memory.selected {
  border-color: #ef9dc9;
  color: #f3c6df;
  background: #49233c66;
}
.memory-editor {
  display: grid;
  grid-template-columns: 155px 1fr;
  gap: 23px;
}
.upload-box {
  position: relative;
  display: block;
  cursor: pointer;
}
.upload-box img {
  width: 155px;
  height: 178px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid var(--line);
  display: block;
}
.upload-box span {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: 0 0 9px 9px;
  padding: 9px;
  background: #160b1ddd;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #f2b9d6;
}
.upload-box svg {
  width: 13px;
  height: 13px;
}
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.reset-image {
  border: 0;
  background: none;
  color: #d1a0bc;
  padding: 7px 0;
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.image-help {
  font-size: 9px;
  color: #997b91;
  line-height: 1.8;
  margin-top: 9px;
}
.editor-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 30px;
  background: #1a0e1ff5;
  border-top: 1px solid var(--line);
  backdrop-filter: blur(15px);
  z-index: 5;
}
.save-button {
  border: 1px solid #efb8d2;
  background: #eab1cd;
  color: #2b1021;
  border-radius: 24px;
  padding: 11px 23px;
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.save-button svg {
  width: 15px;
  height: 15px;
}
.download-button {
  border: 1px solid #e6a7cf38;
  background: #32172d;
  border-radius: 22px;
  padding: 11px 15px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #e9bfd7;
  font-size: 11px;
}
.download-button svg {
  width: 14px;
  height: 14px;
}
.export-note {
  padding: 0 30px 25px;
  font-size: 10px;
  line-height: 1.9;
  color: #a68a9d;
}
.export-note strong {
  font-weight: 400;
  color: #deacc9;
}
.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 25px;
  max-width: calc(100% - 35px);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
  background: #312033f2;
  border: 1px solid #e2a6cf55;
  border-radius: 13px;
  color: #f7d0e6;
  padding: 13px 20px;
  font-size: 12px;
  line-height: 1.8;
  box-shadow: 0 8px 50px #0008;
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.loading-scene {
  opacity: 0;
}
.orbit-item.ready {
  opacity: 1;
}
@media (min-width: 1500px) {
  .intro {
    top: 14%;
  }
  h1 {
    font-size: 76px;
  }
}
@media (max-width: 700px) {
  #universe {
    min-height: 480px;
  }
  header {
    padding: 23px 20px;
  }
  .brand-name {
    font-size: 17px;
  }
  .brand-mark {
    width: 31px;
    height: 31px;
  }
  .brand-note {
    font-size: 7px;
    letter-spacing: 2px;
  }
  .pill {
    padding: 10px;
  }
  .pill span {
    display: none;
  }
  .header-actions {
    gap: 7px;
  }
  .header-actions .icon-button {
    width: 36px;
    height: 36px;
  }
  .floating-heart {
    top: 55%;
    width: 140px;
    height: 140px;
  }
  .intro {
    top: 15%;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 3.4px;
  }
  h1 {
    font-size: 49px;
    line-height: 1.04;
    letter-spacing: -1.5px;
    margin: 17px 0 12px;
  }
  .subtitle {
    font-size: 10px;
    line-height: 1.9;
    margin: auto;
    max-width: 260px;
  }
  .word {
    font-size: 9px;
    padding: 5px 5px;
    gap: 4px;
    width: 126px;
    min-height: 32px;
    white-space: normal;
    justify-content: center;
    text-align: center;
    line-height: 1.5;
  }
  .photo {
    width: 67px;
    padding: 4px 4px 17px;
    border-radius: 5px;
  }
  .photo img {
    width: 57px;
    height: 63px;
  }
  .photo:after {
    font-size: 8px;
    bottom: 4px;
  }
  .center-note {
    font-size: 13px;
    top: 82%;
  }
  .center-note span {
    font-size: 6px;
    letter-spacing: 2.7px;
  }
  .bottom {
    left: 20px;
    right: 20px;
    bottom: max(25px, env(safe-area-inset-bottom));
    align-items: center;
  }
  .bottom-center {
    position: static;
    transform: none;
  }
  .main-cta {
    padding: 12px 18px;
    font-size: 11px;
    gap: 9px;
  }
  .cta-note {
    font-size: 6px;
    letter-spacing: 1.6px;
  }
  .gesture {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 77px;
    justify-content: center;
    font-size: 9px;
  }
  .bottom-right {
    gap: 8px;
  }
  .letter-button {
    padding: 11px 0;
    gap: 6px;
    font-size: 10px;
  }
  .bottom-right .icon-button {
    width: 33px;
    height: 33px;
  }
  .scene-count {
    left: 20px;
    bottom: 115px;
    font-size: 7px;
  }
  .memory-dialog {
    width: 360px;
  }
  .memory-copy {
    padding: 20px 12px 9px;
  }
  .memory-copy h2 {
    font-size: 23px;
  }
  .memory-copy p {
    font-size: 11px;
  }
  .memory-image-wrap img {
    max-height: 42svh;
  }
  .editor-head {
    padding: 25px 20px 18px;
  }
  .editor-form {
    padding: 20px;
  }
  .editor-head h2 {
    font-size: 19px;
  }
  .editor-head p {
    font-size: 10px;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .memory-editor {
    grid-template-columns: 100px 1fr;
    gap: 14px;
  }
  .upload-box img {
    width: 100px;
    height: 135px;
  }
  .upload-box span {
    font-size: 9px;
    padding: 8px 2px;
    gap: 4px;
  }
  .field {
    font-size: 10px;
  }
  .field input,
  .field textarea {
    padding: 10px;
    font-size: 11px;
  }
  .editor-actions {
    padding: 14px 17px;
    gap: 8px;
  }
  .download-button {
    font-size: 10px;
    padding: 11px 12px;
    gap: 5px;
  }
  .save-button {
    font-size: 11px;
    padding: 11px 17px;
  }
  .export-note {
    padding: 0 20px 20px;
  }
  .letter-dialog {
    padding: 35px 25px;
  }
  .letter-body {
    font-size: 12px;
  }
  .letter-dialog h2 {
    font-size: 31px;
  }
}
@media (max-height: 680px) and (min-width: 701px) {
  .intro {
    top: 13%;
  }
  h1 {
    font-size: 47px;
  }
  .subtitle {
    font-size: 10px;
  }
  header {
    padding-top: 20px;
  }
  .bottom {
    bottom: 18px;
  }
  .center-note {
    top: 81%;
  }
  .gesture {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
/* Version 2: opening scene, creator tools and touch-friendly layouts. */
:root {
  --sans: Tahoma, "Thonburi", "Noto Sans Thai", Arial, sans-serif;
}
button {
  min-height: 44px;
}
.icon-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
}
.brand-mark {
  font:
    28px Georgia,
    serif;
}
.draft-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  background: #efbc83;
  border-radius: 50%;
  box-shadow: 0 0 8px #eaae6588;
}
#edit-button {
  position: relative;
}
.music-icon {
  font-size: 17px;
}
.header-actions .pill span.music-icon {
  display: inline;
}
#universe {
  min-height: 0;
  height: 100svh;
  touch-action: none;
}
.scene-ui {
  transition: opacity 0.8s;
}
.is-welcome .scene-ui {
  opacity: 0;
  pointer-events: none;
}
.is-welcome #cosmos {
  opacity: 0.32;
  filter: blur(1px);
}
#cosmos {
  transition:
    opacity 1.2s,
    filter 1.2s;
}
.intro {
  top: 13%;
}
.intro h1 {
  font-size: clamp(32px, 3.6vw, 52px);
  margin: 16px 0 13px;
  letter-spacing: -1.3px;
}
.intro .subtitle {
  font-size: 11px;
  max-width: 540px;
  margin: auto;
}
.intro .recipient {
  overflow-wrap: anywhere;
}
.floating-heart {
  top: 51%;
  width: 160px;
  height: 160px;
}
.orbit-item.word {
  min-height: 44px;
  max-width: 220px;
  white-space: normal;
  text-align: center;
  justify-content: center;
}
.photo:hover,
.photo:focus-visible,
.word:hover,
.word:focus-visible {
  z-index: 2000 !important;
}
.center-note {
  top: 82%;
  font-size: 15px;
}
.bottom {
  bottom: max(23px, env(safe-area-inset-bottom));
}
.scene-count {
  bottom: 98px;
}
.back-to-welcome {
  position: absolute;
  top: 96px;
  left: 42px;
  border: 0;
  background: none;
  color: #a88a9f;
  font-size: 10px;
  z-index: 4;
  padding: 8px 0;
}
.back-to-welcome:hover {
  color: #f2bed9;
}
.welcome {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  text-align: center;
  background: radial-gradient(ellipse at 50% 40%, #35182a44, transparent 65%);
  padding: 100px 20px 70px;
  overflow: auto;
  touch-action: pan-y;
}
.welcome-content {
  width: min(100%, 540px);
  margin: auto;
}
.welcome-seal {
  width: 92px;
  height: 78px;
  color: #d58cb5;
  margin: 0 auto 29px;
  position: relative;
  filter: drop-shadow(0 0 18px #fa84bd22);
}
.welcome-seal svg {
  width: 100%;
  height: 100%;
}
.welcome-seal span {
  position: absolute;
  left: calc(50% - 12px);
  bottom: 8px;
  width: 24px;
  height: 24px;
  background: #d99dbc;
  color: #48223a;
  border-radius: 50%;
  line-height: 24px;
  font-size: 16px;
  box-shadow: 0 0 16px #fb75b722;
}
.welcome h1 {
  font-size: clamp(45px, 5vw, 72px);
  margin: 23px 0 20px;
  line-height: 1.06;
}
.welcome .eyebrow {
  font-size: 8px;
  letter-spacing: 3.4px;
}
.welcome-to {
  color: #edbed7;
  font-size: 13px;
  margin: 0 auto 13px;
  max-width: 90%;
  overflow-wrap: anywhere;
}
.welcome-description {
  font-size: 12px;
  line-height: 2;
  color: #b69bab;
  margin: 0 0 30px;
}
.start-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 16px 27px;
  border: 1px solid #edb4ce88;
  border-radius: 30px;
  background: linear-gradient(115deg, #eab6d1, #cb83ad);
  color: #291021;
  font-size: 13px;
  box-shadow: 0 0 45px #cf629425;
  transition:
    transform 0.25s,
    box-shadow 0.25s;
}
.start-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 50px #db7ca540;
}
.music-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 10px;
  color: #ad8d9f;
  margin: 21px auto 0;
  min-height: 30px;
  cursor: pointer;
}
.music-choice input {
  accent-color: #d292b5;
  width: 13px;
  height: 13px;
}
.music-choice span:last-child {
  margin-left: 3px;
  font-size: 13px;
  color: #dca7c4;
}
.welcome-foot {
  position: absolute;
  bottom: max(26px, env(safe-area-inset-bottom));
  left: 20px;
  right: 20px;
  color: #7e6479;
  font-size: 7px;
  letter-spacing: 2.7px;
}
.memory-dots button {
  min-height: 0;
}
.memory-dots button:before {
  inset: -18px -7px;
}
.memory-nav .icon-button {
  width: 44px;
  height: 44px;
}
.dialog-close {
  width: 44px;
  height: 44px;
}
.letter-symbol {
  font:
    40px Georgia,
    serif;
  width: auto;
  height: auto;
  text-align: center;
}
.memory-copy h2 {
  overflow-wrap: anywhere;
}
.memory-copy p,
.letter-body {
  overflow-wrap: anywhere;
}
.preview-ribbon {
  position: fixed;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 7px 15px;
  border: 1px solid #dbb48745;
  border-radius: 20px;
  background: #291e22f2;
  color: #eac9a7;
  font-size: 10px;
  box-shadow: 0 4px 20px #0004;
}
.preview-ribbon button {
  min-height: 25px;
  border: 0;
  background: none;
  color: #f1d8b6;
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  white-space: nowrap;
}
.draft-status {
  font-size: 10px;
  color: #d5b18a;
  line-height: 1.8;
  margin-top: 13px;
}
.draft-status:empty {
  display: none;
}
.editor-dialog {
  width: 840px;
}
.audio-settings {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 26px;
  background: #100912;
}
.audio-name {
  font-size: 12px;
  color: #e5c4d9;
  overflow-wrap: anywhere;
  line-height: 1.8;
  max-width: 440px;
}
.audio-help {
  font-size: 9px;
  color: #9b7e92;
  margin: 5px 0 12px;
  line-height: 1.8;
}
.audio-upload-actions {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
}
.small-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dba1c549;
  border-radius: 20px;
  padding: 10px 15px;
  background: #32192c;
  color: #e8c0d7;
  font-size: 10px;
  cursor: pointer;
  line-height: 1.6;
  white-space: nowrap;
}
.small-button:hover {
  background: #4c2641;
}
.text-button {
  border: 0;
  background: none;
  font-size: 10px;
  color: #b48da5;
  padding: 8px 0;
  line-height: 1.8;
}
.text-button:hover {
  color: #f2bfd9;
}
.volume-field {
  display: block;
  width: 143px;
  flex: none;
  font-size: 10px;
  color: #bc97ae;
  line-height: 1.9;
}
.volume-field output {
  float: right;
  color: #ebc7dc;
}
.volume-field input {
  width: 100%;
  accent-color: #de9dc3;
  margin: 13px 0 0;
  min-height: 26px;
}
.export-explanation {
  border-left: 2px solid #8f526e;
  padding: 1px 0 1px 14px;
  margin: 12px 0 8px;
}
.export-explanation strong {
  font-size: 11px;
  font-weight: 400;
  color: #e2b4cf;
}
.export-explanation p {
  font-size: 10px;
  color: #ad8da2;
  line-height: 1.9;
  margin: 6px 0;
}
.export-progress {
  font-size: 11px;
  color: #e6bfa0;
  line-height: 1.9;
  margin-top: 13px;
  overflow-wrap: anywhere;
}
.export-progress:empty {
  display: none;
}
.editor-primary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.editor-actions {
  padding: 14px 25px;
}
.save-button {
  min-height: 40px;
  line-height: 1.6;
  white-space: nowrap;
}
.reset-image {
  min-height: 30px;
}
.upload-box {
  outline-offset: 3px;
}
.select-memory {
  min-height: 0;
}
.file-input:focus-visible + * {
  outline: 1px solid #edb1d2;
}
.no-script {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: #130b19;
  display: grid;
  place-items: center;
  padding: 30px;
  color: #f2c3dc;
  text-align: center;
}
@media (max-width: 700px) {
  header {
    padding: 21px 18px;
  }
  .brand-name {
    font-size: 17px;
  }
  .brand-note {
    font-size: 6.5px;
    letter-spacing: 1.8px;
  }
  .header-actions {
    gap: 6px;
  }
  .header-actions .icon-button {
    width: 40px;
    min-width: 40px;
    height: 44px;
  }
  .header-actions .pill {
    min-width: 40px;
    padding: 8px 11px;
  }
  .header-actions .pill #sound-label {
    display: none;
  }
  .welcome {
    padding: 112px 24px 70px;
  }
  .welcome-seal {
    width: 76px;
    height: 65px;
    margin-bottom: 25px;
  }
  .welcome h1 {
    font-size: 46px;
    letter-spacing: -1.7px;
    margin-top: 22px;
  }
  .welcome .eyebrow {
    font-size: 6.3px;
    letter-spacing: 2px;
    gap: 8px;
  }
  .welcome .eyebrow:before,
  .welcome .eyebrow:after {
    width: 17px;
  }
  .welcome-to {
    font-size: 12px;
  }
  .welcome-description {
    font-size: 11px;
    margin-bottom: 26px;
  }
  .start-button {
    font-size: 12px;
    padding: 15px 24px;
    gap: 21px;
  }
  .welcome-foot {
    font-size: 6px;
    letter-spacing: 1.5px;
  }
  .intro {
    top: 14%;
    left: 18px;
    right: 18px;
  }
  .intro .eyebrow {
    font-size: 7px;
    letter-spacing: 2.5px;
  }
  .intro h1 {
    font-size: 33px;
    line-height: 1.06;
    margin: 13px 0 10px;
  }
  .intro .subtitle {
    font-size: 9px;
    max-width: 270px;
    line-height: 1.8;
  }
  .back-to-welcome {
    top: 77px;
    left: 19px;
    font-size: 9px;
    min-height: 30px;
  }
  .orbit-item.word {
    font-size: 9px;
    width: 126px;
    max-width: 126px;
    min-height: 34px;
    padding: 4px 5px;
  }
  .center-note {
    font-size: 12px;
    top: 82%;
  }
  .center-note span {
    font-size: 6px;
    letter-spacing: 2.3px;
  }
  .gesture {
    bottom: 80px;
    font-size: 8px;
  }
  .scene-count {
    bottom: 112px;
    font-size: 6px;
    letter-spacing: 1.7px;
  }
  .bottom {
    left: 18px;
    right: 18px;
    bottom: max(22px, env(safe-area-inset-bottom));
  }
  .main-cta {
    padding: 12px 14px;
    font-size: 10px;
    gap: 8px;
  }
  .cta-note {
    font-size: 5.5px;
    letter-spacing: 1.3px;
  }
  .bottom-right {
    gap: 5px;
  }
  .letter-button {
    font-size: 9px;
    gap: 5px;
  }
  .bottom-right .icon-button {
    width: 40px;
    height: 44px;
    min-width: 40px;
  }
  .audio-settings {
    flex-direction: column;
    gap: 16px;
    padding: 14px;
  }
  .volume-field {
    width: 100%;
  }
  .volume-field input {
    margin-top: 4px;
  }
  .audio-name {
    font-size: 11px;
  }
  .audio-help {
    font-size: 9px;
  }
  .editor-head h2 {
    font-size: 17px;
  }
  .editor-head {
    padding-right: 55px;
  }
  .editor-head p {
    font-size: 10px;
  }
  .editor-actions {
    padding: 12px 13px;
    align-items: center;
    gap: 5px;
  }
  .editor-primary-actions {
    gap: 5px;
  }
  .editor-primary-actions .small-button {
    padding: 9px 10px;
    font-size: 9px;
  }
  .save-button {
    padding: 10px 13px;
    font-size: 10px;
  }
  .reset-draft {
    font-size: 8px;
    max-width: 54px;
    text-align: left;
  }
  .preview-ribbon {
    font-size: 8px;
    gap: 12px;
    width: calc(100% - 30px);
    justify-content: center;
    padding: 6px 10px;
  }
  .preview-ribbon button {
    font-size: 8px;
  }
  .is-preview header {
    padding-top: 48px;
  }
  .is-preview .back-to-welcome {
    top: 99px;
  }
  .is-preview .intro {
    top: 18%;
  }
}
@media (max-width: 360px) {
  .brand-note {
    letter-spacing: 1.1px;
    font-size: 6px;
  }
  .brand-name {
    font-size: 15px;
  }
  .brand {
    gap: 8px;
  }
  .welcome h1 {
    font-size: 41px;
  }
  .editor-primary-actions .small-button {
    font-size: 8px;
    padding: 9px 7px;
  }
  .save-button {
    font-size: 9px;
    padding: 10px;
  }
  .editor-actions {
    padding: 11px;
  }
  .letter-button {
    font-size: 8px;
  }
  .main-cta {
    font-size: 9px;
    padding: 11px;
  }
  .gesture {
    font-size: 7px;
  }
}
@media (max-height: 550px) and (orientation: landscape) {
  header {
    padding: 10px 20px;
  }
  .brand-note {
    display: none;
  }
  .brand-name {
    font-size: 15px;
  }
  .header-actions .pill {
    min-height: 36px;
    padding: 8px 12px;
  }
  .header-actions .icon-button {
    height: 36px;
    width: 36px;
    min-width: 36px;
    min-height: 36px;
  }
  .welcome {
    padding: 50px 20px 32px;
  }
  .welcome-content {
    max-width: 580px;
  }
  .welcome-seal {
    display: none;
  }
  .welcome h1 {
    font-size: 38px;
    margin: 10px 0;
  }
  .welcome-description {
    font-size: 10px;
    margin: 8px 0 12px;
    line-height: 1.7;
  }
  .welcome-to {
    font-size: 10px;
    margin: 0;
  }
  .welcome .eyebrow {
    font-size: 6px;
  }
  .music-choice {
    margin-top: 8px;
    font-size: 9px;
    min-height: 23px;
  }
  .start-button {
    font-size: 11px;
    padding: 10px 22px;
    min-height: 40px;
  }
  .welcome-foot {
    font-size: 5px;
    bottom: 12px;
  }
  .intro {
    top: 14%;
    left: 26%;
    right: 26%;
  }
  .intro h1 {
    font-size: 24px;
    line-height: 1.04;
    margin: 7px 0;
  }
  .intro .eyebrow {
    font-size: 6px;
    letter-spacing: 2px;
  }
  .intro .subtitle {
    font-size: 8px;
    max-width: 280px;
    line-height: 1.6;
  }
  .center-note,
  .gesture,
  .scene-count,
  .cta-note {
    display: none;
  }
  .photo {
    width: 47px;
    padding: 3px 3px 12px;
  }
  .photo img {
    width: 39px;
    height: 40px;
  }
  .photo:after {
    font-size: 6px;
    bottom: 2px;
  }
  .orbit-item.word {
    font-size: 8px;
    min-height: 25px;
    max-width: 130px;
    padding: 3px 6px;
  }
  .bottom {
    left: 20px;
    right: 20px;
    bottom: 10px;
    align-items: center;
  }
  .bottom-center {
    left: 50%;
    position: relative;
    transform: none;
    bottom: auto;
    margin-left: -80px;
  }
  .main-cta {
    font-size: 10px;
    padding: 10px 16px;
  }
  .letter-button {
    font-size: 10px;
  }
  .back-to-welcome {
    top: 48px;
    left: 22px;
    font-size: 8px;
    min-height: 28px;
  }
  .memory-image-wrap img {
    max-height: 38svh;
  }
  .memory-copy {
    padding-top: 12px;
  }
  .memory-copy h2 {
    font-size: 20px;
    margin: 6px 0;
  }
  .memory-copy p {
    font-size: 10px;
  }
  .memory-nav {
    margin-top: 12px;
  }
  .memory-shell {
    max-height: calc(100svh - 25px);
  }
  .is-preview header {
    padding-top: 33px;
  }
  .is-preview .intro {
    top: 20%;
  }
  .editor-actions {
    position: sticky;
  }
  .preview-ribbon {
    top: 2px;
    font-size: 8px;
  }
}

/* Keep short landscape screens clear of the heart. */
.start-button svg {
  width: 16px;
  height: 16px;
}
@media (max-width: 700px) {
  .scene-count {
    display: none;
  }
}
@media (max-height: 550px) and (orientation: landscape) {
  .intro .eyebrow,
  .intro .subtitle {
    display: none;
  }
  .intro h1 {
    font-size: 24px;
    margin: 7px 0;
  }
  .intro {
    top: 14%;
  }
}
