/* ==========================================================================
   Court Theme Style & Design Tokens
   Pure Native CSS | Zero External Dependencies | Zero CLS | Mobile First
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens (CSS Variables)
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette */
  --gf-bg-base: #0f172a;
  --gf-bg-surface: #131c31;
  --gf-bg-elevated: #1e293b;
  --gf-bg-glass: rgba(15, 23, 42, 0.88);

  --gf-text-main: #e2e8f0;
  --gf-text-muted: #94a3b8;
  --gf-text-dim: #94a3b8;

  --gf-primary: #047457;
  --gf-primary-hover: #047457;
  --gf-primary-text: #e2e8f0;

  --gf-accent: #38bdf8;
  --gf-accent-glow: rgba(56, 189, 248, 0.25);
  --gf-highlight: #38bdf8;

  --gf-border-subtle: #334155;
  --gf-border-strong: #334155;

  /* Typography Stack */
  --gf-font-sans: "Inter", system-ui, sans-serif;
  --gf-font-mono: monospace;

  /* Geometry & Elevation */
  --gf-radius-sm: 4px;
  --gf-radius-md: 8px;
  --gf-radius-lg: 12px;

  --gf-shadow-player: 0 12px 32px -4px rgba(0, 0, 0, 0.6);
  --gf-shadow-btn: 0 4px 14px rgba(4, 120, 87, 0.35);

  /* Container Constraints */
  --gf-sand-bg: #0f172a;
  --gf-sand-stage: #0f172a;

  --gf-max-width: 1040px;
  --gf-content-width: 740px;
}

/* --------------------------------------------------------------------------
   2. Reset & Base Layout
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--gf-font-sans);
  background-color: var(--gf-bg-base);
  color: var(--gf-text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--gf-font-sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
}

a {
  color: var(--gf-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  text-decoration: underline;
}

.gf-container {
  width: 100%;
  max-width: var(--gf-max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* --------------------------------------------------------------------------
   3. Header Navigation (Compact Above-The-Fold: 52px)
   -------------------------------------------------------------------------- */
.gf-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 52px;
  background: var(--gf-bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gf-border-subtle);
}

.gf-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.gf-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gf-text-main);
  font-weight: 700;
  font-size: 16px;
}
.gf-brand-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gf-nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.gf-nav-link {
  color: var(--gf-text-muted);
  padding: 4px 8px;
  border-radius: var(--gf-radius-sm);
}
.gf-nav-link:hover {
  color: var(--gf-text-main);
  background: var(--gf-bg-surface);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   4. Title Area (Minimal Vertical Margin)
   -------------------------------------------------------------------------- */
.gf-title-section {
  padding: 12px 0 8px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.gf-game-h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gf-text-main);
  line-height: 1.25;
}

.gf-category-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--gf-bg-elevated);
  color: var(--gf-accent);
  padding: 2px 8px;
  border-radius: var(--gf-radius-sm);
  border: 1px solid var(--gf-border-subtle);
}

/* --------------------------------------------------------------------------
   5. this site Player Stage & Three-State Engine (Zero Layout Shift)
   -------------------------------------------------------------------------- */
.gf-player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #0a0f1d;
  border-radius: var(--gf-radius-lg);
  border: 1px solid var(--gf-border-subtle);
  box-shadow: var(--gf-shadow-player);
  overflow: hidden;
  margin-bottom: 12px;
}

/* State 1: Cover Layer & Play Button */
.gf-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 0.3s ease;
}

/* The engine toggles the cover and loading layers with the `hidden` attribute.
   Both carry an explicit display value, which beats the UA [hidden] default,
   so without these rules the layers stay painted and the loading overlay sits
   above the cover and swallows the play click. */
.gf-cover[hidden] {
  display: none;
}

.gf-cover-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.4) 0%, rgba(15, 23, 42, 0.85) 100%);
  pointer-events: none;
}

.gf-play-btn {
  position: relative;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 200px;
  height: 52px;
  padding: 0 28px;
  background: var(--gf-primary);
  color: var(--gf-primary-text);
  font-family: var(--gf-font-sans);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: none;
  border-radius: var(--gf-radius-md);
  box-shadow: var(--gf-shadow-btn);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, box-shadow 0.2s ease;
  animation: gf-btn-pulse 2.2s infinite ease-in-out;
}

.gf-play-btn:hover {
  background: var(--gf-primary-hover);
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
  animation: none;
}

.gf-play-btn:active {
  transform: scale(0.98);
}

