.field-finale {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, rgba(26, 39, 27, .28), rgba(3, 8, 5, .94) 72%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 1.1s ease, visibility 0s linear 1.1s;
}

.field-finale::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(108deg, transparent 25%, rgba(238, 228, 198, .05) 50%, transparent 74%);
  transform: translateX(-100%);
}

.field-finale.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.field-finale.show::before {
  animation: field-wash 1.4s .25s ease-out forwards;
}

.field-copy {
  position: absolute;
  left: 8%;
  top: max(8%, env(safe-area-inset-top));
  z-index: 4;
  writing-mode: vertical-rl;
  text-align: left;
  color: rgba(245, 237, 216, .82);
}

.field-copy small {
  font: 400 12px/1.2 "Songti SC", "STSong", serif;
  letter-spacing: .32em;
}

.field-copy p {
  margin: 22px 8px 0 0;
  font-size: 10px;
  letter-spacing: .2em;
  color: rgba(245, 237, 216, .52);
}

.field-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: visible;
  background: transparent;
  opacity: 0;
}

.field-finale.show .field-grid {
  animation: field-land 1.1s .18s cubic-bezier(.2, .75, .2, 1) forwards;
}

.field-finale.adjusting .field-grid {
  animation: none;
  opacity: 1;
  touch-action: none;
}

.field-finale.adjusting .field-grid button {
  pointer-events: none;
}

.field-grid button {
  position: absolute;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #172319;
  color: #f4ecd6;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.field-grid button:nth-of-type(1) { clip-path: url(#fieldClip1); -webkit-mask: url(#fieldMask1); mask: url(#fieldMask1); }
.field-grid button:nth-of-type(2) { clip-path: url(#fieldClip2); -webkit-mask: url(#fieldMask2); mask: url(#fieldMask2); }
.field-grid button:nth-of-type(3) { clip-path: url(#fieldClip3); -webkit-mask: url(#fieldMask3); mask: url(#fieldMask3); }
.field-grid button:nth-of-type(4) { clip-path: url(#fieldClip4); -webkit-mask: url(#fieldMask4); mask: url(#fieldMask4); }
.field-grid button:nth-of-type(1) { clip-path: url(#fieldClip1); }
.field-grid button:nth-of-type(2) { clip-path: url(#fieldClip2); }
.field-grid button:nth-of-type(3) { clip-path: url(#fieldClip3); }
.field-grid button:nth-of-type(4) { clip-path: url(#fieldClip4); }
.field-mask-defs { position: absolute; pointer-events: none; }

.field-grid video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.78) contrast(1.04) brightness(.8);
  transition: transform .55s ease, filter .55s ease;
}

.field-grid button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 48%, rgba(5, 12, 8, .18) 76%, rgba(5, 12, 8, .52) 100%),linear-gradient(to top, rgba(3, 8, 5, .48), transparent 46%);
  pointer-events: none;
}

.field-grid button span {
  position: absolute;
  z-index: 2;
  right: 9px;
  bottom: 7px;
  font-family: "MaShanZheng", cursive;
  font-size: 25px;
  text-shadow: 0 2px 8px #000;
}

.field-grid button:active video,
.field-grid button:hover video {
  transform: scale(1.06);
  filter: saturate(1) contrast(1.02) brightness(.98);
}

.field-glyph {
  position: absolute;
  z-index: 3;
  left: var(--glyph-x, 50%);
  top: var(--glyph-y, 50%);
  width: min(78%, 410px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: rgba(242, 233, 208, .92);
  font-family: "MaShanZheng", cursive;
  font-size: min(92vw, 500px);
  line-height: 1;
  font-weight: 400;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(var(--glyph-scale, 1));
  text-shadow: 0 0 1px rgba(255, 250, 232, .58), 0 4px 13px rgba(0, 0, 0, .88);
}

.stage.finale-mode .video-verse,
.stage.finale-mode .chapter-card,
.stage.finale-mode .topbar,
.stage.finale-mode .timeline,
.stage.finale-mode .nav-arrow {
  opacity: 0;
  pointer-events: none;
}

@keyframes field-wash {
  to { transform: translateX(100%); }
}

@keyframes field-land {
  to { opacity: 1; }
}

.bezier-editor { position:absolute; inset:0; z-index:6; width:100%; height:100%; overflow:visible; opacity:0; visibility:hidden; pointer-events:none; }
.field-finale.adjusting .bezier-editor { opacity:1; visibility:visible; pointer-events:auto; }
.editor-hit { width:100%; height:100%; fill:transparent; }
.editor-path { fill:rgba(217,197,139,.08); stroke:#eadcad; stroke-width:1.2; stroke-dasharray:5 4; vector-effect:non-scaling-stroke; }
.editor-nodes circle { fill:#f4ecd6; stroke:#182419; stroke-width:1.5; vector-effect:non-scaling-stroke; cursor:grab; }
.field-finale.editing-field .editor-path { fill:none; stroke:#f4ecd6; }

.field-adjust-toggle {
  position: absolute;
  z-index: 7;
  right: 18px;
  top: max(18px, env(safe-area-inset-top));
  min-width: 86px;
  min-height: 40px;
  border: 1px solid rgba(242, 233, 208, .4);
  background: rgba(4, 10, 6, .46);
  color: rgba(246, 238, 216, .85);
  font: 11px/1 "Songti SC", "STSong", serif;
  letter-spacing: .15em;
  touch-action: manipulation;
  display: none;
}

.field-finale.calibration-enabled .field-adjust-toggle { display: block; }

.field-calibrator {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(88%, 420px);
  padding: 12px 14px;
  border: 1px solid rgba(242, 233, 208, .28);
  background: rgba(3, 8, 5, .82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #f2e9d0;
  transform: translateX(-50%);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}

.field-finale.adjusting .field-calibrator {
  opacity: 1;
  pointer-events: auto;
}

.field-calibrator p { margin: 0 0 7px; font-size: 11px; letter-spacing: .14em; }
.layer-tabs { display:grid!important; grid-template-columns:repeat(5,1fr); gap:5px!important; margin-bottom:8px; }
.layer-tabs button { min-width:0; padding:0!important; }
.layer-tabs button.active { color:#10170f; background:#e8ddbc; }
.field-calibrator label { display: grid; grid-template-columns: auto 1fr 24px; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 11px; color: rgba(242,233,208,.78); }
.field-calibrator input { width: 100%; accent-color: #d9c58b; touch-action: pan-x; }
.field-calibrator label b { font: 11px/1 ui-monospace, SFMono-Regular, monospace; color: #d9c58b; }
.field-calibrator output { display: block; margin-bottom: 10px; font: 12px/1.2 ui-monospace, SFMono-Regular, monospace; color: #d9c58b; }
.field-calibrator div { display: flex; justify-content: center; gap: 8px; }
.field-calibrator button { min-height: 36px; padding: 0 12px; border: 1px solid rgba(242,233,208,.3); background: rgba(242,233,208,.08); color: #f2e9d0; font-size: 11px; }

@media (max-width: 620px) {
  .field-copy { left: 5%; }
}

@media (prefers-reduced-motion: reduce) {
  .field-finale.show .field-grid { animation-duration: .15s; animation-delay: 0s; }
}
