* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, "Malgun Gothic", sans-serif;
  overflow: hidden;
}

#top-bar {
  position: fixed;
  top: 32px;
  left: 34px;
  z-index: 10;
}

#site-title {
  display: inline-block;
  font-size: 22px;
  font-weight: 500;
  color: #1414e0;
  text-decoration: underline;
  margin-bottom: 18px;
}

#input-row {
  display: flex;
  gap: 8px;
}

#pip-input {
  width: 420px;
  max-width: 60vw;
  padding: 10px 14px;
  font-size: 15px;
  border: 1.5px solid #1414e0;
  border-radius: 2px;
  outline: none;
  color: #1414e0;
}

#pip-input::placeholder {
  color: #b3b3f5;
}

#send-btn {
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 600;
  background: #1414e0;
  color: #fff;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

#send-btn:hover {
  opacity: 0.85;
}

#send-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

#notice {
  margin-top: 10px;
  font-size: 12px;
  color: #1414e0;
}

/* 떠다니는 pip 카드 */
#pip-container {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.pip {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1414e0;
  text-decoration: underline;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  animation-name: orbit;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
  opacity: 0;
  animation-fill-mode: forwards;
}

.pip.appear {
  animation-name: orbit, fadeIn;
  animation-duration: var(--dur), 0.6s;
  animation-timing-function: linear, ease-out;
  animation-iteration-count: infinite, 1;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* r을 반지름(px)으로 하는 정원 궤도 (8분할 근사) */
@keyframes orbit {
  0%    { transform: translate(var(--r), 0); }
  12.5% { transform: translate(calc(var(--r) * 0.7071), calc(var(--r) * 0.7071)); }
  25%   { transform: translate(0, var(--r)); }
  37.5% { transform: translate(calc(var(--r) * -0.7071), calc(var(--r) * 0.7071)); }
  50%   { transform: translate(calc(var(--r) * -1), 0); }
  62.5% { transform: translate(calc(var(--r) * -0.7071), calc(var(--r) * -0.7071)); }
  75%   { transform: translate(0, calc(var(--r) * -1)); }
  87.5% { transform: translate(calc(var(--r) * 0.7071), calc(var(--r) * -0.7071)); }
  100%  { transform: translate(var(--r), 0); }
}

#bgm-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid #1414e0;
  background: #fff;
  color: #1414e0;
  font-size: 18px;
  cursor: pointer;
  z-index: 20;
  opacity: 0.85;
}

#bgm-toggle.playing {
  background: #1414e0;
  color: #fff;
}

@media (max-width: 640px) {
  #pip-input {
    width: 60vw;
  }
  #site-title {
    font-size: 18px;
  }
  .pip {
    font-size: 16px;
  }
}
