/* =========================================================
   西兰姑娘 · 摆手舞 AI 健身课
   Visual system: Tujia indigo, silver, vermilion, warm mist
   ========================================================= */

:root {
  --ink: #070d13;
  --ink-2: #0b141d;
  --ink-3: #111d28;
  --panel: rgba(10, 18, 25, .72);
  --panel-solid: #0d1720;
  --paper: #f2e8d8;
  --paper-soft: #d8c9b5;
  --muted: #9e9283;
  --muted-2: #756c60;
  --gold: #d7b477;
  --gold-bright: #f0d49a;
  --gold-deep: #a67b45;
  --red: #bf4a42;
  --red-deep: #8c2f31;
  --jade: #7fb3aa;
  --indigo: #1a2b4a;
  --line: rgba(215, 180, 119, .18);
  --line-strong: rgba(215, 180, 119, .35);
  --shadow: 0 24px 70px rgba(0, 0, 0, .46);
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "Consolas", monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  overflow: hidden;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}
a { color: inherit; }
svg { width: 1em; height: 1em; fill: currentColor; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

::selection { background: rgba(215, 180, 119, .28); color: #fff; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(215,180,119,.25) transparent; }
*::-webkit-scrollbar { width: 5px; height: 5px; }
*::-webkit-scrollbar-thumb { background: rgba(215,180,119,.25); border-radius: 99px; }

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 60% at 43% 15%, rgba(82, 104, 105, .28), transparent 60%),
    radial-gradient(ellipse 55% 60% at 8% 100%, rgba(124, 57, 45, .12), transparent 65%),
    linear-gradient(180deg, #0a131b 0%, #081017 55%, #060b10 100%);
}

.ambient-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: .28;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}

/* =============================== Topbar =============================== */

.topbar {
  position: relative;
  z-index: 30;
  flex: 0 0 76px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(215, 180, 119, .09);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  text-decoration: none;
}

.brand-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  color: var(--gold);
  filter: drop-shadow(0 0 12px rgba(215, 180, 119, .25));
}
.brand-mark svg { width: 100%; height: 100%; }

.brand-type { display: flex; flex-direction: column; line-height: 1.15; }
.brand-type strong {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .12em;
}
.brand-type small {
  margin-top: 5px;
  font-size: 9px;
  letter-spacing: .24em;
  color: var(--muted);
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(215,180,119,.12);
  border-radius: 99px;
  background: rgba(7, 13, 18, .35);
  backdrop-filter: blur(14px);
}
.nav-link {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: .1em;
  padding: 9px 17px;
  border-radius: 99px;
  transition: color .25s, background .25s;
}
.nav-link:hover { color: var(--paper); }
.nav-link.is-active {
  color: #14100b;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 4px 18px rgba(215,180,119,.15);
  font-weight: 600;
}

.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 6px;
  font-size: 10.5px;
  letter-spacing: .15em;
  color: #aebdb7;
  white-space: nowrap;
}
.live-dot, .status-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #80c9ab;
  box-shadow: 0 0 0 4px rgba(128, 201, 171, .09), 0 0 10px rgba(128, 201, 171, .55);
  animation: livePulse 2.4s infinite;
}
@keyframes livePulse { 50% { box-shadow: 0 0 0 7px rgba(128,201,171,0), 0 0 14px rgba(128,201,171,.3); } }

.icon-btn {
  width: 35px; height: 35px;
  display: grid; place-items: center;
  border: 1px solid rgba(215,180,119,.13);
  border-radius: 50%;
  background: rgba(255,255,255,.015);
  color: var(--muted);
  transition: .25s var(--ease);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--gold-bright); border-color: var(--line-strong); transform: translateY(-1px); }
.icon-btn.is-off { color: var(--red); border-color: rgba(191,74,66,.25); }

/* =============================== Workspace =============================== */

.workspace {
  position: relative;
  z-index: 10;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 356px;
  gap: 14px;
  padding: 8px 22px 12px;
}

/* =============================== Stage =============================== */

.stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(215,180,119,.16);
  background: linear-gradient(180deg, #14252b 0%, #0e1a20 52%, #081116 100%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.04);
  isolation: isolate;
}

.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  border-radius: inherit;
  box-shadow: inset 0 0 90px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.015);
}

.stage-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 46% 38% at 63% 30%, rgba(241, 204, 140, .28), transparent 64%),
    radial-gradient(ellipse 70% 30% at 60% 58%, rgba(171, 140, 91, .12), transparent 70%),
    radial-gradient(ellipse 90% 70% at 60% 20%, rgba(98, 137, 132, .3), transparent 72%),
    linear-gradient(180deg, #1a3034 0%, #14252a 42%, #0d1a1e 70%, #081014 100%);
}
.sun-glow {
  position: absolute;
  left: 59%; top: 17%;
  width: 32%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 230, 180, .2), rgba(239, 196, 128, .07) 38%, transparent 67%);
  filter: blur(12px);
  animation: sunBreath 9s ease-in-out infinite;
}
@keyframes sunBreath { 50% { opacity: .65; transform: scale(1.06); } }

.mist {
  position: absolute;
  left: -15%;
  width: 130%;
  height: 22%;
  background: linear-gradient(180deg, transparent, rgba(181, 201, 196, .075), transparent);
  filter: blur(22px);
  animation: drift 24s linear infinite;
}
.mist-a { top: 43%; animation-duration: 28s; }
.mist-b { top: 58%; opacity: .6; animation-duration: 38s; animation-direction: reverse; }
@keyframes drift { from { transform: translateX(-4%); } to { transform: translateX(4%); } }

.landscape {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 90%;
  pointer-events: none;
  z-index: 1;
  opacity: .96;
}

.stage-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7,13,18,.82) 0%, rgba(7,13,18,.32) 24%, transparent 46%, transparent 76%, rgba(7,13,18,.36) 100%),
    linear-gradient(180deg, rgba(7,13,18,.42) 0%, transparent 24%, transparent 66%, rgba(5,9,12,.7) 100%);
}

#scene {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.webgl-fallback {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 40px;
  background: rgba(7,13,18,.82);
  backdrop-filter: blur(10px);
}
.webgl-fallback[hidden] { display: none; }
.webgl-fallback img { width: 42%; border-radius: 14px; border: 1px solid var(--line); }
.webgl-fallback strong { font-family: var(--serif); font-size: 22px; }
.webgl-fallback p { color: var(--muted); font-size: 13px; line-height: 1.8; }

