/* ============================================================
   P5 Baton - Fireworks Viewer Styles
   ============================================================ */

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ステージ: 常に400x800で描画し、JSでスケール制御 */
#stage {
  position: relative;
  width: 400px;
  height: 800px;
  overflow: hidden;
  background: #000;
  transform-origin: center center;
}

/* iframeスロット: 重ねて配置 */
.sketch-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.sketch-frame.active {
  opacity: 1;
  z-index: 2;
}

.sketch-frame.fading-out {
  opacity: 0;
  z-index: 1;
}

/* メタデータオーバーレイ */
#overlay {
  position: absolute;
  bottom: 40px;
  left: 20px;
  right: 20px;
  z-index: 30;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 12px;
}

#overlay.visible {
  opacity: 1;
  transform: translateY(0);
}

.overlay-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.3);
}

#overlay-text {
  display: flex;
  flex-direction: column;
}

#overlay-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 1), 0 0 20px rgba(0, 0, 0, 0.8);
  margin-bottom: 4px;
}

#overlay-author {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 1), 0 0 16px rgba(0, 0, 0, 0.8);
}

/* フレーム画像オーバーレイ */
#frame-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  pointer-events: none;
}

/* カウンター */
#counter {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 30;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#counter.visible {
  opacity: 1;
}
