:root {
  color-scheme: light;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  background: #f3ead8;
  color: #291a13;
}

* { box-sizing: border-box; }

body.momotaro-kamishibai-host {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(255,255,255,.75), transparent 34%),
    linear-gradient(135deg, #f7efdf, #ead9bd);
}

.momotaro-kamishibai-app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.momotaro-kamishibai-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.momotaro-kamishibai-kicker {
  margin: 0 0 6px;
  color: #a53f35;
  font: 700 12px/1.2 system-ui, sans-serif;
  letter-spacing: .17em;
}

.momotaro-kamishibai-header h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}

.momotaro-kamishibai-header h1 span {
  color: #75543c;
  font-size: .52em;
  font-weight: 600;
}

.momotaro-kamishibai-note {
  max-width: 390px;
  margin: 0;
  color: #604a3c;
  font: 500 13px/1.55 system-ui, sans-serif;
}

.momotaro-kamishibai-player {
  padding: 14px;
  border: 1px solid rgba(83,51,31,.22);
  border-radius: 22px;
  background: rgba(255,252,244,.88);
  box-shadow: 0 22px 70px rgba(69,39,21,.18);
}

.momotaro-kamishibai-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 13px;
  background: #20150f;
  isolation: isolate;
}

.momotaro-kamishibai-image {
  position: absolute;
  inset: -3%;
  width: 106%;
  height: 106%;
  object-fit: cover;
  transform-origin: center;
  will-change: transform, opacity;
}

.momotaro-kamishibai-wash {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(24,12,8,.18), transparent 28%, transparent 68%, rgba(18,9,6,.48)),
    radial-gradient(circle at center, transparent 52%, rgba(26,12,7,.28));
  pointer-events: none;
}

.momotaro-kamishibai-paper {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: .12;
  mix-blend-mode: multiply;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(12deg, rgba(73,45,30,.25) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(98deg, rgba(255,255,255,.28) 0 1px, transparent 1px 7px);
}

.momotaro-kamishibai-scene-label {
  position: absolute;
  top: 30px;
  left: 32px;
  z-index: 3;
  display: grid;
  gap: 3px;
  max-width: 58%;
  color: #fffdf5;
  text-shadow: 0 2px 14px rgba(0,0,0,.75);
}

.momotaro-kamishibai-scene-label span {
  font: 700 13px/1.2 system-ui, sans-serif;
  letter-spacing: .12em;
}

.momotaro-kamishibai-scene-label strong {
  font-size: clamp(25px, 4.2vw, 54px);
  line-height: 1.08;
}

.momotaro-kamishibai-opening {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: #fffaf0;
  text-align: center;
  text-shadow: 0 4px 24px rgba(0,0,0,.9);
  background: rgba(35,13,8,.25);
  opacity: 0;
  pointer-events: none;
}

.momotaro-kamishibai-opening.is-visible { opacity: 1; }

.momotaro-kamishibai-opening span {
  font-size: clamp(15px, 2vw, 24px);
  letter-spacing: .18em;
}

.momotaro-kamishibai-opening strong {
  font-size: clamp(56px, 11vw, 132px);
  letter-spacing: .08em;
}

.momotaro-kamishibai-caption {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 5;
  width: max-content;
  max-width: calc(100% - 44px);
  margin: 0;
  padding: 11px 22px 12px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  color: #fff;
  background: rgba(20,12,8,.82);
  box-shadow: 0 6px 24px rgba(0,0,0,.24);
  font-size: clamp(15px, 2.1vw, 27px);
  line-height: 1.28;
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%);
  backdrop-filter: blur(5px);
}

.momotaro-kamishibai-progress {
  height: 5px;
  margin: 12px 3px 4px;
  overflow: hidden;
  border-radius: 99px;
  background: #e4d7c2;
}

.momotaro-kamishibai-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e26358, #f0a843);
}

.momotaro-kamishibai-controls {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 10px;
  margin: 12px 0 8px;
}

.momotaro-kamishibai-controls button {
  min-height: 44px;
  border: 1px solid #c9b79f;
  border-radius: 11px;
  color: #4a3324;
  background: #fffaf1;
  font: 700 14px/1 system-ui, sans-serif;
  cursor: pointer;
}

.momotaro-kamishibai-controls button:hover { background: #f6ead8; }

.momotaro-kamishibai-controls .momotaro-kamishibai-primary {
  border-color: #a33c32;
  color: #fff;
  background: #b84539;
}

.momotaro-kamishibai-controls .momotaro-kamishibai-primary:hover { background: #98352d; }

.momotaro-kamishibai-player audio { width: 100%; height: 38px; }

.momotaro-kamishibai-status {
  margin: 6px 2px 0;
  color: #705a49;
  font: 600 12px/1.4 system-ui, sans-serif;
  text-align: center;
}

.momotaro-kamishibai-thumbnails {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.momotaro-kamishibai-thumb {
  display: grid;
  gap: 6px;
  padding: 6px;
  border: 2px solid transparent;
  border-radius: 10px;
  color: #51392a;
  background: rgba(255,250,241,.78);
  font: 700 11px/1.25 system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
}

.momotaro-kamishibai-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
}

.momotaro-kamishibai-thumb.is-active {
  border-color: #b84539;
  background: #fff7e9;
}

@media (max-width: 760px) {
  .momotaro-kamishibai-app { width: min(100% - 16px, 1180px); padding-top: 18px; }
  .momotaro-kamishibai-header { align-items: start; flex-direction: column; gap: 8px; }
  .momotaro-kamishibai-note { max-width: none; }
  .momotaro-kamishibai-player { padding: 7px; border-radius: 14px; }
  .momotaro-kamishibai-stage { border-radius: 9px; }
  .momotaro-kamishibai-scene-label { top: 14px; left: 15px; }
  .momotaro-kamishibai-scene-label span { font-size: 9px; }
  .momotaro-kamishibai-caption { bottom: 10px; max-width: calc(100% - 16px); padding: 6px 10px 7px; font-size: clamp(9px, 3vw, 16px); }
  .momotaro-kamishibai-controls { grid-template-columns: 1fr 1.35fr 1fr; gap: 6px; }
  .momotaro-kamishibai-controls button { min-height: 41px; padding: 0 6px; font-size: 12px; }
  .momotaro-kamishibai-thumbnails { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .momotaro-kamishibai-image { transform: none !important; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}