.stage-topline {
  position: absolute;
  z-index: 10;
  top: 24px; left: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(230, 218, 200, .62);
  font-size: 9.5px;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.stage-topline b { color: var(--gold); font-weight: 500; }
.edition-rule { width: 28px; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }

.stage-title {
  position: absolute;
  z-index: 12;
  top: 76px;
  left: 30px;
  width: min(310px, 34%);
  pointer-events: none;
}
.stage-title .eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: .19em;
  line-height: 1.5;
}
.stage-title h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 4.5vw, 62px);
  line-height: .98;
  font-weight: 500;
  letter-spacing: .045em;
  text-shadow: 0 8px 34px rgba(0,0,0,.28);
}
.stage-title h1 span { color: var(--red); padding: 0 .03em; font-size: .72em; vertical-align: .18em; }
.stage-title .sub {
  margin: 17px 0 0;
  color: rgba(226, 215, 199, .68);
  font-size: 12.5px;
  line-height: 1.85;
  letter-spacing: .04em;
}
.text-link {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  padding: 0 0 5px;
  border: 0;
  border-bottom: 1px solid rgba(215,180,119,.28);
  background: transparent;
  color: var(--gold);
  font-size: 10.5px;
  letter-spacing: .08em;
  transition: color .25s, border-color .25s;
}
.text-link svg { width: 12px; height: 12px; transition: transform .25s; }
.text-link:hover { color: var(--gold-bright); border-color: var(--gold); }
.text-link:hover svg { transform: translate(2px, -2px); }

.stage-badge {
  position: absolute;
  z-index: 10;
  right: 30px;
  top: 104px;
  width: 104px;
  height: 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(215,180,119,.2);
  color: var(--gold);
  background: rgba(8, 15, 20, .28);
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.badge-orbit {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px dashed rgba(215,180,119,.25);
  animation: spinSlow 30s linear infinite;
}
.badge-orbit::before, .badge-orbit::after {
  content: "";
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold);
  top: 11px; left: 14px;
  box-shadow: 0 0 8px var(--gold);
}
.badge-orbit::after { top: auto; left: auto; bottom: 13px; right: 12px; }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.badge-core { font-family: var(--serif); font-size: 21px; letter-spacing: .1em; }
.stage-badge small { margin-top: 6px; font-size: 8px; letter-spacing: .12em; color: var(--muted); }

/* Move caption */
.move-caption {
  position: absolute;
  z-index: 12;
  left: 30px;
  bottom: 118px;
  width: 250px;
  padding-left: 14px;
  border-left: 1px solid rgba(215,180,119,.45);
  transition: opacity .25s, transform .35s var(--ease);
}
.move-caption.is-changing { opacity: 0; transform: translateY(8px); }
.move-caption-head { display: flex; align-items: center; gap: 8px; }
.caption-index {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--gold);
  letter-spacing: .04em;
}
.caption-kicker {
  font-size: 8.5px;
  color: var(--muted);
  letter-spacing: .2em;
}
.move-caption h2 {
  margin: 7px 0 8px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: .08em;
}
.move-caption p {
  margin: 0;
  color: rgba(220, 209, 193, .66);
  font-size: 11.5px;
  line-height: 1.75;
}
.caption-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
  color: rgba(215,180,119,.7);
  font-size: 8.5px;
  letter-spacing: .06em;
}
.caption-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--gold); opacity: .5; }

.stage-side-tools {
  position: absolute;
  z-index: 15;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  border: 1px solid rgba(215,180,119,.12);
  background: rgba(7,13,18,.4);
  backdrop-filter: blur(14px);
}
.tool-btn {
  width: 51px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 0 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition: .22s;
}
.tool-btn svg { width: 16px; height: 16px; }
.tool-btn span { font-size: 8px; letter-spacing: .05em; }
.tool-btn:hover, .tool-btn.is-active { color: var(--gold-bright); background: rgba(215,180,119,.095); }

.orbit-hint {
  position: absolute;
  z-index: 12;
  right: 88px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(215,180,119,.42);
  font-size: 8.5px;
  letter-spacing: .1em;
  pointer-events: none;
  transition: opacity 1s;
}
.orbit-hint svg { width: 12px; height: 12px; }

.rig-chip {
  position: absolute;
  z-index: 12;
  right: 26px;
  bottom: 48px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid rgba(127,179,170,.16);
  border-radius: 99px;
  background: rgba(7,14,18,.32);
  color: rgba(191, 224, 215, .58);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: .08em;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.rig-chip i {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #7fe3cb;
  box-shadow: 0 0 7px rgba(127,227,203,.8);
}

/* Dialect callout */
.dialect-callout {
  position: absolute;
  z-index: 16;
  right: 28px;
  top: 250px;
  width: 244px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 15px 15px 13px;
  border: 1px solid rgba(215,180,119,.28);
  border-radius: 4px 16px 16px 16px;
  background:
    linear-gradient(140deg, rgba(25, 38, 46, .93), rgba(11, 19, 25, .9));
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  opacity: 0;
  transform: translateY(10px) scale(.97);
  pointer-events: none;
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.dialect-callout.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.dialect-callout::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(215,180,119,.09);
  border-radius: inherit;
  pointer-events: none;
}
.quote-mark {
  font-family: Georgia, serif;
  font-size: 28px;
  line-height: .8;
  color: rgba(215,180,119,.55);
}
.quote-mark.end { align-self: flex-end; }
.dialect-callout p {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: .06em;
  color: #f5e8d4;
}
.dialect-callout small {
  display: block;
  margin-top: 6px;
  font-size: 8.5px;
  line-height: 1.55;
  color: var(--muted);
  letter-spacing: .02em;
}

/* Subtitle */
.subtitle {
  position: absolute;
  z-index: 17;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(680px, 72%);
  padding: 9px 15px;
  border: 1px solid rgba(215,180,119,.1);
  border-radius: 99px;
  background: rgba(6, 11, 15, .58);
  backdrop-filter: blur(14px);
  color: rgba(235, 226, 212, .85);
  font-size: 10.5px;
  line-height: 1.4;
  letter-spacing: .02em;
  transition: opacity .3s;
}
.subtitle-speaker {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 8px;
  letter-spacing: .1em;
  border-right: 1px solid rgba(215,180,119,.2);
  padding-right: 9px;
}
.subtitle-eq { display: flex; align-items: center; gap: 2px; height: 12px; margin-left: 2px; }
.subtitle-eq i {
  display: block; width: 2px; height: 4px; border-radius: 2px; background: var(--gold);
  animation: eq 1s ease-in-out infinite;
}
.subtitle-eq i:nth-child(2) { animation-delay: .15s; }
.subtitle-eq i:nth-child(3) { animation-delay: .3s; }
.subtitle-eq i:nth-child(4) { animation-delay: .45s; }
.subtitle.is-speaking .subtitle-eq i { animation-duration: .55s; }
@keyframes eq { 50% { height: 12px; opacity: .8; } }

/* Bone labels */
.bone-labels {
  position: absolute;
  inset: 0;
  z-index: 14;
  pointer-events: none;
}
.bone-label {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 3px 6px;
  border: 1px solid rgba(126, 233, 209, .28);
  border-radius: 3px;
  background: rgba(5, 18, 20, .72);
  color: #91ebd8;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: .03em;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(73, 220, 190, .12);
  opacity: 0;
  transition: opacity .3s;
}
.bone-label::before {
  content: "";
  position: absolute;
  left: -4px; top: 50%;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #91ebd8;
  box-shadow: 0 0 6px #91ebd8;
}
.bone-label.is-on { opacity: 1; }

/* =============================== Coach panel =============================== */

.coach-panel {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  border: 1px solid rgba(215,180,119,.17);
  background:
    linear-gradient(180deg, rgba(19, 30, 38, .88), rgba(9, 16, 21, .94)),
    radial-gradient(ellipse at 50% 0%, rgba(215,180,119,.07), transparent 60%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.04);
  overflow: hidden;
}
.coach-panel::before {
  content: "";
  position: absolute;
  top: 0; left: 18px; right: 18px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(215,180,119,.5), transparent);
}

