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

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding-top: 100px;
  padding-bottom: 56px;
  background: #1a1a2e;
  font-family: 'Yu Gothic', 'Meiryo', sans-serif;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: 12px 16px;
  text-align: center;
  background: #1a1a2e;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.site-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #e0e0e0;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.header-tabs {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.tab-link {
  padding: 8px 16px;
  color: #a0a0a0;
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: color 0.2s, background-color 0.2s;
}

.tab-link:hover {
  color: #e0e0e0;
  background-color: rgba(255, 255, 255, 0.08);
}

.tab-link.active {
  color: #e0e0e0;
  background-color: rgba(255, 255, 255, 0.12);
}

.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: 12px 16px;
  text-align: center;
  background: #1a1a2e;
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
}

.footer-text {
  font-size: 0.75rem;
  color: #888;
}

#game-container {
  position: relative;
  width: 1024px;
  height: 576px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  overflow: hidden;
}

#game-container:fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

#game-container:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

/* 設定パネル（Three.js Canvas 上の歯車クリックで表示） */
.config-panel {
  position: absolute;
  top: 44px;
  right: 8px;
  min-width: 180px;
  padding: 12px;
  background: rgba(26, 26, 46, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  z-index: 11;
  display: none;
}

.config-panel.is-open {
  display: block;
}

.config-panel-title {
  font-size: 0.75rem;
  color: #a0a0a0;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.config-panel-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.config-panel-btn {
  padding: 8px 12px;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #e0e0e0;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s, border-color 0.2s;
}

.config-panel-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
}

.config-panel-btn.active {
  background: rgba(232, 213, 183, 0.2);
  border-color: #e8d5b7;
  color: #e8d5b7;
}

#game-canvas {
  display: block;
}

.concept-section {
  width: 1024px;
  padding: 32px 40px;
  text-align: left;
  color: #a0a0a0;
}

.concept-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #e0e0e0;
  text-align: center;
  margin-bottom: 32px;
}

.concept-block {
  margin-bottom: 28px;
}

.concept-block:last-child {
  margin-bottom: 0;
}

.concept-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: #c0c0c0;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.concept-text {
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 12px;
}

.concept-text:last-child {
  margin-bottom: 0;
}

.concept-text strong {
  color: #d0d0d0;
  font-weight: 600;
}

.concept-text em {
  color: #e8d5b7;
  font-style: normal;
  font-weight: 500;
}

.tab-content.hidden {
  display: none;
}

/* ローディングオーバーレイ */
#loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(10, 10, 16, 0.85), rgba(10, 10, 16, 0.65));
  z-index: 12;
  transition: opacity 0.25s ease;
}

#loading-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-box {
  width: min(70%, 520px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.loading-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.4);
}

.loading-bar__fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #e8d5b7, #f0e6cf);
  box-shadow: 0 0 12px rgba(232, 213, 183, 0.65);
  transition: width 0.15s linear;
}

.loading-percent {
  font-size: 0.9rem;
  color: #e0e0e0;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}