/* THE SECRET SIDE — built into the town (Option B, founder's ruling
   2026-11-20). The piece's own styles, scoped to its stage (#ss-stage):
   the piece no longer owns the page, so its global rules (html/body,
   fixed furniture) are re-homed under the stage — fixed becomes
   absolute within the stage, and its #fade is #ssFade so the town's
   boot veil keeps its own name. Values, order and behavior unchanged. */

/* ---- the stage shell (town integration) ---- */
#ss-stage{
  --field:#141210;
  --gold:#C9A227;
  --pale-gold:#FFEFC1;
  --salt:#F4EFE6;
  color-scheme:dark;
  position:fixed;
  inset:0;
  z-index:2;
  background:#141210;
  font-family:"Inter",sans-serif;
  -webkit-font-smoothing:antialiased;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .45s ease,visibility 0s linear .45s;
}
body.at-square #ss-stage{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transition:opacity .45s ease,visibility 0s;
}
html.town-fallback #ss-stage{display:none!important}
/* While the square is live, the piece's own furniture is the square's
   coin furniture — the town's duplicate coin-controls retire. */
body.at-square .coin-controls{display:none}

/* ---- the piece's own styles, scoped ---- */
#ss-stage *{box-sizing:border-box}
#ss-stage #scene, #ss-stage #scene canvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
}
#ss-stage #scene canvas{
  touch-action:none;
  cursor:grab;
  -webkit-user-select:none;
  user-select:none;
  -webkit-touch-callout:none;
  -webkit-tap-highlight-color:transparent;
}
#ss-stage #scene canvas:active{cursor:grabbing}
#ss-stage #tiltBtn{
  pointer-events:auto;
  margin-top:17px;
  padding:13px 26px 12px;
  font-family:"Cinzel",serif;
  font-size:11px;
  font-weight:600;
  letter-spacing:.24em;
  text-indent:.24em;
  color:var(--pale-gold);
  background:rgba(201,162,38,.07);
  border:1px solid rgba(201,162,38,.65);
  border-radius:999px;
  cursor:pointer;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
  box-shadow:0 0 22px rgba(201,162,38,.12), inset 0 0 14px rgba(201,162,38,.06);
  transition:background .25s ease, color .25s ease, opacity .25s ease;
}
#ss-stage #tiltBtn.on{
  background:linear-gradient(180deg, #E4C65B, var(--gold));
  color:#3D2A08;
  border-color:var(--pale-gold);
}
#ss-stage #tiltBtn.off{opacity:.32; pointer-events:none}
#ss-stage .vignette{
  position:absolute;
  inset:0;
  z-index:2;
  pointer-events:none;
  background:radial-gradient(ellipse at center, transparent 38%, rgba(20,18,16,.22) 66%, rgba(20,18,16,.88) 112%);
}
#ss-stage .brand{
  position:absolute;
  top:max(30px, env(safe-area-inset-top));
  left:50%;
  transform:translateX(-50%);
  z-index:3;
  width:max-content;
  max-width:94vw;
  text-align:center;
  pointer-events:none;
}
#ss-stage .brand h1{
  margin:0;
  color:var(--pale-gold);
  font-family:"Cinzel",serif;
  font-size:clamp(26px, 3.2vw, 46px);
  font-weight:500;
  line-height:1.1;
  letter-spacing:.29em;
  text-indent:.29em;
  text-shadow:0 2px 24px rgba(201,162,38,.18);
}
#ss-stage .brand p{
  margin:11px 0 0;
  color:rgba(244,239,230,.72);
  font-size:10px;
  font-weight:500;
  letter-spacing:.23em;
  text-indent:.23em;
  white-space:nowrap;
}
#ss-stage .caption-wrap{
  position:absolute;
  left:50%;
  bottom:max(34px, env(safe-area-inset-bottom));
  transform:translateX(-50%);
  z-index:3;
  width:max-content;
  max-width:94vw;
  text-align:center;
  pointer-events:none;
}
#ss-stage #markName{
  margin:0;
  color:var(--pale-gold);
  font-family:"Cinzel",serif;
  font-size:clamp(21px, 3vw, 36px);
  font-weight:600;
  letter-spacing:.34em;
  text-indent:.34em;
  text-shadow:0 0 26px rgba(201,162,38,.35), 0 2px 18px rgba(201,162,38,.2);
  transition:opacity .22s ease;
}
#ss-stage .rule{
  width:118px;
  height:1px;
  margin:15px auto 13px;
  background:linear-gradient(90deg, transparent, rgba(201,162,38,.75), transparent);
}
#ss-stage .hint{
  margin:0;
  color:rgba(244,239,230,.78);
  font-size:11px;
  font-weight:500;
  letter-spacing:.21em;
  text-indent:.21em;
  white-space:nowrap;
}
#ss-stage .hint-sub{
  margin:8px 0 0;
  color:rgba(244,239,230,.42);
  font-size:9px;
  font-weight:500;
  letter-spacing:.24em;
  text-indent:.24em;
  white-space:nowrap;
}
#ss-stage #ssFade{
  position:absolute;
  inset:0;
  z-index:10;
  pointer-events:none;
  background:var(--field);
  animation:clear-fade 2.2s ease-out both;
}
@keyframes clear-fade{
  0%, 8%{opacity:1}
  100%{opacity:0}
}
@media (max-width:700px){
  #ss-stage .brand h1{font-size:clamp(24px, 8vw, 33px); letter-spacing:.2em; text-indent:.2em}
  #ss-stage .brand p{font-size:8px; letter-spacing:.13em; text-indent:.13em}
  #ss-stage #markName{font-size:clamp(19px, 6.4vw, 27px); letter-spacing:.26em; text-indent:.26em}
  #ss-stage .hint{font-size:9px; letter-spacing:.15em; text-indent:.15em}
  #ss-stage .hint-sub{font-size:8px}
  #ss-stage #tiltBtn{font-size:10px; padding:12px 20px 11px; margin-top:14px}
}