@keyframes gf-btn-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 12px rgba(16, 185, 129, 0);
  }
}

/* State 2: CSS-Only Kinetic Physics Loading Screen */
.gf-loading {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--gf-bg-base);
  gap: 16px;
}

.gf-loading[hidden] {
  display: none;
}

/* Once the engine marks the station as playing, the loader must never paint
   again, even if a later script toggles the attribute off. */
[data-gf-playing] .gf-loading {
  display: none;
}

/* Kinetic Cradle Animation: 4 Balls */
.gf-kinetic-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
}

.gf-ball {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gf-accent);
  box-shadow: 0 0 10px var(--gf-accent-glow);
}

.gf-ball-1 {
  animation: gf-kinetic-left 1.2s infinite ease-in-out;
  transform-origin: top center;
}

.gf-ball-2, .gf-ball-3 {
  animation: gf-kinetic-middle 1.2s infinite ease-in-out;
}

.gf-ball-4 {
  animation: gf-kinetic-right 1.2s infinite ease-in-out;
  transform-origin: top center;
}

@keyframes gf-kinetic-left {
  0% { transform: rotate(0deg) translateX(0); }
  25% { transform: rotate(45deg) translateX(-18px); }
  50% { transform: rotate(0deg) translateX(0); }
  100% { transform: rotate(0deg) translateX(0); }
}

@keyframes gf-kinetic-middle {
  0%, 45%, 55%, 100% { transform: scale(1); }
  50% { transform: scale(0.92); }
}

@keyframes gf-kinetic-right {
  0% { transform: rotate(0deg) translateX(0); }
  50% { transform: rotate(0deg) translateX(0); }
  75% { transform: rotate(-45deg) translateX(18px); }
  100% { transform: rotate(0deg) translateX(0); }
}

.gf-loading-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--gf-text-muted);
  letter-spacing: 0.3px;
}

/* State 3: Game Iframe Frame */
.gf-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 30;
  background-color: #000;
}

/* --------------------------------------------------------------------------
   6. Player Toolbar (Like / Share / Fullscreen)
   -------------------------------------------------------------------------- */
.gf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gf-bg-surface);
  border: 1px solid var(--gf-border-subtle);
  border-radius: var(--gf-radius-md);
  padding: 6px 12px;
  margin-bottom: 24px;
}

.gf-toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gf-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  background: var(--gf-bg-elevated);
  border: 1px solid var(--gf-border-subtle);
  border-radius: var(--gf-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.gf-tool-btn:hover {
  color: var(--gf-text-main);
  border-color: var(--gf-border-strong);
}

.gf-tool-btn[data-active="true"], .gf-tool-btn:active {
  color: var(--gf-highlight);
  border-color: var(--gf-highlight);
}

/* --------------------------------------------------------------------------
   7. Main Content & Long-form Article Section (Max-Width: 740px)
   -------------------------------------------------------------------------- */
.gf-content-wrapper {
  max-width: var(--gf-content-width);
  margin: 0 auto;
  padding-bottom: 48px;
}

.gf-section {
  margin-bottom: 32px;
}

.gf-section-h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gf-text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gf-section-h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--gf-accent);
  border-radius: 2px;
}

.gf-prose p {
  color: var(--gf-text-muted);
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 14px;
}

/* Visual Keycaps Table */
.gf-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.gf-control-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--gf-bg-surface);
  border: 1px solid var(--gf-border-subtle);
  border-radius: var(--gf-radius-md);
}

.gf-action-label {
  font-size: 13px;
  color: var(--gf-text-muted);
  font-weight: 500;
}

.gf-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--gf-font-mono);
  font-size: 12px;
  font-weight: 600;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  background: var(--gf-bg-elevated);
  color: var(--gf-accent);
  border: 1px solid var(--gf-border-strong);
  border-radius: var(--gf-radius-sm);
  box-shadow: 0 2px 0 var(--gf-border-strong);
}

/* FAQ Accordion Details */
.gf-faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gf-faq-item {
  background: var(--gf-bg-surface);
  border: 1px solid var(--gf-border-subtle);
  border-radius: var(--gf-radius-md);
  overflow: hidden;
}

.gf-faq-summary {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gf-text-main);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gf-faq-summary::-webkit-details-marker {
  display: none;
}

.gf-faq-summary::after {
  content: "+";
  font-size: 16px;
  color: var(--gf-text-muted);
  transition: transform 0.2s ease;
}

.gf-faq-item[open] .gf-faq-summary::after {
  content: "−";
  color: var(--gf-accent);
}

