/* Fonts loaded via <link rel="preconnect"> in each HTML file */

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

:root {
  --bg:           #ede8de;
  --surface:      #f7f2e8;
  --surface-btn:  #ddd5c3;
  --accent:       #b58863;
  --accent-hover: #9a7050;
  --accent-light: #f0d9b5;
  --accent-dark:  #7a4a20;
  --text:         #2e2416;
  --text-sub:     #5a4e3e;
  --muted:        #7a6e5c;
  --border:       #c5bba8;
  --shadow-sm: 0 2px 8px rgba(46,36,22,0.08);
  --shadow:    0 4px 24px rgba(46,36,22,0.14);
  --shadow-lg: 0 8px 40px rgba(46,36,22,0.20);
}

body {
  font-family: 'Noto Serif JP', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.8;
  letter-spacing: 0.01em;
}

/* ══════════════════ Header ══════════════════ */
header {
  background: var(--surface);
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--accent-light);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: 'Noto Serif JP', serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.logo .logo-icon { color: var(--accent); font-size: 1.5rem; }
.logo span { color: var(--accent); }

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

nav a {
  display: none;
  color: var(--text-sub);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

/* ── Language switcher ── */
.lang-switcher select {
  background: var(--surface-btn);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}
.lang-switcher select:focus,
.lang-switcher select:hover { border-color: var(--accent); }

/* ══════════════════ Hero ══════════════════ */
.hero-outer {
  background: linear-gradient(135deg, #b58863 0%, #c9a27a 35%, #f0d9b5 100%);
  border-bottom: 3px solid var(--accent);
}

/* Mobile: single column, board on top */
.hero {
  background: linear-gradient(135deg, #b58863 0%, #c9a27a 35%, #f0d9b5 100%);
  padding: 3rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.hero-visual {
  order: -1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(46,36,22,0.15);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(46,36,22,0.2);
}

.hero-content h1 {
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}
.hero-content h1 em {
  font-style: normal;
  color: #fff;
  text-shadow: 0 2px 8px rgba(46,36,22,0.25);
}

.hero-content p {
  font-size: 1rem;
  color: var(--text);
  opacity: 0.85;
  line-height: 1.75;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.hero-note {
  font-size: 0.82rem;
  color: var(--text);
  opacity: 0.7;
}

/* Decorative chess board — mobile size */
.board-deco {
  width: 200px;
  height: 200px;
  background-image: repeating-conic-gradient(#f0d9b5 0% 25%, #b58863 0% 50%);
  background-size: 50px 50px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  position: relative;
  border: 6px solid var(--accent-dark);
  flex-shrink: 0;
}

.board-pieces {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  pointer-events: none;
}

.board-piece {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  line-height: 1;
}

/* ══════════════════ Stats bar ══════════════════ */
.stats-bar {
  background: var(--text);
  color: var(--accent-light);
  padding: 1.25rem 1rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.stat-item { text-align: center; }
.stat-num {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent-light);
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-top: 0.2rem;
}

/* ══════════════════ Features ══════════════════ */
.features-section {
  padding: 3rem 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.section-header h2 {
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.03em;
  margin-bottom: 0.6rem;
}
.section-header p {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.7;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.feature-icon { font-size: 2rem; margin-bottom: 1rem; display: block; line-height: 1; }
.feature-card h3 {
  font-family: 'Noto Serif JP', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
}
.feature-card p { font-size: 0.88rem; color: var(--muted); line-height: 1.7; }

/* ══════════════════ Game spotlight ══════════════════ */
.spotlight-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 3rem 1.25rem;
}

/* Mobile: single column, board hidden */
.spotlight-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

.spotlight-board { display: none; }

.board-lg {
  width: 260px;
  height: 260px;
  background-image: repeating-conic-gradient(#f0d9b5 0% 25%, #b58863 0% 50%);
  background-size: 65px 65px;
  border-radius: 10px;
  border: 8px solid var(--accent-dark);
  box-shadow: var(--shadow-lg);
  position: relative;
}

.board-label {
  position: absolute;
  bottom: -2.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.spotlight-content .game-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}
.spotlight-content .game-subtitle {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

.quality-legend {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 2rem;
}
.quality-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--text-sub);
}
.q-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ══════════════════ CTA strip ══════════════════ */
.cta-section {
  background: linear-gradient(135deg, #2e2416 0%, #4a3828 100%);
  padding: 3.5rem 1.25rem;
  text-align: center;
}
.cta-section h2 {
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 0.75rem;
  letter-spacing: 0.04em;
}
.cta-section p {
  font-size: 1rem;
  color: var(--accent-light);
  opacity: 0.7;
  margin-bottom: 2rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

/* ══════════════════ Buttons ══════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
  cursor: pointer;
  border: none;
  font-family: inherit;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: linear-gradient(135deg, #b58863, #9a7050);
  color: #fff;
  box-shadow: 0 4px 16px rgba(46,36,22,0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #9a7050, #7a5838);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(46,36,22,0.4);
}
.btn-light {
  background: var(--accent-light);
  color: var(--text);
  box-shadow: 0 4px 16px rgba(46,36,22,0.15);
}
.btn-light:hover {
  background: #fff;
  transform: translateY(-2px);
}
.btn-block { width: 100%; justify-content: center; }

/* ══════════════════ Games grid ══════════════════ */
.games-section {
  padding: 3rem 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ══════════════════ Content / Legal pages ══════════════════ */
.page-hero {
  background: linear-gradient(135deg, #b58863 0%, #d4a87a 50%, #f0d9b5 100%);
  padding: 3rem 1.25rem;
  text-align: center;
  border-bottom: 2px solid var(--accent);
}
.page-hero h1 { font-size: 2rem; font-weight: 900; color: var(--text); margin-bottom: 0.4rem; letter-spacing: -0.02em; }
.page-hero p { color: var(--text); opacity: 0.75; font-size: 0.9rem; }

.container {
  max-width: 820px;
  margin: 1.5rem auto;
  padding: 0 1.25rem;
  flex: 1;
}

.content-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.content-card-center { text-align: center; padding: 3rem 1.5rem; }

h2 { font-size: 1.05rem; font-weight: 700; margin: 2rem 0 0.6rem; color: var(--accent-dark); }
h2:first-child { margin-top: 0; }
p, li { line-height: 1.85; color: var(--text-sub); font-size: 0.95rem; }
ul { padding-left: 1.5rem; margin-top: 0.4rem; }
li { margin-bottom: 0.35rem; }
a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }

/* Thanks page */
.icon-xl { font-size: 3rem; margin-bottom: 1rem; display: block; line-height: 1; }
.btn-group { margin-top: 2rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ══════════════════ Contact form ══════════════════ */
.form-group { margin-bottom: 1.5rem; }
label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.45rem; color: var(--text); }
label .req { color: #b02020; margin-left: 0.2rem; }
input, textarea, select {
  width: 100%;
  background: #fdf9f3;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(181,136,99,0.18);
}
input, select { border-radius: 999px; }
textarea { resize: vertical; min-height: 140px; border-radius: 16px; }
.form-note { font-size: 0.8rem; color: var(--muted); margin-top: 1rem; line-height: 1.6; }

/* ══════════════════ Footer ══════════════════ */
footer {
  background: var(--text);
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.82rem;
  color: var(--accent-light);
}
.footer-links { margin-bottom: 0.65rem; }
footer a { color: var(--accent-light); text-decoration: none; margin: 0 0.6rem; opacity: 0.8; transition: opacity 0.2s; }
footer a:hover { opacity: 1; }
footer p { opacity: 0.5; font-size: 0.78rem; }

/* ══════════════════ Desktop enhancements ══════════════════ */
@media (min-width: 769px) {
  header { padding: 0.85rem 2rem; }
  .header-right { gap: 1.5rem; }
  nav a { display: inline; }
  nav a:hover { color: var(--accent); }

  .hero { grid-template-columns: 1fr 1fr; padding: 4.5rem 2rem; gap: 3rem; }
  .hero-visual { order: 0; }
  .board-deco { width: 260px; height: 260px; background-size: 65px 65px; }
  .board-piece { font-size: 2.8rem; }

  .stats-bar { gap: 3rem; padding: 1.25rem 2rem; }

  .features-section, .games-section { padding: 4.5rem 2rem; }

  .spotlight-section { padding: 4.5rem 2rem; }
  .spotlight-inner { grid-template-columns: 1fr 1fr; gap: 4rem; }
  .spotlight-board { display: flex; position: relative; justify-content: center; }
  .board-lg { width: 320px; height: 320px; background-size: 80px 80px; }

  .cta-section { padding: 4rem 2rem; }

  .container { margin: 2.5rem auto; padding: 0 2rem; }
  .content-card { padding: 2.5rem; }
  .content-card-center { padding: 3rem 2rem; }

  footer { padding: 2rem; }
}

/* ══════════════════ Guide / Article pages ══════════════════ */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.guide-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.guide-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.guide-card-icon { font-size: 2rem; line-height: 1; }
.guide-card h3 {
  font-family: 'Noto Serif JP', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.guide-card p { font-size: 0.85rem; color: var(--muted); margin: 0; line-height: 1.65; }
.guide-card-arrow { font-size: 0.8rem; color: var(--accent); margin-top: auto; padding-top: 0.5rem; font-weight: 700; }

/* Article body */
.article-body h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2.25rem 0 0.7rem;
  color: var(--accent-dark);
  border-left: 4px solid var(--accent);
  padding-left: 0.75rem;
}
.article-body h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
}
.article-body p { font-size: 0.95rem; line-height: 1.9; color: var(--text-sub); margin-bottom: 0.85rem; }
.article-body ul, .article-body ol { padding-left: 1.6rem; margin-bottom: 1rem; }
.article-body li { font-size: 0.93rem; line-height: 1.85; color: var(--text-sub); margin-bottom: 0.4rem; }
.article-body strong { color: var(--text); }

/* Piece table */
.piece-table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 0.88rem; }
.piece-table th {
  background: var(--accent-light);
  color: var(--text);
  font-weight: 700;
  padding: 0.65rem 0.9rem;
  text-align: left;
  border: 1px solid var(--border);
}
.piece-table td {
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-sub);
  line-height: 1.6;
}
.piece-table tr:nth-child(even) td { background: #fdf9f3; }
.piece-symbol { font-size: 1.4rem; line-height: 1; }

/* Info box */
.info-box {
  background: var(--accent-light);
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
}
.info-box strong { display: block; margin-bottom: 0.3rem; color: var(--accent-dark); }

/* Score badge row */
.score-row { display: flex; flex-direction: column; gap: 0.75rem; margin: 1rem 0 1.5rem; }
.score-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
}
.score-dot {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; margin-top: 4px;
}
.score-item-text { flex: 1; }
.score-item-text strong { font-size: 0.92rem; color: var(--text); display: block; margin-bottom: 0.15rem; }
.score-item-text span { font-size: 0.83rem; color: var(--muted); line-height: 1.5; }

/* Breadcrumb */
.breadcrumb {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--accent-dark); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { opacity: 0.5; }

/* Article CTA */
.article-cta {
  background: linear-gradient(135deg, #2e2416 0%, #4a3828 100%);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  margin-top: 2.5rem;
}
.article-cta h3 {
  font-family: 'Noto Serif JP', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
}
.article-cta p { font-size: 0.88rem; color: var(--accent-light); opacity: 0.7; margin-bottom: 1.25rem; }

@media (min-width: 769px) {
  .article-body h2 { font-size: 1.25rem; }
  .score-row { flex-direction: column; }
}

/* ══════════════════ RTL (Arabic) ══════════════════ */
[dir="rtl"] { direction: rtl; }
[dir="rtl"] body { text-align: right; }
[dir="rtl"] nav a { margin-left: 0; margin-right: 1.5rem; }
[dir="rtl"] ul { padding-left: 0; padding-right: 1.5rem; }
[dir="rtl"] .hero-actions { flex-direction: row-reverse; }
[dir="rtl"] .hero-content { text-align: right; }
[dir="rtl"] .hero-badge { direction: rtl; }
[dir="rtl"] .quality-item { flex-direction: row-reverse; }
[dir="rtl"] .stats-bar { direction: rtl; }
[dir="rtl"] .section-header { direction: rtl; }
[dir="rtl"] label .req { margin-left: 0; margin-right: 0.2rem; }
[dir="rtl"] .form-note { text-align: right; }
[dir="rtl"] .footer-links { direction: rtl; }
[dir="rtl"] .spotlight-content { text-align: right; }
[dir="rtl"] .quality-legend { text-align: right; }
[dir="rtl"] .btn-group { flex-direction: row-reverse; }
