/* Demo-download infrastructure shared by all six game cassettes. */
.demo-download-section {
  position: relative;
  z-index: 4;
  margin: 16px 0 5px;
  padding: 13px;
  border: 1px solid rgba(214, 187, 116, .52);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(229, 204, 139, .07), transparent 25%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.014) 0 1px, transparent 1px 4px),
    rgba(5, 9, 7, .88);
  box-shadow: inset 0 0 18px rgba(0,0,0,.66), 0 1px rgba(255,255,255,.04);
  color: #d7c9a6;
  font-family: var(--mono, "Courier New", monospace);
}
.demo-download-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(214,187,116,.22);
  padding-bottom: 7px;
}
.demo-download-heading p,
.demo-download-heading h3,
.demo-download-status { margin: 0; }
.demo-download-heading p {
  color: #8c8068;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .18em;
}
.demo-download-heading h3 {
  color: #ebd99c;
  font-family: var(--ui, Arial, sans-serif);
  font-size: clamp(13px, 1.65vw, 19px);
  letter-spacing: .055em;
  text-transform: uppercase;
}
.demo-download-status {
  padding: 8px 0 7px;
  color: #afa387;
  font-size: 9px;
  line-height: 1.45;
}
.demo-platform-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 5px;
  margin-bottom: 9px;
}
.demo-platform-state {
  display: grid;
  grid-template-columns: 7px 1fr;
  gap: 1px 5px;
  align-items: center;
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid rgba(194,178,139,.18);
  background: rgba(0,0,0,.28);
  color: #c7baa0;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .08em;
}
.demo-platform-state i {
  grid-row: 1 / span 2;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #544d42;
  box-shadow: inset 0 0 2px #000;
}
.demo-platform-state b {
  color: #766f61;
  font-size: 5.5px;
  letter-spacing: .12em;
}
.demo-platform-state.is-ready i {
  background: #8fb976;
  box-shadow: 0 0 7px rgba(143,185,118,.5), inset 0 0 2px rgba(255,255,255,.45);
}
.demo-platform-state.is-ready b { color: #9ebd8d; }
.demo-download-controls { display: grid; justify-items: start; gap: 7px; }
.demo-download-primary,
.game-demo-os-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid #d4b760;
  border-radius: 3px;
  background: linear-gradient(#e2c671, #b7923f);
  box-shadow: inset 0 1px rgba(255,255,255,.35), 0 2px 4px rgba(0,0,0,.45);
  color: #171006;
  font-family: var(--ui, Arial, sans-serif);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}
.demo-download-primary:hover,
.demo-download-primary:focus-visible,
.game-demo-os-button:hover,
.game-demo-os-button:focus-visible { filter: brightness(1.12); outline: 1px solid #f2de9e; outline-offset: 2px; }
.demo-download-primary:active,
.game-demo-os-button:active { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(0,0,0,.35); }
.demo-download-primary.is-unavailable,
.game-demo-os-button.is-unavailable {
  border-color: #514b3f;
  background: linear-gradient(#454139, #292720);
  color: #8f8775;
  box-shadow: inset 0 1px rgba(255,255,255,.05);
  cursor: not-allowed;
  filter: none;
}
.demo-choose-os-link {
  padding: 2px 1px;
  border: 0;
  border-bottom: 1px solid rgba(225,201,132,.58);
  background: transparent;
  color: #d9c078;
  font: 800 7px/1.25 var(--mono, "Courier New", monospace);
  letter-spacing: .12em;
  text-shadow: -1px 0 #1b160e, 0 1px #1b160e, 1px 0 #1b160e, 0 -1px #1b160e;
  text-transform: uppercase;
  cursor: pointer;
}
.demo-choose-os-link:hover,
.demo-choose-os-link:focus-visible { color: #fff0ba; border-bottom-color: #fff0ba; outline: none; }

.game-demo-download-dialog {
  width: min(570px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 1px solid #987b39;
  border-radius: 5px;
  background: #0c0b09;
  color: #d8cba9;
  box-shadow: 0 28px 90px rgba(0,0,0,.9), inset 0 0 0 2px #211b10;
}
.game-demo-download-dialog::backdrop {
  background: rgba(0,0,0,.82);
  backdrop-filter: blur(2px) saturate(.7);
}
.game-demo-dialog-panel {
  padding: 17px;
  background:
    linear-gradient(135deg, rgba(208,172,82,.08), transparent 26%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 4px),
    #0d0c09;
}
.game-demo-dialog-panel header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(214,187,116,.28);
}
.game-demo-dialog-panel header p,
.game-demo-dialog-panel header h2,
.game-demo-dialog-game,
.game-demo-dialog-note { margin: 0; }
.game-demo-dialog-panel header p {
  margin-bottom: 4px;
  color: #81745a;
  font: 800 8px/1 var(--mono, "Courier New", monospace);
  letter-spacing: .18em;
}
.game-demo-dialog-panel header h2 {
  color: #eedb9c;
  font: 900 clamp(20px, 5vw, 32px)/1 var(--ui, Arial, sans-serif);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.game-demo-dialog-close {
  display: grid;
  place-content: center;
  width: 31px;
  height: 31px;
  padding: 0;
  border: 1px solid #615438;
  border-radius: 2px;
  background: linear-gradient(#39342b,#1c1a16);
  color: #d9c68f;
  font: 700 21px/1 Arial, sans-serif;
  cursor: pointer;
}
.game-demo-dialog-game {
  padding: 13px 0 11px;
  color: #c5b99b;
  font: 800 12px/1.3 var(--mono, "Courier New", monospace);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.game-demo-os-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 9px;
}
.game-demo-os-button {
  display: grid;
  min-height: 67px;
  align-content: center;
  gap: 6px;
  width: 100%;
}
.game-demo-os-button span { font-size: 12px; }
.game-demo-os-button small { font: 800 6px/1 var(--mono, "Courier New", monospace); letter-spacing: .15em; }
.game-demo-dialog-note {
  padding-top: 12px;
  color: #887e69;
  font: 8px/1.45 var(--mono, "Courier New", monospace);
}
body.game-demo-dialog-open::before {
  content: "";
  position: fixed;
  z-index: 3998;
  inset: 0;
  background: rgba(0,0,0,.82);
}
body.game-demo-dialog-open .game-demo-download-dialog { position: fixed; z-index: 3999; inset: 50% auto auto 50%; transform: translate(-50%,-50%); }

@media (max-width: 560px) {
  .demo-download-heading { align-items: start; flex-direction: column-reverse; gap: 4px; }
  .demo-platform-summary { grid-template-columns: 1fr; }
  .demo-platform-state { grid-template-columns: 7px 1fr auto; }
  .demo-platform-state b { align-self: center; }
  .demo-download-primary { width: 100%; }
  .demo-download-controls { justify-items: stretch; }
  .demo-choose-os-link { justify-self: start; }
  .game-demo-os-grid { grid-template-columns: 1fr; }
  .game-demo-os-button { min-height: 48px; }
}

.demo-release-page-link,
.game-demo-release-page {
  color: #94866a;
  font: 700 6.5px/1.35 var(--mono, "Courier New", monospace);
  letter-spacing: .08em;
  text-decoration: underline;
  text-decoration-color: rgba(205,181,118,.38);
  text-underline-offset: 3px;
  text-transform: uppercase;
}
.demo-release-page-link:hover,
.demo-release-page-link:focus-visible,
.game-demo-release-page:hover,
.game-demo-release-page:focus-visible {
  color: #e4cb86;
  text-decoration-color: currentColor;
  outline: none;
}
.game-demo-release-page {
  display: inline-block;
  margin-top: 11px;
}

.demo-download-primary[hidden] { display: none !important; }

/* ==============================================================
   v18 demo visibility system
   Demo availability is intentionally communicated as a simple
   PLAYABLE / NOT YET PLAYABLE state. OS details live only inside
   the explicit download chooser, where they are actually useful.
   ============================================================== */

.library-header .library-demo-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px -3px -3px;
  padding-top: 5px;
  border-top: 1px solid rgba(55, 38, 20, .24);
  color: #2a2116;
  font-family: var(--mono);
  text-transform: uppercase;
}
.library-demo-summary strong {
  font: 900 7px/1 var(--mono);
  letter-spacing: .08em;
}
.library-demo-summary small {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font: 800 6px/1 var(--mono);
  letter-spacing: .06em;
}
.library-demo-summary i { color: #536c26; font-style: normal; }
.library-instruction b { color: #d4c166; }

.tape-stack .vhs-tape.has-demo {
  transform: translateX(-3px) !important;
  box-shadow:
    inset 0 1px rgba(255,255,255,.1),
    inset 0 -2px 2px rgba(0,0,0,.7),
    0 7px 13px rgba(0,0,0,.54),
    0 0 0 1px rgba(189,166,87,.16) !important;
}
.tape-stack .vhs-tape.has-demo:hover,
.tape-stack .vhs-tape.has-demo:focus-visible {
  transform: translateX(-7px) translateY(-1px) !important;
}
.tape-demo-sticker {
  position: absolute !important;
  z-index: 12 !important;
  top: 4px;
  left: 34px;
  display: grid;
  justify-items: center;
  min-width: 47px;
  padding: 2px 4px 1px;
  border: 1px solid rgba(38, 42, 13, .72);
  border-radius: 1px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.34), transparent 38%),
    #c4dd58;
  color: #1b2209;
  box-shadow: 0 1px 2px rgba(0,0,0,.38), inset 0 0 0 1px rgba(255,255,255,.2);
  transform: rotate(-1.8deg);
  pointer-events: none;
  font-family: var(--mono);
  text-transform: uppercase;
}
.tape-demo-sticker strong {
  font: 900 5.4px/1 var(--mono);
  letter-spacing: .06em;
  white-space: nowrap;
}
.tape-demo-sticker small {
  margin-top: 1px;
  padding: 1px 3px;
  background: #7f231c;
  color: #f5deaa;
  font: 900 4.4px/1 var(--mono);
  letter-spacing: .08em;
  white-space: nowrap;
}

.playable-demos-button {
  border-color: rgba(202, 173, 92, .58) !important;
  background: linear-gradient(180deg, rgba(210,180,92,.09), rgba(0,0,0,.08)) !important;
}
.playable-demos-button span { color: #e3c76e; }

.demo-download-section {
  position: relative;
  margin: 11px 0 15px;
  padding: 12px;
  border: 1px solid rgba(184, 159, 89, .5);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(221, 196, 116, .07), transparent 34%),
    rgba(7, 10, 7, .78);
  box-shadow: inset 0 0 16px rgba(0,0,0,.28), 0 4px 10px rgba(0,0,0,.22);
}
.demo-download-section.is-playable {
  border-color: rgba(181, 201, 91, .6);
  background:
    linear-gradient(180deg, rgba(163, 189, 74, .09), transparent 42%),
    rgba(7, 10, 7, .8);
}
.demo-download-section.is-pending { opacity: .83; }

.demo-state-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -3px 0 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(188, 169, 108, .2);
}
.demo-state-strip > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 8px;
}
.demo-state-strip p,
.demo-state-strip strong,
.demo-state-strip small { margin: 0; }
.demo-state-strip p {
  color: #c8d66c;
  font: 900 7px/1 var(--mono);
  letter-spacing: .14em;
}
.demo-state-strip strong {
  color: #eee5c9;
  font: 900 8px/1 var(--mono);
  letter-spacing: .08em;
}
.demo-state-strip small {
  color: #9f967e;
  font: 700 6px/1 var(--mono);
}
.demo-state-lamp {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border: 1px solid #18130b;
  border-radius: 50%;
  background: #3d3324;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.demo-state-lamp.is-live {
  background: #a9c24f;
  box-shadow: 0 0 8px rgba(176, 210, 78, .55), inset 0 0 0 1px rgba(255,255,255,.26);
}
.demo-download-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 5px;
}
.demo-download-heading p,
.demo-download-heading h3 { margin: 0; }
.demo-download-heading p {
  color: #a49a80;
  font: 800 6px/1 var(--mono);
  letter-spacing: .14em;
}
.demo-download-heading h3 {
  color: #f0e7cb;
  font: 900 14px/1 var(--ui);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.demo-download-status {
  margin: 0 0 9px;
  color: #b9b09a;
  font: 8px/1.45 var(--mono);
}
.demo-download-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.demo-download-primary,
.demo-web-pre-demo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #d2b957;
  border-radius: 2px;
  background: linear-gradient(#dfc865, #a98d35);
  color: #171207;
  font: 900 7px/1 var(--ui);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.demo-download-primary:hover,
.demo-download-primary:focus-visible,
.demo-web-pre-demo:hover,
.demo-web-pre-demo:focus-visible { filter: brightness(1.08); outline: 1px solid #f0d87d; outline-offset: 1px; }
.demo-download-primary.is-unavailable {
  border-color: rgba(151,139,108,.32);
  background: #2b2923;
  color: #867e6a;
  cursor: not-allowed;
}
.demo-web-pre-demo {
  border-color: rgba(143, 195, 180, .55);
  background: linear-gradient(#6e9c91, #42665e);
  color: #f3f0dc;
}
.demo-choose-os-link,
.demo-release-page-link {
  border: 0;
  background: transparent;
  color: #d3c16f;
  font: 800 6.5px/1 var(--mono);
  letter-spacing: .06em;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.demo-release-page-link { color: #938b76; }
.demo-build-contents {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(174,158,103,.18);
}
.demo-build-contents p { margin: 0 0 5px; color: #b8a867; font: 900 6px/1 var(--mono); letter-spacing: .14em; }
.demo-build-contents ul { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; padding: 0; list-style: none; }
.demo-build-contents li { color: #a9a18d; font: 7px/1.35 var(--mono); }
.demo-build-contents li::before { content: "• "; color: #c7b75f; }

.game-demo-os-button small { font-size: 8px !important; letter-spacing: .04em !important; }

.playable-demos-dialog {
  width: min(760px, calc(100vw - 22px));
  max-height: min(760px, calc(100vh - 22px));
  padding: 0;
  border: 1px solid #7d6330;
  border-radius: 5px;
  background: #0d0b08;
  color: #e6dcc0;
  box-shadow: 0 28px 70px rgba(0,0,0,.78), inset 0 0 30px rgba(0,0,0,.28);
}
.playable-demos-dialog::backdrop { background: rgba(2,2,2,.78); backdrop-filter: blur(2px); }
.playable-demos-panel { padding: 16px; }
.playable-demos-panel > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 15px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(200,167,85,.26);
}
.playable-demos-panel header p,
.playable-demos-panel header h2,
.playable-demos-intro,
.playable-demo-row h3,
.playable-demo-row p { margin: 0; }
.playable-demos-panel header p { color: #af9350; font: 800 7px/1 var(--mono); letter-spacing: .17em; }
.playable-demos-panel header h2 { margin-top: 5px; color: #f0e2b8; font: 900 22px/1 var(--ui); text-transform: uppercase; }
.playable-demos-panel header button {
  width: 34px;
  height: 34px;
  border: 1px solid #66532c;
  background: #211a10;
  color: #d9c174;
  font-size: 20px;
  cursor: pointer;
}
.playable-demos-intro { padding: 10px 0; color: #9f957f; font: 9px/1.45 var(--mono); }
.playable-demos-list { display: grid; gap: 8px; }
.playable-demo-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(166,146,82,.28);
  background: linear-gradient(90deg, rgba(147,172,66,.06), rgba(0,0,0,.12));
}
.playable-demo-row > div:first-child > span { color: #bdd15d; font: 900 6px/1 var(--mono); letter-spacing: .13em; }
.playable-demo-row h3 { margin-top: 4px; color: #e9dec0; font: 900 13px/1.1 var(--ui); text-transform: uppercase; }
.playable-demo-row p { margin-top: 4px; color: #8f8774; font: 7px/1.25 var(--mono); }
.playable-demo-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 5px; }
.playable-demo-actions a,
.playable-demo-actions button {
  min-height: 31px;
  padding: 6px 8px;
  border: 1px solid #725d2f;
  border-radius: 2px;
  background: #211b11;
  color: #dcca83;
  font: 800 6.5px/1 var(--ui);
  letter-spacing: .05em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}
.playable-demo-actions .playable-demo-download { border-color: #b49b43; background: linear-gradient(#c7b15d, #8d7430); color: #151006; }

@media (max-width: 640px) {
  .tape-demo-sticker { left: 30px; min-width: 43px; }
  .library-demo-summary { flex-wrap: wrap; gap: 4px 8px; }
  .demo-download-section { margin: 9px 0 12px; padding: 10px; }
  .demo-download-controls { display: grid; grid-template-columns: 1fr; align-items: stretch; }
  .demo-download-primary,
  .demo-web-pre-demo { width: 100%; min-height: 44px; }
  .demo-choose-os-link,
  .demo-release-page-link { min-height: 34px; padding: 8px 0; text-align: left; }
  .demo-build-contents ul { display: grid; gap: 3px; }
  .playable-demo-row { grid-template-columns: 1fr; }
  .playable-demo-actions { justify-content: stretch; }
  .playable-demo-actions a,
  .playable-demo-actions button { flex: 1 1 100%; min-height: 44px; }
  .playable-demos-panel { padding: 12px; }
}

/* Keep optional links truly hidden; author display rules otherwise override the
   browser's default [hidden] styling in some engines. */
.demo-web-pre-demo[hidden],
.demo-release-page-link[hidden],
.game-demo-release-page[hidden] { display: none !important; }
.demo-download-heading { justify-content: flex-start !important; }

@media (pointer: coarse), (max-width: 640px) {
  #playable-demos-button { min-height: 44px !important; padding-block: 10px !important; }
}