.gf-faq-body {
  padding: 0 16px 14px 16px;
  font-size: 14px;
  color: var(--gf-text-muted);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   8. Comments Area (Clean this site Slot)
   -------------------------------------------------------------------------- */
.gf-comments-container {
  background: var(--gf-bg-surface);
  border: 1px solid var(--gf-border-subtle);
  border-radius: var(--gf-radius-lg);
  padding: 20px;
  margin-top: 16px;
}

.gf-comment-empty {
  text-align: center;
  padding: 24px 0;
  color: var(--gf-text-dim);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   9. Footer
   -------------------------------------------------------------------------- */
.gf-footer {
  margin-top: auto;
  border-top: 1px solid var(--gf-border-subtle);
  background: #0b1120;
  padding: 24px 0;
  font-size: 12px;
  color: var(--gf-text-muted);
}

.gf-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.gf-footer-links {
  display: flex;
  gap: 16px;
}
.gf-footer-links a {
  color: var(--gf-text-muted);
}

/* --------------------------------------------------------------------------
   10. Mobile First Adaptations (< 640px)
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .gf-container {
    padding: 0 12px;
  }

  .gf-player-stage {
    border-radius: 0;
    margin-left: -12px;
    margin-right: -12px;
    width: calc(100% + 24px);
  }

  .gf-play-btn {
    min-width: 170px;
    height: 48px;
    font-size: 15px;
    padding: 0 20px;
  }

  .gf-tool-btn {
    min-height: 44px; /* Touch friendly minimum */
    padding: 0 10px;
  }

  .gf-game-h1 {
    font-size: 18px;
  }
}

/* ==========================================================================
   12. Supplement — components required by the engine theme templates
   (skip link, brand name, comment system hooks, legal/404, buttons)
   All values derive from the tokens declared in section 1.
   ========================================================================== */

.gf-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--gf-bg-elevated);
  color: var(--gf-text-main);
  border-radius: var(--gf-radius-sm);
}
.gf-skip:focus {
  left: 12px;
  top: 12px;
}

.gf-brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--gf-text-main);
}

.gf-play-icon {
  font-size: 13px;
  line-height: 1;
}

.gf-tool-msg {
  font-size: 12px;
  color: var(--gf-primary);
  min-height: 1em;
}

/* --- Comment system ------------------------------------------------------ */
.gf-comment-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  margin-bottom: 24px;
  background: var(--gf-bg-surface);
  border: 1px solid var(--gf-border-subtle);
  border-radius: var(--gf-radius-md);
}

.gf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gf-field-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--gf-text-muted);
}

.gf-field-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--gf-text-dim);
}

.gf-input {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--gf-font-sans);
  font-size: 14px;
  color: var(--gf-text-main);
  background: var(--gf-bg-base);
  border: 1px solid var(--gf-border-strong);
  border-radius: var(--gf-radius-sm);
}
.gf-input:focus {
  outline: 2px solid var(--gf-accent);
  outline-offset: 1px;
}

.gf-textarea {
  resize: vertical;
  min-height: 84px;
}

.gf-comment-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.gf-comment-msg {
  font-size: 12px;
  color: var(--gf-text-muted);
}

.gf-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  font-family: var(--gf-font-sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--gf-primary-text);
  background: var(--gf-primary);
  border: none;
  border-radius: var(--gf-radius-md);
  cursor: pointer;
}
.gf-btn-primary:hover {
  background: var(--gf-primary-hover);
}

.gf-comments-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gf-comment {
  padding: 14px 16px;
  background: var(--gf-bg-surface);
  border: 1px solid var(--gf-border-subtle);
  border-radius: var(--gf-radius-md);
}

.gf-comment--reply {
  background: var(--gf-bg-base);
  border-color: var(--gf-border-subtle);
}

.gf-comment-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.gf-comment-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--gf-text-main);
}

.gf-comment-owner {
  display: none;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  color: var(--gf-bg-base);
  background: var(--gf-accent);
  border-radius: 999px;
}
.gf-comment[data-gf-owner] .gf-comment-owner,
.gf-comment [data-gf-c-owner]:not(:empty) {
  display: inline-block;
}

.gf-comment-time {
  font-size: 12px;
  color: var(--gf-text-dim);
}

.gf-comment-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--gf-text-muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gf-comment-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.gf-comment-reply {
  font-family: var(--gf-font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--gf-accent);
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
}

.gf-comment-to {
  font-size: 12px;
  color: var(--gf-text-dim);
}

