html, body { margin: 0; height: 100%; overflow: hidden; background: #a9dcf5; font-family: 'Jua', sans-serif; }
canvas { display: block; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; color: #fff; font-size: 22px; letter-spacing: 1px; pointer-events: none; transition: opacity .5s; }
#loading.done { opacity: 0; }
#tip {
  position: fixed; left: 0; top: 0; padding: 8px 16px 9px; border-radius: 999px;
  background: #fffaf0; color: #3a2f2c; font-size: 18px; box-shadow: 0 4px 0 rgba(0, 0, 0, .14);
  transform: translate(-50%, -100%) scale(.6); opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s cubic-bezier(.3, 1.6, .5, 1); white-space: nowrap;
}
#tip.on { opacity: 1; transform: translate(-50%, -100%) scale(1); }
#toggle {
  position: fixed; right: 22px; top: 22px; width: 52px; height: 52px; border: 0; border-radius: 50%;
  background: #fffaf0; box-shadow: 0 4px 0 rgba(0, 0, 0, .14); cursor: pointer; font-size: 24px; line-height: 52px; padding: 0;
}
#toggle::before { content: '🌙'; }
body.night #toggle::before { content: '☀️'; }
body.night #toggle { background: #2b2a3a; }
#hint { position: fixed; left: 22px; bottom: 20px; display: flex; gap: 18px; color: rgba(60, 60, 60, .75); font: 500 13px/1 -apple-system, 'Apple SD Gothic Neo', 'Pretendard', sans-serif; pointer-events: none; }
#hint span { display: flex; align-items: center; gap: 6px; }
#hint kbd { padding: 5px 8px; border: 1px solid rgba(0, 0, 0, .16); border-radius: 6px; background: rgba(255, 255, 255, .55); color: rgba(40, 40, 40, .85); font: 600 12px/1 -apple-system, 'SF Pro Text', sans-serif; }
body.night #hint { color: rgba(255, 255, 255, .6); }
body.night #hint kbd { border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .85); }
#bubble {
  position: fixed; left: 0; top: 0; display: flex; gap: 8px; padding: 10px 12px; border-radius: 22px;
  background: #fffaf0; box-shadow: 0 5px 0 rgba(0, 0, 0, .14);
  transform: translate(-50%, -100%) scale(.2); transform-origin: 50% 120%; opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .25s cubic-bezier(.3, 1.7, .5, 1);
}
#bubble::after { content: ''; position: absolute; left: 50%; bottom: -9px; width: 18px; height: 18px; margin-left: -9px; border-radius: 4px; background: #fffaf0; transform: rotate(45deg); box-shadow: 4px 4px 0 rgba(0, 0, 0, .14); }
#bubble.on { opacity: 1; pointer-events: auto; transform: translate(-50%, -100%) scale(1); }
#bubble a {
  position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--c, #fff); box-shadow: 0 2px 0 rgba(0, 0, 0, .12);
  transform: scale(0); transition: scale .15s, translate .15s;
}
#bubble a img { width: 100%; height: 100%; object-fit: cover; display: block; }
#bubble a img.glyph { width: 58%; height: 58%; object-fit: contain; filter: invert(1); }
#bubble.on a { animation: pop .32s cubic-bezier(.3, 1.8, .5, 1) calc(var(--i) * 45ms + 90ms) forwards; }
/* hover는 scale/translate 속성으로만 준다. animation을 건드리면 마우스를 뗄 때 처음부터 다시 재생된다 */
#bubble a:hover { scale: 1.15; translate: 0 -3px; }
@keyframes pop { to { transform: scale(1); } }
.clickme {
  position: fixed; left: 0; top: 0; padding: 5px 11px 6px; border-radius: 999px; background: #fffaf0; color: #3a2f2c;
  font: 14px/1 'Jua', sans-serif; white-space: nowrap; box-shadow: 0 3px 0 rgba(0, 0, 0, .14);
  transform: translate(-50%, -100%); opacity: 0; pointer-events: none; transition: opacity .2s;
  animation: bob 1.4s ease-in-out infinite;
}
.clickme::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; margin-left: -5px; border-radius: 2px; background: #fffaf0; transform: rotate(45deg); box-shadow: 3px 3px 0 rgba(0, 0, 0, .14); }
.clickme.on { opacity: 1; }
@keyframes bob { 50% { translate: 0 -5px; } }
