:root {
  --ink: #1d1206;
  --brown-900: #24170a;
  --brown-800: #33210e;
  --brown-700: #4a3014;
  --brown-500: #7a5424;
  --gold: #e3b45c;
  --gold-soft: #c99a49;
  --cream: #fbf0d8;
  --cream-dim: #d9c7a3;
  --blue: #6fb8ff;
  /* 台座のパネルに合わせた、淡めの虹色 */
  --rainbow: linear-gradient(100deg, #ffd36e, #ffef9a 18%, #a8f0b4 36%, #8fd6ff 54%, #b9a6ff 72%, #ff9fd0 88%, #ffd36e);
  --rainbow-text: linear-gradient(90deg, #ffe08a, #fff6c4, #b6f5c4, #a6e2ff, #d2c2ff, #ffc0e2, #ffe08a);
  --font-ui: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  --font-display: "Dela Gothic One", "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
}

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

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--brown-900);
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--gold);
}

button,
input {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

/* 言語ごとのブロック（js/common/i18n.js が <html lang> を切り替える） */
html[lang="en"] [data-lang="ja"],
html:not([lang="en"]) [data-lang="en"] {
  display: none !important;
}

/* 背景：ゲームと同じ素材を暗めに敷く */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #3a250f url("../assets/images/backgrounds/game.webp") center top / cover no-repeat;
}

.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(20, 12, 4, 0.25), rgba(20, 12, 4, 0.6));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--gold-soft);
  border-radius: 6px;
  background: var(--brown-800);
  color: var(--cream);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s, transform 0.08s;
}

.btn:hover {
  background: var(--brown-700);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}

.btn-primary {
  border-color: rgba(255, 255, 255, 0.7);
  background:
    linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 55%),
    var(--rainbow);
  background-size: 100% 100%, 200% 100%;
  color: #2a1a09;
  box-shadow: 0 2px 0 #6b4a1c, 0 0 18px rgba(200, 180, 255, 0.35);
  animation: shimmer 6s linear infinite;
}

.btn-primary:hover {
  filter: brightness(1.06);
  background:
    linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 55%),
    var(--rainbow);
  background-size: 100% 100%, 200% 100%;
}

@keyframes shimmer {
  from { background-position: 0 0, 0% 0; }
  to { background-position: 0 0, 200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary { animation: none; }
}

.sub-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.sub-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.sub-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.06em;
}

/* 見出しと戻るボタンは画面上部に固定し、見出しは中央に置く */
.sub-header-fixed {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  margin: -20px -16px 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  background: linear-gradient(#2a1a09, #2f1e0b);
  border-bottom: 1px solid rgba(227, 180, 92, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sub-header-fixed .back-link {
  justify-self: start;
}

.sub-header-fixed h1 {
  text-align: center;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(227, 180, 92, 0.5);
  border-radius: 6px;
  background: rgba(36, 23, 10, 0.7);
  color: var(--cream);
  font-size: 13px;
  text-decoration: none;
}

.panel {
  border: 1px solid rgba(227, 180, 92, 0.45);
  border-radius: 8px;
  background: rgba(30, 19, 8, 0.82);
}

.fineprint {
  color: var(--cream-dim);
  font-size: 12px;
}
