:root {
  /* 色設計: 深みのあるダークテーマ */
  --bg-main: #050505;
  --bg-card: #111111;
  --border-color: #333333;
  
  /* アクセントカラー: 知的なブルーからパープルへのグラデーション */
  --accent-primary: #3b82f6;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --accent-glow: rgba(59, 130, 246, 0.5);

  --text-main: #f3f4f6;
  --text-sub: #9ca3af;
  
  --radius-lg: 16px;
  --radius-md: 12px;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* 背景にうっすら光を配置して高級感を出す */
.background-glow {
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-sub);
  font-size: 14px;
  margin-bottom: 32px;
}

/* カードデザイン: 境界線をうっすら光らせる */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  width: 100%;
}

/* ボタンのグリッド配置 */
.button-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.choice-editor {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.choice-row label {
  width: 32px;
  font-weight: 700;
  color: var(--text-sub);
}

.choice-hint {
  margin: 6px 0 0 0;
  color: var(--text-sub);
  font-size: 12px;
}

button {
  width: 100%;
  background: var(--bg-main); /* 通常時は暗く */
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  font-family: var(--font-family);
}

/* ボタンのホバー・アクティブ時の演出 */
button:hover {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.05);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

button:active {
  transform: scale(0.98) translateY(0);
  background: rgba(59, 130, 246, 0.1);
}

/* 入力エリアのデザイン */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  align-items: stretch;
}

input {
  flex: 1;
  width: 100%;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 16px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s;
  font-family: var(--font-family);
}

input:focus {
  border-color: var(--accent-primary);
  background: #000;
}

/* 送信ボタン（入力エリア専用） */
.send-btn {
  width: 100%;
  background: var(--accent-gradient);
  border: none;
  color: white;
  padding: 0 24px;
  font-weight: 700;
}

.send-btn:hover {
  background: var(--accent-primary);
  box-shadow: 0 0 20px var(--accent-glow);
}

footer {
  margin-top: 48px;
  font-size: 11px;
  color: var(--text-sub);
  opacity: 0.4;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* -------------------------- */
/* モバイル最適化: index.html */
/* -------------------------- */
body.page-index {
  padding: 0;
  align-items: stretch;
  justify-content: flex-start;
}

.page-index .container {
  max-width: none;
  min-height: 100vh;
  padding: 32px 20px 40px;
  justify-content: center;
  gap: 24px;
}

.page-index h1 {
  font-size: 22px;
  text-align: center;
  margin-bottom: 8px;
}

.page-index #area.panel {
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-index .button-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
}

.page-index button {
  font-size: 20px;
  padding: 18px;
  border-radius: 14px;
  min-height: 64px;
}

.page-index .input-group {
  gap: 14px;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.page-index input {
  font-size: 18px;
  padding: 16px;
  border-radius: 14px;
}

.page-index .send-btn {
  font-size: 18px;
  padding: 18px;
  border-radius: 14px;
}

.page-index footer {
  margin-top: 12px;
}

/* ------------------------- */
/* デスクトップ最適化: 管理・集計 */
/* ------------------------- */
body.page-admin,
body.page-result {
  justify-content: flex-start;
  align-items: stretch;
  padding: 32px 40px;
}

.page-admin .container,
.page-result .container {
  max-width: 1200px;
  gap: 24px;
  padding: 16px 0 48px;
  text-align: left;
}

.page-admin h1,
.page-result h1 {
  font-size: 32px;
  margin-bottom: 12px;
}

.page-admin .panel,
.page-result .panel {
  padding: 28px;
}

.page-admin .button-grid {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 16px;
}

.page-admin .button-grid button {
  flex: 1 1 200px;
  min-width: 200px;
}

.page-admin .choice-editor {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 16px;
}

.page-admin .choice-row {
  width: calc(50% - 8px);
}

.page-admin .choice-hint {
  width: 100%;
  margin-top: 4px;
}

.page-result #chartPanel {
  min-height: 520px;
  display: flex;
  align-items: center;
}

.page-result #chart {
  width: 100% !important;
  height: 420px !important;
}

.page-result #textPanel {
  font-size: 18px;
  line-height: 1.8;
}

@media (max-width: 768px) {
  body.page-admin,
  body.page-result {
    padding: 20px 16px;
  }

  .page-admin .container,
  .page-result .container {
    padding: 0;
  }

  .page-admin .button-grid,
  .page-admin .choice-editor {
    flex-direction: column;
  }

  .page-admin .choice-row {
    width: 100%;
  }

  .page-admin h1,
  .page-result h1 {
    font-size: 26px;
  }
}
