:root {
  --pine: #6A0D1C; --pine-deep: #2A0409; --pine-mid: #7E1828; --pine-line: #A23446;
  --cream: #F7EFE1; --paper: #FBF6EC; --gold: #D8B26A; --gold-light: #F1D79B; --gold-deep: #A9823F;
  --cherry: #C9283F; --cherry-deep: #8E1529; --blush: #F3C9CF; --ink: #1F2A26; --ink-soft: #5D6964;
  --green: #25D366; --line: rgba(0,0,0,.08);
  --serif: "Fraunces", Georgia, serif; --sans: "Inter", system-ui, sans-serif; --hand: "Caveat", cursive;
}
* { box-sizing: border-box; margin: 0; padding: 0; min-width: 0; }
html, body { height: 100%; }
body { font: 16px/1.5 var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.hidden { display: none !important; }
.dark { background: radial-gradient(70% 45% at 20% 0%, rgba(214,58,80,.55), transparent 70%), linear-gradient(180deg, var(--pine), var(--pine-deep)); color: var(--cream); min-height: 100%; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none; font-weight: 700; border-radius: 999px; padding: 14px 22px; min-height: 48px; transition: transform .18s cubic-bezier(.16,1,.3,1), opacity .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-gold { color: var(--ink); background: linear-gradient(150deg, var(--gold-light), var(--gold)); box-shadow: 0 10px 26px rgba(216,178,106,.3), inset 0 1px 0 rgba(255,255,255,.6); }
.btn-cherry { color: var(--cream); background: linear-gradient(150deg, #DF3A52, var(--cherry-deep)); box-shadow: 0 10px 26px rgba(201,40,63,.3), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-green { color: #fff; background: var(--green); box-shadow: 0 10px 26px rgba(37,211,102,.3); }
.btn-ghost { background: transparent; border: 1.5px solid currentColor; opacity: .85; }
.btn-soft { background: rgba(0,0,0,.06); }
.dark .btn-soft { background: rgba(255,255,255,.1); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 14px; min-height: 38px; font-size: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.dark .field label { color: rgba(247,239,225,.75); }
.field input, .field textarea, .field select { width: 100%; font-size: 16px; padding: 13px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; outline: none; transition: border-color .2s; }
.field textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
.field input:focus, .field textarea:focus { border-color: var(--gold); }
.dark .field input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: var(--cream); }
.hint { font-size: 13px; color: var(--ink-soft); }
.dark .hint { color: rgba(247,239,225,.65); }

.logo { display: inline-flex; align-items: center; gap: 9px; font-family: var(--serif); font-size: 20px; text-decoration: none; }
.logo .ic { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(160deg, var(--cherry), var(--cherry-deep)); display: grid; place-items: center; }

.door { aspect-ratio: 4/3; border-radius: 12px; position: relative; overflow: hidden; border: 0; cursor: pointer; transition: transform .2s cubic-bezier(.16,1,.3,1), filter .3s; box-shadow: inset 0 2px 0 rgba(255,255,255,.2), 0 6px 14px rgba(0,0,0,.25); }
.door::before, .door::after { content: ""; position: absolute; background: var(--rib); opacity: .9; }
.door::before { left: calc(50% - 4px); top: 0; bottom: 0; width: 8px; }
.door::after { top: calc(50% - 4px); left: 0; right: 0; height: 8px; }
.door .num { position: absolute; left: 8px; bottom: 3px; font-family: var(--serif); font-weight: 700; font-size: 22px; z-index: 1; }
.d-red { background: linear-gradient(150deg,#D63A50,var(--cherry-deep)); --rib: var(--gold-light); color: var(--cream); }
.d-cream { background: linear-gradient(150deg,#FFF9EE,#EADFC9); --rib: var(--cherry); color: var(--cherry-deep); }
.d-green { background: linear-gradient(150deg,#2E6A57,#143A30); --rib: var(--gold-light); color: var(--cream); }
.d-gold { background: linear-gradient(150deg,var(--gold-light),var(--gold-deep)); --rib: var(--cherry); color: var(--ink); }

.sheet-back { position: fixed; inset: 0; background: rgba(8,20,16,.55); backdrop-filter: blur(4px); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .3s; }
.sheet-back.on { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow: auto; background: var(--paper); color: var(--ink); border-radius: 26px 26px 0 0; padding: 14px 20px calc(24px + env(safe-area-inset-bottom)); z-index: 51; transform: translateY(105%); transition: transform .45s cubic-bezier(.16,1,.3,1); max-width: 620px; margin: 0 auto; }
.sheet.on { transform: none; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: rgba(0,0,0,.15); margin: 0 auto 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--cherry); color: var(--cream); font-size: 12px; font-weight: 800; letter-spacing: 1.5px; padding: 6px 12px; border-radius: 999px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); background: var(--ink); color: var(--cream); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14px; opacity: 0; transition: all .35s cubic-bezier(.16,1,.3,1); z-index: 90; max-width: 90vw; text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.scratch-card { position: relative; width: 100%; aspect-ratio: 1.5; border-radius: 22px; overflow: hidden; touch-action: none; box-shadow: 0 20px 40px rgba(0,0,0,.15); }
.scratch-card .under { position: absolute; inset: 0; background: linear-gradient(160deg, var(--paper), #EFE2C8); border: 5px dashed var(--gold); border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px; }
.scratch-card .k { font-size: 12px; font-weight: 800; letter-spacing: 6px; color: var(--gold-deep); }
.scratch-card .w { font-family: var(--serif); font-style: italic; font-size: clamp(26px, 7vw, 38px); color: var(--cherry-deep); line-height: 1.05; margin: 6px 0; }
.scratch-card .s { font-family: var(--hand); font-size: 24px; }
.scratch-card canvas { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .6s; cursor: grab; }

.rec { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: #fff; border: 1.5px solid var(--line); }
.rec .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--cherry); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
audio, video { width: 100%; border-radius: 14px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
