:root {
  color-scheme: dark;
  --page: #0b1016;
  --panel: #131c26;
  --panel-raised: #192633;
  --line: #314656;
  --text: #eef6fa;
  --muted: #9eb1bd;
  --cyan: #57d7e6;
  --orange: #f29a54;
  --focus: #fff0a8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; background: var(--page); color: var(--text); }

body {
  background:
    radial-gradient(circle at 80% -10%, rgb(63 146 164 / 24%), transparent 35rem),
    linear-gradient(145deg, #0b1016 0%, #0e151d 52%, #111119 100%);
}

a { color: inherit; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.site-header, .site-main, .site-footer { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  gap: 20px;
}

.brand { color: var(--text); font-weight: 800; text-decoration: none; letter-spacing: .04em; }
.brand-mark { color: var(--cyan); }
.eyebrow { color: var(--cyan); font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }

.hero { padding: clamp(44px, 9vw, 112px) 0 44px; max-width: 760px; }
.hero h1 { font-size: clamp(2.4rem, 7vw, 5.8rem); line-height: .96; margin: 14px 0 22px; letter-spacing: -.055em; }
.hero p { color: var(--muted); font-size: clamp(1rem, 2vw, 1.2rem); line-height: 1.55; max-width: 58ch; }

.games { padding-bottom: 70px; }
.games h2 { font-size: 1.1rem; letter-spacing: .08em; text-transform: uppercase; }

.game-card {
  display: grid;
  grid-template-columns: minmax(150px, 42%) 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgb(26 38 51 / 96%), rgb(15 23 31 / 96%));
  box-shadow: 0 24px 70px rgb(0 0 0 / 25%);
}

.game-cover { min-height: 220px; background: #101a24 url("ironfall-og.png") center / cover no-repeat; }
.game-copy { padding: clamp(22px, 4vw, 42px); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.game-copy h3 { margin: 0 0 10px; font-size: clamp(1.5rem, 4vw, 2.4rem); }
.game-copy p { margin: 0 0 25px; color: var(--muted); line-height: 1.5; }

.button, button, select {
  font: inherit;
  min-height: 44px;
  border-radius: 9px;
}

.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: var(--cyan);
  color: #071216;
  font-weight: 800;
  padding: 0 18px;
  text-decoration: none;
  cursor: pointer;
}

.button:hover, button:hover { background: #9cf3f7; }
.button.secondary, button.secondary { background: transparent; border-color: var(--line); color: var(--text); }
.button.secondary:hover, button.secondary:hover { border-color: var(--cyan); color: var(--cyan); }

.site-footer { padding: 24px 0 36px; color: var(--muted); font-size: .9rem; }

.game-page { overflow: hidden; height: 100dvh; overscroll-behavior: none; touch-action: manipulation; }
.game-page .site-header { min-height: 54px; }
.controls-hint { height: 24px; margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
.game-page .brand { font-size: .92rem; }
.game-shell { width: 100%; height: calc(100dvh - 78px); position: relative; background: #080d11; }
.game-shell:fullscreen { height: 100dvh; }
.game-shell iframe { display: block; width: 100%; height: 100%; border: 0; }
.game-tools { position: absolute; z-index: 2; inset: auto 12px 12px auto; display: flex; gap: 8px; }
.game-tools button { background: rgb(11 16 22 / 88%); border-color: var(--line); color: var(--text); backdrop-filter: blur(8px); }
.game-tools button[hidden] { display: none; }
.game-status { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); text-align: center; width: min(420px, calc(100% - 32px)); color: var(--muted); }
.game-status p { line-height: 1.55; }

.test-page { padding-bottom: 52px; }
.test-page .site-header { min-height: 70px; }
.test-intro { margin: 16px 0 24px; color: var(--muted); max-width: 70ch; line-height: 1.55; }
.build-picker { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 20px 0 30px; }
.build-picker label { font-weight: 700; }
select { background: var(--panel); color: var(--text); border: 1px solid var(--line); padding: 0 12px; min-width: min(100%, 340px); }
.test-status { color: var(--muted); font-size: .92rem; }
.frame-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; align-items: start; }
.test-frame { min-width: 0; margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.test-frame figcaption { font-size: .9rem; color: var(--muted); margin-bottom: 10px; }
.frame-viewport { width: 100%; overflow: hidden; border-radius: 7px; background: #06090d; position: relative; }
.frame-viewport iframe { display: block; transform-origin: top left; border: 0; background: #080d11; }

@media (max-width: 620px) {
  .site-header, .site-main, .site-footer { width: min(100% - 24px, 1120px); }
  .game-card { grid-template-columns: 1fr; }
  .game-cover { min-height: 180px; }
  .game-page .site-header { min-height: 50px; }
  .game-shell { height: calc(100dvh - 74px); }
  .game-tools { inset: auto 8px 8px auto; }
  .game-tools button { min-height: 44px; padding-inline: 12px; }
}