.coach-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 17px 13px 15px 15px;
  border-bottom: 1px solid rgba(215,180,119,.09);
}
.coach-avatar {
  position: relative;
  width: 48px; height: 48px;
  flex: 0 0 48px;
}
.coach-avatar > svg { width: 100%; height: 100%; border-radius: 50%; display: block; }
.avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(215,180,119,.3);
  border-right-color: transparent;
  animation: spinSlow 9s linear infinite;
}
.coach-id { min-width: 0; flex: 1; }
.coach-kicker { display: block; color: var(--muted-2); font-family: var(--mono); font-size: 6.5px; letter-spacing: .1em; white-space: nowrap; }
.coach-id h3 {
  margin: 3px 0 2px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-tag {
  display: inline-grid;
  place-items: center;
  padding: 1px 4px;
  border: 1px solid rgba(215,180,119,.28);
  border-radius: 3px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: .05em;
  vertical-align: middle;
}
.coach-id p { margin: 0; color: var(--muted); font-size: 8.5px; display: flex; align-items: center; gap: 6px; }
.ghost-icon {
  width: 28px; height: 28px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted-2);
  display: grid; place-items: center;
}
.ghost-icon:hover { color: var(--gold); border-color: var(--line); }
.ghost-icon svg { width: 14px; height: 14px; }

.coach-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 13px 14px 4px;
  scroll-behavior: smooth;
}

.coach-messages { display: flex; flex-direction: column; gap: 7px; }
.msg { display: flex; max-width: 95%; animation: msgIn .35s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
.msg-coach { align-self: flex-start; }
.msg-user { align-self: flex-end; }
.msg-body {
  padding: 9px 11px;
  border-radius: 4px 12px 12px 12px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.04);
  color: rgba(231, 220, 205, .82);
  font-size: 10.5px;
  line-height: 1.78;
  letter-spacing: .01em;
}
.msg-user .msg-body {
  border-radius: 12px 4px 12px 12px;
  background: rgba(215,180,119,.1);
  border-color: rgba(215,180,119,.13);
  color: #e8d8bf;
}
.msg-body b { color: var(--gold-bright); font-weight: 500; }
.msg-body .dialect { color: #f3d7a4; font-family: var(--serif); font-size: 13px; letter-spacing: .04em; }

.plan-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 17px 2px 8px;
  color: rgba(234, 221, 204, .68);
  font-size: 9px;
  letter-spacing: .12em;
}
.plan-head small { color: var(--muted-2); font-size: 8px; letter-spacing: .04em; }

.plan-list { display: flex; flex-direction: column; gap: 4px; }
.plan-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  transition: .2s;
}
.plan-item:hover { background: rgba(255,255,255,.025); border-color: rgba(215,180,119,.1); }
.plan-item.is-active {
  background: linear-gradient(90deg, rgba(215,180,119,.095), rgba(215,180,119,.025));
  border-color: rgba(215,180,119,.19);
}
.plan-item.is-active::before {
  content: ""; position: absolute; left: -1px; top: 9px; bottom: 9px; width: 2px; border-radius: 2px;
  background: var(--gold);
}
.plan-no { flex: 0 0 22px; font-family: var(--mono); font-size: 8px; color: var(--muted-2); }
.plan-item.is-active .plan-no { color: var(--gold); }
.plan-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.plan-copy b { font-size: 11.5px; font-weight: 500; color: rgba(242,232,216,.9); letter-spacing: .03em; }
.plan-copy small { font-size: 8px; color: var(--muted-2); letter-spacing: .02em; }
.plan-state {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--muted-2);
  border: 1px solid rgba(255,255,255,.06);
}
.plan-state svg { width: 9px; height: 9px; }
.plan-item.is-active .plan-state { color: #17120c; background: var(--gold); border-color: var(--gold); }

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 15px 0 11px;
  border-top: 1px solid rgba(215,180,119,.1);
  border-bottom: 1px solid rgba(215,180,119,.1);
  background: rgba(215,180,119,.1);
}
.metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 9px 9px 8px;
  background: #0d1720;
}
.metric-val { font-family: var(--mono); font-size: 16px; color: var(--paper); line-height: 1; }
.metric-key { display: flex; align-items: center; gap: 4px; font-size: 7.5px; color: var(--muted-2); letter-spacing: .06em; }
.metric-key svg { width: 9px; height: 9px; color: var(--gold); }

.coach-tip {
  display: flex;
  gap: 9px;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid rgba(127,179,170,.12);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(127,179,170,.055), rgba(127,179,170,.012));
}
.tip-ico {
  flex: 0 0 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(127,179,170,.1);
  color: var(--jade);
}
.tip-ico svg { width: 11px; height: 11px; }
.coach-tip b { display: block; color: var(--jade); font-size: 8px; font-weight: 500; letter-spacing: .1em; margin-bottom: 3px; }
.coach-tip p { margin: 0; color: rgba(220,213,202,.66); font-size: 9.5px; line-height: 1.65; }

.quick-row { display: flex; flex-wrap: wrap; gap: 5px; padding-bottom: 10px; }
.quick-chip {
  padding: 5px 8px;
  border: 1px solid rgba(215,180,119,.14);
  border-radius: 99px;
  background: rgba(255,255,255,.02);
  color: rgba(215,180,119,.75);
  font-size: 8.5px;
  transition: .2s;
}
.quick-chip:hover { border-color: var(--line-strong); color: var(--gold-bright); background: rgba(215,180,119,.06); }

.chatbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 10px 10px;
  padding: 5px;
  border: 1px solid rgba(215,180,119,.16);
  border-radius: 12px;
  background: rgba(5,11,15,.54);
  transition: border-color .25s;
}
.chatbar:focus-within { border-color: rgba(215,180,119,.4); }
.chatbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 9.5px;
  color: var(--paper);
  padding: 5px 2px;
}
.chatbar input::placeholder { color: var(--muted-2); }
.chat-mic, .chat-send {
  width: 27px; height: 27px;
  flex: 0 0 27px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  color: var(--muted);
}
.chat-send { background: var(--gold); color: #17110a; }
.chat-mic svg, .chat-send svg { width: 13px; height: 13px; }
.chat-mic.is-listening { color: var(--red); background: rgba(191,74,66,.14); animation: micPulse 1.2s infinite; }
@keyframes micPulse { 50% { box-shadow: 0 0 0 6px rgba(191,74,66,.08); } }

.camera-pip {
  position: absolute;
  z-index: 20;
  right: 12px;
  bottom: 62px;
  width: 156px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(215,180,119,.35);
  background: #05090c;
  box-shadow: 0 14px 40px rgba(0,0,0,.55);
  animation: pipIn .3s var(--ease);
}
.camera-pip[hidden] { display: none; }
@keyframes pipIn { from { opacity: 0; transform: translateY(8px) scale(.95); } }
.camera-pip video { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; transform: scaleX(-1); opacity: .82; }
.camera-pip canvas { display: none; }
.pip-hud {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px;
  background: linear-gradient(0deg, rgba(0,0,0,.78), transparent);
  font-size: 7px; color: #c9d8d2; letter-spacing: .05em;
}
.pip-hud span { display: flex; align-items: center; gap: 4px; }
.pip-dot { width: 4px; height: 4px; border-radius: 50%; background: #7ee0bd; box-shadow: 0 0 6px #7ee0bd; }
.pip-hud b { font-family: var(--mono); font-weight: 500; color: #a7e7d3; font-size: 9px; }
.camera-pip > button {
  position: absolute; top: 5px; right: 5px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(0,0,0,.5); color: #fff;
}
.camera-pip > button svg { width: 10px; height: 10px; }

/* =============================== Player =============================== */

.player {
  position: relative;
  z-index: 25;
  flex: 0 0 102px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 25px 13px;
  border-top: 1px solid rgba(215,180,119,.1);
  background: linear-gradient(180deg, rgba(8,15,20,.45), rgba(7,12,16,.9));
  backdrop-filter: blur(16px);
}

.timeline-wrap { display: flex; align-items: center; gap: 14px; }
.timeline-meta { flex: 0 0 132px; display: flex; flex-direction: column; gap: 3px; }
.playing-label { display: flex; align-items: center; gap: 6px; color: rgba(236,224,207,.78); font-size: 9px; letter-spacing: .08em; }
.beat-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--muted-2); transition: background .2s, box-shadow .2s; }
.is-playing .beat-dot { background: var(--gold); box-shadow: 0 0 9px var(--gold); animation: beatBlink .71s infinite; }
@keyframes beatBlink { 0%,100% { transform: scale(1); opacity: 1; } 45% { transform: scale(1.8); opacity: .55; } }
.timeline-count { color: var(--muted-2); font-family: var(--mono); font-size: 7.5px; letter-spacing: .04em; }

.timeline { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.timeline-seg {
  position: relative;
  height: 27px;
  overflow: hidden;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,.035);
  background: rgba(255,255,255,.022);
  cursor: pointer;
  transition: background .25s, border-color .25s;
}
.timeline-seg:hover { border-color: rgba(215,180,119,.2); }
.seg-fill {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(215,180,119,.18), rgba(215,180,119,.32));
  border-right: 1px solid rgba(240,212,154,.5);
  transition: width .16s linear;
}
.timeline-seg.is-done .seg-fill { width: 100%; background: rgba(215,180,119,.12); border: 0; }
.timeline-seg.is-active { border-color: rgba(215,180,119,.28); background: rgba(215,180,119,.045); }
.seg-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: var(--muted-2);
  font-size: 8.5px;
  letter-spacing: .06em;
  transition: color .25s;
}
.timeline-seg.is-active .seg-label { color: var(--gold-bright); }

.player-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.player-left, .player-right { display: flex; align-items: center; gap: 7px; }
.player-right { gap: 6px; }
.player-center { display: flex; align-items: center; gap: 18px; }

.round-btn {
  width: 31px; height: 31px;
  display: grid; place-items: center;
  border: 1px solid rgba(215,180,119,.14);
  border-radius: 50%;
  background: rgba(255,255,255,.02);
  color: var(--muted);
  transition: .2s;
}
.round-btn:hover { color: var(--gold-bright); border-color: var(--line-strong); }
.round-btn svg { width: 14px; height: 14px; }
.nav-play { width: 28px; height: 28px; border-color: transparent; background: transparent; }
.nav-play svg { width: 13px; height: 13px; }

