/* haso.lol festival greetings: one festive-night look for the maker (/greet/) and the player (/greet/play/).
   Deep navy night, pure candy pieces (magenta, cyan, green, violet), marigold only for flames and gold accents. */
:root {
  --night: #070b30; --night2: #22145e; --ink: #101a46; --muted: #56618f; --line: #d9def2;
  --mag: #ff3b8d; --mag-d: #c4136a; --cyan: #1ec8ef; --green: #22d98a; --violet: #7c4dff; --gold: #ffc83d; --red: #ff3b5c;
  --wa: #1fae5b; --wa-d: #138043;
  --font: 'Baloo 2', 'Noto Sans Devanagari', 'Nirmala UI', 'Kohinoor Devanagari', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: #fff; background: var(--night); }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ---------- buttons (chunky, pressed bottom edge like the portal) */
.btn {
  --c: var(--violet); --d: #5a2fd6;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 12px 22px; border: 0; border-radius: 18px;
  background: var(--c); color: #fff; box-shadow: 0 5px 0 var(--d);
  font-weight: 800; font-size: 18px; line-height: 1.15; text-decoration: none; cursor: pointer;
  transition: transform .08s, box-shadow .08s, filter .15s; -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--d); }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn.big { min-height: 64px; font-size: 21px; padding: 14px 28px; border-radius: 20px; }
.btn.pink { --c: var(--mag); --d: var(--mag-d); }
.btn.wa { --c: var(--wa); --d: var(--wa-d); }
.btn.cyan { --c: #0fa8cf; --d: #0a7899; }
.btn.ghost { --c: rgba(255,255,255,.12); --d: rgba(0,0,0,.4); border: 2px solid rgba(255,255,255,.28); }
.btn.line { --c: #fff; --d: #c7cde6; color: var(--ink); border: 2px solid var(--line); }

/* ============================================================= player */
html:has(body.pl), body.pl { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.pl { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
#c { position: fixed; inset: 0; display: block; width: 100vw; height: 100vh; height: 100dvh; touch-action: none; outline: none; }
.hud { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 3; pointer-events: none; }
.meter { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 10px; border-radius: 999px; background: rgba(7, 11, 48, .72); border: 2px solid rgba(255,255,255,.16); }
.track { width: clamp(130px, 38vw, 240px); height: 12px; border-radius: 99px; background: rgba(255,255,255,.14); overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--mag), var(--gold)); transform: scaleX(0); transform-origin: left; transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
#count { min-width: 3.6em; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; text-align: right; }
.mute { position: fixed; z-index: 6; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; border: 2px solid rgba(255,255,255,.18); background: rgba(7, 11, 48, .65); cursor: pointer; }
.mute svg { width: 24px; height: 24px; }
.mute .x { display: none; }
.mute.off .x { display: inline; }
.mute.off .on { display: none; }
.hint { position: fixed; z-index: 3; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); max-width: calc(100vw - 32px); margin: 0;
  padding: 10px 18px; border-radius: 999px; background: rgba(7, 11, 48, .8); border: 2px solid rgba(255,255,255,.16);
  font-weight: 700; font-size: 18px; text-align: center; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
.hint.on { opacity: 1; transform: translate(-50%, 0); }

.ov { position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); text-align: center; }
.intro { background: radial-gradient(ellipse at center, rgba(7, 11, 48, .35), rgba(7, 11, 48, .8)); transition: opacity .25s; }
.intro.out { opacity: 0; }
.intro h1 { max-width: 15em; margin: 14px 0 6px; font-size: clamp(28px, 7vw, 44px); font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; text-shadow: 0 3px 0 rgba(0,0,0,.25); }
.intro p { max-width: 24em; margin: 0 0 26px; font-size: clamp(18px, 4.6vw, 22px); font-weight: 600; color: rgba(255,255,255,.88); }
.gift { width: 104px; height: 104px; animation: gift 1.6s ease-in-out infinite; }
.gift svg { width: 100%; height: 100%; }
@keyframes gift { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-8px) rotate(4deg); } }
#go { min-width: 200px; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(1.06); } 90% { transform: scale(.98); } }

