:root {
  color-scheme: light;
  --paper: #f7f4ea;
  --surface: #ffffff;
  --ink: #17202a;
  --muted: #5b6570;
  --line: #d9d6cb;
  --sky: #78d8ff;
  --sky-soft: #d9f4ff;
  --lime: #b9f45a;
  --lime-soft: #ecffd2;
  --coral: #ff705e;
  --coral-soft: #ffe1dc;
  --gold: #ffc857;
  --gold-soft: #fff0c2;
  --violet: #8d7cff;
  --violet-soft: #e9e5ff;
  --dark: #22313f;
  --dark-2: #0f1720;
  --shadow: rgba(15, 23, 32, 0.16);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  padding: 16px clamp(18px, 4vw, 64px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-size: 24px;
  font-weight: 800;
}

.brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 2px solid var(--dark-2);
  border-radius: var(--radius);
  background: var(--lime);
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 10px;
  width: 13px;
  height: 22px;
  background: var(--dark-2);
  clip-path: polygon(42% 0, 100% 0, 63% 39%, 100% 39%, 28% 100%, 45% 53%, 0 53%);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 26px);
  font-size: 15px;
  font-weight: 700;
}

.nav-links > a:not(.button) {
  padding: 10px 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid var(--dark-2);
  border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--dark-2);
  font-weight: 800;
  line-height: 1;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--dark-2);
}

.button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--dark-2);
}

.button-small {
  min-height: 40px;
  padding: 9px 14px;
  box-shadow: 0 3px 0 var(--dark-2);
}

.button-dark {
  background: var(--dark-2);
  color: #fff;
}

.button-light {
  background: var(--surface);
  color: var(--ink);
}

.button-coral {
  background: var(--coral);
  color: #fff;
}

.play-icon {
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor;
}

.plus-icon {
  position: relative;
  width: 16px;
  height: 16px;
}

.plus-icon::before,
.plus-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
  border-radius: 2px;
}

.plus-icon::before {
  left: 7px;
  top: 1px;
  width: 2px;
  height: 14px;
}

.plus-icon::after {
  left: 1px;
  top: 7px;
  width: 14px;
  height: 2px;
}

main {
  width: min(100%, 1440px);
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  margin: 46px clamp(18px, 4vw, 64px) 54px;
  padding: clamp(24px, 4vw, 38px);
  border: 2px solid var(--dark-2);
  border-radius: var(--radius);
  background: var(--sky-soft);
}

.hero-copy {
  max-width: 680px;
}

.eyebrow {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  margin: 0 0 14px;
  padding: 5px 9px;
  border: 1.5px solid var(--dark-2);
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.98;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.08;
}

h3 {
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.15;
}

.hero-text {
  max-width: 560px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.4;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.console-art {
  position: relative;
  min-height: 220px;
  border: 3px solid var(--dark-2);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 0 var(--dark-2);
}

.console-screen {
  position: absolute;
  left: 28px;
  top: 24px;
  width: min(70%, 300px);
  height: 170px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--dark-2);
}

.screen-player,
.screen-platform,
.screen-star {
  position: absolute;
  display: block;
}

.screen-player {
  left: 70px;
  top: 66px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--lime);
}

.screen-platform {
  left: 36px;
  bottom: 38px;
  width: 220px;
  height: 14px;
  border-radius: 999px;
  background: var(--sky);
}

.screen-star {
  right: 38px;
  top: 42px;
  width: 34px;
  height: 34px;
  background: var(--gold);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 56%, 80% 92%, 50% 70%, 20% 92%, 32% 56%, 2% 35%, 39% 35%);
}

.console-pad,
.console-a,
.console-b {
  position: absolute;
  border: 2px solid var(--dark-2);
}

.console-pad {
  right: 26px;
  top: 72px;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--lime);
}

.console-a {
  right: 40px;
  bottom: 48px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--coral);
}

.console-b {
  right: 10px;
  bottom: 64px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--gold);
}

