/* play.trentpowell.site — one stylesheet for the catalog and the game runner. */

:root {
  --bg: #0a0a0b;
  --panel: #131315;
  --line: #232327;
  --ink: #e6e0d1;
  --dim: #97907f;
  --faint: #6b6659;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #3a3a40; }

a { color: inherit; }

/* ————— catalog ————— */

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 56px 24px 40px;
}

.site-head h1 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.site-head .sub {
  margin: 0 0 36px;
  color: var(--faint);
  font-size: 13px;
}

.card {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.card:hover { border-color: #3d3d44; }

.card .thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.card h2 {
  margin: 2px 0 8px;
  font-size: 26px;
  letter-spacing: 0.02em;
}

.card p {
  margin: 0 0 16px;
  color: var(--dim);
  font-size: 14.5px;
  line-height: 1.55;
}

.card .meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tag {
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--dim);
  border: 1px solid var(--line);
  padding: 3px 8px;
}

.card .play {
  margin-left: auto;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.card:hover .play { color: #fff; }

.site-foot {
  margin-top: 44px;
  color: var(--faint);
  font-size: 12px;
}

@media (max-width: 680px) {
  .card { grid-template-columns: 1fr; }
  .wrap { padding: 36px 16px 32px; }
}

/* ————— game runner ————— */

.play-body { overflow-x: hidden; }

.stage-wrap {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

.stage {
  position: relative;
  width: min(100%, calc((100svh - 130px) * (16 / 9)));
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  background: #000;
  border: 1px solid var(--line);
}

.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  outline: none;
}

.gate {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(rgba(6, 6, 7, 0.62), rgba(6, 6, 7, 0.82)),
    url("/assets/oldtech-cover.png") center / cover no-repeat;
  transition: opacity 0.3s ease;
}

.gate.gone {
  opacity: 0;
  pointer-events: none;
}

.gate-card {
  text-align: center;
  padding: 24px;
  max-width: 560px;
}

.gate h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 5vw, 46px);
  letter-spacing: 0.08em;
}

.gate .hook {
  margin: 0 0 26px;
  color: var(--dim);
  font-size: 15px;
  line-height: 1.5;
}

.loadbar {
  width: min(340px, 70vw);
  height: 4px;
  margin: 0 auto 8px;
  background: #26262b;
}

#loadfill {
  width: 0%;
  height: 100%;
  background: var(--ink);
  transition: width 0.15s ease;
}

.loadlabel {
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--dim);
  margin-bottom: 20px;
}

#play {
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.05em;
  padding: 11px 38px;
  background: var(--ink);
  color: #0a0a0b;
  border: 0;
  cursor: pointer;
}

#play:hover:not(:disabled) { background: #fff; }

#play:disabled {
  background: #26262b;
  color: var(--faint);
  cursor: default;
}

.gate .hint {
  margin: 16px 0 0;
  color: var(--faint);
  font-size: 12px;
}

.banner {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  padding: 7px 12px;
  background: #6e1f1f;
  color: #fff;
  font-size: 12px;
}

.banner.on { display: block; }

.under {
  width: min(100%, 1200px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--faint);
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
  font-size: 12px;
}

.under .links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.under a { color: var(--faint); text-decoration: none; }
.under a:hover { color: var(--ink); }

.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--faint);
  cursor: pointer;
}

.linkish:hover { color: var(--ink); }

@media (max-width: 720px) {
  .under { flex-direction: column; align-items: flex-start; }
  .stage { width: 100%; }
  .stage-wrap { justify-content: flex-start; padding-top: 28px; }
}
