/*
 * Shared styles for every site page (not the games themselves).
 * Based on C:\Users\agoto\Projects\DESIGN\AnthropicDESIGN (warm parchment, serif body, single clay accent).
 */
:root {
  --color-slate-dark: #141413;
  --color-slate-medium: #3d3d3a;
  --color-ivory-medium: #f0eee6;
  --color-ivory-light: #faf9f5;
  --color-cloud-medium: #b0aea5;
  --color-cloud-dark: #87867f;
  --color-stone: #cccbc8;
  --color-oat-warm: #e3dacc;
  --color-manilla: #f5e3c7;
  --color-clay: #d97757;
  --color-clay-deep: #c6613f;

  --text-muted: #5e5d59;

  --font-serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", Georgia, serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;

  --page-max: 1080px;
  --text-max: 720px;
  --gutter: 16px;
  --radius-card: 24px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-ivory-medium);
  color: var(--color-slate-dark);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}
@media (min-width: 768px) {
  body { font-size: 18px; }
  :root { --gutter: 32px; }
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { line-height: 1.3; font-weight: 600; margin: 0; }
h1 { font-size: clamp(30px, 6vw, 52px); letter-spacing: 0.02em; }
h2 { font-size: clamp(22px, 3.6vw, 30px); margin-top: 56px; margin-bottom: 16px; }
h3 { font-size: 20px; margin-top: 32px; margin-bottom: 8px; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; margin: 0 0 1em; }
li { margin-bottom: 0.4em; }

.skip-link {
  position: absolute; left: 8px; top: -100px;
  background: var(--color-ivory-light); padding: 8px 12px;
  font-family: var(--font-sans); font-size: 14px; z-index: 10;
}
.skip-link:focus { top: 8px; }

.container { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--text-max); }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--color-stone); }
.site-header .container {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 24px; padding-top: 14px; padding-bottom: 14px;
}
.site-logo {
  font-family: var(--font-serif); font-weight: 600; font-size: 20px;
  text-decoration: none; letter-spacing: 0.08em;
  display: inline-flex; align-items: center; gap: 8px;
}
.site-logo img { width: 36px; height: 36px; flex: none; }
/* The menu is a "≡" button on every screen size (same UI on phone and PC). */
.site-menu { position: relative; }
/* Only the "≡" button itself, not the "ゲーム一覧" toggle inside the menu */
.site-menu > summary {
  list-style: none; cursor: pointer; width: 44px; height: 44px; margin: -6px -10px -6px 0;
  display: flex; align-items: center; justify-content: center; border-radius: 8px;
}
.site-menu > summary::-webkit-details-marker { display: none; }
.site-menu > summary:hover { background: var(--color-oat-warm); }
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block; width: 22px; height: 2px; background: var(--color-slate-dark); border-radius: 1px;
  transition: transform 0.2s, background 0.2s;
}
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -7px; }
.menu-icon::after { top: 7px; }
.site-menu[open] .menu-icon { background: transparent; }
.site-menu[open] .menu-icon::before { transform: translateY(7px) rotate(45deg); }
.site-menu[open] .menu-icon::after { transform: translateY(-7px) rotate(-45deg); }
.site-nav {
  position: absolute; right: -10px; top: calc(100% + 12px); z-index: 20; min-width: 220px;
  display: flex; flex-direction: column; padding: 8px 0;
  background: var(--color-ivory-light); border: 1px solid var(--color-stone); border-radius: var(--radius-card);
  font-family: var(--font-sans); font-size: 16px;
}
.site-nav a { text-decoration: none; color: var(--color-slate-dark); padding: 12px 24px; }
.site-nav a:hover { background: var(--color-oat-warm); }
.site-nav a[aria-current="page"] { font-weight: 600; text-decoration: underline; }
/* "ゲーム一覧 ▼" opens the list of games inside the menu */
.nav-games summary {
  list-style: none; cursor: pointer; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav-games summary::-webkit-details-marker { display: none; }
.nav-games summary::after {
  content: ""; width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--color-slate-dark);
  transition: transform 0.2s;
}
.nav-games[open] summary::after { transform: rotate(180deg); }
.nav-games summary:hover { background: var(--color-oat-warm); }
.nav-games-list { display: flex; flex-direction: column; padding-bottom: 4px; }
.site-nav .nav-games-list a { padding: 10px 24px 10px 40px; font-size: 15px; }

