* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #071117; }
body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  overflow: hidden;
  color: #f2ebdc;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.cover-stage {
  position: relative;
  width: min(100vw, calc(100vh * 480 / 852));
  height: min(100vh, calc(100vw * 852 / 480));
  flex: 0 0 auto;
  overflow: hidden;
  isolation: isolate;
  background: #0d2028;
  box-shadow: 0 18px 70px #0009;
}
.cover-official,
.cover-canvas,
.cover-gold,
.cover-seal-glow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.cover-official { object-fit: cover; opacity: 1; }
.cover-canvas { display: block; opacity: 1; image-rendering: pixelated; }
.cover-stage:not([data-state="official"]):not([data-state="error"]) .cover-official { opacity: 0; }
.cover-start {
  display: none;
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: calc(4% + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: 156px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid #d8bc76;
  border-radius: 2px;
  background: #0a2b47ed;
  box-shadow: 0 5px 18px #020c1666, inset 0 0 0 1px #f2dfa41a;
  color: #fff3ce;
  font: 600 16px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 3px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cover-stage[data-state="official"] .cover-start { display: block; }
.cover-start:disabled { opacity: .55; cursor: wait; }
.cover-start:not(:disabled):hover { background: #123d5c; color: #fff9e8; }
.cover-start:focus-visible { outline: 2px solid #fff0ba; outline-offset: 3px; }
.cover-start:not(:disabled):active { transform: translateX(-50%) translateY(1px); }
/* The canvas owns all light effects: soft dust only, never a reflective sweep. */
.cover-gold, .cover-seal-glow { display: none !important; }
.cover-gold {
  inset: -35%;
  width: 170%;
  height: 170%;
  opacity: .22;
  background: linear-gradient(108deg, transparent 42%, rgba(255, 235, 174, .08) 47%, rgba(255, 239, 190, .68) 50%, rgba(255, 235, 174, .08) 53%, transparent 58%);
  transform: translateX(-72%);
  animation: coverSweep 3.6s ease-in-out infinite;
  mix-blend-mode: screen;
}
.cover-seal-glow {
  inset: auto;
  left: 39%;
  top: 38%;
  width: 22%;
  aspect-ratio: 1;
  height: auto;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 246, 198, .9), rgba(226, 201, 133, .36) 35%, transparent 70%);
  mix-blend-mode: screen;
}
.cover-stage[data-state="charge"] .cover-gold {
  opacity: .82;
  animation: coverCharge .45s cubic-bezier(.2, .8, .2, 1) both;
}
.cover-stage[data-state="charge"] .cover-seal-glow { animation: sealCharge .45s ease-out both; }
.cover-stage[data-state="transition"] .cover-gold,
.cover-stage[data-state="hold"] .cover-gold,
.cover-stage[data-state="done"] .cover-gold,
.cover-stage[data-state="transition"] .cover-seal-glow,
.cover-stage[data-state="hold"] .cover-seal-glow,
.cover-stage[data-state="done"] .cover-seal-glow { opacity: 0; animation: none; }
@keyframes coverSweep {
  0%, 24% { transform: translateX(-72%); }
  76%, 100% { transform: translateX(72%); }
}
@keyframes coverCharge {
  from { transform: translateX(-60%); opacity: .25; }
  to { transform: translateX(60%); opacity: .95; }
}
@keyframes sealCharge {
  0% { opacity: 0; transform: scale(.65); }
  60% { opacity: .95; transform: scale(1.35); }
  100% { opacity: .5; transform: scale(1.7); }
}
.preview-tools {
  width: 260px;
  padding: 22px 0;
  flex: 0 0 auto;
  color: #d8d9cb;
}
.preview-kicker { color: #b79452; font-size: 11px; letter-spacing: 2px; }
.preview-tools h1 { margin: 8px 0 10px; font-size: 23px; font-weight: 600; }
.preview-status { min-height: 42px; margin: 0 0 18px; color: #aab9b8; font-size: 13px; line-height: 1.6; }
.preview-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.preview-buttons button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #806c45;
  border-radius: 4px;
  background: transparent;
  color: #f2e3bc;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.preview-buttons button:hover,
.preview-buttons button:focus-visible { background: #17313a; outline: 2px solid #e2c985; outline-offset: 2px; }
.preview-buttons button[aria-pressed="true"] { background: #e2c985; color: #0d2028; }
.preview-note { margin-top: 18px; padding-top: 14px; border-top: 1px solid #29414a; color: #82979b; font-size: 12px; line-height: 1.8; }
.preview-note strong { color: #d8c18a; font-weight: 500; }
@media (max-width: 760px) {
  body { display: block; }
  .cover-stage { box-shadow: none; }
  .preview-tools {
    position: fixed;
    z-index: 10;
    right: 8px;
    bottom: 8px;
    width: auto;
    padding: 8px;
    border: 1px solid #806c4566;
    border-radius: 5px;
    background: #071117d9;
  }
  .preview-tools h1, .preview-kicker, .preview-note, .preview-status { display: none; }
  .preview-buttons { gap: 5px; }
  .preview-buttons button { min-height: 34px; padding: 0 9px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .cover-gold, .cover-seal-glow { animation: none !important; }
}
