@font-face {
  font-family: "Hachi Maru Pop";
  src: url("./assets/HachiMaruPop-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #34435f;
  --muted: #6f7e96;
  --pink: #ff78ae;
  --pink-dark: #e94d8c;
  --line: #dfe9f4;
  --page: #f8fbff;
  --card: rgba(255, 255, 255, 0.9);
  font-family: "Hachi Maru Pop", "Segoe UI", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 190, 220, 0.26), transparent 34rem),
    radial-gradient(circle at 100% 20%, rgba(170, 224, 255, 0.30), transparent 32rem),
    var(--page);
}
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }

.site-header {
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(164, 182, 204, 0.28);
  background: rgba(255,255,255,.74);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 900; }
.brand-mark { background: var(--pink); color: white; padding: 9px 13px; border-radius: 16px 16px 16px 5px; transform: rotate(-3deg); }
.header-badges { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.header-badges span { padding: 7px 12px; border-radius: 999px; background: #edf3fa; font-size: 12px; font-weight: 800; }

main { width: min(1460px, calc(100% - 32px)); margin: 0 auto; padding: 52px 0 80px; }
.intro { max-width: 940px; margin: 0 auto 34px; text-align: center; }
.eyebrow { margin: 0 0 10px; color: var(--pink-dark); font-weight: 900; letter-spacing: .08em; }
h1 { margin: 0; font-size: clamp(32px, 5vw, 62px); line-height: 1.22; letter-spacing: .01em; }
.intro > p:last-child { margin: 18px auto 0; max-width: 760px; color: var(--muted); font-size: clamp(15px, 2vw, 19px); line-height: 1.9; }

.demo-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(360px, .78fr); gap: 24px; align-items: start; }
.preview-column, .control-panel { border: 1px solid rgba(196, 211, 228, .8); border-radius: 30px; background: var(--card); box-shadow: 0 18px 60px rgba(62, 82, 116, .12); }
.preview-column { overflow: hidden; }
.preview-toolbar { min-height: 70px; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #34435f; color: white; }
.live-dot { width: 10px; height: 10px; display: inline-block; margin-right: 8px; border-radius: 50%; background: #63e2a0; box-shadow: 0 0 0 5px rgba(99,226,160,.14); }
.toolbar-actions { display: flex; gap: 8px; }
.small-button { border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: 8px 12px; background: rgba(255,255,255,.1); color: white; font-size: 12px; font-weight: 800; }
.small-button:hover, .small-button:focus-visible { background: rgba(255,255,255,.2); }

.preview-stage {
  --stage-overlay: rgba(34, 48, 79, .58);
  min-height: 720px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(var(--stage-overlay), var(--stage-overlay)),
    var(--theme-background) center / cover no-repeat,
    linear-gradient(135deg, #26385d, #684b7f);
  transition: background .25s ease;
}
.preview-stage.stage-light { --stage-overlay: rgba(255,255,255,.36); }
.stage-copy { position: absolute; left: clamp(26px, 5vw, 70px); top: 58px; color: white; text-shadow: 0 4px 18px rgba(0,0,0,.35); }
.stage-light .stage-copy { color: #34435f; text-shadow: 0 2px 12px rgba(255,255,255,.6); }
.stage-copy span { display: block; margin-bottom: 20px; font: 800 13px "Segoe UI", sans-serif; letter-spacing: .16em; }
.stage-copy strong { display: block; font-size: clamp(28px, 4vw, 54px); line-height: 1.35; }
.comments { position: absolute; right: 34px; bottom: 22px; width: 500px; max-width: calc(100% - 38px); display: flex; flex-direction: column-reverse; align-items: center; gap: 12px; }
.empty-state { position: absolute; right: 48px; bottom: 68px; width: min(420px, calc(100% - 96px)); padding: 24px; border: 2px dashed rgba(255,255,255,.52); border-radius: 22px; color: white; text-align: center; background: rgba(38,52,82,.34); }
.stage-light .empty-state { color: #34435f; border-color: rgba(52,67,95,.35); background: rgba(255,255,255,.62); }
.empty-state span { display: block; margin-top: 8px; font-size: 12px; line-height: 1.7; opacity: .82; }
.empty-state[hidden] { display: none; }
.preview-note { margin: 0; padding: 14px 22px 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }

.comment-card { --comment-color: rgba(255,217,232,.78); position: relative; width: 450px; max-width: calc(100vw - 74px); min-height: 120px; padding: 10px 18px; border: 4px solid rgba(255,255,255,.96); border-radius: 28px; background: var(--card-background) center / cover; box-shadow: 0 8px 24px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.1); animation: comment-enter .45s cubic-bezier(.2,.9,.3,1.15) both; isolation: isolate; }
.comment-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgba(255,255,255,.18); z-index: -1; }
.name-pill { position: absolute; top: -20px; left: 50px; z-index: 5; min-width: 160px; max-width: 230px; height: 42px; padding: 4px 14px; display: flex; align-items: center; justify-content: center; gap: 6px; color: white; background: linear-gradient(135deg,#ff9fd0,#ffe278); border: 3px solid white; border-radius: 999px; box-shadow: 0 4px 12px rgba(0,0,0,.14); font-size: 15px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comment-card.type-first .name-pill { background: linear-gradient(135deg,#ffd05f,#ffae6a); }
.comment-card.type-superchat .name-pill { background: linear-gradient(135deg,#ff788b,#ff9b6e); }
.comment-card.type-member .name-pill { background: linear-gradient(135deg,#8079e5,#a76ed8); }
.member-badge { flex: 0 0 auto; width: 21px; height: 21px; border-radius: 50%; background: #ffe36a; border: 2px solid white; }
.first-sticker { position: absolute; left: -13px; top: -9px; z-index: 7; padding: 7px 10px; border: 2px solid white; border-radius: 999px; background: linear-gradient(135deg,#ffacd5,#ffad72); color: white; font-size: 11px; font-weight: 900; transform: rotate(-22deg); box-shadow: 0 5px 12px rgba(0,0,0,.16); }
.comment-body { min-height: 90px; padding: 28px 38px 12px; display: flex; align-items: center; justify-content: center; border: 2px solid rgba(255,255,255,.95); border-radius: 17px; background: var(--comment-color); box-shadow: inset 0 1px rgba(255,255,255,.7), 0 2px 6px rgba(0,0,0,.06); text-align: center; color: #383838; font-size: clamp(16px, 2.2vw, 21px); font-weight: 800; line-height: 1.35; word-break: break-word; }
.inline-paid { color: #ee4e90; font-weight: 900; }
.decoration { position: absolute; z-index: 4; object-fit: contain; pointer-events: none; transform-origin: center; animation-duration: 1.35s; animation-iteration-count: infinite; animation-delay: var(--delay,0s); }
.decoration.pos-1 { width: 96px; height: 96px; left: -26px; top: -38px; }
.decoration.pos-2 { width: 74px; height: 74px; right: -24px; top: -23px; }
.decoration.pos-3 { width: 65px; height: 65px; left: -16px; bottom: -25px; }
.decoration.pos-4 { width: 84px; height: 84px; right: -33px; bottom: -34px; }
.motion-paused .decoration { animation-play-state: paused !important; }
@keyframes comment-enter { from { opacity: 0; transform: translateY(34px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes bounce { 0%,20%,53%,100%{transform:translateY(0)} 40%,43%{transform:translateY(-30px) scaleY(1.08)} 70%{transform:translateY(-15px)} 80%{transform:translateY(0) scaleY(.95)} 90%{transform:translateY(-4px)} }
@keyframes wobble { 0%,100%{transform:none} 20%{transform:translateX(-10px) rotate(-5deg)} 40%{transform:translateX(8px) rotate(4deg)} 60%{transform:translateX(-5px) rotate(-2deg)} 80%{transform:translateX(3px) rotate(1deg)} }
@keyframes pop { 0%,100%{transform:scale(1)} 40%{transform:scale(1.18) rotate(4deg)} 70%{transform:scale(.95) rotate(-2deg)} }
@keyframes swing { 0%,100%{transform:rotate(0)} 25%{transform:rotate(9deg)} 50%{transform:rotate(-7deg)} 75%{transform:rotate(4deg)} }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 50%{transform:translateX(6px)} 75%{transform:translateX(-3px)} }
.anim-bounce { animation-name: bounce; }
.anim-wobble { animation-name: wobble; }
.anim-pop { animation-name: pop; }
.anim-swing { animation-name: swing; }
.anim-shake { animation-name: shake; }

.control-panel { padding: 24px; }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.step-label, fieldset legend span { margin: 0 0 4px; color: var(--pink-dark); font: 900 11px "Segoe UI",sans-serif; letter-spacing: .15em; }
.panel-heading h2, .details h2, .purchase-panel h2, .notice h2 { margin: 0; font-size: 20px; }
select, input, textarea { width: 100%; border: 1px solid #cbd9e8; border-radius: 14px; background: white; color: var(--ink); padding: 12px 13px; outline: none; }
select:focus, input:focus, textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255,120,174,.14); }
.panel-heading select { width: 160px; }
fieldset { margin: 20px 0 0; padding: 0; border: 0; }
fieldset legend { margin-bottom: 12px; font-weight: 900; }
fieldset legend span { display: block; }
.type-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 7px; }
.type-grid input { position: absolute; opacity: 0; pointer-events: none; }
.type-grid span { display: block; padding: 10px 5px; border: 1px solid #d5e1ee; border-radius: 12px; text-align: center; font-size: 12px; font-weight: 900; background: white; }
.type-grid input:checked + span { color: white; border-color: var(--pink); background: var(--pink); box-shadow: 0 5px 14px rgba(255,120,174,.25); }
.type-grid input:focus-visible + span { outline: 3px solid rgba(255,120,174,.3); }
.field-grid { display: grid; gap: 14px; margin-top: 20px; }
.field-grid label > span, .conditional-field label > span { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 900; }
textarea { resize: vertical; min-height: 88px; }
.field-grid small { display: block; margin-top: 5px; color: var(--muted); text-align: right; }
.conditional-field { margin-top: 14px; padding: 14px; border-radius: 16px; background: #f5f8fc; }
.primary-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.primary-button, .demo-button, .purchase-button { border: 0; border-radius: 16px; padding: 14px 16px; font-weight: 900; text-align: center; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.primary-button { color: white; background: linear-gradient(135deg,var(--pink),#ff9c76); box-shadow: 0 9px 22px rgba(255,110,158,.28); }
.demo-button { color: white; background: #40506b; }
.primary-button:hover, .demo-button:hover, .purchase-button:hover { transform: translateY(-2px); }
.secondary-actions { display: flex; justify-content: center; gap: 18px; margin-top: 15px; }
.text-button { border: 0; padding: 5px; color: var(--muted); background: transparent; font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.local-only { margin: 18px 0 0; padding: 12px; border-radius: 12px; color: #60738b; background: #edf8f2; font-size: 11px; line-height: 1.7; }

.details { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-top: 28px; }
.details article, .notice { padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.74); }
.details p, .purchase-panel p, .notice li { color: var(--muted); line-height: 1.8; }
.detail-number { color: var(--pink); font: 900 38px "Segoe UI",sans-serif; opacity: .6; }
.purchase-panel { margin-top: 28px; padding: 32px; display: flex; align-items: center; justify-content: space-between; gap: 26px; border-radius: 28px; color: white; background: linear-gradient(135deg,#40506b,#6e527f); box-shadow: 0 18px 50px rgba(51,65,92,.18); }
.purchase-panel p { margin: 8px 0 0; color: rgba(255,255,255,.78); }
.purchase-panel .eyebrow { color: #ffd0e2; }
.purchase-button { flex: 0 0 auto; min-width: 230px; color: #40506b; background: white; }
.notice { margin-top: 28px; }
.notice ul { margin: 14px 0 0; padding-left: 1.3em; }
.notice li + li { margin-top: 8px; }
footer { padding: 24px clamp(18px,4vw,64px); display: flex; justify-content: space-between; gap: 20px; color: var(--muted); border-top: 1px solid var(--line); background: white; font-size: 13px; }

@media (max-width: 1050px) {
  .demo-layout { grid-template-columns: 1fr; }
  .preview-stage { min-height: 720px; }
  .control-panel { max-width: 760px; margin: 0 auto; width: 100%; }
}
@media (max-width: 720px) {
  .site-header { position: static; align-items: flex-start; }
  .header-badges { display: none; }
  main { width: min(100% - 20px, 1460px); padding-top: 34px; }
  .preview-toolbar { align-items: flex-start; }
  .toolbar-actions { flex-direction: column; }
  .preview-stage { min-height: 720px; }
  .stage-copy { top: 35px; }
  .comments { right: 50%; transform: translateX(50%); bottom: 28px; }
  .empty-state { right: 20px; width: calc(100% - 40px); }
  .comment-card { width: min(450px, calc(100vw - 52px)); }
  .panel-heading { align-items: stretch; flex-direction: column; }
  .panel-heading select { width: 100%; }
  .type-grid { grid-template-columns: repeat(3,1fr); }
  .primary-actions, .details { grid-template-columns: 1fr; }
  .purchase-panel { align-items: stretch; flex-direction: column; }
  .purchase-button { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