.main-play {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 132px;
  height: 45px;
  padding: 0 17px 0 11px;
  border: 1px solid rgba(240,212,154,.65);
  border-radius: 99px;
  background: linear-gradient(135deg, #efd49e 0%, #d5ad6b 48%, #bb8f51 100%);
  color: #1d140b;
  box-shadow: 0 8px 28px rgba(215,180,119,.2), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.main-play:hover { transform: translateY(-1px); box-shadow: 0 11px 34px rgba(215,180,119,.3); }
.main-play:active { transform: translateY(0); }
.play-icon {
  width: 27px; height: 27px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(24,16,8,.15);
}
.play-icon svg { width: 12px; height: 12px; margin-left: 1px; }
.play-copy { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.play-copy b { font-size: 12px; font-weight: 600; letter-spacing: .05em; }
.play-copy small { margin-top: 3px; font-family: var(--mono); font-size: 6px; letter-spacing: .13em; opacity: .55; }
.is-playing .main-play { background: linear-gradient(135deg, #eee0c4, #c7a36a); }
.is-playing .play-icon svg { margin-left: 0; }

.time-readout { margin-left: 6px; display: flex; align-items: center; gap: 3px; font-family: var(--mono); font-size: 8.5px; color: var(--muted-2); }
.time-readout #timeNow { color: rgba(240,230,214,.8); }
.time-sep { opacity: .35; }

.bpm-block { display: flex; align-items: center; gap: 6px; }
.bpm-label { color: var(--muted-2); font-size: 8px; letter-spacing: .08em; }
.bpm-block b { font-family: var(--mono); font-size: 15px; font-weight: 400; color: var(--paper); min-width: 24px; text-align: center; }
.bpm-unit { font-family: var(--mono); font-size: 6.5px; color: var(--muted-2); margin-left: -3px; }
.bpm-step {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border: 1px solid rgba(215,180,119,.13);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}
.bpm-step:hover { color: var(--gold); border-color: var(--line-strong); }

.speed-group { display: flex; gap: 2px; padding: 2px; border: 1px solid rgba(215,180,119,.1); border-radius: 99px; }
.speed-btn {
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
  padding: 4px 7px;
}
.speed-btn.is-active { color: #181208; background: var(--gold); }

.toggle-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: .04em;
  transition: .2s;
}
.toggle-btn svg { width: 13px; height: 13px; }
.toggle-btn:hover { color: var(--muted); background: rgba(255,255,255,.03); }
.toggle-btn[aria-pressed="true"] { color: var(--gold); border-color: rgba(215,180,119,.13); background: rgba(215,180,119,.055); }
.toggle-btn[aria-pressed="false"] svg { opacity: .65; }
.drum-ico { display: flex; align-items: center; gap: 2px; height: 13px; }
.drum-ico i { display: block; width: 2px; height: 5px; border-radius: 2px; background: currentColor; }
.drum-ico i:nth-child(2) { height: 9px; }
.drum-ico i:nth-child(3) { height: 7px; }

/* =============================== Modal =============================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 8, 11, .7);
  backdrop-filter: blur(12px);
  animation: fadeIn .25s;
}
.modal-backdrop[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }

.modal {
  width: min(1000px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(215,180,119,.25);
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(215,180,119,.075), transparent 42%),
    linear-gradient(160deg, #101b24, #0a1218);
  box-shadow: 0 40px 120px rgba(0,0,0,.7);
  overflow: hidden;
  animation: modalIn .45s var(--ease-out);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.985); } }
.modal-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 26px 16px;
  border-bottom: 1px solid rgba(215,180,119,.1);
}
.modal-kicker { color: var(--gold); font-family: var(--mono); font-size: 7.5px; letter-spacing: .18em; }
.modal-head h2 { margin: 5px 0 0; font-family: var(--serif); font-size: 28px; font-weight: 500; letter-spacing: .1em; }
.modal-close {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid rgba(215,180,119,.15);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  transition: .2s;
}
.modal-close:hover { color: var(--paper); border-color: var(--line-strong); transform: rotate(90deg); }
.modal-close svg { width: 15px; height: 15px; }
.modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 26px 30px; }

body.modal-open { overflow: hidden; }

/* Moves modal */
.moves-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.moves-intro p { max-width: 600px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.9; }
.moves-intro .seal {
  flex: 0 0 72px;
  width: 72px; height: 72px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  place-items: center;
  gap: 2px;
  border: 1px solid rgba(191,74,66,.55);
  border-radius: 50%;
  color: var(--red);
  font-family: var(--serif);
  font-size: 9px;
  line-height: 1.15;
  letter-spacing: .04em;
  transform: rotate(-7deg);
  box-shadow: inset 0 0 0 3px rgba(191,74,66,.1);
}
.moves-intro .seal i { font-style: normal; }
.move-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.move-card {
  position: relative;
  padding: 17px 17px 15px;
  border: 1px solid rgba(215,180,119,.12);
  border-radius: 13px;
  background: rgba(255,255,255,.018);
  overflow: hidden;
  transition: .25s;
}
.move-card::before {
  content: attr(data-index);
  position: absolute;
  right: 11px; top: 6px;
  font-family: var(--serif);
  font-size: 52px;
  line-height: 1;
  color: rgba(215,180,119,.075);
}
.move-card:hover { border-color: rgba(215,180,119,.28); background: rgba(215,180,119,.035); }
.move-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.move-card h3 { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 500; letter-spacing: .08em; }
.move-card .move-time { color: var(--gold); font-family: var(--mono); font-size: 7.5px; border: 1px solid rgba(215,180,119,.2); padding: 3px 6px; border-radius: 99px; }
.move-card p { margin: 0 0 10px; color: var(--muted); font-size: 10px; line-height: 1.75; }
.move-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.move-card li { display: flex; gap: 7px; color: rgba(226,216,201,.7); font-size: 9px; line-height: 1.6; }
.move-card li::before { content: ""; flex: 0 0 4px; height: 4px; margin-top: 5px; border-radius: 50%; background: var(--red); }
.move-card footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(215,180,119,.08); }
.move-card footer span { color: var(--muted-2); font-size: 8px; }
.move-card footer button { border: 0; background: transparent; color: var(--gold); font-size: 9px; display: flex; align-items: center; gap: 4px; padding: 0; }
.move-card footer button svg { width: 11px; height: 11px; }
.move-actions { display: flex; align-items: center; gap: 11px; }
.move-actions button:first-child { color: var(--muted); border-bottom: 1px solid rgba(215,180,119,.2); padding-bottom: 2px; }
.move-actions button:hover { color: var(--gold-bright); }
.moves-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 2px solid var(--red);
  background: rgba(191,74,66,.055);
  color: rgba(218,207,192,.66);
  font-size: 9.5px;
  line-height: 1.8;
}

/* Heritage modal */
.heritage-hero {
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: 22px;
  margin-bottom: 24px;
}
.heritage-feature {
  position: relative;
  min-height: 245px;
  border: 1px solid rgba(215,180,119,.14);
  border-radius: 15px;
  overflow: hidden;
  background: #0c161d;
}
.heritage-feature img { width: 100%; height: 100%; object-fit: cover; opacity: .76; }
.heritage-feature::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(6,11,15,.88), transparent 65%); }
.heritage-feature-copy { position: absolute; z-index: 2; left: 18px; right: 18px; bottom: 16px; }
.heritage-feature-copy span { color: var(--gold); font-family: var(--mono); font-size: 7px; letter-spacing: .14em; }
.heritage-feature-copy h3 { margin: 5px 0 5px; font-family: var(--serif); font-size: 24px; font-weight: 500; }
.heritage-feature-copy p { margin: 0; color: rgba(224,214,199,.65); font-size: 9px; line-height: 1.7; }
.heritage-summary p { margin: 0 0 11px; color: rgba(224,214,199,.78); font-size: 11px; line-height: 1.95; }
.heritage-summary p b { color: var(--gold-bright); font-weight: 500; }
.fact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.fact {
  padding: 10px 11px;
  border: 1px solid rgba(215,180,119,.1);
  border-radius: 9px;
  background: rgba(255,255,255,.02);
}
.fact span { display: block; color: var(--muted-2); font-size: 7.5px; letter-spacing: .1em; margin-bottom: 4px; }
.fact b { color: var(--paper); font-size: 11px; font-weight: 500; }

.section-label { display: flex; align-items: center; gap: 11px; margin: 23px 0 11px; color: var(--gold); font-size: 9px; letter-spacing: .14em; }
.section-label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(215,180,119,.18), transparent); }

