:root {
  --bg: #ffffff;
  --bg-card: #ffffff;
  --fg: #1a1410;
  --accent: #c8a45c;
  --accent-strong: #a87f3a;
  --danger: #b03030;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --border: 1px solid #e0d6c2;
}

* { box-sizing: border-box; }

html, body {
  background: #ffffff;
}

body {
  margin: 0;
  color: var(--fg);
  font-family: "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  line-height: 1.6;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
  text-align: center;
  padding: 24px 16px 8px;
  border-bottom: 1px solid #e0d6c2;
  background: #ffffff;
}
.site-header h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.1em;
  color: var(--accent-strong);
  font-weight: bold;
}
.site-header p.tagline {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--accent-strong);
  font-weight: bold;
  opacity: 1;
}

/* Unity container wrapper */
.game-wrapper {
  display: flex;
  justify-content: center;
  padding: 24px 16px;
  background: #ffffff;
}
#unity-container {
  box-shadow: var(--shadow);
  border: var(--border);
  background: #000;
  /* 横幅(ラッパー幅)と縦幅(ビューポート高 - 32px)の小さい方に合わせてスケール */
  width: min(100%, calc((100vh - 32px) * 960 / 600));
  aspect-ratio: 960 / 600;
}
#unity-canvas {
  width: 100% !important;
  height: 100% !important;
}
#unity-footer { position: absolute; left: 0; right: 0; bottom: -38px; height: 38px; }

/* ローディング中の Unity ロゴ、フッターロゴ、ビルドタイトルを非表示 */
#unity-logo,
#unity-logo-title-footer,
#unity-build-title { display: none !important; }

/* 全画面表示ボタンを非表示（全画面時の操作性が悪いため無効化） */
#unity-fullscreen-button { display: none !important; }

/* Share bar */
.share-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: #ffffff;
  flex-wrap: wrap;
}
.share-bar a.btn-x {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #000;
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: bold;
  border: 1px solid #333;
  transition: background 0.2s;
}
.share-bar a.btn-x:hover {
  background: #222;
  text-decoration: none;
}
.share-bar a.btn-x svg { width: 18px; height: 18px; fill: #fff; }

/* Stores section */
.stores {
  padding: 32px 16px 48px;
  max-width: 1100px;
  margin: 0 auto;
}
.stores h2 {
  text-align: center;
  font-size: 22px;
  color: var(--accent-strong);
  margin: 0 0 8px;
  letter-spacing: 0.08em;
}
.stores p.lead {
  text-align: center;
  margin: 0 0 24px;
  opacity: 0.85;
  font-size: 14px;
}
.store-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.store-card {
  background: var(--bg-card);
  border: var(--border);
  border-radius: 8px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.store-card .platform-name {
  font-size: 16px;
  font-weight: bold;
  color: var(--accent-strong);
  letter-spacing: 0.05em;
}
.store-card .qr {
  background: #fff;
  padding: 8px;
  border-radius: 4px;
  width: 132px;
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.store-card .qr canvas,
.store-card .qr img { display: block; width: 116px; height: 116px; }
.store-card a.store-btn {
  display: inline-block;
  background: var(--accent);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 14px;
  width: 100%;
  transition: background 0.2s;
}
.store-card a.store-btn:hover {
  background: var(--accent-strong);
  text-decoration: none;
  color: #ffffff;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 20px 16px;
  border-top: 1px solid #e0d6c2;
  background: #ffffff;
  font-size: 12px;
  opacity: 0.85;
}
.site-footer .legal-links {
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.site-footer .legal-links a {
  color: var(--accent-strong);
  font-weight: bold;
}
.site-footer .legal-links .sep {
  opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
  .store-grid { grid-template-columns: repeat(2, 1fr); }
  .site-header h1 { font-size: 22px; }
  .game-wrapper { padding: 12px 16px; }
  #unity-footer { display: none; }
}
@media (max-width: 420px) {
  .store-grid { grid-template-columns: 1fr; }
  .stores { padding: 24px 12px 32px; }
}