[id] { scroll-margin-top: 24px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-family: var(--font-sans); font-size: 13px; color: var(--text-muted); margin: 24px 0 0; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "／"; margin-right: 4px; color: var(--color-cloud-dark); }

/* ---------- Game page tabs (紹介｜遊び方｜攻略のコツ｜…) ---------- */
.game-tabs {
  display: flex; margin: 16px 0 0; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--color-stone); font-family: var(--font-sans); font-size: 14px;
}
.game-tabs::-webkit-scrollbar { display: none; }
.game-tabs a {
  flex: none; padding: 10px 9px; text-decoration: none; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.game-tabs a:hover { color: var(--color-slate-dark); background: var(--color-oat-warm); }
.game-tabs a[aria-current="page"] { color: var(--color-slate-dark); font-weight: 600; border-bottom-color: var(--color-slate-dark); }

/* ---------- Page heading ---------- */
.page-head { padding: 40px 0 8px; }
.page-head .lead { font-size: 1.1em; color: var(--text-muted); margin-top: 16px; }
.eyebrow { font-family: var(--font-sans); font-size: 13px; letter-spacing: 0.12em; color: var(--text-muted); margin-bottom: 12px; }

main { padding-bottom: 96px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font-family: var(--font-sans); font-weight: 600; font-size: 16px;
  text-decoration: none; padding: 14px 32px; border-radius: 0 0 8px 8px;
  background: var(--color-ivory-light); color: var(--color-slate-dark);
  border: 1px solid var(--color-stone);
}
.btn:hover { background: var(--color-oat-warm); color: var(--color-slate-dark); }
.btn-primary { background: var(--color-clay); color: #fff; border-color: var(--color-clay); border-radius: 8px; }
.btn-primary:hover { background: var(--color-clay-deep); border-color: var(--color-clay-deep); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }

/* ---------- Hero ---------- */
.hero { padding: 48px 0 16px; display: grid; gap: 24px; }
@media (min-width: 860px) {
  .hero { grid-template-columns: 1.1fr 1fr; align-items: end; gap: 48px; padding-top: 72px; }
}
.hero p { color: var(--text-muted); font-size: 1.05em; }

/* Top page: a short heading, then every game in one compact row each, so a phone's first screen shows them all. */
.hero-compact { padding: 24px 0 0; gap: 4px; }
.hero-compact .eyebrow { margin: 0; }
.hero-compact h1 { font-size: clamp(26px, 4vw, 40px); }
@media (min-width: 860px) { .hero-compact { display: block; padding-top: 48px; } }
.game-picks { display: grid; gap: 10px; margin: 16px 0 0; }
.game-pick {
  display: grid; grid-template-columns: 132px 1fr; gap: 12px; align-items: center;
  text-decoration: none; background: var(--color-ivory-light); border: 1px solid var(--color-stone);
  border-radius: 16px; overflow: hidden;
}
.game-pick:hover { background: var(--color-oat-warm); }
.game-pick img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: contain; background: #f0eee6; }
.game-pick b { display: block; font-size: 17px; line-height: 1.35; font-weight: 600; }
.game-pick small { display: block; font-family: var(--font-sans); font-size: 13px; color: var(--text-muted); }
@media (min-width: 768px) {
  .game-picks { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .game-pick { grid-template-columns: 1fr; gap: 0; }
  .game-pick span { padding: 12px 16px 16px; }
}
.hero-note { color: var(--text-muted); font-size: 15px; margin: 12px 0 0; }

/* ---------- Cards ---------- */
.card {
  background: var(--color-ivory-light); border: 1px solid var(--color-stone);
  border-radius: var(--radius-card); padding: 24px;
}
@media (min-width: 768px) { .card { padding: 32px; } }
.card-feature { background: var(--color-manilla); border: none; }

.game-card { display: grid; gap: 0; overflow: hidden; padding: 0; text-decoration: none; }
@media (min-width: 768px) { .game-card { grid-template-columns: 1fr 1fr; } }
.game-card img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 2; }
/* Share images (1200x630) hold the game title on the left, so show them whole instead of cropping. */
.game-card img[src$="/og.png"] { object-fit: contain; background: #f0eee6; }
.game-card .body { padding: 24px; }
@media (min-width: 768px) { .game-card .body { padding: 40px; } }
.game-card h3 { margin-top: 0; font-size: clamp(22px, 3vw, 28px); }
.game-card h3 a { text-decoration: none; }
.game-card h3 a:hover { text-decoration: underline; }
.game-card-img { display: block; }
.game-card .btn-row { margin-bottom: 0; }
.game-card p { color: var(--text-muted); }

.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-family: var(--font-sans); font-size: 13px; color: var(--text-muted); margin: 12px 0 16px; padding: 0; list-style: none; }
.meta li { margin: 0; }
.meta strong { color: var(--color-slate-dark); font-weight: 600; }

.grid-3 { display: grid; gap: 16px; }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-3 .card h3 { margin-top: 0; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
.grid-2 .card h3 { margin-top: 0; }

.figure { margin: 24px 0; }
.figure img { border-radius: var(--radius-card); }
.figure figcaption { font-family: var(--font-sans); font-size: 13px; color: var(--text-muted); margin-top: 8px; }

.note {
  background: var(--color-oat-warm); border-radius: 16px; padding: 16px 20px; margin: 24px 0;
}
.note p:last-child { margin-bottom: 0; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 48px; margin-bottom: 20px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 2px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--color-slate-dark); color: var(--color-ivory-light);
  font-family: var(--font-sans); font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

table { border-collapse: collapse; width: 100%; margin: 16px 0 24px; font-size: 0.95em; }
th, td { border-bottom: 1px solid var(--color-stone); padding: 10px 8px; text-align: left; vertical-align: top; }
th { font-family: var(--font-sans); font-size: 14px; font-weight: 600; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

/* Board diagrams on the rules / strategy pages */
.board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; max-width: 280px; margin: 16px 0; }
.board span {
  aspect-ratio: 1; background: #dcb35c; border: 2px solid #a66a38; border-radius: 2px;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-sans); font-size: 14px; font-weight: 600;
}
.board span.dark { background: #b88c3c; }
.board span.mark { background: var(--color-clay); color: #fff; border-color: var(--color-clay-deep); }

/* Replay diagrams: no gap so samurai markers sit exactly on room corners */
.board-replay { position: relative; gap: 0; max-width: 300px; }
.board-replay span { border-width: 1px; }
.board span.label { font-size: 13px; font-weight: 400; }
.board span.ninja { background: var(--color-slate-dark); color: #fff; border-color: var(--color-slate-dark); }
.board span.n1 { background: #f2c94c; border-color: #a66a38; }
.board span.foot { background: #7a4f2a; color: #fff; }
.board span.guess { border: 2px dashed var(--color-slate-dark); }
.board span.out { color: var(--color-slate-medium); }
.board .samurai {
  position: absolute; left: calc(var(--x) * 20%); top: calc(var(--y) * 20%); transform: translate(-50%, -50%);
  height: 24px; padding: 0 5px; border-radius: 12px; background: var(--color-ivory-light); border: 2px solid var(--color-slate-dark);
  display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 12px; font-weight: 600; white-space: nowrap;
}

/* Ad slots stay empty until AdSense is approved (see CLAUDE.md). */
.ad-slot:empty { display: none; }
.ad-slot { margin: 40px 0; min-height: 100px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-slate-dark); color: var(--color-ivory-light); font-family: var(--font-sans); font-size: 14px; }
.site-footer .container { padding-top: 48px; padding-bottom: 48px; display: grid; gap: 24px; }
@media (min-width: 768px) { .site-footer .container { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h2 { font-size: 13px; margin: 0 0 12px; letter-spacing: 0.1em; color: var(--color-cloud-medium); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--color-ivory-light); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: var(--color-ivory-light); }
.site-footer .footer-name { font-family: var(--font-serif); font-size: 20px; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.site-footer .footer-name img { width: 36px; height: 36px; border-radius: 8px; }
.site-footer .copyright { color: var(--color-cloud-medium); font-size: 12px; margin-top: 16px; }