.gf-comment-replies {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding-left: 16px;
  border-left: 2px solid var(--gf-border-subtle);
}
.gf-comment-replies:empty {
  display: none;
}

.gf-comment-replying-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: #cbd5e1;
  background: var(--gf-bg-elevated);
  border-radius: var(--gf-radius-sm);
}
.gf-comment-replying-bar[hidden] {
  display: none;
}

/* --- Legal / 404 --------------------------------------------------------- */
.gf-legal-updated {
  margin: 6px 0 20px;
  font-size: 12px;
  color: var(--gf-text-dim);
}

.gf-page-body h2,
.gf-legal h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gf-text-main);
  margin: 22px 0 8px;
}

.gf-page-body ul,
.gf-legal ul {
  margin: 0 0 14px 18px;
  color: var(--gf-text-muted);
  font-size: 15px;
  line-height: 1.65;
}

.gf-notfound .gf-btn-primary {
  margin-top: 8px;
  text-decoration: none;
}

/* --- Footer meta --------------------------------------------------------- */
.gf-footer-brand {
  font-size: 13px;
  font-weight: 700;
  color: var(--gf-text-main);
}

.gf-footer-note,
.gf-footer-copy {
  font-size: 12px;
  color: var(--gf-text-dim);
}

/* ==========================================================================
   13. Comparison-page blocks (learned from the showcase sites)
   Lead paragraph, comparison table, dated check line, disclaimer, fallback.
   ========================================================================== */

.gf-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.gf-lead {
  margin: 4px 0 20px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--gf-text-main);
}

.gf-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--gf-border-subtle);
  border-radius: var(--gf-radius-md);
}

.gf-compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 420px;
}

.gf-compare thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #cbd5e1;
  background: var(--gf-bg-elevated);
  border-bottom: 1px solid var(--gf-border-subtle);
  white-space: nowrap;
}

.gf-compare tbody th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--gf-text-main);
  border-bottom: 1px solid var(--gf-border-subtle);
  white-space: nowrap;
}

.gf-compare tbody td {
  padding: 10px 12px;
  color: var(--gf-text-muted);
  border-bottom: 1px solid var(--gf-border-subtle);
  vertical-align: top;
}

.gf-compare tbody tr:last-child th,
.gf-compare tbody tr:last-child td {
  border-bottom: none;
}

.gf-checked {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--gf-text-dim);
}

.gf-disclaimer {
  margin: 8px 0 28px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--gf-text-muted);
  background: var(--gf-bg-surface);
  border-left: 3px solid var(--gf-border-strong);
  border-radius: var(--gf-radius-sm);
}

.gf-fallback {
  margin: 0 0 22px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--gf-text-muted);
}
.gf-fallback a {
  color: var(--gf-accent);
  text-decoration: underline;
}

/* ==========================================================================
   14. Self-built game: falling sand (pages containing #gf-sand only)
   Everything is scoped under .gf-sand so the stylesheet stays safe to load
   on every page of the site.
   ========================================================================== */

body.gf-bare {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--gf-sand-bg);
}

.gf-sand {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--gf-sand-bg);
  color: var(--gf-text-main);
  font-family: var(--gf-font-sans);
  z-index: 1;
}

.gf-sand-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--gf-sand-stage);
}

#gf-sand-view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  touch-action: none;
  cursor: crosshair;
}

.gf-sand-hint {
  position: absolute;
  left: 10px;
  top: 8px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--gf-text-muted);
  background: rgba(7, 11, 22, 0.72);
  border-radius: 6px;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.gf-sand-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  background: var(--gf-bg-surface);
  border-top: 1px solid var(--gf-border-subtle);
}

.gf-sand-el {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--gf-text-main);
  background: var(--gf-bg-elevated);
  border: 1px solid var(--gf-border-subtle);
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.gf-sand-el[aria-pressed="true"] {
  border-color: var(--gf-accent);
  color: var(--gf-accent);
  box-shadow: 0 0 0 1px var(--gf-accent) inset;
}

.gf-sand-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.gf-sand-dot--empty {
  background: var(--gf-bg-base);
  border: 1px solid var(--gf-border-subtle);
}

.gf-sand-sep {
  width: 1px;
  height: 24px;
  background: var(--gf-border-subtle);
  margin: 0 2px;
}

@media (max-width: 520px) {
  .gf-sand-el { height: 34px; padding: 0 8px; font-size: 12px; }
  .gf-sand-hint { display: none; }
}

