/* Game creator.
   Uses the workspace tokens defined in workspace.css. Surfaces are fills, never
   outlines; no shadows, rings, pill radii, decorative dots or entrance
   animation, per DESIGN.md. The source viewer keeps the interface font: a
   source viewer inside PeakFrame still follows the interface rules, and
   indentation survives because the element preserves whitespace. */

html.ui-v2 .game-creator { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

html.ui-v2 .game-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
html.ui-v2 .game-heading .pf-h1 { margin: 0; }
/* The label and its chevron are one control, on one line at every width. */
html.ui-v2 .game-creator .pf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; text-decoration: none; white-space: nowrap; flex: 0 0 auto; }
html.ui-v2 .game-creator .pf-btn:disabled { opacity: .55; }

html.ui-v2 .game-workspace { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 20px; align-items: start; }

html.ui-v2 .game-message { margin: 0; padding: 11px 14px; border-radius: 12px; background: #171c2c; color: #ccd5ff; font-size: 12px; line-height: 1.6; }

/* ------------------------------------------------------------- project list */

html.ui-v2 .game-projects { background: var(--pf-panel); border-radius: 18px; padding: 16px; position: sticky; top: 16px; min-width: 0; }
html.ui-v2 .game-projects > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding: 0 4px; }
html.ui-v2 .game-projects h2 { margin: 0; font-size: 14px; font-weight: 560; letter-spacing: -.2px; }
html.ui-v2 .game-projects > header span { color: var(--pf-dimmer); font-size: 11px; }
html.ui-v2 .game-project-list { display: flex; flex-direction: column; gap: 2px; }
html.ui-v2 .game-project {
  display: flex; flex-direction: column; gap: 3px; width: 100%; min-width: 0;
  padding: 10px 11px; border: 0; border-radius: 9px; text-align: left; cursor: pointer;
  background: transparent; color: var(--pf-dim); font-family: inherit;
}
html.ui-v2 .game-project:hover, html.ui-v2 .game-project:focus-visible { background: var(--pf-panel-2); color: var(--pf-text); outline: none; }
html.ui-v2 .game-project[aria-current="true"] { background: #1c2133; color: #ccd5ff; }
html.ui-v2 .game-project-name { font-size: 13px; font-weight: 520; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.ui-v2 .game-project-meta { font-size: 11px; color: var(--pf-dimmer); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ----------------------------------------------------------------- detail */

html.ui-v2 .game-detail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
html.ui-v2 .game-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
html.ui-v2 .game-detail-title { min-width: 0; }
html.ui-v2 .game-detail-heading h2 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -.6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.ui-v2 .game-detail-heading p { margin: 4px 0 0; color: var(--pf-dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

html.ui-v2 .game-tabs { margin: 0; flex-wrap: nowrap; gap: 6px; }
html.ui-v2 .game-tabs .pf-tab, html.ui-v2 .game-mode .pf-tab { padding: 0 14px; min-height: 34px; font-size: 12.5px; }

html.ui-v2 .game-panel { background: var(--pf-panel); border-radius: 18px; padding: 22px; min-width: 0; }
html.ui-v2 .game-panel h3 { margin: 0 0 10px; font-size: 14px; font-weight: 560; letter-spacing: -.2px; }
html.ui-v2 .game-panel h4 { margin: 0 0 6px; font-size: 12px; font-weight: 540; color: var(--pf-dim); }
html.ui-v2 .game-muted { color: var(--pf-dimmer); font-size: 12px; margin: 0; line-height: 1.6; }
html.ui-v2 .game-view { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ----------------------------------------------------------------- design */

html.ui-v2 .game-design { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
html.ui-v2 .game-design p { margin: 0 0 14px; color: var(--pf-dim); font-size: 13px; line-height: 1.65; }
html.ui-v2 .game-design section > p:last-child { margin-bottom: 0; }
html.ui-v2 .game-pitch { font-size: 16px !important; line-height: 1.55 !important; color: var(--pf-text) !important; max-width: 64ch; margin: 0 !important; letter-spacing: -.2px; }
html.ui-v2 .game-design-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
html.ui-v2 .game-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
html.ui-v2 .game-steps, html.ui-v2 .game-bullets { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 6px; color: var(--pf-dim); font-size: 13px; line-height: 1.6; }
html.ui-v2 .game-steps li::marker { color: var(--v2-accent); font-weight: 600; }
html.ui-v2 .game-bullets li::marker { color: var(--pf-dimmer); }
/* One column: a template's settings come in any count, and a two column
   grid would leave a lone item on its last row. */
html.ui-v2 .game-settings { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 460px; margin: 0; }
html.ui-v2 .game-settings > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 8px 0; font-size: 13px; min-width: 0; }
html.ui-v2 .game-settings dt { color: var(--pf-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
html.ui-v2 .game-settings dd { margin: 0; color: var(--pf-text); font-weight: 520; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
html.ui-v2 .game-brief-read blockquote { margin: 0 0 18px; padding: 12px 14px; border-radius: 12px; background: var(--pf-panel-2); color: var(--pf-text); font-size: 13px; line-height: 1.6; }
html.ui-v2 .game-brief-read h4 { margin-top: 14px; }
html.ui-v2 .game-brief-read [data-kind="contradiction"] li, html.ui-v2 .game-brief-read [data-kind="unsupported"] li { color: var(--pf-warn); }

/* --------------------------------------------------------------- new game */

html.ui-v2 .game-new { display: flex; flex-direction: column; gap: 16px; }
html.ui-v2 .game-new-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
html.ui-v2 .game-new-head h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.4px; white-space: nowrap; }
html.ui-v2 .game-mode { margin: 0; flex-wrap: nowrap; gap: 6px; }

html.ui-v2 .game-form { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
html.ui-v2 .game-form h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; letter-spacing: -.4px; }
html.ui-v2 .game-form label, html.ui-v2 .game-form legend { font-size: 12px; color: var(--pf-dim); }
html.ui-v2 .game-form > label:not(:first-child), html.ui-v2 .game-draft-fields > label:not(:first-child) { margin-top: 8px; }
html.ui-v2 .game-form input, html.ui-v2 .game-form textarea, html.ui-v2 .game-form select {
  width: 100%; min-width: 0; padding: 9px 11px; border-radius: 9px; border: 1px solid transparent;
  background: var(--pf-panel-2); color: var(--pf-text); font-family: inherit; font-size: 13px; outline: none;
}
html.ui-v2 .game-form select { min-height: 38px; }
/* The browser's spin buttons are a light box on a dark field; the keyboard
   arrows and typing still change the value. */
html.ui-v2 .game-form input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
html.ui-v2 .game-form input[type="number"]::-webkit-inner-spin-button, html.ui-v2 .game-form input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
html.ui-v2 .game-form textarea { resize: vertical; line-height: 1.6; }
html.ui-v2 .game-form-actions { display: flex; gap: 8px; margin-top: 12px; }
html.ui-v2 .game-form-problems { margin: 6px 0 0; font-size: 12px; color: var(--pf-bad); line-height: 1.6; }
html.ui-v2 .game-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

html.ui-v2 .game-templates { border: 0; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
html.ui-v2 .game-templates legend { padding: 0; margin-bottom: 8px; }
html.ui-v2 .game-template {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 10px; align-content: start;
  padding: 14px; border-radius: 12px; cursor: pointer; background: var(--pf-panel-2); margin: 0 !important;
}
html.ui-v2 .game-template:hover { background: #1d1f25; }
html.ui-v2 .game-template:has(input:checked) { background: #1c2133; }
html.ui-v2 .game-template:has(input:focus-visible) { background: #232a42; }
html.ui-v2 .game-template input { width: auto; grid-row: 1 / span 2; align-self: start; margin: 3px 0 0; accent-color: var(--v2-accent); }
html.ui-v2 .game-template-name { font-size: 13px; font-weight: 540; color: var(--pf-text); }
html.ui-v2 .game-template-summary { font-size: 12px; color: var(--pf-dim); line-height: 1.6; }

html.ui-v2 .game-draft { gap: 0; }
html.ui-v2 .game-draft-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
html.ui-v2 .game-draft-head h3 { margin: 0; font-size: 16px; }
html.ui-v2 .game-draft-head span { color: var(--pf-dimmer); font-size: 12px; white-space: nowrap; }
html.ui-v2 .game-draft-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 32px; align-items: start; }
html.ui-v2 .game-draft-fields { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
html.ui-v2 .game-params { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
html.ui-v2 .game-param { display: flex; flex-direction: column; gap: 6px; }
html.ui-v2 .game-draft-fields .game-form-actions { flex-wrap: wrap; }

/* ----------------------------------------------------------------- source */

html.ui-v2 .game-source { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; padding: 16px; }
html.ui-v2 .game-tree-wrap { min-width: 0; max-height: 620px; overflow: auto; }
html.ui-v2 .game-file-pick, html.ui-v2 .game-file-select, html.ui-v2 .game-tree-wrap .pf-dd { display: none; }
html.ui-v2 .game-tree, html.ui-v2 .game-tree ul { list-style: none; margin: 0; padding: 0; }
html.ui-v2 .game-tree-label { display: block; padding: 6px 8px 4px calc(8px + var(--depth) * 12px); font-size: 11.5px; color: var(--pf-dimmer); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.ui-v2 .game-tree-file {
  display: block; width: 100%; border: 0; background: transparent; color: var(--pf-dim); font-family: inherit; font-size: 12.5px;
  padding: 5px 8px 5px calc(8px + var(--depth) * 12px); border-radius: 7px; cursor: pointer; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html.ui-v2 .game-tree-file:hover, html.ui-v2 .game-tree-file:focus-visible { background: var(--pf-panel-2); color: var(--pf-text); outline: none; }
html.ui-v2 .game-tree-file[aria-current="true"] { background: #1c2133; color: #ccd5ff; }

html.ui-v2 .game-code { min-width: 0; display: flex; flex-direction: column; border-radius: 12px; background: #09090b; overflow: hidden; }
html.ui-v2 .game-code > .game-muted { padding: 16px; }
html.ui-v2 .game-code-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 10px 9px 14px; background: var(--pf-panel-2); min-width: 0; min-height: 52px; }
html.ui-v2 .game-code-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
html.ui-v2 .game-code-head h3 { margin: 0; font-size: 12.5px; font-weight: 540; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
html.ui-v2 .game-code-head span { color: var(--pf-dimmer); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.ui-v2 .game-code-head .pf-btn { min-height: 32px; background: var(--pf-panel-3); }
html.ui-v2 .game-edit { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
html.ui-v2 .game-edit textarea, html.ui-v2 .game-edit input {
  width: 100%; min-width: 0; border: 1px solid transparent; border-radius: 9px; background: var(--pf-panel-2); color: var(--pf-text);
  font-family: inherit; font-size: 12px; padding: 10px 12px; outline: none;
}
html.ui-v2 .game-edit textarea { min-height: 440px; line-height: 1.7; tab-size: 2; white-space: pre; resize: vertical; }
html.ui-v2 .game-edit .game-form-actions { margin-top: 4px; }
html.ui-v2 .game-code-body { display: grid; grid-template-columns: auto minmax(0, 1fr); max-height: 580px; overflow: auto; outline: none; }
html.ui-v2 .game-code-body:focus-visible { background: #0d0e12; }
html.ui-v2 .game-gutter, html.ui-v2 .game-lines { margin: 0; padding: 14px 0; font-family: inherit; font-size: 12px; line-height: 1.7; tab-size: 2; white-space: pre; }
html.ui-v2 .game-gutter { padding: 14px 12px 14px 14px; color: var(--pf-dimmer); text-align: right; user-select: none; position: sticky; left: 0; background: #09090b; }
html.ui-v2 .game-lines { padding-right: 18px; color: var(--pf-text); }

/* ---------------------------------------------------------------- history */

html.ui-v2 .game-history { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; padding: 16px; }
html.ui-v2 .game-revisions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; max-height: 620px; overflow: auto; }
html.ui-v2 .game-revision {
  display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 10px 11px; border: 0; border-radius: 9px;
  background: transparent; color: var(--pf-text); font-family: inherit; text-align: left; cursor: pointer; min-width: 0;
}
html.ui-v2 .game-revision:hover, html.ui-v2 .game-revision:focus-visible { background: var(--pf-panel-2); outline: none; }
html.ui-v2 .game-revision[aria-current="true"] { background: #1c2133; }
html.ui-v2 .game-revision-author { font-size: 12.5px; font-weight: 520; }
html.ui-v2 .game-revision-note { font-size: 12px; color: var(--pf-dim); line-height: 1.5; }
html.ui-v2 .game-revision-meta { font-size: 11px; color: var(--pf-dimmer); }

html.ui-v2 .game-diff { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
html.ui-v2 .game-diff > .game-muted { padding: 10px 0; }
html.ui-v2 .game-diff-summary { margin: 4px 0 2px; font-size: 13px; color: var(--pf-dim); }
html.ui-v2 .game-diff-file { border-radius: 12px; background: #09090b; overflow: hidden; }
html.ui-v2 .game-diff-file summary { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 10px 14px; background: var(--pf-panel-2); cursor: pointer; list-style: none; font-size: 12.5px; min-width: 0; }
html.ui-v2 .game-diff-file summary::-webkit-details-marker { display: none; }
html.ui-v2 .game-diff-file summary:focus-visible { background: #232a42; outline: none; }
html.ui-v2 .game-diff-path { font-weight: 540; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
html.ui-v2 .game-diff-counts { color: var(--pf-dimmer); font-size: 11.5px; white-space: nowrap; }
html.ui-v2 .game-hunk { overflow-x: auto; padding: 6px 0; font-size: 12px; line-height: 1.7; }
html.ui-v2 .game-hunk + .game-hunk { border-top: 1px solid var(--pf-line); }
html.ui-v2 .game-hunk-line { display: grid; grid-template-columns: 40px 40px max-content; min-width: 100%; width: max-content; }
html.ui-v2 .game-hunk-n { color: var(--pf-dimmer); text-align: right; padding-right: 10px; user-select: none; }
html.ui-v2 .game-hunk-t { white-space: pre; tab-size: 2; padding: 0 16px 0 8px; color: var(--pf-dim); }
html.ui-v2 .game-hunk-line[data-op="add"] { background: rgba(126, 196, 140, .1); }
html.ui-v2 .game-hunk-line[data-op="add"] .game-hunk-t { color: #cfe8c4; }
html.ui-v2 .game-hunk-line[data-op="del"] { background: rgba(228, 162, 131, .1); }
html.ui-v2 .game-hunk-line[data-op="del"] .game-hunk-t { color: #f0c6b2; }

/* ------------------------------------------------------------------ build */

html.ui-v2 .game-build { display: flex; flex-direction: column; gap: 16px; }
html.ui-v2 .game-build-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
html.ui-v2 .game-build-head h3 { margin-bottom: 5px; }
html.ui-v2 .game-build-head p { margin: 0; color: var(--pf-dim); font-size: 12.5px; line-height: 1.6; max-width: 62ch; }
html.ui-v2 .game-build[data-state="succeeded"] { background: #0f1411; }
html.ui-v2 .game-build[data-state="failed"] { background: #16100e; }
html.ui-v2 .game-facts { display: flex; gap: 24px; margin: 0; font-size: 12px; flex: 0 0 auto; }
html.ui-v2 .game-facts dt { color: var(--pf-dimmer); margin-bottom: 3px; }
html.ui-v2 .game-facts dd { margin: 0; color: var(--pf-text); white-space: nowrap; }

html.ui-v2 .game-progress { height: 6px; border-radius: 3px; background: var(--pf-panel-3); overflow: hidden; }
html.ui-v2 .game-progress > span { display: block; height: 100%; background: var(--v2-accent); border-radius: inherit; transition: width .2s ease; }
html.ui-v2 .game-build[data-state="succeeded"] .game-progress > span { background: var(--pf-good); }
html.ui-v2 .game-build[data-state="failed"] .game-progress > span { background: var(--pf-bad); }
@media (prefers-reduced-motion: reduce) { html.ui-v2 .game-progress > span { transition: none; } }

html.ui-v2 .game-stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 20px; }
html.ui-v2 .game-stages li { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 7px 0; font-size: 12px; min-width: 0; }
html.ui-v2 .game-stages li > span:first-child { font-weight: 520; white-space: nowrap; }
html.ui-v2 .game-stages li > span:last-child { color: var(--pf-dimmer); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.ui-v2 .game-stages li[data-status="failed"] { color: var(--pf-bad); }
html.ui-v2 .game-stages li[data-status="skipped"] > span:first-child { color: var(--pf-dim); }
html.ui-v2 .game-build-error { margin: 0; font-size: 12.5px; color: var(--pf-bad); line-height: 1.6; }

html.ui-v2 .game-findings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
html.ui-v2 .game-findings li { display: flex; flex-direction: column; gap: 3px; padding: 9px 12px; border-radius: 9px; background: var(--pf-panel-2); min-width: 0; }
html.ui-v2 .game-findings li[data-severity="error"] { background: #241814; }
html.ui-v2 .game-finding-where { font-size: 11px; color: var(--pf-dimmer); overflow-wrap: anywhere; }
html.ui-v2 .game-findings li[data-severity="error"] .game-finding-where { color: var(--pf-bad); }
html.ui-v2 .game-finding-text { font-size: 12px; line-height: 1.6; }

html.ui-v2 .game-downloads { display: grid; grid-template-columns: repeat(2, max-content); gap: 8px; }

html.ui-v2 .game-playtests-panel { display: flex; flex-direction: column; gap: 12px; }
html.ui-v2 .game-playtests-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
html.ui-v2 .game-playtests-head h3 { margin: 0; }
html.ui-v2 .game-unplayed { margin: 0; font-size: 12.5px; color: var(--pf-dim); }
html.ui-v2 .game-playtests { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
html.ui-v2 .game-playtests li { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 9px; background: var(--pf-panel-2); }
html.ui-v2 .game-playtest-kind { font-size: 12px; font-weight: 520; }
html.ui-v2 .game-playtest-text { font-size: 12px; color: var(--pf-dim); line-height: 1.6; }

/* ------------------------------------------------------------------ empty */

html.ui-v2 .game-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 28px; background: var(--pf-panel); border-radius: 18px; }
html.ui-v2 .game-empty h2 { margin: 6px 0 0; font-size: 19px; font-weight: 600; letter-spacing: -.4px; text-wrap: balance; }
html.ui-v2 .game-empty p { margin: 0; color: var(--pf-dim); font-size: 13px; line-height: 1.65; max-width: 58ch; text-wrap: pretty; }
html.ui-v2 .game-empty .pf-object { width: 56px; height: 56px; }
html.ui-v2 .game-empty .pf-btn { margin-top: 6px; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 1180px) {
  html.ui-v2 .game-workspace { grid-template-columns: minmax(0, 1fr); }
  html.ui-v2 .game-projects { position: static; padding: 12px; }
  html.ui-v2 .game-project-list { flex-direction: row; overflow-x: auto; gap: 4px; }
  html.ui-v2 .game-project { width: 200px; flex: 0 0 200px; }
  html.ui-v2 .game-draft-grid { grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
}

@media (max-width: 860px) {
  html.ui-v2 .game-draft-grid { grid-template-columns: minmax(0, 1fr); }
  html.ui-v2 .game-source, html.ui-v2 .game-history { grid-template-columns: minmax(0, 1fr); }
  html.ui-v2 .game-tree { display: none; }
  html.ui-v2 .game-tree-wrap { max-height: none; overflow: visible; display: flex; flex-direction: column; gap: 6px; }
  html.ui-v2 .game-file-pick { display: block; font-size: 12px; color: var(--pf-dim); }
  html.ui-v2 .game-tree-wrap .pf-dd { display: flex; width: 100%; min-width: 0 !important; }
  html.ui-v2 .game-tree-wrap .pf-dd .game-file-select { display: flex; width: 100%; }
  html.ui-v2 .game-tree-wrap select.game-file-select { display: block; width: 100%; }
  html.ui-v2 .game-revisions { max-height: 260px; }
  html.ui-v2 .game-templates { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  html.ui-v2 .game-panel { padding: 16px; border-radius: 14px; }
  html.ui-v2 .game-source, html.ui-v2 .game-history { padding: 12px; }
  html.ui-v2 .game-detail-heading h2 { font-size: 18px; }
  html.ui-v2 .game-design-pair, html.ui-v2 .game-controls, html.ui-v2 .game-settings, html.ui-v2 .game-stages { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  html.ui-v2 .game-settings, html.ui-v2 .game-stages { gap: 0; }
  html.ui-v2 .game-build-head { flex-direction: column; gap: 12px; }
  html.ui-v2 .game-downloads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.ui-v2 .game-downloads .pf-btn { padding: 0 8px; }
  html.ui-v2 .game-new-head { flex-direction: column; align-items: flex-start; gap: 12px; }
    html.ui-v2 .game-empty { padding: 20px; }
  html.ui-v2 .game-tabs, html.ui-v2 .game-mode { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
  html.ui-v2 .game-tabs .pf-tab, html.ui-v2 .game-mode .pf-tab { padding: 0 6px; justify-content: center; text-align: center; }
  html.ui-v2 .game-form-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  html.ui-v2 .game-form-actions .pf-btn { padding: 0 8px; }
  html.ui-v2 .game-draft-fields .game-form-actions { flex-wrap: nowrap; }
}
