:root {
  color-scheme: dark;
  --bg: #100e13;
  --bg-raise: #1a1620;
  --bg-card: #221c2a;
  --line: rgba(255, 244, 230, 0.12);
  --text: #f4efe9;
  --muted: #b7aeb8;
  --accent: #e25b4a;
  --gold: #e6c27a;
  --hit: rgba(226, 91, 74, 0.28);
  --header: 72px;
  --rail: 168px;
  --gap: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(226, 91, 74, 0.16), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: #f0c2b6;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: white;
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--gold);
  color: #1a120c;
  padding: 8px 12px;
  z-index: 5;
}

.skip:focus {
  top: 12px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--header);
  padding: 12px 24px;
  background: rgba(16, 14, 19, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  margin-right: auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #2a1216;
  color: var(--gold);
  font-weight: 700;
  border: 1px solid rgba(226, 91, 74, 0.7);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-top {
  font-size: 15px;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.brand-bottom {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.top-nav {
  display: flex;
  gap: 18px;
}

.top-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}

.top-nav a:hover {
  color: var(--gold);
}

.search {
  display: flex;
  gap: 8px;
}

.search input {
  width: 180px;
  border: 1px solid var(--line);
  background: #121016;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
}

.search button,
.fullscreen {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-size: 14px;
  padding: 8px 14px;
  cursor: pointer;
}

.search button:hover,
.fullscreen:hover {
  filter: brightness(1.08);
}

.search-status {
  min-height: 0;
  margin: 0;
  padding: 0 24px;
  color: var(--gold);
  font-size: 14px;
}

.search-status:empty {
  display: none;
}

.search-status:not(:empty) {
  padding-top: 8px;
}

.play-layout {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr) var(--rail);
  gap: var(--gap);
  width: min(1240px, calc(100% - 32px));
  margin: 20px auto 0;
  align-items: stretch;
}

.side-rail {
  display: grid;
  grid-template-rows: repeat(6, minmax(72px, 1fr));
  gap: 8px;
}

.rail-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #141218;
  color: var(--text);
  text-decoration: none;
}

.rail-card img {
  display: block;
  width: 100%;
  flex: 1;
  min-height: 48px;
  object-fit: cover;
}

.rail-card span {
  padding: 4px 6px 6px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-card:hover {
  border-color: var(--gold);
}

.rail-card.is-current {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.game-stage {
  background: #070608;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 800 / 635;
  background: #000;
}

.frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.frame-wrap:fullscreen,
.frame-wrap:-webkit-full-screen {
  aspect-ratio: auto;
  background: #000;
}

.game-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  background: #16131b;
  border-top: 1px solid var(--line);
}

.control,
.status {
  margin: 0;
  font-size: 14px;
}

.control {
  color: var(--muted);
  white-space: nowrap;
}

.control span {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #2a2433;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.status {
  flex: 1;
  color: var(--text);
}

.content-panel {
  width: min(1240px, calc(100% - 32px));
  margin: 28px auto 48px;
}

.breadcrumbs {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumbs span::before {
  content: "/";
  margin-right: 8px;
  color: var(--line);
}

h1,
h2,
h3 {
  line-height: 1.25;
  font-weight: 700;
}

h1 {
  margin: 8px 0 12px;
  font-size: 40px;
}

h2 {
  margin: 32px 0 12px;
  font-size: 26px;
}

h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.content-panel p {
  max-width: 72ch;
}

.content-note {
  margin: 0 0 16px;
  padding: 10px 14px;
  max-width: none;
  border-left: 3px solid var(--accent);
  background: rgba(226, 91, 74, 0.1);
  color: #f6d7d1;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 8px;
}

.quick-links a {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--bg-raise);
  color: var(--text);
  font-size: 14px;
}

.quick-links a:hover {
  border-color: var(--accent);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.feature-grid div {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.feature-grid p {
  margin: 0;
  color: var(--muted);
}

.faq details {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.faq details:last-child {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
}

.faq details p {
  color: var(--muted);
}

.closing {
  margin-top: 28px;
}

.is-hit {
  background: var(--hit);
  border-radius: 6px;
}

.site-footer {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto 32px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 4px 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.host-link {
  color: var(--gold);
  font-size: 14px;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .site-header {
    flex-wrap: wrap;
  }

  .top-nav {
    order: 3;
    width: 100%;
  }

  .search {
    width: 100%;
  }

  .search input {
    flex: 1;
    width: auto;
  }

  .play-layout {
    grid-template-columns: 1fr;
  }

  .game-column {
    order: -1;
  }

  .side-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: none;
  }

  .rail-card {
    min-height: 120px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .game-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .status {
    flex: none;
  }

  .control {
    white-space: normal;
  }

  h1 {
    font-size: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
