/* Counterweight landing: the playable game block and the comments (js/game.js, js/comments.js).
   Same system as site.css: page tokens only, 1px var(--iron) lines, the one .btn, the one label style.
   States on #game-root: .is-loading .is-ready .is-error .is-touch */

/* ---------- game ---------- */
.game { position: relative; }
/* game.js sizes the stage to a whole number of screen pixels per game pixel (480 x 270) that fits under the nav */
.game-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 0 auto; overflow: hidden; background: var(--soot); }
.game-fs { position: absolute; inset: 0; background: var(--soot); }
.game-fs:fullscreen { width: 100vw; height: 100vh; background: #000; }
#unity-canvas { display: block; width: 100%; height: 100%; background: var(--soot); outline: none; image-rendering: pixelated; touch-action: none; }

.game-poster { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: fill; image-rendering: pixelated;
  pointer-events: none; transition: opacity .6s var(--ease), visibility 0s linear .6s; }
.game-cover { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 14px; padding: 0 16px 2.5%; cursor: pointer; text-align: center;
  background: linear-gradient(0deg, rgba(22, 20, 18, .9) 0%, rgba(22, 20, 18, .6) 10%, rgba(22, 20, 18, 0) 20%);
  transition: opacity .6s var(--ease), visibility 0s linear .6s; }
.game-cover[hidden], .game-touch[hidden], .game-warn[hidden] { display: none !important; }
.btn-play { position: absolute; left: 40.8%; top: 42%; transform: translate(-50%, -50%); min-width: 0; }
.btn-play:active { transform: translate(-50%, calc(-50% + 5px)); }
@media (max-width: 1300px) { .btn-play { min-height: 52px; padding: 0 34px; font-size: 24px; box-shadow: 0 4px 0 var(--brass-dk); } }
.game-status { margin: 0; max-width: 52ch; color: var(--ash); font-size: 15px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.game-status a { color: var(--brass); }

.game-progress { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 3px; background: var(--iron); opacity: 0; transition: opacity .3s; }
.game-progress > i { display: block; width: 0; height: 100%; background: var(--brass); transition: width .2s var(--ease); }

.game.is-loading .btn-play { display: none; }
.game.is-loading .game-cover { cursor: progress; }
.game.is-loading .game-progress { opacity: 1; }
.game.is-loading .game-status { color: var(--paper); font: 700 18px/1 var(--cond); letter-spacing: .14em; text-transform: uppercase; }
.game.is-ready .game-cover, .game.is-ready .game-poster { opacity: 0; visibility: hidden; pointer-events: none; }
.game.is-ready .game-progress { opacity: 0; }
.game.is-error .game-cover { justify-content: center; background: rgba(22, 20, 18, .92); cursor: default; }
.game.is-error .game-status { color: var(--paper); border-left: 3px solid var(--red); padding-left: 14px; text-align: left; }
.game.is-error .btn-play { display: none; }

.game-stall { position: absolute; left: 0; right: 0; bottom: 14%; z-index: 2; display: none; pointer-events: none; color: var(--ash);
  font: 700 14px/1 var(--cond); letter-spacing: .14em; text-transform: uppercase; text-align: center; }
.game-stall.is-on { display: block; }
.game-warn { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 4; display: grid; gap: 6px; pointer-events: none; }
.game-warn > div { padding: 8px 12px; background: var(--paper); color: var(--soot); font-size: 14px; line-height: 1.4; }

/* controls under the game: the same label style as everywhere */
.game-bar { display: flex; align-items: flex-start; gap: var(--s3) var(--s5); padding-top: var(--s4); border-bottom: 1px solid var(--iron); padding-bottom: var(--s4); }
.game:not(.is-ready) #game-fsbtn { visibility: hidden; }
.keys { flex: 1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s2) var(--s3); margin: 0; padding: 0; list-style: none; color: var(--ash); font-size: 15px; line-height: 1.35; }
.keys b { display: block; margin-bottom: 6px; color: var(--paper); font: 700 14px/1 var(--cond); letter-spacing: .14em; text-transform: uppercase; }
.game-note { margin: var(--s2) 0 0; color: var(--grey); font-size: 15px; }
.game .btn:focus-visible, .game-cover:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

/* phones: no Play; the picture, then the message under it */
.game.is-touch .game-cover, .game.is-touch .game-bar, .game.is-touch .game-note, .game.is-touch .game-fs, .game.is-touch .game-progress { display: none; }
.game.is-touch .game-stage { aspect-ratio: auto; height: auto !important; overflow: visible; }
.game.is-touch .game-poster { position: relative; inset: auto; height: auto; aspect-ratio: 16 / 9; opacity: .8; }
.game-touch { position: relative; z-index: 3; padding: var(--s3) var(--gut) 0; color: var(--paper); }
.game-touch p { margin: 0 0 var(--s2); max-width: 46ch; font-size: 17px; }
.game-touch .btn { width: 100%; }

/* ---------- comments ---------- */
.cmts { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: var(--s6); align-items: start; color: var(--paper); font-size: 17px; line-height: 1.55; }
.cmts-form { grid-row: 1 / span 3; position: sticky; top: 96px; display: grid; gap: 10px; margin: 0; }
.cmts-empty, .cmts-list, .cmts-more { grid-column: 2; }
.cmts-label { margin-top: 6px; color: var(--ash); font: 700 14px/1 var(--cond); letter-spacing: .14em; text-transform: uppercase; }
.cmts-label span { color: var(--grey); font: 400 14px var(--sans); letter-spacing: 0; text-transform: none; }
.cmts-form textarea, .cmts-form input:not([type=file]):not(.cmts-hp) { width: 100%; margin: 0; padding: 12px 14px; border: 1px solid var(--iron); border-radius: 0;
  background: var(--coal); color: var(--paper); font: 400 17px/1.5 var(--sans); transition: border-color .15s; }
.cmts-form textarea { min-height: 140px; resize: vertical; }
.cmts-form textarea::placeholder, .cmts-form input::placeholder { color: var(--grey); opacity: 1; }
.cmts-form textarea:hover, .cmts-form input:hover { border-color: var(--rule); }
.cmts-form textarea:focus, .cmts-form input:focus { outline: none; }
.cmts-form textarea:focus-visible, .cmts-form input:focus-visible { border-color: var(--brass); outline: 1px solid var(--brass); outline-offset: 0; }
.cmts-form.is-drop textarea { border-color: var(--brass); border-style: dashed; }
.cmts-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cmts-row { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-top: 6px; }
.cmts-hint { flex: 1 1 100%; order: 3; color: var(--grey); font-size: 14px; line-height: 1.4; }
.cmts-post { margin-left: auto; }
.cmts-status { min-height: 24px; margin: 0; color: var(--brass); font-size: 15px; }
.cmts-status:empty { min-height: 0; }
.cmts-thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.cmts-thumbs:empty { display: none; }
.cmts-t { position: relative; }
.cmts-t img { display: block; height: 72px; }
.cmts-x { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; padding: 0; border: 0; background: var(--paper); color: var(--soot);
  font: 600 15px/24px var(--sans); cursor: pointer; }
.cmts-x:hover { background: var(--brass); }
.cmts-x:focus-visible, .cmts-imgs button:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.cmts-empty { margin: 0; color: var(--grey); font-size: 16px; }
.cmts-empty[hidden] { display: none; }
.cmts-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--iron); }
.cmts-item { padding: var(--s3) 0; border-bottom: 1px solid var(--iron); }
.cmts-meta { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; color: var(--grey); font-size: 14px; }
.cmts-meta b { color: var(--paper); font: 700 18px/1 var(--cond); letter-spacing: .06em; text-transform: uppercase; overflow-wrap: anywhere; }
.cmts-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ash); font-size: 17px; line-height: 1.55; }
.cmts-imgs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.cmts-imgs button { padding: 0; border: 0; background: var(--soot); cursor: zoom-in; }
.cmts-imgs img { display: block; height: 128px; max-width: 100%; object-fit: cover; }
.cmts-more { margin-top: var(--s3); }
.cmts-more[hidden] { display: none; }
.cmts-lightbox { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(22, 20, 18, .95); cursor: zoom-out; }
.cmts-lightbox[hidden] { display: none; }
.cmts-lightbox img { max-width: 100%; max-height: 100%; }

@media (max-width: 1100px) {
  .keys { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cmts { grid-template-columns: 1fr; }
  .cmts-form { position: static; grid-row: auto; margin-bottom: var(--s5); }
  .cmts-empty, .cmts-list, .cmts-more { grid-column: 1; }
}
@media (max-width: 640px) {
  .game-bar { flex-direction: column; }
  .keys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmts, .cmts-text { font-size: 16px; }
  .cmts-row .btn { flex: 1 1 140px; }
  .cmts-post { margin-left: 0; }
  .cmts-imgs img { height: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  .game-poster, .game-cover, .game-progress, .game-progress > i { transition: none; }
}
