﻿:root {
  color-scheme: light;
  --paper: #eff5e9;
  --ink: #163b2c;
  --muted: #52664e;
  --line: #bacab0;
  --accent: #d2e5ba;
  --white: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--muted) var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: wait; opacity: 0.55; }
button:focus-visible { outline: 3px solid var(--ink); outline-offset: 5px; }
::selection { background: var(--ink); color: var(--paper); }
.page {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: max(28px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}
.gift { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 48px; }
.gift-content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 24px; text-align: center; }
.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 32px;
  border-radius: 50%;
  background: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  font-style: italic;
}
.avatar-dot { position: absolute; right: 0; bottom: 2px; width: 18px; height: 18px; border: 4px solid var(--paper); border-radius: 50%; background: var(--ink); }
h1 { margin: 0; font-size: clamp(25px, 7vw, 30px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.3; text-wrap: balance; }
.amount { display: block; margin-top: 12px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(76px, 24vw, 96px); font-weight: 400; letter-spacing: -0.04em; line-height: 1.15; font-variant-numeric: lining-nums; }
.amount-period { color: #6c873f; }
.message { margin: 22px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; text-wrap: balance; }
.gift-actions { width: 100%; }
.personal-note { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 24px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  min-height: 60px;
  padding: 18px 20px;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: var(--white);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  transition: background-color 160ms ease-out, transform 160ms ease-out;
}
.button svg { flex-shrink: 0; }
.button:active:not(:disabled) { transform: scale(0.98); }
.status { min-height: 20px; margin: 14px 0 0; color: var(--muted); font-size: 13px; text-align: center; line-height: 1.5; }
.reveal { align-self: center; width: 100%; max-width: 420px; text-align: center; }
.reveal .avatar { margin: 0 auto 32px; }
.reveal h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(48px, 12vw, 64px); font-weight: 400; letter-spacing: -0.03em; }
.reveal .button { margin-top: 40px; }
.scare { position: fixed; z-index: 10; inset: 0; overflow: hidden; background: #000; }
.scare-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 44%; animation: reveal-face 350ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.scare-controls { position: absolute; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); left: max(20px, env(safe-area-inset-left)); display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; }
.stop-button { min-width: 84px; min-height: 48px; padding: 12px 24px; border: 1px solid #a0a0a0; border-radius: 12px; background: #171717; color: var(--white); font-size: 16px; font-weight: 600; }
.stop-button:focus-visible { outline-color: var(--white); }
.sound-status { flex: 1; margin: 0; padding: 10px 14px; background: #171717; color: var(--white); border-radius: 12px; font-size: 14px; line-height: 1.4; }
body.is-scaring { overflow: hidden; }
@keyframes reveal-face { from { transform: scale(1.12); } to { transform: scale(1); } }
@media (hover: hover) {
  .button:hover:not(:disabled) { background: #24543c; }
  .stop-button:hover { background: #303030; }
}
@media (min-width: 700px) {
  .page { padding-top: 48px; padding-bottom: 32px; }
  .gift { max-width: 420px; }
  .gift-content { padding-top: 0; }
}
@media (max-height: 600px) {
  .gift { gap: 28px; }
  .gift-content { padding-top: 0; }
  .avatar { width: 56px; height: 56px; margin-bottom: 16px; font-size: 30px; }
  .amount { margin-top: 4px; font-size: 76px; }
  .message { margin-top: 12px; }
  .personal-note { padding-top: 12px; margin-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .scare-image { animation: none; }
  .button { transition: none; }
  .button:active:not(:disabled) { transform: none; }
}
