:root {
  --bg: #0a0a0c;
  --card: #111114;
  --text: #e5e5e7;
  --muted: #8b8b94;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #00B8FF;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[lang='ja'] body {
  font-family: "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", "Meiryo", -apple-system, BlinkMacSystemFont, sans-serif;
}

html[lang='en'] body {
  font-family: "Charter", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

html[lang='en'] .legal-title,
html[lang='en'] .legal-lang-switch button,
html[lang='en'] .legal-back,
html[lang='en'] .legal-meta {
  font-family: "Avenir Next", "SF Pro Text", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.legal-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px;
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

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

.legal-lang-switch {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}

.legal-lang-switch a,
.legal-lang-switch button {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.legal-lang-switch a.active,
.legal-lang-switch button.active {
  color: #ffffff;
  background: var(--accent);
}

.legal-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.3);
}

.legal-title {
  margin: 0;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: #ffffff;
}

.legal-meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.legal-content {
  margin-top: 20px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.85;
  overflow-x: auto;
  color: rgba(255, 255, 255, 0.7);
}

html[lang='en'] .legal-content {
  font-size: 16px;
  line-height: 1.9;
}

@media (max-width: 720px) {
  .legal-page {
    padding: 14px;
  }

  .legal-card {
    padding: 18px;
    border-radius: 14px;
  }

  .legal-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
