/* Achilles' Choice — site */
* { box-sizing: border-box; }
html, body { margin: 0; background: #0E0E0F; color: #C9C4B8;
  font-family: ui-monospace, Menlo, 'SF Mono', monospace; font-size: 13px; }
a { color: #C9C4B8; text-decoration: none; }
a:hover { color: #FFF; }

#nav { display: flex; justify-content: space-between; align-items: center;
  padding: 18px 28px; border-bottom: 1px solid #1E1E22;
  position: sticky; top: 0; background: rgba(14,14,15,.94); backdrop-filter: blur(6px); z-index: 5; }
.brand { letter-spacing: .22em; color: #E8E2D0; font-size: 13px; }
.brand .tag { margin-left: 10px; font-size: 10px; letter-spacing: .18em;
  color: #E9A825; border: 1px solid #4a3a12; padding: 2px 6px; vertical-align: 2px; }
#nav .links { display: flex; gap: 22px; align-items: center; }
#nav .links a { letter-spacing: .18em; font-size: 11px; color: #8b877d; }
#nav .links a.on, #nav .links a:hover { color: #FFF; }
#walletBtn { font-family: inherit; font-size: 10px; letter-spacing: .14em;
  background: none; border: 1px solid #33333a; color: #C9C4B8;
  padding: 7px 12px; cursor: pointer; }
#walletBtn:hover { border-color: #E9A825; color: #E9A825; }
#walletBtn.connected { color: #E9A825; border-color: #4a3a12; }
/* anything scrolled into view lands below the sticky nav, not under it */
#viewerSec, #reveal, #postPanel, #detail { scroll-margin-top: 84px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 28px 80px; }
h1 { font-weight: normal; letter-spacing: .24em; color: #E8E2D0;
  font-size: clamp(24px, 4.5vw, 40px); margin: 64px 0 10px; }
h2 { font-weight: normal; letter-spacing: .2em; font-size: 13px;
  color: #8b877d; margin: 70px 0 18px; }
p.lead { color: #8b877d; line-height: 1.9; max-width: 640px; }
.gold { color: #E9A825; }
.dim { color: #7d7969; }

.poem { margin: 26px 0 34px; line-height: 2.15; color: #C9C4B8; letter-spacing: .08em; }
.poem .t { color: #E8E2D0; letter-spacing: .2em; margin-bottom: 8px; }

.btn { display: inline-block; font-family: inherit; font-size: 12px;
  letter-spacing: .18em; background: none; border: 1px solid #33333a;
  color: #C9C4B8; padding: 13px 26px; cursor: pointer; }
.btn:hover { border-color: #E9A825; color: #E9A825; }
.btn.primary { border-color: #E9A825; color: #E9A825; }
.btn.primary:hover { background: #E9A825; color: #0E0E0F; }
.btn:disabled { opacity: .35; cursor: default; }

.hero { display: flex; gap: 54px; align-items: center; flex-wrap: wrap; margin-top: 26px; }
.hero > div:first-child { flex: 0 1 min(68vh, 570px); max-width: 100%; }
.hero .slides { position: relative; width: 100%; aspect-ratio: 1; }
.hero canvas { display: block; border: 1px solid #1E1E22; width: 100%; height: auto;
  position: absolute; top: 0; left: 0; opacity: 0; transition: opacity 1.2s ease; }
.hero canvas.on { opacity: 1; }
.cap { font-size: 10px; letter-spacing: .16em; color: #7d7969; margin-top: 10px; }

.stats { display: flex; gap: 0; border: 1px solid #1E1E22; margin: 26px 0; flex-wrap: wrap; }
.stat { flex: 1 1 140px; padding: 20px 22px; border-right: 1px solid #1E1E22; }
.stat:last-child { border-right: none; }
.stat b { display: block; font-weight: normal; color: #E8E2D0; font-size: 21px; margin-bottom: 6px; }
.stat span { font-size: 10px; letter-spacing: .14em; color: #7d7969; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.card { border: 1px solid #1E1E22; padding: 26px; }
.card h3 { font-weight: normal; letter-spacing: .2em; color: #E8E2D0; margin: 0 0 12px; font-size: 13px; }
.card p { color: #8b877d; line-height: 1.8; min-height: 68px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.piece { border: 1px solid #1E1E22; }
.piece canvas { display: block; width: 100%; }
.piece .m { padding: 9px 11px; font-size: 10px; letter-spacing: .1em;
  color: #8b877d; display: flex; justify-content: space-between; }
.shimmer { aspect-ratio: 1; background: linear-gradient(100deg, #141416 40%, #1b1b1e 50%, #141416 60%);
  background-size: 200% 100%; animation: sh 1.4s infinite; }
@keyframes sh { to { background-position: -200% 0; } }

.bar { height: 4px; background: #1E1E22; margin: 14px 0 8px; }
.bar i { display: block; height: 100%; background: #E9A825; }

table.scores { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.scores th { text-align: left; font-weight: normal; font-size: 10px;
  letter-spacing: .16em; color: #7d7969; padding: 10px 12px; border-bottom: 1px solid #1E1E22; }
table.scores td { padding: 10px 12px; border-bottom: 1px solid #17171a; font-size: 12px; }
table.scores tr.row { cursor: pointer; }
table.scores tr.row:hover td { background: #131316; }
td.rank { color: #7d7969; } tr.top td.rank { color: #E9A825; }
.thumb { width: 56px; height: 56px; display: block; border: 1px solid #1E1E22; }

.panel { border: 1px solid #1E1E22; padding: 26px; margin-top: 22px; }
.trow { display: flex; gap: 14px; align-items: center; margin: 14px 0; flex-wrap: wrap; }
.trow label { font-size: 10px; letter-spacing: .16em; color: #7d7969; width: 110px; }
select, input[type=text] { font-family: inherit; font-size: 12px; background: #131316;
  color: #C9C4B8; border: 1px solid #33333a; padding: 8px 10px; }
.sw { width: 22px; height: 22px; display: inline-block; cursor: pointer;
  border: 2px solid transparent; margin-right: 4px; vertical-align: middle; }
.sw.on { border-color: #E9A825; }
.playwrap { display: flex; gap: 40px; flex-wrap: wrap; align-items: flex-start; margin-top: 24px; }
#game { border: 2px solid #FFFFFF; display: block; touch-action: none; }
.hud { display: flex; gap: 26px; margin: 14px 0; font-size: 12px; letter-spacing: .12em; }
.hud b { color: #E8E2D0; font-weight: normal; }
.keys { color: #7d7969; font-size: 10px; letter-spacing: .12em; line-height: 2; }
/* while a run is live the page holds still — swipes steer, not scroll */
html.playing, html.playing body { overflow: hidden; overscroll-behavior: none; touch-action: none; }
.overlay { position: absolute; inset: 0; background: rgba(10,10,11,.82);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.overlay b { font-weight: normal; color: #E8E2D0; letter-spacing: .22em; font-size: 19px; }
.gamebox { position: relative; }
.plaque { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0; border: 1px solid #1E1E22; border-top: none; }
.plaque div { padding: 12px 14px; border-right: 1px solid #1E1E22; }
.plaque div:last-child { border-right: none; }
.plaque span { display: block; font-size: 10px; letter-spacing: .16em; color: #7d7969; margin-bottom: 5px; }
.plaque b { font-weight: normal; color: #E8E2D0; font-size: 13px; }

.palrow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #17171a; }
.palrow .nm { width: 150px; letter-spacing: .14em; font-size: 11px; color: #8b877d; }
.dot { width: 14px; height: 14px; }

/* ---------- the stage (engine-ext acStage) ---------- */
.revealbox { position: relative; width: 480px; max-width: 100%; }
.revealbox canvas { display: block; border: 1px solid #1E1E22; width: 100%; height: auto; }
#stPaint { position: absolute; top: 0; left: 0; opacity: 0; transition: opacity 1.4s ease; }
#stPaint.in { opacity: 1; }
/* the stamp: a painted word on its own layer, in the piece's colours */
#stStamp { position: absolute; top: 0; left: 0; border: none; pointer-events: none;
  opacity: 0; transition: opacity .35s ease; }
#stStamp.on { opacity: 1; }
#stage { position: fixed; inset: 0; z-index: 20; background: rgba(14,14,15,.97);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 24px; opacity: 0; transition: opacity .6s ease; }
#stage.on { display: flex; }
#stage.lit { opacity: 1; }
#stage .revealbox { width: min(66vh, 92vw); }
#stageTitle { letter-spacing: .24em; font-size: 12px; color: #8b877d; }
#stageTitle b { font-weight: normal; color: #E8E2D0; }
/* the panel under the board swaps from HUD to rest — same height both
   ways, so the centred column never re-centres and the board holds still */
#liveSec { display: flex; flex-direction: column; align-items: center; gap: 12px; height: 150px; }
.hud2 { display: grid; grid-template-columns: repeat(3, auto); gap: 34px; text-align: center; }
.hud2 div span { display: block; font-size: 10px; letter-spacing: .16em; color: #7d7969; margin-bottom: 4px; }
.hud2 div b { font-weight: normal; color: #E8E2D0; font-size: 20px; }
#liveCap { min-height: 16px; font-size: 10px; letter-spacing: .14em; color: #E9A825; }
#stageHint { font-size: 10px; letter-spacing: .14em; color: #5f5c52; }
#restSec { display: none; flex-direction: column; align-items: center; gap: 14px; height: 150px;
  opacity: 0; transition: opacity .6s ease; }
#restSec.on { display: flex; }
#restSec.lit { opacity: 1; }
#stageLine { letter-spacing: .2em; font-size: 11px; color: #8b877d; }
#stageLine b { font-weight: normal; color: #E8E2D0; }
html.staged, html.staged body { overflow: hidden; }

/* ---------- small screens ---------- */
canvas { max-width: 100%; }
@media (max-width: 720px){
  #nav { flex-wrap: wrap; gap: 12px 18px; padding: 14px 16px; }
  #nav .links { gap: 14px 18px; flex-wrap: wrap; }
  .brand .tag { display: none; }          /* the footer says MOCKUP too */
  .wrap { padding: 0 16px 60px; }
  h1 { margin: 34px 0 10px; }
  .hero { gap: 26px; }
  .hero > div:first-child { flex-basis: 100%; }
  .plaque { grid-template-columns: repeat(2, 1fr); }
  .playwrap { gap: 22px; margin-top: 12px; }
  .playlead { display: none; }    /* the HUD says how to start; the board needs the room */
  #stageHint { display: none; }   /* no Esc on a phone */
  /* the board bleeds past the page gutters, edge to edge */
  .gamebox { margin-left: -16px; margin-right: -16px; }
  .gamebox canvas { margin: 0 auto; }
  .hud { flex-wrap: wrap; gap: 10px 20px; }
  table.scores th:nth-child(8), table.scores td:nth-child(8),
  table.scores th:nth-child(9), table.scores td:nth-child(9) { display: none; }
  table.scores td, table.scores th { padding: 8px 6px; }
}

#foot { max-width: 1100px; margin: 40px auto 0; padding: 22px 28px 46px;
  border-top: 1px solid #1E1E22; color: #5f5c52; font-size: 10px; letter-spacing: .1em; }
#foot a { color: #7d7969; text-decoration: underline; }
#busyLine { color: #E9A825; font-size: 11px; letter-spacing: .14em; min-height: 18px; margin: 10px 0; }

.sbtag { display: inline-block; font-size: 10px; letter-spacing: .18em;
  color: #E9A825; border: 1px solid #4a3a12; padding: 3px 8px; vertical-align: 2px; }