/* ==========================================================================
   15. Info-site blocks: quick facts, bullet lists, link cards
   ========================================================================== */

.gf-article {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 0 40px;
}

.gf-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  margin: 4px 0 24px;
  background: var(--gf-border-subtle);
  border: 1px solid var(--gf-border-subtle);
  border-radius: var(--gf-radius-md);
  overflow: hidden;
}

.gf-fact {
  padding: 12px 14px;
  background: var(--gf-bg-surface);
}

.gf-fact dt {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #cbd5e1;
}

.gf-fact dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--gf-text-main);
}

.gf-list {
  margin: 0 0 8px;
  padding-left: 20px;
}

.gf-list li {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--gf-text-muted);
}

.gf-linkgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.gf-linkcard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  text-decoration: none;
  background: var(--gf-bg-surface);
  border: 1px solid var(--gf-border-subtle);
  border-radius: var(--gf-radius-md);
}

.gf-linkcard:hover {
  border-color: var(--gf-accent);
}

.gf-linkcard-t {
  font-size: 15px;
  font-weight: 700;
  color: var(--gf-text-main);
}

.gf-linkcard-n {
  font-size: 13px;
  line-height: 1.5;
  color: var(--gf-text-muted);
}

/* ==========================================================================
   16. Self-built rally game (pages containing the rally canvas only)
   ========================================================================== */

.gf-rally {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--gf-sand-bg);
}

.gf-rally-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--gf-sand-bg);
}

#gf-rally-view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: pointer;
}

.gf-rally-hud {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gf-text-main);
  background: rgba(11, 18, 32, 0.72);
  border-radius: 999px;
}

.gf-rally-hud b {
  color: var(--gf-accent);
  font-size: 15px;
}

.gf-rally-msg {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gf-text-main);
  background: rgba(15, 118, 110, 0.9);
  border-radius: 8px;
  white-space: nowrap;
}

.gf-rally-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: var(--gf-bg-surface);
  border-top: 1px solid var(--gf-border-subtle);
}

.gf-rally-btn {
  min-width: 56px;
  height: 44px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--gf-text-main);
  background: var(--gf-bg-elevated);
  border: 1px solid var(--gf-border-subtle);
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

.gf-rally-btn:active {
  border-color: var(--gf-accent);
  color: var(--gf-accent);
}

.gf-rally-sep {
  width: 1px;
  height: 26px;
  background: var(--gf-border-subtle);
}

/* CTA to the official store (outbound link, deliberately prominent) */
.gf-cta { margin: 22px 0 6px; }
.gf-btn-steam {
  display: inline-block;
  padding: 12px 22px;
  min-height: 44px;
  border-radius: 8px;
  background: var(--gf-primary);
  color: var(--gf-bg);
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
}
.gf-btn-steam:hover { background: var(--gf-primary-hover); }

/* 首页把自制小游戏放到正文之后，先给事实 */
.gf-play-block { margin: 28px 0 8px; }
.gf-play-cap { margin: 0 0 12px; font-size: 14px; color: var(--gf-text-muted); }
.gf-play-cap a { color: var(--gf-accent); }

/* --- Mobile navigation and first-screen order (< 768px) ------------------- */
.gf-menu { display: none; }

@media (max-width: 767px) {
  .gf-nav-links { display: none; }

  .gf-menu {
    display: block;
    position: relative;
    margin-left: auto;
  }
  .gf-menu-btn {
    list-style: none;
    cursor: pointer;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gf-text-main);
    background: var(--gf-bg-surface);
    border: 1px solid var(--gf-border-subtle);
    border-radius: var(--gf-radius-sm);
    white-space: nowrap;
  }
  .gf-menu-btn::-webkit-details-marker { display: none; }
  .gf-menu[open] .gf-menu-btn { border-color: var(--gf-primary); }

  .gf-menu-links {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 60;
    display: flex;
    flex-direction: column;
    min-width: 190px;
    padding: 6px;
    background: var(--gf-bg-elevated);
    border: 1px solid var(--gf-border-subtle);
    border-radius: var(--gf-radius-md);
  }
  .gf-menu-links a {
    padding: 11px 12px;
    font-size: 14px;
    color: var(--gf-text-main);
    white-space: nowrap;
    border-radius: var(--gf-radius-sm);
  }
  .gf-menu-links a:hover { background: var(--gf-bg-surface); text-decoration: none; }

  .gf-brand-name { font-size: 14px; white-space: nowrap; }

  /* 信息块压成两列，试玩框提到首屏 */
  .gf-article { display: flex; flex-direction: column; }
  .gf-article > * { order: 6; }
  .gf-game-h1 { order: 1; }
  .gf-lead { order: 2; }
  .gf-play-block { order: 3; margin: 14px 0 18px; }
  .gf-facts { order: 4; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gf-cta { order: 5; }
  .gf-fact { padding: 10px 12px; }
  .gf-fact dd { font-size: 14px; }
}


