:root {
  --white: #FFFFFF;
  --stone: #F6F6F5;
  --stone-deep: #EFEFED;
  --hairline: #E3E1DC;
  --ink: #2B2B2B;
  --muted: #6E6D69;
  --gold: #967D4B;
  --gold-hover: #816B3F;
  --serif: 'Cormorant Garamond', 'Noto Serif JP', Georgia, serif;
  --sans: 'Jost', 'Noto Sans JP', system-ui, sans-serif;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

:where(button):focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

button { font: inherit; color: inherit; cursor: pointer; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--hairline);
}

.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-word { font-family: var(--serif); font-size: 1.35rem; letter-spacing: 0.18em; }
.brand-sub { font-size: 0.62rem; letter-spacing: 0.5em; color: var(--gold); margin-top: 0.25rem; }

.lang { display: flex; gap: 0.5rem; align-items: center; font-size: 0.72rem; color: var(--muted); }
.lang-btn { background: none; border: 0; padding: 0.4rem 0.2rem; letter-spacing: 0.14em; color: var(--muted); }
.lang-btn.active { color: var(--ink); border-bottom: 1px solid var(--gold); }

main { flex: 1; }

.hero {
  text-align: center;
  padding: clamp(3rem, 9vw, 6rem) 1rem clamp(2rem, 5vw, 3.5rem);
  max-width: 40rem;
  margin-inline: auto;
}

.kicker { margin: 0; font-size: 0.7rem; letter-spacing: 0.3em; color: var(--gold); }

.hero-title {
  margin: 1rem 0 0.75rem;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.1;
  text-wrap: balance;
}

.hero-sub { margin: 0; color: var(--muted); font-weight: 300; text-wrap: pretty; }

.games {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1rem clamp(3rem, 8vw, 5rem);
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.5rem 1.5rem;
  background: var(--stone);
  border: 1px solid var(--hairline);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

@media (hover: hover) {
  .game-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(43, 43, 43, 0.08); }
}

.card-art {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  margin-bottom: 1.5rem;
  background: var(--white);
  border: 1px solid var(--hairline);
  color: var(--gold);
}
.card-art svg { width: 46%; height: auto; }

.card-num { font-family: var(--serif); font-style: italic; color: var(--gold); font-size: 1rem; }

.card-title { margin: 0.2rem 0 0.6rem; font-family: var(--serif); font-weight: 400; font-size: 1.75rem; line-height: 1.15; }

.card-how { flex: 1; margin: 0 0 1.5rem; font-size: 0.92rem; font-weight: 300; color: var(--muted); }

.play-btn {
  align-self: stretch;
  padding: 0.95rem 1rem;
  background: var(--gold);
  color: var(--white);
  border: 0;
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  transition: background 0.3s var(--ease);
}
.play-btn:hover { background: var(--gold-hover); }

.site-footer {
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  border-top: 1px solid var(--hairline);
}

#game-dialog {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--stone);
  display: none;
  flex-direction: column;
}
#game-dialog[open] { display: flex; }
#game-dialog::backdrop { background: rgba(43, 43, 43, 0.4); }

.dialog-bar { display: flex; justify-content: flex-end; padding: 0.5rem 0.75rem; background: var(--white); border-bottom: 1px solid var(--hairline); }

.close-btn {
  background: none;
  border: 1px solid var(--hairline);
  padding: 0.5rem 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}
.close-btn:hover { border-color: var(--gold); color: var(--gold); }

#game-frame { flex: 1; width: 100%; border: 0; display: block; }

@media (max-width: 1100px) and (min-width: 761px) {
  .games { grid-template-columns: repeat(2, 1fr); max-width: 46rem; }
}

@media (max-width: 760px) {
  .games { grid-template-columns: 1fr; max-width: 32rem; gap: 1rem; }
  .game-card { display: grid; grid-template-columns: 5.5rem 1fr; column-gap: 1.1rem; padding: 1.1rem; }
  .card-art { grid-row: 1 / 4; aspect-ratio: 1; margin: 0; align-self: start; }
  .card-art svg { width: 70%; }
  .card-num { grid-column: 2; }
  .card-title { grid-column: 2; font-size: 1.45rem; }
  .card-how { grid-column: 2; margin-bottom: 1rem; font-size: 0.88rem; }
  .play-btn { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