.video-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.video-card {
  position: relative;
  min-height: 152px;
  border: 1px solid rgba(215,180,119,.13);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, #16252c, #0b151b);
  cursor: pointer;
  transition: .25s;
}
.video-card:hover { border-color: rgba(215,180,119,.32); transform: translateY(-2px); }
.video-card .video-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 71% 33%, rgba(215,180,119,.15), transparent 22%),
    radial-gradient(ellipse at 30% 100%, rgba(50, 94, 82, .3), transparent 58%),
    repeating-linear-gradient(115deg, rgba(255,255,255,.018) 0 1px, transparent 1px 9px);
}
.video-card .video-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: .55;
  filter: saturate(.65) brightness(.78) blur(.6px);
  transform: scale(1.03);
  transition: transform .5s var(--ease), opacity .4s;
}
.video-card:hover .video-art img { transform: scale(1.08); opacity: .7; }
.video-card .video-art::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 55%;
  background: linear-gradient(180deg, transparent, rgba(4,9,12,.88));
}
.video-play {
  position: absolute; z-index: 2; top: 50%; left: 50%;
  width: 45px; height: 45px;
  transform: translate(-50%,-50%);
  display: grid; place-items: center;
  border: 1px solid rgba(240,212,154,.6);
  border-radius: 50%;
  background: rgba(7,14,18,.5);
  color: var(--gold-bright);
  backdrop-filter: blur(8px);
}
.video-play svg { width: 14px; height: 14px; margin-left: 2px; }
.video-meta { position: absolute; z-index: 2; left: 13px; right: 13px; bottom: 10px; }
.video-meta span { color: var(--gold); font-family: var(--mono); font-size: 6.5px; letter-spacing: .1em; }
.video-meta h4 { margin: 3px 0 2px; font-family: var(--serif); font-size: 15px; font-weight: 500; }
.video-meta p { margin: 0; color: var(--muted); font-size: 7.5px; }
.video-frame { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 12px; background: #000; }
.video-frame-wrap { min-width: 0; }
.video-fallback { margin: 6px 0 0; color: var(--muted-2); font-size: 7.5px; line-height: 1.6; }
.video-fallback a { color: var(--gold); text-decoration: none; }
.video-fallback svg { width: 9px; height: 9px; }

.origin-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.origin-card {
  padding: 13px;
  border: 1px solid rgba(215,180,119,.1);
  border-radius: 10px;
  background: rgba(255,255,255,.016);
}
.origin-card span { color: var(--red); font-family: var(--mono); font-size: 7px; letter-spacing: .1em; }
.origin-card h4 { margin: 6px 0 6px; font-family: var(--serif); font-size: 13px; font-weight: 500; letter-spacing: .03em; }
.origin-card p { margin: 0; color: var(--muted); font-size: 8.5px; line-height: 1.75; }

.source-list { display: flex; flex-direction: column; gap: 0; }
.source-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 2px;
  border-bottom: 1px solid rgba(215,180,119,.08);
  text-decoration: none;
}
.source-item:hover .source-title { color: var(--gold-bright); }
.source-title { color: var(--paper); font-size: 10.5px; transition: color .2s; }
.source-item small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 8px; }
.source-arrow { color: var(--gold); flex: 0 0 auto; margin-top: 1px; }
.source-arrow svg { width: 12px; height: 12px; }

.quote-block {
  margin: 18px 0 0;
  padding: 17px 19px;
  border-left: 2px solid var(--gold);
  background: rgba(215,180,119,.04);
  font-family: var(--serif);
  color: rgba(239,227,209,.82);
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: .03em;
}
.quote-block cite { display: block; margin-top: 8px; color: var(--muted-2); font-family: var(--sans); font-size: 8px; font-style: normal; }

