:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --paper: #ffffff;
  --ink: #172033;
  --muted: #5f6d82;
  --line: rgba(23, 32, 51, .13);
  --brand: #0f9f7a;
  --brand-strong: #08765b;
  --accent: #3157d5;
  --gold: #d99a25;
  --danger: #c2410c;
  --shadow: 0 18px 46px rgba(23, 32, 51, .10);
  font-family: "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(15,159,122,.08), transparent 260px),
    var(--bg);
}
a { color: inherit; }
.site-shell { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 251, .88);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: var(--brand); }
.topnav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.topnav a, .pill-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  padding: 9px 13px;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.topnav a.active, .pill-button.primary, .primary-button { color: #fff; background: var(--brand); border-color: var(--brand); }
.main-wrap { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 42px 0 64px; }
.hero { display: grid; grid-template-columns: 1.25fr .75fr; gap: 28px; align-items: end; margin-bottom: 28px; }
.hero h1 { margin: 0; font-size: clamp(40px, 7vw, 82px); line-height: .95; letter-spacing: 0; }
.hero p { color: var(--muted); font-size: 18px; line-height: 1.6; max-width: 680px; }
.eyebrow { margin: 0 0 12px; color: var(--brand-strong); font-weight: 800; text-transform: uppercase; font-size: 12px; letter-spacing: .08em; }
.hero-actions, .actions, .filter-row { display: flex; flex-wrap: wrap; gap: 10px; }
.primary-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}
.secondary-button { background: var(--paper); color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat, .panel, .card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.stat { padding: 16px; }
.stat strong { display: block; font-size: 28px; }
.panel { padding: 18px; }
.searchbar { display: flex; gap: 10px; margin: 18px 0; }
.searchbar input, input, textarea, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 22px; }
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 10px; min-height: 215px; padding: 16px; text-align: left; cursor: pointer; }
.card h3 { margin: 0; font-size: 19px; }
.card p { margin: 0; color: var(--muted); line-height: 1.5; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tag { border-radius: 999px; background: rgba(15,159,122,.10); color: var(--brand-strong); padding: 5px 8px; font-size: 12px; font-weight: 800; }
.card-media { aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #e6eaf2; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.icon-box { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 8px; background: rgba(15,159,122,.10); color: var(--brand-strong); font-weight: 900; }
.detail-shell { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 18px; }
.detail-header { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; margin-bottom: 16px; }
.tool-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tool-meta span { border-radius: 999px; border: 1px solid var(--line); padding: 6px 9px; color: var(--muted); font-size: 12px; font-weight: 700; }
.tool-area { display: grid; gap: 12px; }
.tool-grid { display: grid; gap: 12px; }
.tool-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tool-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tool-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tool-actions button, button.primary { border: 0; border-radius: 8px; background: var(--brand); color: #fff; padding: 10px 13px; font: inherit; font-weight: 800; cursor: pointer; }
.output, pre { white-space: pre-wrap; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #f3f6fa; }
.empty { padding: 22px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 8px; }
.game-frame-wrap { min-height: 520px; background: #05070b; border-radius: 8px; overflow: hidden; }
.unified-game-frame { width: 100%; height: 70vh; min-height: 480px; border: 0; display: block; background: #000; }
footer { color: var(--muted); padding: 28px clamp(18px, 4vw, 56px); border-top: 1px solid var(--line); }
@media (max-width: 780px) {
  .topbar, .hero, .detail-header { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
  .stats, .tool-grid.two, .tool-grid.three, .tool-grid.four { grid-template-columns: 1fr; }
  .searchbar { flex-direction: column; }
}
