:root {
  --bg: #09090a;
  --panel: #121214;
  --panel-2: #18181b;
  --panel-3: #202024;
  --text: #f3f3f0;
  --muted: #9b9ba3;
  --line: #29292e;
  --line-strong: #3a3a42;
  --accent: #c8ff48;
  --accent-dim: rgba(200,255,72,.12);
  --max: 1160px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 0%, rgba(200,255,72,.08), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
}

a { color: inherit; }

.wrap {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}

.site-header {
  width: min(calc(100% - 40px), var(--max));
  height: 74px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  text-decoration: none;
  font-size: 1rem;
  font-weight: 950;
  letter-spacing: .22em;
}

.header-nav {
  display: flex;
  gap: 24px;
}

.header-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.header-nav a:hover { color: var(--text); }

.hero {
  min-height: 520px;
  padding: 90px 0 82px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 50px;
  align-items: end;
}

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

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .18em;
}

.hero h1 {
  margin: 0;
  max-width: 900px;
  font-size: clamp(3.25rem, 8vw, 7.2rem);
  line-height: .96;
  letter-spacing: -.075em;
}

.lead {
  margin: 30px 0 0;
  max-width: 650px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.9;
}

.hero-stat {
  min-width: 150px;
  padding: 18px 0 0 24px;
  border-left: 1px solid var(--line);
  display: grid;
}

.stat-label,
.stat-unit {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .15em;
}

.hero-stat strong {
  margin: 2px 0 -2px;
  font-size: 4.2rem;
  line-height: 1;
  letter-spacing: -.08em;
}

.featured-section,
.games-section,
.about {
  padding: 58px 0 96px;
  border-top: 1px solid var(--line);
}

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

.section-title-row h2,
.about h2 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
  letter-spacing: -.05em;
}

.result-count {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
}

.featured-card {
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  text-decoration: none;
  transition: border-color .2s ease, transform .2s ease;
}

.featured-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
}

.featured-visual {
  min-height: 360px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(200,255,72,.16), transparent 55%),
    linear-gradient(45deg, #121612, #0c0d0c);
  position: relative;
  overflow: hidden;
}

.featured-visual::before,
.featured-visual::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(200,255,72,.25);
  border-radius: 999px;
}

.featured-visual::before {
  width: 240px;
  height: 240px;
}

.featured-visual::after {
  width: 330px;
  height: 330px;
}

.featured-visual strong {
  position: relative;
  z-index: 1;
  color: var(--accent);
  font-size: clamp(3rem, 9vw, 7rem);
  letter-spacing: -.08em;
}