/* Costume modal */
.costume-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 22px; align-items: stretch; }
.costume-viewer {
  position: relative;
  border: 1px solid rgba(215,180,119,.16);
  border-radius: 15px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(215,180,119,.07), transparent 58%),
    #0a1218;
  height: 545px;
  min-height: 0;
}
.costume-viewer img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  opacity: .96;
  transform-origin: 50% 20%;
  transition: transform .55s var(--ease-out);
  cursor: zoom-in;
}
.costume-bg {
  position: absolute;
  inset: -24px;
  z-index: 1;
  background: url("assets/img/costume-front.jpg") center 20% / cover no-repeat;
  filter: blur(26px) brightness(.38) saturate(.85);
  opacity: .6;
  transform: scale(1.08);
}
.costume-viewer.is-zoomed img { cursor: zoom-out; }
.costume-palette { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 13px; }
.costume-palette span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 8px; letter-spacing: .05em; }
.costume-palette i { width: 11px; height: 11px; border-radius: 2px; border: 1px solid rgba(255,255,255,.16); box-shadow: inset 0 0 0 1px rgba(0,0,0,.16); }
.costume-design-note { margin-top: 14px; padding: 10px 12px; border-left: 2px solid var(--gold); background: rgba(215,180,119,.045); color: rgba(235,224,207,.75); font-family: var(--serif); font-size: 12px; letter-spacing: .05em; line-height: 1.7; }
.costume-design-note span { display: block; margin-bottom: 4px; color: var(--gold); font-family: var(--mono); font-size: 6.5px; letter-spacing: .16em; }
.costume-viewer::after { content: ""; position: absolute; inset: 0; z-index: 3; background: linear-gradient(0deg, rgba(6,11,15,.65), transparent 32%); pointer-events: none; }
.costume-tabs { position: absolute; z-index: 6; top: 11px; left: 11px; display: flex; gap: 4px; padding: 3px; border-radius: 99px; background: rgba(5,10,14,.7); backdrop-filter: blur(8px); }
.costume-tab { border: 0; border-radius: 99px; background: transparent; color: var(--muted); font-size: 8px; padding: 6px 10px; }
.costume-tab.is-active { color: #161009; background: var(--gold); }
.hotspot {
  position: absolute;
  z-index: 5;
  width: 23px; height: 23px;
  border: 1px solid rgba(240,212,154,.8);
  border-radius: 50%;
  background: rgba(7,14,18,.55);
  color: var(--gold-bright);
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 7px;
  transform: translate(-50%,-50%);
  box-shadow: 0 0 0 6px rgba(215,180,119,.08);
  transition: .2s;
}
.hotspot::after { content: ""; position: absolute; inset: -7px; border: 1px solid rgba(215,180,119,.2); border-radius: 50%; animation: hotPulse 2.4s infinite; }
@keyframes hotPulse { 50% { transform: scale(1.2); opacity: 0; } }
.hotspot:hover, .hotspot.is-active { background: var(--gold); color: #161009; transform: translate(-50%,-50%) scale(1.08); }
.costume-viewer canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.costume-viewer .viewer-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 10px; background: #0a1218; z-index: 2; }
.costume-side { min-width: 0; }
.costume-side .costume-kicker { color: var(--gold); font-family: var(--mono); font-size: 7px; letter-spacing: .15em; }
.costume-side h3 { margin: 7px 0 10px; font-family: var(--serif); font-size: 26px; font-weight: 500; letter-spacing: .07em; }
.costume-side > p { margin: 0 0 15px; color: var(--muted); font-size: 10.5px; line-height: 1.9; }
.costume-detail {
  min-height: 142px;
  padding: 14px;
  border: 1px solid rgba(215,180,119,.12);
  border-radius: 11px;
  background: rgba(255,255,255,.02);
}
.costume-detail span { display: block; color: var(--red); font-family: var(--mono); font-size: 7px; letter-spacing: .1em; margin-bottom: 6px; }
.costume-detail h4 { margin: 0 0 6px; font-family: var(--serif); font-size: 18px; font-weight: 500; }
.costume-detail p { margin: 0; color: var(--muted); font-size: 9.5px; line-height: 1.85; }
.costume-note { margin-top: 12px; color: var(--muted-2); font-size: 8px; line-height: 1.7; }
.costume-note a { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(215,180,119,.25); }
.costume-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 14px; }
.costume-list button { border: 1px solid rgba(215,180,119,.13); border-radius: 99px; background: transparent; color: var(--muted); font-size: 8px; padding: 5px 8px; }
.costume-list button.is-active { color: var(--gold-bright); border-color: rgba(215,180,119,.35); }
.costume-canvas-wrap { position: absolute; inset: 0; z-index: 4; background: radial-gradient(ellipse at 50% 45%, rgba(45,62,66,.4), #080f14 70%); }
.costume-canvas-wrap[hidden] { display: none; }
.costume-canvas-wrap canvas { width: 100% !important; height: 100% !important; display: block; }
.viewer-loading {
  position: absolute;
  z-index: 7;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 14px;
  border: 1px solid rgba(215,180,119,.2);
  border-radius: 99px;
  background: rgba(5,10,14,.8);
  color: var(--muted);
  font-size: 8.5px;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.viewer-loading[hidden] { display: none; }
.viewer-loading span { color: var(--gold); font-family: var(--mono); }
.viewer-reset {
  position: absolute;
  z-index: 6;
  right: 11px;
  bottom: 11px;
  padding: 5px 9px;
  border: 1px solid rgba(215,180,119,.28);
  border-radius: 99px;
  background: rgba(5,10,14,.65);
  color: var(--gold);
  font-size: 8px;
  letter-spacing: .06em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  backdrop-filter: blur(6px);
}
.costume-viewer.is-zoomed .viewer-reset { opacity: 1; pointer-events: auto; }
.viewer-reset:hover { border-color: var(--gold); color: var(--gold-bright); }

/* Guide modal */
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.guide-card { padding: 15px; border: 1px solid rgba(215,180,119,.12); border-radius: 11px; background: rgba(255,255,255,.018); }
.guide-card span { display: grid; place-items: center; width: 27px; height: 27px; margin-bottom: 10px; border-radius: 50%; background: rgba(215,180,119,.1); color: var(--gold); font-family: var(--mono); font-size: 9px; }
.guide-card h3 { margin: 0 0 6px; font-size: 12px; font-weight: 500; }
.guide-card p { margin: 0; color: var(--muted); font-size: 9.5px; line-height: 1.8; }
.guide-note { margin-top: 13px; padding: 11px 13px; border-radius: 8px; background: rgba(191,74,66,.06); border-left: 2px solid var(--red); color: var(--muted); font-size: 9px; line-height: 1.75; }
.guide-note code { color: var(--gold); font-family: var(--mono); font-size: 8px; }

/* =============================== Toast =============================== */

.toast-stack {
  position: fixed;
  z-index: 150;
  right: 24px;
  bottom: 118px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 310px;
  padding: 10px 13px;
  border: 1px solid rgba(215,180,119,.25);
  border-radius: 9px;
  background: rgba(10,18,24,.94);
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
  color: rgba(238,227,211,.86);
  font-size: 10px;
  line-height: 1.5;
  animation: toastIn .35s var(--ease);
}
.toast svg { width: 13px; height: 13px; color: var(--gold); flex: 0 0 auto; }
.toast.is-out { animation: toastOut .3s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(12px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(12px); } }

/* =============================== Preloader =============================== */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 43%, rgba(52, 78, 76, .25), transparent 55%),
    #070d12;
  transition: opacity .7s var(--ease), visibility .7s;
}
.preloader.is-done { opacity: 0; visibility: hidden; }
.preloader-inner { position: relative; text-align: center; width: min(340px, 78vw); }
.pre-glow {
  position: absolute;
  left: 50%; top: 42%;
  width: 280px; height: 280px;
  transform: translate(-50%,-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(215,180,119,.12), transparent 66%);
  filter: blur(12px);
  animation: preGlow 3s ease-in-out infinite;
}
@keyframes preGlow { 50% { opacity: .55; transform: translate(-50%,-50%) scale(1.12); } }
.pre-mark { position: relative; width: 70px; height: 70px; margin: 0 auto 20px; color: var(--gold); animation: spinSlow 16s linear infinite; }
.pre-mark svg { width: 100%; height: 100%; filter: drop-shadow(0 0 14px rgba(215,180,119,.4)); }
.pre-kicker { position: relative; margin: 0 0 10px; color: var(--gold); font-family: var(--mono); font-size: 7px; letter-spacing: .28em; }
.preloader h2 { position: relative; margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 500; letter-spacing: .08em; }
.pre-sub { position: relative; margin: 9px 0 22px; color: var(--muted); font-size: 9px; letter-spacing: .12em; }
.pre-bar { position: relative; width: 100%; height: 2px; background: rgba(215,180,119,.12); overflow: hidden; }
.pre-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); box-shadow: 0 0 14px var(--gold); transition: width .25s; }
.pre-pct { position: relative; display: block; margin-top: 9px; color: var(--muted-2); font-family: var(--mono); font-size: 8px; letter-spacing: .1em; }

