/* ============ GRAND BIBIMBAP UNIVERSE ============ */
:root {
  --gold: #e8b45a;
  --gold-bright: #f6d27c;
  --ink: #f2ede4;
  --bg: #030308;
}

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

html { background: var(--bg); }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Zen Kaku Gothic New', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(232, 180, 90, 0.4); }

#spacer { height: 1000vh; }

/* ---------- canvas & vignette ---------- */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

#vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0, 0, 0, 0.6) 100%);
}

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.4rem 2rem;
  pointer-events: none;
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.42em;
  color: rgba(232, 180, 90, 0.85);
  text-shadow: 0 0 12px rgba(232, 180, 90, 0.4);
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 1.6em;
}

.hud-link {
  pointer-events: auto;
  color: var(--gold-bright);
  text-decoration: none;
  border-bottom: 1px solid rgba(246, 210, 124, 0.5);
  padding-bottom: 0.2em;
  transition: color 0.25s, border-color 0.25s;
}

.hud-link:hover {
  color: #fff;
  border-color: #fff;
}

#bbnbLink {
  pointer-events: auto;
  display: inline-block;
  margin-top: 2.2rem;
  font-family: 'Shippori Mincho B1', serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  padding: 1em 2.2em;
  color: var(--gold);
  text-decoration: none;
  border: 1px solid rgba(232, 180, 90, 0.6);
  border-radius: 999px;
  transition: all 0.3s ease;
}

#bbnbLink:hover {
  color: #14090a;
  background: linear-gradient(135deg, var(--gold-bright), #e8a33d);
  box-shadow: 0 0 50px rgba(240, 180, 80, 0.6);
}

#progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(232, 180, 90, 0.12);
}

#progressFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #b3121f, var(--gold-bright));
  box-shadow: 0 0 10px rgba(246, 210, 124, 0.8);
}

/* ---------- panels ---------- */
.panel {
  position: fixed;
  z-index: 5;
  max-width: min(680px, 88vw);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.panel.center {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.panel.left {
  left: 7vw;
  top: 50%;
  transform: translateY(-50%);
}

.panel.right {
  right: 7vw;
  top: 50%;
  transform: translateY(-50%);
  text-align: right;
}

#hero { top: 46%; max-width: 96vw; }

.p-in { will-change: transform; }

.kicker {
  font-weight: 300;
  letter-spacing: 0.55em;
  font-size: clamp(0.8rem, 1.6vw, 1.05rem);
  color: var(--gold);
  margin-bottom: 1.2rem;
  text-indent: 0.55em;
}

.mega {
  font-family: 'Shippori Mincho B1', serif;
  font-weight: 800;
  white-space: nowrap;
  font-size: clamp(3.2rem, 12vw, 10.5rem);
  line-height: 1.02;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-shadow: 0 0 60px rgba(255, 160, 50, 0.45), 0 0 140px rgba(255, 80, 30, 0.25);
  animation: megaGlow 4.5s ease-in-out infinite;
}

@keyframes megaGlow {
  0%, 100% { text-shadow: 0 0 60px rgba(255, 160, 50, 0.45), 0 0 140px rgba(255, 80, 30, 0.25); }
  50% { text-shadow: 0 0 85px rgba(255, 185, 70, 0.75), 0 0 210px rgba(255, 95, 40, 0.45); }
}

.mega .latin {
  display: block;
  font-family: 'Cinzel', serif;
  font-weight: 500;
  font-size: clamp(0.85rem, 2vw, 1.3rem);
  letter-spacing: 0.85em;
  text-indent: 0.85em;
  color: var(--gold);
  margin-top: 1.4rem;
  text-shadow: 0 0 20px rgba(232, 180, 90, 0.6);
}

.mega-small {
  font-family: 'Shippori Mincho B1', serif;
  font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  letter-spacing: 0.12em;
  color: var(--ink);
  text-shadow: 0 0 50px rgba(255, 160, 50, 0.4);
  margin-bottom: 1.4rem;
}

.lead {
  font-weight: 300;
  font-size: clamp(0.95rem, 1.9vw, 1.2rem);
  letter-spacing: 0.3em;
  color: rgba(242, 237, 228, 0.85);
  margin-top: 2rem;
}

.chapter {
  font-family: 'Shippori Mincho B1', serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.6em;
  color: var(--gold);
  margin-bottom: 1.1rem;
}

.chapter::after {
  content: "";
  display: inline-block;
  width: 3.2em;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  vertical-align: middle;
  margin-left: 1em;
}

.panel.right .chapter::after { display: none; }
.panel.right .chapter::before {
  content: "";
  display: inline-block;
  width: 3.2em;
  height: 1px;
  background: linear-gradient(270deg, var(--gold), transparent);
  vertical-align: middle;
  margin-right: 1em;
}

.panel h2 {
  font-family: 'Shippori Mincho B1', serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 5.4vw, 4rem);
  letter-spacing: 0.1em;
  line-height: 1.2;
  margin-bottom: 1.6rem;
  text-shadow: 0 0 40px rgba(255, 160, 50, 0.35);
}

.body {
  font-weight: 300;
  font-size: clamp(0.92rem, 1.7vw, 1.08rem);
  line-height: 2.3;
  letter-spacing: 0.14em;
  color: rgba(242, 237, 228, 0.88);
}

.rt {
  font-size: 0.68em;
  color: var(--gold);
  margin: 0 0.2em;
}

/* 五方色リスト */
.obangsaek {
  list-style: none;
  display: flex;
  gap: 1.6em;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 1.8rem;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  color: rgba(242, 237, 228, 0.75);
}

.panel.left .obangsaek { justify-content: flex-start; }

.obangsaek i {
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 10px var(--c);
  margin-right: 0.6em;
}

/* ---------- MIXボタン ---------- */
#mixBtn {
  pointer-events: auto;
  cursor: pointer;
  margin-top: 2.4rem;
  font-family: 'Shippori Mincho B1', serif;
  font-weight: 700;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  padding: 1.15em 2.6em;
  color: #14090a;
  background: linear-gradient(135deg, var(--gold-bright), #e8a33d 55%, #d4822a);
  border: none;
  border-radius: 999px;
  box-shadow: 0 0 45px rgba(240, 180, 80, 0.45), inset 0 1px 0 rgba(255,255,255,0.5);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#mixBtn:hover {
  transform: scale(1.07);
  box-shadow: 0 0 90px rgba(240, 180, 80, 0.85), inset 0 1px 0 rgba(255,255,255,0.6);
}

#mixBtn:active { transform: scale(0.98); }

#mixBtn:disabled {
  opacity: 0.4;
  cursor: wait;
  transform: none;
}