.section-shell {
  padding: 0 clamp(18px, 4vw, 64px) 72px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.text-link {
  border-bottom: 2px solid currentColor;
  color: var(--dark);
  font-weight: 900;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
}

.game-card {
  display: flex;
  min-height: 354px;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 2px solid var(--dark-2);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 0 var(--shadow);
}

.game-card.compact {
  min-height: auto;
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--sky-soft);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.generated-art {
  position: absolute;
  inset: 0;
}

.generated-art::before {
  content: "";
  position: absolute;
  right: 7%;
  top: 14%;
  width: 31%;
  aspect-ratio: 1;
  border-radius: 999px;
  background: var(--gold);
}

.generated-art::after {
  content: "";
  position: absolute;
  left: 12%;
  bottom: 17%;
  width: 74%;
  height: 18px;
  border-radius: 999px;
  background: var(--dark);
}

.art-player {
  position: absolute;
  left: 22%;
  bottom: 31%;
  width: 42px;
  height: 52px;
  border: 2px solid var(--dark-2);
  border-radius: var(--radius);
  background: var(--surface);
}

.accent-sky .thumb,
.accent-sky.generated-art,
.accent-sky .generated-art {
  background: var(--sky-soft);
}

.accent-lime .thumb,
.accent-lime.generated-art,
.accent-lime .generated-art {
  background: var(--lime-soft);
}

.accent-coral .thumb,
.accent-coral.generated-art,
.accent-coral .generated-art {
  background: var(--coral-soft);
}

.accent-gold .thumb,
.accent-gold.generated-art,
.accent-gold .generated-art {
  background: var(--gold-soft);
}

.accent-violet .thumb,
.accent-violet.generated-art,
.accent-violet .generated-art {
  background: var(--violet-soft);
}

.card-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.card-topline h3 {
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1.5px solid var(--dark-2);
  border-radius: var(--radius);
  background: var(--lime-soft);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-testing {
  background: var(--gold-soft);
}

.status-idea {
  background: var(--violet-soft);
}

.game-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.43;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
}

.tag {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.about-band {
  display: grid;
  grid-template-columns: minmax(220px, 0.6fr) minmax(280px, 1fr);
  gap: 24px;
  margin: 0 clamp(18px, 4vw, 64px) 72px;
  padding: 28px;
  border: 2px solid var(--dark-2);
  border-radius: var(--radius);
  background: var(--gold-soft);
}

.about-band p:last-child {
  margin: 0;
  color: var(--dark);
  font-size: 18px;
  line-height: 1.55;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(18px, 4vw, 64px) 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.detail-main {
  padding: 42px clamp(18px, 4vw, 64px) 72px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.detail-panel,
.play-panel,
.editor-panel,
.preview-panel,
.json-output,
.not-found {
  border: 2px solid var(--dark-2);
  border-radius: var(--radius);
  background: var(--surface);
}

.detail-panel,
.play-panel {
  padding: 22px;
}

.detail-panel h1 {
  margin-bottom: 14px;
  font-size: clamp(36px, 5vw, 58px);
}

.learned-box {
  margin: 20px 0;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--gold-soft);
}

.learned-box strong {
  display: block;
  margin-bottom: 5px;
}

.game-frame-wrap {
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 2px solid var(--dark-2);
  border-radius: var(--radius);
  background: var(--dark-2);
}

.game-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.add-main {
  padding: 42px clamp(18px, 4vw, 64px) 72px;
}

.editor-panel {
  display: grid;
  grid-template-columns: minmax(280px, 440px) minmax(280px, 1fr);
  gap: 34px;
  padding: clamp(20px, 4vw, 32px);
}

.game-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.game-form h1 {
  margin-bottom: 4px;
  font-size: clamp(36px, 5vw, 52px);
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1.5px solid var(--dark-2);
  border-radius: var(--radius);
  background: #fafaf7;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}

textarea {
  resize: vertical;
  line-height: 1.4;
}

input:focus,
select:focus,
textarea:focus,
.json-output:focus {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.preview-panel {
  padding: 22px;
  background: var(--sky-soft);
}

.preview-panel .game-card {
  margin: 18px 0;
  box-shadow: 0 6px 0 var(--shadow);
}

.json-output {
  max-height: 270px;
  overflow: auto;
  padding: 14px;
  background: var(--dark-2);
  color: #ecf7ff;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.not-found {
  display: grid;
  place-items: start;
  gap: 18px;
  width: min(560px, calc(100% - 36px));
  margin: 80px auto;
  padding: 28px;
}

.not-found h1 {
  margin-bottom: 8px;
  font-size: clamp(34px, 6vw, 56px);
}

.empty-state {
  padding: 24px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .hero,
  .detail-layout,
  .editor-panel,
  .about-band {
    grid-template-columns: 1fr;
  }

  .console-art {
    min-height: 190px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .nav-links a:not(.button):nth-child(n + 2) {
    display: none;
  }

  .hero {
    margin-top: 24px;
    padding: 18px;
  }

  h1 {
    font-size: 42px;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
  }
}