/* =============================== Responsive =============================== */

@media (max-width: 1240px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 330px; }
  .coach-kicker { font-size: 6px; }
  .stage-badge { right: 22px; width: 92px; height: 92px; }
  .stage-badge .badge-core { font-size: 18px; }
  .player { padding-left: 20px; padding-right: 20px; }
  .player-center { gap: 10px; }
  .toggle-btn span { display: none; }
  .toggle-btn { padding: 7px; }
}

@media (max-width: 1050px) {
  body { overflow: auto; }
  .app { height: auto; min-height: 100vh; overflow: visible; }
  .topbar { grid-template-columns: 1fr auto; }
  .nav { display: none; }
  .live-pill { display: none; }
  .workspace { grid-template-columns: 1fr; padding: 0 12px 10px; }
  .stage { min-height: 620px; height: 68vh; }
  .coach-panel { min-height: 430px; max-height: 560px; }
  .player { position: sticky; bottom: 0; }
  .stage-title { top: 66px; left: 24px; width: 280px; }
  .stage-title h1 { font-size: 44px; }
  .stage-badge { display: none; }
  .dialect-callout { top: auto; bottom: 154px; right: 20px; width: 220px; }
  .coach-scroll { max-height: 400px; }
}

@media (max-width: 760px) {
  .topbar { padding: 0 14px; flex-basis: 64px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-type strong { font-size: 16px; }
  .brand-type small { font-size: 7px; letter-spacing: .17em; }
  .top-actions .icon-btn:nth-child(2) { display: none; }
  .live-pill { display: none; }
  .workspace { padding: 0 8px 8px; gap: 8px; }
  .stage { min-height: 400px; height: 50vh; border-radius: 18px; }
  .stage-topline { top: 14px; left: 15px; font-size: 7px; gap: 6px; letter-spacing: .16em; }
  .stage-topline .edition-rule { width: 15px; }
  .stage-title { display: none; }
  .stage-badge { display: none; }
  .stage-side-tools {
    right: 9px;
    top: 10px;
    bottom: auto;
    transform: none;
    flex-direction: row;
    padding: 3px;
    gap: 1px;
    border-radius: 11px;
  }
  .tool-btn { width: 36px; padding: 6px 0 5px; }
  .tool-btn svg { width: 13px; height: 13px; }
  .tool-btn span { font-size: 6px; }
  .move-caption { display: none; }
  .orbit-hint { display: none; }
  .rig-chip { display: none; }
  .dialect-callout { right: 10px; bottom: 58px; width: 206px; padding: 10px; }
  .dialect-callout p { font-size: 12px; }
  .dialect-callout small { font-size: 7px; }
  .subtitle { left: 9px; right: 9px; bottom: 9px; transform: none; max-width: none; font-size: 8.5px; padding: 7px 9px; }
  .subtitle-speaker { font-size: 6.5px; padding-right: 6px; }
  .subtitle-eq { display: none; }
  .coach-panel { border-radius: 18px; max-height: none; min-height: 0; }
  .coach-head { padding: 12px 12px; }
  .coach-id h3 { font-size: 15px; }
  .coach-scroll { max-height: none; overflow: visible; }
  .coach-messages { display: none; }
  .plan-head { margin-top: 11px; }
  .plan-list { display: grid; grid-template-columns: 1fr 1fr; }
  .metric-val { font-size: 14px; }
  .camera-pip { position: fixed; width: 128px; bottom: 138px; right: 9px; }
  .player { flex-basis: auto; padding: 8px 10px 10px; gap: 7px; }
  .timeline-wrap { flex-direction: column; align-items: stretch; gap: 5px; }
  .timeline-meta { flex-direction: row; align-items: center; justify-content: space-between; flex-basis: auto; }
  .timeline-seg { height: 22px; }
  .seg-label { font-size: 7px; padding: 0 6px; }
  .player-row { flex-wrap: wrap; gap: 8px; }
  .player-center { order: 3; width: 100%; justify-content: space-between; padding-top: 3px; }
  .player-left { flex: 1; }
  .player-right { gap: 2px; }
  .main-play { min-width: 116px; height: 41px; padding-right: 13px; }
  .time-readout { display: none; }
  .round-btn { width: 28px; height: 28px; }
  .nav-play { display: none; }
  .bpm-label, .bpm-unit { display: none; }
  .bpm-block b { font-size: 13px; }
  .speed-btn { padding: 4px 5px; }
  .toggle-btn { padding: 6px; }
  .toggle-btn span { display: none; }
  .toast-stack { right: 10px; bottom: 170px; }
  .modal-backdrop { padding: 8px; }
  .modal { max-height: 94vh; border-radius: 16px; }
  .modal-head { padding: 16px 16px 12px; }
  .modal-head h2 { font-size: 22px; }
  .modal-body { padding: 15px 15px 22px; }
  .moves-intro { flex-direction: column; align-items: flex-start; }
  .moves-intro .seal { display: none; }
  .move-grid, .video-grid, .guide-grid { grid-template-columns: 1fr; }
  .origin-grid { grid-template-columns: 1fr 1fr; }
  .move-card footer { flex-direction: column; align-items: flex-start; gap: 8px; }
  .heritage-hero, .costume-layout { grid-template-columns: 1fr; }
  .heritage-feature { min-height: 200px; }
  .costume-viewer { height: 430px; min-height: 0; }
  .fact-row { grid-template-columns: 1fr; }
  .costume-side h3 { font-size: 22px; }
}

@media (max-height: 760px) and (min-width: 1051px) {
  .topbar { flex-basis: 64px; }
  .stage-title { top: 58px; }
  .stage-title h1 { font-size: 46px; }
  .stage-title .sub { margin-top: 11px; }
  .stage-badge { top: 74px; width: 86px; height: 86px; }
  .dialect-callout { top: 200px; }
  .move-caption { bottom: 74px; }
  .subtitle { bottom: 20px; }
  .player { flex-basis: 92px; padding-top: 8px; gap: 6px; }
  .timeline-seg { height: 23px; }
  .coach-head { padding-top: 12px; padding-bottom: 11px; }
  .plan-item { padding-top: 6px; padding-bottom: 6px; }
  .metric-row { margin-top: 10px; margin-bottom: 8px; }
  .coach-tip { padding: 8px; margin-bottom: 7px; }
  .quick-row { display: none; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