/* ---------- スクロールヒント ---------- */
#scrollHint {
  position: fixed;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.6em;
  text-indent: 0.6em;
  color: rgba(232, 180, 90, 0.9);
  text-align: center;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

#scrollHint span {
  display: block;
  width: 1px;
  height: 3.4rem;
  margin: 0.8rem auto 0;
  background: linear-gradient(180deg, var(--gold), transparent);
  animation: hintDrop 2s ease-in-out infinite;
  transform-origin: top;
}

@keyframes hintDrop {
  0% { transform: scaleY(0); opacity: 0; }
  35% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(1.2rem); opacity: 0; }
}

/* ---------- フラッシュ ---------- */
#flash {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, #fff9e8, #ffd898 38%, rgba(255, 130, 40, 0.55) 62%, transparent 82%);
}

#flash.on { animation: flashA 1s ease-out forwards; }

@keyframes flashA {
  0% { opacity: 0; }
  10% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- ローダー ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1s ease, visibility 1s;
}

#loader.done {
  opacity: 0;
  visibility: hidden;
}

.loader-inner { text-align: center; }

.loader-latin {
  font-family: 'Cinzel', serif;
  font-size: 0.66rem;
  letter-spacing: 0.55em;
  text-indent: 0.55em;
  color: var(--gold);
  margin-bottom: 1.4rem;
}

.loader-title {
  font-family: 'Shippori Mincho B1', serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  letter-spacing: 0.24em;
  margin-bottom: 1.6rem;
  text-shadow: 0 0 40px rgba(255, 160, 50, 0.4);
}

.loader-msg {
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  color: rgba(242, 237, 228, 0.6);
  margin-bottom: 2rem;
  min-height: 1.4em;
}

.loader-bar {
  width: min(260px, 60vw);
  height: 2px;
  margin: 0 auto;
  background: rgba(232, 180, 90, 0.15);
  overflow: hidden;
}

#loaderFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #b3121f, var(--gold-bright));
  box-shadow: 0 0 12px rgba(246, 210, 124, 0.9);
  transition: width 0.3s ease;
}

/* ---------- モバイル ---------- */
@media (max-width: 640px) {
  #hud { padding: 1rem 1.1rem; font-size: 0.55rem; letter-spacing: 0.3em; }
  .panel.left, .panel.right { left: 6vw; right: 6vw; max-width: 88vw; }
  .panel.right { text-align: left; }
  .panel.right .chapter::before { display: none; }
  .panel.right .chapter::after { display: inline-block; }
  .obangsaek { justify-content: flex-start; gap: 1em; }
  .body { line-height: 2.1; }
}