/* Refinements from the 2026-11-19 design review: long-form rhythm, data cards, mobile first screen. */
.gf-prose p, .gf-list li, .gf-faq-body p { font-size: 16px; line-height: 1.6; }
.gf-prose p { max-width: 68ch; }
.gf-section-h2 { margin-top: 2.5rem; }
.gf-nav-links { display: flex; gap: 2px; }
.gf-nav-link { padding: 0 12px; }
.gf-facts dt { font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; }
.gf-fact dd { font-variant-numeric: tabular-nums; }
.gf-compare th { font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; }
.gf-compare td, .gf-compare th { padding: 14px 16px; }
@media (max-width: 768px) {
  .gf-nav-links { display: none; }
  .gf-game-h1 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.01em; }
  .gf-lead { font-size: .95rem; line-height: 1.55; }
  .gf-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gf-fact { padding: 10px 12px; }
  .gf-fact dd { font-size: 1.05rem; }
  .gf-play-block { margin: 0 16px; }
  .gf-play-block .gf-player, .gf-play-block canvas, .gf-play-block iframe { min-height: 300px; }
  .gf-cta { display: grid; gap: 8px; }
  .gf-cta .gf-btn-steam { width: 100%; text-align: center; }
  .gf-section-h2 { margin-top: 2rem; }
  .gf-section { margin-block: 32px; }
}


/* Second pass from the 2026-11-19 design review: force mobile type scale, calm the secondary links, make the Menu control look clickable. */
.gf-play-cap a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.gf-menu-btn { border: 1px solid currentColor; border-radius: 6px; padding: 6px 12px; line-height: 1.2; }
@media (max-width: 768px) {
  .gf-article .gf-game-h1 { font-size: 1.45rem !important; line-height: 1.25 !important; }
  .gf-article .gf-lead { font-size: .95rem !important; line-height: 1.6 !important; }
  .gf-article .gf-facts { margin-block: 16px 20px; }
  .gf-article .gf-play-block { margin-block: 24px 8px; }
}


/* Web font: the review found body copy falling back to a system serif because no webfont was loaded. */
body, button, input, select, textarea { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
h1, h2, h3, h4, h5, h6, .gf-game-h1, .gf-section-h2, .gf-brand-name, .gf-nav-link, .gf-facts dd, .gf-btn-steam { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.gf-facts dd, .gf-fact dd, .gf-compare td { font-variant-numeric: tabular-nums; }
@media (max-width: 768px) {
  h1.gf-game-h1, .gf-article h1.gf-game-h1, .gf-article .gf-game-h1 { font-size: 24px !important; line-height: 1.3 !important; }
  .gf-article .gf-facts { order: -1; }
  .gf-menu-btn { border: 0; padding: 8px 4px; }
}


/* Third pass on the 2026-11-19 review: give the player an edge so it stops reading as an empty black hole, and open up long-form rhythm. */
.gf-play-block { border: 1px solid var(--gf-border-subtle); border-radius: var(--gf-radius-lg); padding: 12px; }
.gf-play-cap { margin-bottom: 10px; }
.gf-prose p { line-height: 1.7; margin-bottom: 1.1em; }
.gf-prose p:last-child { margin-bottom: 0; }
.gf-list { padding-left: 1.5em; }
.gf-list li { margin-bottom: 8px; }
.gf-list li:last-child { margin-bottom: 0; }


/* Fourth pass: soften the player frame, tighten the primary button, even out the fact cells. */
.gf-play-block { border: 0; box-shadow: var(--gf-shadow-player); }
.gf-btn-steam { border-radius: var(--gf-radius-sm); font-weight: 600; transition: transform 150ms ease, box-shadow 150ms ease; }
.gf-btn-steam:hover { transform: translateY(-1px); box-shadow: var(--gf-shadow-btn); }
.gf-menu-btn { background: transparent; }
.gf-fact dd { min-height: 1.4em; }
.gf-list li { margin-bottom: .5em; }
@media (prefers-reduced-motion: reduce) {
  .gf-btn-steam, .gf-btn-steam:hover { transition: none; transform: none; }
}
