:root {
  --bg: #0d1426;
  --bg-2: #141e36;
  --surface: #1b2745;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f3efe6;
  --muted: #aab3c8;
  --accent: #ff7a59;
  --accent-2: #3fd0c0;
  --gold: #f5c25b;
  --radius: 14px;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #0d1426;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", "Meiryo", sans-serif;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.container { width: min(1120px, 100% - 32px); margin: 0 auto; }

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 700;
}

h1, h2, h3 { line-height: 1.4; margin: 0 0 12px; }
h2 { font-size: clamp(24px, 3.4vw, 34px); }
h3 { font-size: 18px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(13, 20, 38, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #1a1020;
  font-weight: 900;
  font-size: 20px;
}
.brand-text { font-weight: 700; font-size: 15px; line-height: 1.2; }
.brand-text small { display: block; font-size: 10px; letter-spacing: 0.18em; color: var(--muted); font-weight: 500; }

.site-nav { display: flex; gap: 22px; }
.site-nav a { text-decoration: none; font-size: 14px; color: var(--muted); }
.site-nav a:hover { color: var(--text); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn i, .btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: #1a1020; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-small { padding: 8px 14px; font-size: 13px; }

/* Hero */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13,20,38,0.2), var(--bg) 96%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  width: min(1120px, 100% - 32px);
  margin: 0 auto;
  padding: 80px 0;
}
.hero h1 { font-size: clamp(32px, 6vw, 60px); line-height: 1.25; }
.lead { font-size: 17px; color: var(--muted); max-width: 620px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Sections */
.section { padding: 88px 0; }
.section h2 { margin-bottom: 36px; }

/* About */
.about-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 48px; align-items: center; }
.avatar {
  width: 200px; height: 200px;
  margin: 0 auto 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #1a1020;
  font-size: 84px;
  font-weight: 900;
  box-shadow: var(--shadow);
}
.stats {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  text-align: center;
}
.stats li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 6px;
}
.stats strong { display: block; font-size: 24px; color: var(--gold); }
.stats span { font-size: 12px; color: var(--muted); }
.about-body p { color: var(--muted); }
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tags li {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(63, 208, 192, 0.12);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
}

/* Services */
.services { background: var(--bg-2); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.card > i, .card > svg { width: 32px; height: 32px; color: var(--accent); margin-bottom: 14px; }
.card p { color: var(--muted); font-size: 14px; margin: 0; }

/* Works */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 760px) { .work-grid { grid-template-columns: 1fr; } }
.work {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}
a.work:hover { transform: translateY(-4px); }
.work img { width: 100%; height: 190px; object-fit: cover; }
.work-body { padding: 20px; }
.work-body p { color: var(--muted); font-size: 14px; margin: 0; }
.badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #1a1020;
  font-size: 11px;
  font-weight: 800;
}

/* Play teaser */
.play { position: relative; overflow: hidden; text-align: center; padding: 110px 0; }
.play-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
}
.play::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--bg), rgba(13,20,38,0.6), var(--bg));
}
.play-inner { position: relative; z-index: 1; width: min(640px, 100% - 32px); margin: 0 auto; }
.play p { color: var(--muted); }
.play .btn { margin-top: 12px; }

/* Process */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.steps li {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.steps span { font-size: 28px; font-weight: 900; color: var(--gold); }
.steps p { color: var(--muted); font-size: 14px; margin: 0; }

/* Contact */
.contact { background: var(--bg-2); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.contact-grid > div > p { color: var(--muted); }
.contact-form { display: grid; gap: 16px; }
.contact-form label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: 2px solid var(--accent-2); border-color: transparent; }
.contact-form .btn { justify-self: start; }
.form-note { color: var(--accent-2); font-size: 14px; margin: 0; }

/* Footer */
.site-footer { text-align: center; padding: 28px 16px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.site-footer p { margin: 0; }

/* Game page */
.game-wrap { width: min(760px, 100% - 32px); margin: 0 auto; padding: 36px 0 60px; }
.game-intro p { color: var(--muted); }
.game-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
  margin-top: 20px;
}
.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.score {
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  text-align: center;
}
.score-label { display: block; font-size: 12px; color: var(--muted); }
.score strong { font-size: 28px; color: var(--gold); }
.turn-info { font-weight: 700; font-size: 14px; text-align: center; color: var(--accent-2); min-width: 120px; }

.board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2b6e4f, #1f5238);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.cell {
  position: relative;
  aspect-ratio: 1;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.cell.corner { background: rgba(245, 194, 91, 0.22); }
.cell.hint::after {
  content: "";
  width: 14px; height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}
.cell.last { box-shadow: inset 0 0 0 2px var(--gold); }
.stone {
  width: 78%;
  height: 78%;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}
.stone-black { background: radial-gradient(circle at 35% 30%, #5a5f6b, #0c0d10); }
.stone-white { background: radial-gradient(circle at 35% 30%, #ffffff, #cfd3dc); }

.game-actions { display: flex; justify-content: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.game-message { text-align: center; color: var(--muted); min-height: 1.8em; margin: 14px 0 0; font-size: 14px; }
.game-rules { margin-top: 28px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; }
.game-rules ol { padding-left: 20px; color: var(--muted); font-size: 14px; margin: 0; }
.game-rules li { margin-bottom: 4px; }

/* Responsive */
@media (max-width: 860px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 14px 20px; border-top: 1px solid var(--line); }
  .nav-toggle { display: inline-flex; }
  .site-header { position: sticky; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .section { padding: 64px 0; }
}

@media (max-width: 520px) {
  .site-header .btn { display: none; }
  .hero-inner { padding: 60px 0; }
  .board { gap: 4px; padding: 8px; }
  .cell { border-radius: 6px; }
  .scoreboard { grid-template-columns: 1fr 1fr; }
  .turn-info { grid-column: 1 / -1; order: -1; }
}