.rv { justify-content: safe center; overflow-y: auto; background: rgba(7, 11, 48, .28); touch-action: pan-y; }
.card { width: 100%; max-width: 440px; padding: 22px 24px 24px; border-radius: 28px; background: #fff; color: var(--ink); text-align: center; box-shadow: 0 26px 70px rgba(0, 0, 0, .5); user-select: text; -webkit-user-select: text; }
.band { display: flex; justify-content: center; gap: 10px; margin-bottom: 10px; }
.band i { width: 12px; height: 12px; border-radius: 3px; transform: rotate(45deg); background: var(--mag); }
.band i:nth-child(2) { background: var(--cyan); } .band i:nth-child(3) { background: var(--gold); width: 16px; height: 16px; } .band i:nth-child(4) { background: var(--green); } .band i:nth-child(5) { background: var(--violet); }
.card .kick { margin: 0; font-size: 18px; font-weight: 700; color: var(--violet); }
.card h1, .card .ttl { margin: 0 0 8px; font-size: clamp(38px, 10vw, 52px); line-height: 1.08; font-weight: 800; color: #e0116c; }
.card .dear { margin: 12px 0 2px; font-size: 21px; font-weight: 700; overflow-wrap: anywhere; }
.card .msg { margin: 6px 0 0; font-size: clamp(19px, 5vw, 22px); line-height: 1.45; font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; }
.card .from { margin: 14px 0 0; font-size: 21px; font-weight: 800; color: var(--violet); overflow-wrap: anywhere; }
.acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 22px; }
.more { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; padding: 8px; color: rgba(255,255,255,.88); font-weight: 700; font-size: 17px; text-decoration: underline; text-underline-offset: 4px; }
.more .mk { width: 20px; height: 20px; }
.rv.in .card { animation: cardIn .75s cubic-bezier(.2, 1.35, .4, 1) both; }
.rv.in .acts { animation: up .45s .55s both; }
.rv.in .more { animation: up .45s .75s both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(40px) scale(.6) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
body.bad #hud, body.bad .mute { display: none; }

/* ============================================================= maker */
html:has(body.maker) { background: var(--night2); }
body.maker { min-height: 100vh; background: linear-gradient(180deg, var(--night) 0, #120f48 900px, #1a1258 1800px, var(--night2) 100%); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1120px; margin: 0 auto; padding: 14px 16px 0; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 800; font-size: 24px; }
.logo .mk { width: 34px; height: 34px; }
.logo b { color: var(--red); }
.toplink { color: rgba(255,255,255,.85); font-weight: 700; font-size: 16px; text-decoration: none; padding: 10px 4px; }
.toplink:hover { color: #fff; text-decoration: underline; }
.hero { position: relative; max-width: 1120px; margin: 0 auto; padding: 0 16px; text-align: center; }
#strip { display: block; width: 100%; height: 104px; margin-top: -4px; -webkit-mask-image: linear-gradient(transparent, #000 45%); mask-image: linear-gradient(transparent, #000 45%); }
.hero h1 { margin: 2px auto 6px; max-width: 18em; font-size: clamp(30px, 6.4vw, 52px); line-height: 1.1; font-weight: 800; }
.hero .sub { margin: 0 auto 22px; max-width: 30em; font-size: clamp(18px, 4.2vw, 21px); font-weight: 600; color: rgba(255,255,255,.85); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px 32px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.wrap > * { min-width: 0; }
@media (min-width: 960px) { .wrap { grid-template-columns: minmax(0, 600px) 380px; justify-content: center; align-items: start; } }
.panel { background: #fff; color: var(--ink); border-radius: 26px; padding: 18px 18px 22px; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
@media (min-width: 560px) { .panel { padding: 24px 26px 28px; } }
.step { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.step > legend, .lbl { display: block; padding: 0; margin: 0 0 8px; font-size: 17px; font-weight: 800; color: var(--ink); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 8px 12px; border-radius: 16px; border: 2px solid var(--line); background: #f5f7ff; color: var(--ink); font-weight: 800; font-size: 17px; line-height: 1.2; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.opt:hover { border-color: #b8c0e4; }
.opt[aria-pressed="true"] { border-color: var(--mag); background: #fff0f7; box-shadow: 0 0 0 2px var(--mag) inset; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 48px; padding: 6px 16px; border-radius: 999px; border: 2px solid var(--line); background: #f5f7ff; color: var(--ink); font-weight: 700; font-size: 17px; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--violet); background: var(--violet); color: #fff; }
.games { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.game { position: relative; display: flex; flex-direction: column; align-items: stretch; padding: 6px 6px 10px; border-radius: 18px; border: 2px solid var(--line); background: #f5f7ff; color: var(--ink); cursor: pointer; text-align: center; -webkit-tap-highlight-color: transparent; }
.game canvas { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 13px; background: var(--night); }
.game b { display: block; margin-top: 6px; font-size: 16px; line-height: 1.15; font-weight: 800; }
.game small { display: block; font-size: 14px; font-weight: 600; color: var(--muted); }
.game[aria-pressed="true"] { border-color: var(--mag); box-shadow: 0 0 0 2px var(--mag) inset; background: #fff0f7; }
.game[aria-pressed="true"]::after { content: ''; position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%; background: var(--mag) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; box-shadow: 0 2px 0 var(--mag-d); }
.field { display: block; margin-bottom: 14px; }
.inp, .ta { display: block; width: 100%; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--ink); font-size: 19px; font-weight: 600; line-height: 1.35; }
.inp { min-height: 54px; }
.ta { min-height: 128px; resize: vertical; }
.inp:focus, .ta:focus { outline: none; border-color: var(--mag); box-shadow: 0 0 0 3px rgba(255, 59, 141, .18); }
.inp::placeholder, .ta::placeholder { color: #9aa3c7; }
.tpls { display: flex; gap: 8px; margin: 0 -18px 10px; padding: 0 18px 4px; overflow-x: auto; scrollbar-width: none; }
.tpls::-webkit-scrollbar { display: none; }
.tpls .chip { flex: none; min-height: 44px; font-size: 16px; }
.cnt { margin: 4px 2px 0; font-size: 14px; font-weight: 600; color: var(--muted); text-align: right; }
.row2 { display: grid; gap: 0 12px; }
@media (min-width: 560px) { .row2 { grid-template-columns: 1fr 1fr; } }
.err { margin: 6px 2px 0; color: #d61a4f; font-weight: 700; font-size: 16px; }
.cta { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 8px; }
@media (min-width: 560px) { .cta { grid-template-columns: 1fr auto; } }
.cta .btn { width: 100%; }

.done h2 { margin: 0 0 4px; font-size: 30px; line-height: 1.15; font-weight: 800; color: #e0116c; }
.done .lead { margin: 0 0 14px; font-size: 18px; font-weight: 600; color: var(--muted); overflow-wrap: anywhere; }
.done .shot { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; border-radius: 16px; background: var(--night); }
.linkrow { display: flex; gap: 8px; margin: 14px 0; }
.linkrow .inp { min-height: 50px; font-size: 15px; font-weight: 600; color: var(--muted); }
.shares { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.shares .btn { width: 100%; min-height: 58px; padding: 10px 12px; font-size: 18px; }
.shares .first { grid-column: 1 / -1; }
.again { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 16px; }
.textbtn { padding: 10px 6px; border: 0; background: none; color: var(--violet); font-weight: 800; font-size: 17px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 30; transform: translate(-50%, 20px); padding: 12px 20px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 800; font-size: 17px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.side { position: sticky; top: 16px; display: none; }
@media (min-width: 960px) { .side { display: block; } }
.side .lbl { color: rgba(255,255,255,.85); text-align: center; }
.side .card { animation: none; box-shadow: 0 18px 50px rgba(0,0,0,.4); }

.pvbox { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(4, 6, 24, .86); }
.pvbox iframe { width: 100%; height: 100%; border: 0; background: var(--night); }
@media (min-width: 700px) and (min-height: 700px) { .pvbox iframe { width: 420px; height: min(860px, calc(100vh - 48px)); border-radius: 28px; box-shadow: 0 0 0 8px #1d2150, 0 30px 80px rgba(0,0,0,.6); } }
.pvbox .x { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 10px; z-index: 2; }

.info { max-width: 900px; margin: 0 auto; padding: 8px 16px 40px; color: rgba(255,255,255,.9); }
.info h2 { margin: 34px 0 12px; font-size: clamp(24px, 5vw, 32px); line-height: 1.2; font-weight: 800; color: #fff; }
.info p, .info li { font-size: 18px; line-height: 1.55; font-weight: 500; }
.steps3 { display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; counter-reset: s; }
@media (min-width: 720px) { .steps3 { grid-template-columns: repeat(3, 1fr); } }
.steps3 li { counter-increment: s; padding: 16px 18px; border-radius: 20px; background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.1); }
.steps3 li::before { content: counter(s); display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 8px; border-radius: 12px; background: var(--mag); color: #fff; font-weight: 800; font-size: 20px; }
.steps3 b { display: block; color: #fff; font-size: 19px; }
.wishes { display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; }
.wishes li { padding: 12px 16px; border-radius: 16px; background: rgba(255,255,255,.07); }
.wishes span { display: block; font-size: 14px; font-weight: 700; color: var(--gold); }
.faq details { margin-bottom: 10px; padding: 12px 16px; border-radius: 16px; background: rgba(255,255,255,.07); }
.faq summary { cursor: pointer; font-weight: 800; font-size: 18px; color: #fff; }
.faq details p { margin: 8px 0 0; }
.info a { color: #fff; font-weight: 700; }
.foot { max-width: 900px; margin: 0 auto; padding: 22px 16px 40px; border-top: 2px solid rgba(255,255,255,.1); color: rgba(255,255,255,.75); font-size: 16px; text-align: center; }
.foot a { color: #fff; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .gift, #go { animation: none; } .rv.in .card, .rv.in .acts, .rv.in .more { animation-duration: .01s; animation-delay: 0s; } }