.featured-info {
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.badge {
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.badge.accent {
  color: #111;
  background: var(--accent);
  border-color: var(--accent);
}

.featured-info h3 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -.055em;
}

.featured-info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.play-cta {
  margin-top: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .14em;
}

.play-cta::after { content: "→"; }

.toolbar {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 14px;
  margin-bottom: 16px;
}

.search-box,
.sort-box {
  display: grid;
  gap: 7px;
}

.search-box span,
.sort-box span {
  color: var(--muted);
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .13em;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  outline: none;
}

input:focus,
select:focus {
  border-color: #60606a;
}

.category-filter {
  margin: 0 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .75rem;
  font-weight: 800;
  cursor: pointer;
}

.filter-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.filter-button.active {
  color: #111;
  background: var(--accent);
  border-color: var(--accent);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.game-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}

.card-visual {
  height: 190px;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  position: relative;
  overflow: hidden;
}

.card-visual::before {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
}

.card-visual.reaction {
  background:
    radial-gradient(circle at 50% 50%, rgba(200,255,72,.13), transparent 40%),
    #111712;
}

.card-visual.clicker {
  background:
    radial-gradient(circle, rgba(255,255,255,.07) 0 2px, transparent 3px) 0 0/18px 18px,
    #171719;
}

.card-visual span {
  position: relative;
  z-index: 1;
  font-size: clamp(3.2rem, 7vw, 5.2rem);
  font-weight: 950;
  letter-spacing: -.07em;
}

.card-visual.reaction span { color: var(--accent); }

.card-body {
  min-height: 220px;
  padding: 23px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-category {
  margin: 0 0 11px;
  color: var(--accent);
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .14em;
}

.card-body h3 {
  margin: 0 0 10px;
  font-size: 1.4rem;
  letter-spacing: -.035em;
}

.card-body p {
  margin: 0;
  color: var(--muted);
  font-size: .91rem;
  line-height: 1.7;
}

.card-footer {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  color: var(--muted);
  font-size: .68rem;
}

.card-play {
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .14em;
}

.empty-message {
  padding: 40px 0;
  color: var(--muted);
  text-align: center;
}

.about {
  display: grid;
  grid-template-columns: 1fr .8fr;
  gap: 50px;
  align-items: end;
}

.about > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.site-footer {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .74rem;
  letter-spacing: .09em;
}

/* Game pages */
.game-page {
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto 1fr auto;
}

.game-shell {
  width: min(calc(100% - 40px), 900px);
  margin: 0 auto;
  padding: 60px 0 80px;
}

.back-link {
  display: inline-block;
  margin-bottom: 34px;
  color: var(--muted);
  text-decoration: none;
  font-size: .84rem;
}

.back-link:hover { color: var(--text); }

.game-title {
  margin: 0 0 10px;
  font-size: clamp(2.3rem, 6vw, 4.7rem);
  letter-spacing: -.065em;
}

.game-description {
  margin: 0 0 34px;
  color: var(--muted);
  line-height: 1.8;
}

.play-area {
  min-height: 420px;
  padding: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
}

.reaction-box {
  width: 100%;
  min-height: 360px;
  border: 0;
  border-radius: 14px;
  background: #242429;
  color: var(--text);
  cursor: pointer;
  padding: 30px;
  font: inherit;
  transition: background .12s ease;
}

.reaction-box.ready { background: #20310d; }
.reaction-box.too-soon { background: #3a1717; }

.big-label {
  display: block;
  font-size: clamp(2.4rem, 8vw, 5.5rem);
  font-weight: 950;
  letter-spacing: -.06em;
}

.sub-label {
  display: block;
  margin-top: 12px;
  color: #c9c9cd;
  line-height: 1.6;
}

.stats {
  margin-top: 16px;
  color: var(--muted);
  font-size: .85rem;
}

.clicker-panel {
  width: 100%;
  text-align: center;
}

.timer {
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 950;
  letter-spacing: -.07em;
}

.score {
  margin: 4px 0 24px;
  color: var(--muted);
}

.click-button,
.start-button {
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.click-button {
  width: min(100%, 480px);
  min-height: 170px;
  background: var(--accent);
  color: #10110d;
  font-size: clamp(1.7rem, 5vw, 3rem);
}

.click-button:disabled {
  cursor: not-allowed;
  opacity: .35;
}

.start-button {
  margin-top: 18px;
  padding: 13px 22px;
  background: #fff;
  color: #111;
}

@media (max-width: 860px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hero-stat {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 20px 0 0;
    grid-template-columns: auto auto 1fr;
    gap: 10px;
    align-items: baseline;
  }

  .hero-stat strong { font-size: 2.8rem; }

  .featured-card {
    grid-template-columns: 1fr;
  }

  .featured-visual {
    min-height: 260px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 620px) {
  .wrap,
  .site-header {
    width: min(calc(100% - 28px), var(--max));
  }

  .site-header {
    height: 66px;
  }

  .header-nav {
    gap: 14px;
  }

  .header-nav a:last-child { display: none; }

  .hero {
    padding: 64px 0 58px;
    gap: 34px;
  }

  .featured-section,
  .games-section,
  .about {
    padding: 46px 0 72px;
  }

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

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

  .card-visual {
    height: 165px;
  }

  .game-shell {
    width: min(calc(100% - 28px), 900px);
    padding-top: 42px;
  }

  .play-area {
    padding: 16px;
    min-height: 360px;
  }
}


/* v3 metadata / thumbnail support */
.game-meta {
  margin-top: 14px !important;
  color: #c5c5ca !important;
  font-size: .76rem !important;
  font-weight: 700;
  letter-spacing: .04em;
}

.card-visual img,
.featured-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

/* 404 */
.not-found {
  min-height: calc(100vh - 162px);
  width: min(calc(100% - 40px), 900px);
  margin: 0 auto;
  padding: 80px 0;
  display: grid;
  align-content: center;
}

.not-found-code {
  margin: 0;
  color: var(--accent);
  font-size: clamp(6rem, 22vw, 14rem);
  line-height: .8;
  font-weight: 950;
  letter-spacing: -.09em;
}

.not-found h1 {
  margin: 30px 0 12px;
  font-size: clamp(2rem, 5vw, 3.8rem);
  letter-spacing: -.05em;
}

.not-found-copy {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.home-button {
  display: inline-flex;
  width: fit-content;
  margin-top: 30px;
  padding: 13px 18px;
  border-radius: 12px;
  background: var(--accent);
  color: #111;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 950;
  letter-spacing: .1em;
}


/* Mobile / touch-game optimization */
.reaction-box,
.click-button,
.start-button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.reaction-box,
.click-button {
  -webkit-touch-callout: none;
}

@media (pointer: coarse) {
  .reaction-box {
    min-height: min(56vh, 460px);
  }

  .click-button {
    min-height: 210px;
  }

  .play-area {
    padding: 14px;
  }
}

@media (max-width: 620px) {
  .game-description {
    margin-bottom: 24px;
  }

  .reaction-box {
    min-height: min(54vh, 430px);
    padding: 22px 16px;
  }

  .click-button {
    min-height: 200px;
    width: 100%;
  }

  .start-button {
    min-height: 48px;
    min-width: 120px;
  }

  .stats,
  .score {
    font-size: .9rem;
  }
}
