@import url('https://fonts.googleapis.com/css2?family=Jua&family=Press+Start+2P&display=swap');

:root {
  --pink-50: #fff1f8;
  --pink-100: #ffd8eb;
  --pink-200: #f8b4d0;
  --pink-300: #ed8fb4;
  --pink-500: #ce4f7d;
  --pink-600: #af315f;
  --ink: #60223d;
  --white: #fffafd;
  --shadow: rgba(110, 41, 72, 0.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,.38) 0 2px, transparent 3px),
    radial-gradient(circle at 83% 26%, rgba(255,255,255,.35) 0 1px, transparent 3px),
    linear-gradient(180deg, #eea9c9 0%, #f7c9df 53%, #e9a0c2 100%);
  background-size: 34px 34px, 41px 41px, 100% 100%;
  font-family: "Jua", "Malgun Gothic", sans-serif;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  position: relative;
  min-height: 100dvh;
  isolation: isolate;
  padding: max(18px, env(safe-area-inset-top)) 14px max(24px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  overflow: hidden;
}
.app-shell::before, .app-shell::after {
  content: ""; position: absolute; left: -8%; right: -8%; z-index: -2; pointer-events: none;
}
.app-shell::before {
  bottom: -32px; height: 39%;
  background:
    radial-gradient(ellipse at 12% 72%, #fbe0ee 0 18%, transparent 18.5%),
    radial-gradient(ellipse at 33% 65%, #fbe0ee 0 22%, transparent 22.5%),
    radial-gradient(ellipse at 60% 68%, #fbe0ee 0 21%, transparent 21.5%),
    radial-gradient(ellipse at 86% 64%, #fbe0ee 0 23%, transparent 23.5%),
    linear-gradient(180deg, transparent 0 48%, #f8d7e8 49% 100%);
  opacity: .92;
}
.app-shell::after {
  bottom: 0; height: 19%;
  background:
    linear-gradient(165deg, transparent 0 43%, #d9779f 44% 48%, transparent 49%) 0 0 / 145px 75px,
    linear-gradient(195deg, transparent 0 46%, #d9779f 47% 50%, transparent 51%) 25px 22px / 160px 82px;
  opacity: .58;
}
.sky-decor { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.pixel-star, .pixel-heart { position: absolute; color: rgba(255,255,255,.7); text-shadow: 2px 2px 0 rgba(185,80,122,.1); }
.pixel-star { font-size: clamp(18px,5vw,28px); }
.pixel-heart { color: rgba(195,54,97,.62); font-size: clamp(28px,8vw,50px); transform: rotate(45deg); }
.star-1 { top: 18%; left: 8%; } .star-2 { top: 40%; right: 10%; } .star-3 { top: 58%; left: 44%; }
.heart-1 { top: 12%; left: 15%; } .heart-2 { top: 47%; right: 12%; } .heart-3 { bottom: 15%; left: 6%; }

.screen {
  width: min(100%, 460px); display: none; align-items: center; flex-direction: column; text-align: center;
  animation: pop-in .32s ease both;
}
.screen.active { display: flex; }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

.portrait-frame {
  position: relative; width: min(70vw,300px); aspect-ratio: 1 / 1; padding: 11px;
  border: 4px solid #8f234f; border-radius: 24px; background: linear-gradient(135deg,#fffdfd,#ffe4ef);
  box-shadow: 0 6px 0 #7b2346, 0 12px 22px var(--shadow);
}
.portrait-frame::before { content:""; position:absolute; inset:7px; border:2px solid #d45f87; border-radius:16px; pointer-events:none; }
.hero-image { width:100%; height:100%; object-fit:contain; border-radius:13px; background:#08080b; }
.pixelated { image-rendering: pixelated; }
.screen-copy { margin:30px 0 20px; font-size:clamp(22px,5.7vw,29px); letter-spacing:-.035em; text-shadow:1px 1px 0 rgba(255,255,255,.55); }
.screen-subcopy { max-width:320px; margin:8px 0 22px; font-size:15px; line-height:1.6; opacity:.78; }
.button-stack { width:min(100%,280px); }
.home-actions { display:flex; flex-direction:column; align-items:center; gap:22px; }

.pixel-button {
  appearance:none; border:0; border-radius:12px; min-height:48px; padding:10px 26px; cursor:pointer; color:#fff;
  background:linear-gradient(180deg,#dc6790 0%,#bb3f6a 100%);
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.35),0 4px 0 #8c244c,0 8px 15px rgba(112,31,63,.18);
  font-weight:800; letter-spacing:.02em; transition:transform .12s ease,filter .12s ease;
}
.pixel-button:hover { filter:brightness(1.05); }
.pixel-button:active { transform:translateY(3px); box-shadow:inset 0 0 0 2px rgba(255,255,255,.25),0 1px 0 #8c244c; }
.pixel-button:focus-visible,.activity-card:focus-visible,.date-field input:focus-visible { outline:3px solid rgba(255,255,255,.9); outline-offset:3px; }
.yes-button { min-width:92px; font-size:21px; }
.no-button { min-width:72px; color:#9f3f63; background:rgba(255,244,249,.88); box-shadow:inset 0 0 0 2px #d36b91,0 4px 0 #b54b72,0 8px 15px rgba(112,31,63,.12); }
.no-area { position:relative; width:min(100%,280px); height:74px; }
.no-area .no-button { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); }
.no-area .no-button:active { transform:translate(-50%,calc(-50% + 3px)); }
.tiny-message { min-height:22px; margin:8px 0 0; font-size:13px; color:#9b3a61; }

.love-frame { width:min(74vw,320px); background:#fff; }
.love-frame .hero-image { background:#fff5f9; }
.love-title-row { display:flex; gap:7px; align-items:center; justify-content:center; margin:25px auto 2px; }
.love-title-row span { color:#c03f6e; font-size:17px; }
h1,h2 { margin:0; line-height:1.35; }
h1 { max-width:310px; font-size:clamp(23px,6vw,32px); }
h2 { font-size:clamp(25px,7vw,34px); }

.card-icon { width:78px; height:78px; display:grid; place-items:center; margin-bottom:18px; border-radius:22px; color:#b43b66; background:rgba(255,249,252,.72); border:3px solid #cb5b82; box-shadow:0 5px 0 rgba(149,43,80,.5); font-size:42px; }
.date-field { width:min(100%,330px); text-align:left; margin:10px 0 18px; }
.date-field span { display:block; margin:0 0 7px 4px; font-size:13px; opacity:.72; }
.date-field input { width:100%; height:52px; border:3px solid #b44b71; border-radius:11px; padding:0 14px; color:#6f2848; background:rgba(255,250,253,.95); box-shadow:inset 0 0 0 2px #f9d7e5,0 4px 0 rgba(138,43,77,.28); }
.primary-button { min-width:140px; }
.confirm-button { width:100%; max-width:330px; margin-top:16px; }
.confirm-button:disabled { cursor:not-allowed; opacity:.45; filter:grayscale(.2); }
.activity-grid { width:100%; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:6px; }
.activity-card { min-height:92px; border:3px solid rgba(180,75,113,.66); border-radius:15px; color:#742b4d; background:rgba(255,249,252,.8); box-shadow:0 4px 0 rgba(139,47,79,.2); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; cursor:pointer; transition:transform .12s ease,background .12s ease,border-color .12s ease; }
.activity-card:hover { transform:translateY(-2px); }
.activity-card.selected { border-color:#a82f5c; background:#ffe1ec; box-shadow:inset 0 0 0 2px #ef9dbc,0 5px 0 rgba(139,47,79,.28); }
.activity-emoji { font-size:23px; }
.activity-card span:last-child { font-size:14px; }

.letter-card {
  width:min(100%,430px); padding:30px 26px 24px; position:relative; overflow:hidden; text-align:left;
  border:3px solid #b94770; border-radius:22px; background:rgba(255,250,252,.94);
  box-shadow:0 7px 0 #8c2c50,0 14px 28px rgba(110,41,72,.24);
}
.letter-card::before {
  content:""; position:absolute; inset:9px; border:2px dashed #e49ab6; border-radius:15px; pointer-events:none;
}
.letter-decoration { position:relative; z-index:1; text-align:center; color:#cf507d; font-size:31px; margin-bottom:10px; }
.letter-to { position:relative; z-index:1; margin:0 0 22px; color:#9f315d; font-size:24px; font-weight:800; }
.letter-body { position:relative; z-index:1; padding:0 5px; font-size:17px; line-height:2; letter-spacing:-.02em; }
.letter-body p { margin:0; }
.letter-signature { position:relative; z-index:1; margin:20px 0 16px; text-align:right; color:#cf507d; font-size:26px; }
.letter-home-button { display:block; position:relative; z-index:1; margin:0 auto; }

.toast { position:fixed; left:50%; bottom:max(18px,env(safe-area-inset-bottom)); transform:translate(-50%,130%); width:min(calc(100% - 28px),420px); padding:12px 16px; border-radius:999px; text-align:center; color:#fff; background:rgba(112,31,63,.9); box-shadow:0 6px 20px rgba(70,20,40,.22); transition:transform .22s ease; z-index:10; }
.toast.show { transform:translate(-50%,0); }

@media (min-width:520px) { .app-shell { padding-inline:24px; } .screen-copy { margin-top:34px; } }
@media (max-height:680px) { .portrait-frame { width:min(45vh,270px); } .screen-copy { margin:22px 0 15px; } .activity-card { min-height:78px; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; } }
