:root { color-scheme: light; font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; font-synthesis: none; --brand-blue: #1aa0ee; --bg: #f3f0e8; --ink: #252b27; --muted: #788077; --line: #d9dbcf; --panel: #faf9f4; --accent: #d7f26f; }
* { box-sizing: border-box; }
body { margin: 0; height: 100svh; background: var(--bg); color: var(--ink); overflow: hidden; }
body[data-theme="dark"] { color-scheme: dark; --bg: #202b29; --ink: #f0f0e8; --muted: #a7b2a5; --line: #526058; --panel: #2c3834; }
body[data-theme="brand"] { --bg: var(--brand-blue); --ink: #082d43; --muted: #123549; --line: #1275ad; --panel: #f4fbff; }
button, input { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #5d8044; outline-offset: 5px; }
.site-header { position: fixed; z-index: 10; top: 32px; right: 32px; display: flex; align-items: center; gap: 8px; }
.social-link { position: fixed; z-index: 10; top: 32px; left: 32px; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink); font-size: 13px; line-height: 1; text-decoration: none; }
.social-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.social-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* Both menus share one anchor, so switching tools keeps their edges aligned. */
.site-header details { position: static; }
.icon-control { position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--ink); cursor: pointer; }
.icon-control svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
summary { list-style: none; user-select: none; }
summary::-webkit-details-marker { display: none; }
.site-header details[open] > summary { border-color: var(--ink); }
.control-tooltip { position: absolute; top: calc(100% + 10px); right: 0; width: max-content; padding: 7px 10px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; font-size: 11px; font-weight: 400; white-space: nowrap; visibility: hidden; pointer-events: none; }
.icon-control:focus-visible .control-tooltip { visibility: visible; }
@media (hover: hover) { .icon-control:hover { border-color: var(--muted); } .icon-control:hover .control-tooltip { visibility: visible; } }
.site-header details[open] .control-tooltip, .site-header.tooltips-dismissed .control-tooltip { visibility: hidden; }
.toolbar-popover { position: absolute; top: calc(100% + 12px); right: 0; width: 244px; max-width: calc(100vw - 32px); padding: 16px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 30px #00000012; max-height: calc(100svh - 130px); overflow-y: auto; }
.popover-title { margin: 0 0 12px; font-size: 12px; line-height: 18px; font-weight: 600; letter-spacing: -.02em; }
.option-button { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-width: 0; min-height: 48px; padding: 10px 8px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 12px; font-size: 12px; line-height: 18px; font-weight: 500; white-space: nowrap; }
.option-button:hover { border-color: var(--muted); background: #7880770c; }
.option-button[aria-pressed="true"] { color: #253b25; border-color: #b6d454; background: var(--accent); }
/* Official artwork stays intact: 40px height, 10px clear space per badge. */
.store-links { position: fixed; z-index: 8; left: 32px; bottom: 32px; display: flex; align-items: center; gap: 20px; }
.store-link { display: block; flex-shrink: 0; height: 40px; padding: 0; border: 0; background: transparent; line-height: 0; }
.store-link:disabled { cursor: default; opacity: 1; }
.store-link img { display: block; width: auto; height: 40px; max-width: none; }
.background-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.swatch-dot { flex: 0 0 14px; width: 14px; height: 14px; border: 1px solid #8d9688; border-radius: 50%; }
.swatch-light .swatch-dot { background: #f3f0e8; }
.swatch-dark .swatch-dot { background: #202b29; }
.swatch-brand .swatch-dot { background: var(--brand-blue); }
.sound-off-line { display: none; }
.sound-toggle[aria-pressed="false"] { color: var(--muted); }
.sound-toggle[aria-pressed="false"] .sound-off-line { display: initial; }
.sound-toggle[aria-pressed="false"] .sound-on-waves { display: none; }
.room { position: relative; width: 100%; height: 100%; isolation: isolate; overflow: clip; }
.intro { position: absolute; z-index: 1; left: 7.4%; top: 32.5%; transition: opacity 260ms ease, transform 260ms ease, visibility 0s 260ms; }
body.has-chatted .intro { opacity: 0; transform: translateY(-8px); visibility: hidden; pointer-events: none; }
h1 { margin: 0; font-size: clamp(38px, 3.8vw, 63px); font-weight: 800; letter-spacing: -.075em; line-height: 1.26; }
.mascot { position: absolute; z-index: 2; height: min(97svh, 1050px); aspect-ratio: 560 / 832; bottom: -28px; left: 50%; transform: translateX(-50%); pointer-events: none; }
.neutral-frame, .reaction-video, #video-layers { position: absolute; inset: 0; width: 100%; height: 100%; }
.neutral-frame, .reaction-video { object-fit: contain; object-position: center bottom; }
.neutral-frame { user-select: none; }
.reaction-video { visibility: hidden; }
.reaction-video.is-active { visibility: visible; }
.mascot.is-playing .neutral-frame { visibility: hidden; }
.conversation { position: absolute; z-index: 5; bottom: 31px; left: 50%; transform: translateX(-50%); width: min(620px, calc(100% - 48px)); }
#message-form { display: flex; padding: 8px 9px 8px 25px; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 99px; box-shadow: 0 8px 36px #1b272310; }
#message-form:focus-within { outline: 2px solid #8b9e66; outline-offset: 3px; }
input { background: transparent; color: var(--ink); border: 0; outline: 0; flex: 1; min-width: 0; height: 42px; font-size: 14px; letter-spacing: -.025em; }
input::placeholder { color: var(--muted); }
.send-button { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--accent); color: #253b25; transition: transform 120ms, background 120ms; }
.send-button:hover { background: #c9e85c; transform: translateX(2px); }
.send-button:active { transform: scale(.94); }
.send-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.live-chat { position: absolute; z-index: 4; inset: 0; pointer-events: none; }
.chat-message { position: absolute; width: max-content; max-width: 268px; }
.chat-bubble { display: block; padding: 12px 18px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 22px 22px 22px 6px; box-shadow: 0 7px 24px #1b272312; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; transform-origin: bottom left; animation: message-pop 380ms cubic-bezier(.2,.8,.2,1) both, message-hover 3.6s 380ms ease-in-out infinite; }
.chat-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.chat-message[data-side="right"] .chat-bubble { border-radius: 22px 22px 6px 22px; transform-origin: bottom right; }
.chat-message.is-leaving .chat-bubble { animation: message-out 280ms ease-in both; }
@keyframes message-pop { from { opacity: 0; transform: translateY(14px) scale(.78); } 72% { opacity: 1; transform: translateY(-2px) scale(1.035); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes message-hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes message-out { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-14px) scale(.94); } }
.expression-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
noscript { position: fixed; z-index: 20; top: 100px; left: 50%; transform: translateX(-50%); padding: 15px; background: var(--panel); }
@media (max-width: 1320px) {
  .store-links { left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); }
  .conversation { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (max-width: 1100px) {
  .intro { left: 4%; top: 26%; }
  h1 { font-size: 34px; }
  .mascot { height: 91svh; }
  .conversation { width: min(560px, calc(100% - 48px)); }
}
@media (max-width: 760px) {
  .site-header { top: 16px; right: 16px; }
  .social-link { top: 16px; left: 16px; font-size: 12px; }
  .intro { display: none; }
  .mascot { height: min(80svh, 850px); bottom: calc(86px + env(safe-area-inset-bottom)); max-width: 118vw; }
  .conversation { width: calc(100% - 32px); }
  #message-form { padding-left: 19px; }
  input { font-size: 16px; }
}
@media (max-height: 600px) and (min-width: 1321px) {
  .site-header { top: 20px; }
  .social-link { top: 20px; }
  .intro { top: 29%; }
  .conversation { bottom: 20px; width: 480px; }
  .mascot { height: 96svh; bottom: -20px; }
}
@media (prefers-reduced-motion: reduce) { .send-button, .intro { transition: none; } .chat-bubble { animation: none !important; } .chat-message.is-leaving { visibility: hidden; } }
