:root {
  color-scheme: dark;
  font-family: "DM Sans", sans-serif;
  --ink: #f6f0e4;
  --muted: #a7b1aa;
  --gold: #f3cc82;
  --mint: #9bd9bd;
  --deep: #09110f;
  --panel: rgba(9, 18, 16, 0.74);
  --line: rgba(236, 211, 155, 0.2);
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--deep); }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
.experience { position: relative; width: 100%; height: 100%; min-height: 560px; overflow: hidden; isolation: isolate; background: #000; }
.sky { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; display: block; will-change: transform; }
.stage { position: absolute; inset: 0; z-index: 1; pointer-events: none; will-change: transform; }
.stage-item { position: absolute; left: 50%; top: 50%; opacity: 0; transform: translate(-50%, -50%); transition: opacity .95s ease; }
.stage-item[data-art="tree"] { height: min(66vh, 122vw); aspect-ratio: 980 / 1306; }
.stage-item[data-art="wreath"] { height: min(46vh, 82vw); aspect-ratio: 1; }
.stage-item img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; mix-blend-mode: screen; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.stage-item .art-main { animation: art-breathe 11s ease-in-out infinite; filter: contrast(1.14) saturate(1.05) brightness(1.02); }
.stage-item .art-glow { filter: blur(26px) contrast(1.2) brightness(1.5) saturate(1.12); opacity: .52; }
.stage-item[data-art="tree"] .art-main { -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 80%, rgba(0, 0, 0, .62) 92%, transparent 100%); mask-image: linear-gradient(to bottom, #000 0%, #000 80%, rgba(0, 0, 0, .62) 92%, transparent 100%); }
.stage-item[data-art="tree"]::after { content: ""; position: absolute; left: 50%; bottom: -8%; width: 132%; height: 40%; transform: translateX(-50%); background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(255, 172, 84, .3), rgba(255, 148, 60, .1) 46%, transparent 72%); filter: blur(16px); pointer-events: none; }
body[data-mode="tree"] .stage-item[data-art="tree"],
body[data-mode="wreath"] .stage-item[data-art="wreath"] { opacity: 1; }
.vignette { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(ellipse at 50% 50%, transparent 22%, rgba(0, 0, 0, .35) 62%, rgba(0, 0, 0, .82) 100%); }
@keyframes art-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.022); } }
#scene { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.grain { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: .08; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E"); mix-blend-mode: soft-light; }
.topbar { z-index: 4; position: absolute; inset: 0 0 auto; height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 5vw, 76px); }
.wordmark { display: inline-flex; align-items: center; gap: 9px; color: rgba(246,240,228,.9); text-decoration: none; font-size: 14px; letter-spacing: .03em; }
.wordmark-star { color: var(--gold); font-size: 20px; }
.top-actions { display: flex; gap: 12px; align-items: center; }
.icon-button, .text-button { border: 0; background: transparent; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: rgba(246,240,228,.74); }
.icon-button:hover, .text-button:hover { background: rgba(255,255,255,.07); color: white; }
.icon-button svg, .round-tool svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.text-button { padding: 10px 13px; border-radius: 20px; color: rgba(246,240,228,.76); font-size: 13px; }
.title-block { position: absolute; z-index: 3; top: clamp(132px, 26vh, 250px); left: clamp(26px, 7vw, 104px); width: min(30vw, 384px); text-align: left; pointer-events: none; }
.eyebrow, .form-eyebrow { color: rgba(243,204,130,.82); font-size: 10px; letter-spacing: .19em; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.eyebrow-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px var(--mint); }
h1 { margin: 16px 0 8px; color: var(--ink); font: 500 clamp(29px, 4vw, 48px)/1.2 "Playfair Display", serif; }
.title-block p { margin: 0; color: rgba(223,231,221,.7); font-size: 13px; letter-spacing: .05em; }
.side-tools { position: absolute; z-index: 6; right: clamp(20px, 4vw, 64px); top: 48%; display: grid; justify-items: center; gap: 7px; transform: translateY(-50%); }
.control-panel { position: absolute; z-index: 4; right: clamp(20px, 4vw, 64px); top: 50%; width: 224px; transform: translateY(-50%); padding: 15px 16px 13px; border: 1px solid rgba(239,212,162,.24); border-radius: 14px; background: rgba(10,19,16,.78); backdrop-filter: blur(14px); box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: var(--gold); font-size: 12px; letter-spacing: .06em; }
.panel-x { border: 0; background: transparent; color: rgba(246,240,228,.65); font-size: 22px; line-height: 1; cursor: pointer; }
.panel-row { display: grid; gap: 7px; margin: 11px 0; color: rgba(246,240,228,.78); font-size: 11px; }
.panel-row input[type="range"] { width: 100%; accent-color: var(--gold); cursor: pointer; }
@media (max-width: 650px) {
  .control-panel { right: 16px; width: 200px; top: 34%; transform: none; }
}
.round-tool { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid rgba(244,220,168,.32); border-radius: 50%; background: rgba(12,24,19,.4); backdrop-filter: blur(12px); color: var(--gold); transition: transform .25s, background .25s; }
.round-tool:hover { transform: scale(1.06); background: rgba(227,177,92,.13); }
.tool-caption { color: rgba(240,227,195,.67); font-size: 10px; font-variant-numeric: tabular-nums; }
.bottom-panel { z-index: 4; position: absolute; inset: auto 0 0; padding: 0 clamp(18px, 5vw, 76px) max(22px, env(safe-area-inset-bottom)); background: linear-gradient(0deg, rgba(5,10,9,.75), rgba(5,10,9,0)); }
.gesture-hints { width: min(100%, 690px); margin: 0 auto 20px; display: flex; justify-content: center; gap: clamp(12px, 3.2vw, 42px); }
.gesture-hint { display: flex; align-items: center; gap: 9px; color: rgba(246,240,228,.74); font-size: 11px; white-space: nowrap; }
.gesture-symbol { font-size: 19px; filter: saturate(.7); }
.gesture-hint i { width: 3px; height: 3px; margin: 0 2px; border-radius: 50%; background: rgba(243,204,130,.7); }
.hint-result { color: rgba(243,204,130,.79); }
.bottom-row { display: flex; align-items: center; justify-content: space-between; width: min(100%, 960px); margin: auto; }
.camera-status { display: flex; align-items: center; gap: 8px; min-height: 32px; color: rgba(222,230,219,.62); font-size: 11px; }
.camera-status span:first-child { width: 6px; height: 6px; border-radius: 50%; background: #d7b777; box-shadow: 0 0 10px currentColor; }
.camera-status[data-state="ready"] span:first-child { background: #85d4a4; }
.camera-status[data-state="error"] span:first-child { background: #ef8e85; }
.touch-control-button { display: flex; align-items: center; gap: 15px; padding: 11px 15px; border: 1px solid rgba(240,215,164,.24); border-radius: 24px; background: rgba(10,19,16,.58); color: rgba(244,237,220,.75); backdrop-filter: blur(12px); font-size: 11px; transition: border-color .2s, background .2s; }
.touch-control-button:hover { border-color: rgba(243,204,130,.65); background: rgba(35,55,43,.64); }
.touch-dots { display: inline-flex; align-items: center; gap: 4px; }
.touch-dots i { width: 5px; height: 5px; background: var(--gold); border-radius: 50%; }
.touch-dots i:nth-child(2) { opacity: .55; }.touch-dots i:nth-child(3) { opacity: .28; }
.gesture-toast { z-index: 5; position: absolute; left: 50%; bottom: 106px; transform: translateX(-50%); padding: 11px 16px; border: 1px solid rgba(240,215,164,.24); border-radius: 20px; background: rgba(7,15,12,.8); color: var(--gold); backdrop-filter: blur(12px); font-size: 12px; white-space: nowrap; animation: toast-in .25s ease-out; }
.notice { z-index: 5; position: absolute; top: 84px; left: 50%; transform: translateX(-50%); width: max-content; max-width: min(90vw, 470px); padding: 11px 15px; border: 1px solid rgba(238,195,130,.3); border-radius: 20px; background: rgba(9,16,13,.82); color: rgba(246,240,228,.88); backdrop-filter: blur(14px); font-size: 12px; text-align: center; }
.camera-card { z-index: 5; position: absolute; right: 25px; bottom: 104px; width: 150px; aspect-ratio: 4/3; overflow: hidden; border: 1px solid rgba(243,204,130,.45); border-radius: 9px; background: #050908; box-shadow: 0 10px 35px #0008; }
.camera-card video, .camera-card canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera-card #camera-label { position: absolute; inset: auto 0 0; padding: 5px 7px; background: #0009; color: #fff; font-size: 9px; }
.camera-preview-shell { display: none; }
.dialog { padding: 0; border: 0; color: var(--ink); background: transparent; max-width: none; max-height: none; overflow: visible; }
.dialog::backdrop { background: rgba(2,7,6,.72); backdrop-filter: blur(9px); }
.dialog[open] { animation: dialog-in .22s ease-out; }
.memory-dialog { width: min(90vw, 580px); }
.memory-card { position: relative; min-height: 260px; max-height: 84vh; overflow: auto; border: 3px solid transparent; border-radius: 10px; background: linear-gradient(#101916, #101916) padding-box, linear-gradient(150deg, #f7dc9a, #b98a3e 40%, #ffe9b8 62%, #9c742f) border-box; box-shadow: 0 24px 100px #0009, 0 0 42px rgba(243,204,130,.18); }
.memory-card img { display: block; width: 100%; max-height: 72vh; object-fit: contain; background: #080d0b; }
.frame-bow { position: absolute; top: 10px; left: 50%; width: 96px; height: 30px; transform: translateX(-50%); z-index: 2; }
.bow-loop { position: absolute; top: 2px; width: 38px; height: 26px; background: linear-gradient(150deg, #d94a45, #a8231f); border-radius: 50% 50% 50% 6px; box-shadow: inset 0 -3px 6px rgba(0,0,0,.25); }
.bow-left { left: 0; transform: rotate(-12deg); border-radius: 50% 50% 6px 50%; }
.bow-right { right: 0; transform: rotate(12deg); border-radius: 50% 50% 50% 6px; }
.bow-knot { position: absolute; top: 7px; left: 50%; width: 18px; height: 18px; transform: translateX(-50%); background: linear-gradient(150deg, #e25a54, #9c1f1b); border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,.35); }
.memory-card img[hidden] { display: none; }
.memory-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 19px; color: rgba(246,240,228,.82); font-size: 13px; }
.memory-meta span:first-child { color: var(--gold); font-variant-numeric: tabular-nums; }
.private-note { margin: 20px; padding: 45px 10px; color: var(--gold); text-align: center; }
.owner-actions { padding: 0 19px 16px; text-align: right; }
.danger-action { padding: 8px 11px; border: 1px solid rgba(230,119,103,.4); border-radius: 5px; background: transparent; color: #efa399; font-size: 12px; }
.form-dialog { width: min(92vw, 440px); }
.form-card { position: relative; display: grid; gap: 19px; padding: 35px; border: 1px solid rgba(239,212,162,.2); border-radius: 8px; background: #111b17; box-shadow: 0 24px 100px #0009; }
.dialog-x { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border: 0; background: transparent; color: rgba(246,240,228,.65); font-size: 26px; font-weight: 300; }
.form-eyebrow { margin: 0; }
.form-card h2, .gallery-heading h2 { margin: -10px 0 0; font: 500 25px "Playfair Display", serif; }
.upload-drop { display: grid; justify-items: center; gap: 7px; padding: 23px; border: 1px dashed rgba(239,212,162,.32); border-radius: 6px; color: rgba(246,240,228,.84); cursor: pointer; }
.upload-drop:hover { border-color: var(--gold); background: #fff1; }
.upload-drop small { color: var(--muted); font-size: 10px; }
.upload-drop input { display: none; }
.upload-icon { color: var(--gold); font-size: 23px; }
.field-label { display: grid; gap: 8px; color: rgba(246,240,228,.75); font-size: 12px; }
.field-label input { width: 100%; padding: 12px; border: 1px solid rgba(239,212,162,.2); border-radius: 4px; outline: none; background: #0a120f; color: var(--ink); }
.field-label input:focus { border-color: var(--gold); }
.visibility-field { display: flex; flex-wrap: wrap; gap: 9px; margin: 0; padding: 0; border: 0; }
.visibility-field legend { width: 100%; margin-bottom: 9px; color: rgba(246,240,228,.75); font-size: 12px; }
.visibility-field label { position: relative; cursor: pointer; }
.visibility-field input { position: absolute; opacity: 0; }
.visibility-field label span { display: block; padding: 9px 12px; border: 1px solid rgba(239,212,162,.2); border-radius: 4px; color: var(--muted); font-size: 11px; }
.visibility-field input:checked + span { border-color: var(--gold); color: var(--gold); background: #efcf8012; }
.primary-action { min-height: 43px; padding: 11px 18px; border: 1px solid #eed08e; border-radius: 4px; background: #e5bd72; color: #182119; font-size: 12px; font-weight: 600; transition: background .2s, transform .2s; }
.primary-action:hover { background: #f1d69b; transform: translateY(-1px); }
.primary-action:disabled { opacity: .55; cursor: wait; transform: none; }
.form-message { min-height: 15px; margin: -10px 0 0; color: #f0a69a; font-size: 11px; }
.empty-note { margin: -6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.ghost-action { min-height: 40px; padding: 10px 16px; border: 1px solid rgba(239,212,162,.28); border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; transition: border-color .2s, color .2s; }
.ghost-action:hover { border-color: var(--gold); color: var(--gold); }
.gallery-dialog { width: min(94vw, 960px); }
.gallery-sheet { position: relative; max-height: 86vh; overflow: auto; padding: clamp(23px, 4vw, 42px); border: 1px solid rgba(239,212,162,.2); border-radius: 8px; background: #0e1713; box-shadow: 0 24px 100px #0009; }
.gallery-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 0 33px 22px 0; }
.gallery-heading h2 { margin-top: 7px; }
.compact { min-height: 38px; padding: 9px 12px; }
.memory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.memory-tile { position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; border: 1px solid rgba(239,212,162,.13); border-radius: 3px; background: radial-gradient(circle, rgba(239,212,162,.08), rgba(15,26,20,.8)); cursor: pointer; }
.memory-tile img { width: 100%; height: 100%; object-fit: cover; }
.memory-tile.empty { color: rgba(243,204,130,.58); }
.memory-tile.empty::before { content: "✧"; font-size: 24px; }
.memory-tile .tile-id { position: absolute; right: 5px; bottom: 5px; padding: 3px 5px; border-radius: 3px; background: #07100dc9; color: var(--gold); font-size: 9px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

.rotate-hint { color: rgba(240,232,214,.4); font-size: 10px; letter-spacing: .1em; white-space: nowrap; }

.bloom-cta { position: absolute; z-index: 6; left: 50%; bottom: clamp(124px, 17vh, 178px); transform: translateX(-50%); display: flex; align-items: center; gap: 13px; padding: 12px 16px 12px 13px; border: 1px solid rgba(246,214,158,.46); border-radius: 16px; background: linear-gradient(140deg, rgba(20,32,26,.9), rgba(9,17,14,.84)); color: var(--ink); box-shadow: 0 0 44px rgba(243,204,130,.16), 0 18px 54px rgba(0,0,0,.55); backdrop-filter: blur(18px); white-space: nowrap; animation: cta-in .55s cubic-bezier(.22,.9,.24,1); }
.bloom-cta:hover { border-color: rgba(255,229,175,.85); box-shadow: 0 0 62px rgba(243,204,130,.26), 0 18px 60px rgba(0,0,0,.6); }
.bloom-cta-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255,230,175,.36), rgba(255,204,122,.06) 72%); color: var(--gold); font-size: 20px; box-shadow: inset 0 0 18px rgba(255,214,150,.25); }
.bloom-cta-copy { display: grid; gap: 3px; text-align: left; }
.bloom-cta-copy strong { font-size: 13px; font-weight: 500; letter-spacing: .04em; }
.bloom-cta-copy small { color: rgba(226,236,226,.62); font-size: 10px; letter-spacing: .05em; }
.bloom-cta-plus { color: var(--gold); font-size: 18px; }
@keyframes cta-in { from { opacity: 0; transform: translate(-50%, 14px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }

@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 7px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(9px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 650px) {
  .experience { min-height: 500px; }
  .topbar { height: 62px; padding-inline: 18px; }
  .title-block { top: 91px; left: 4%; width: 92%; text-align: center; }
  .eyebrow { font-size: 8px; }
  h1 { margin-top: 12px; font-size: clamp(25px, 7vw, 34px); }
  .title-block p { font-size: 11px; }
  .side-tools { top: auto; bottom: 286px; right: 16px; transform: none; }
  .round-tool { width: 42px; height: 42px; }
  .camera-card { right: auto; left: 16px; bottom: 150px; width: 132px; }
  .bottom-panel { padding-inline: 15px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .gesture-hints { gap: 10px; margin-bottom: 15px; }
  .gesture-hint { display: grid; justify-items: center; gap: 4px; min-width: 72px; font-size: 9px; }
  .gesture-symbol { font-size: 18px; }
  .gesture-hint i { display: none; }
  .hint-result { font-size: 9px; }
  .rotate-hint { display: none; }
  .bloom-cta { bottom: 148px; gap: 10px; padding: 10px 13px; }
  .bloom-cta-mark { width: 32px; height: 32px; font-size: 17px; }
  .bloom-cta-copy strong { font-size: 12px; }
  .bloom-cta-copy small { font-size: 9px; }
  .camera-status { font-size: 9px; }
  .touch-control-button { gap: 9px; padding: 10px 11px; font-size: 9px; }
  .gesture-toast { bottom: 120px; max-width: 90vw; font-size: 11px; }
  .notice { top: 68px; font-size: 10px; }
  .form-card { padding: 30px 22px 22px; }
  .memory-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 7px; }
  .gallery-heading { align-items: end; }
}
@media (max-height: 620px) and (min-width: 651px) {
  .title-block { top: 82px; }
  .side-tools { top: 52%; }
  .gesture-hints { margin-bottom: 10px; }
  .bottom-panel { padding-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
