:root {
  --bg: #1a1a1a;
  --text: #d0d0d0;
  --heading: #ffffff;
  --muted: #888;
  --accent: #5cb85c;
  --accent-hover: #6bc46b;
  --border: #2e2e2e;
  --card-bg: #222;
  --nav-bg: #141414;
  --sidebar-width: 220px;
}
body.light {
  --bg: #d8d8d8;
  --text: #1a1a1a;
  --heading: #000000;
  --muted: #555;
  --accent: #2d7c2d;
  --accent-hover: #1f5e1f;
  --border: #999999;
  --card-bg: #c8c8c8;
  --nav-bg: #c0c0c0;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  transition: background 0.2s, color 0.2s;
}

aside.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--nav-bg);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
aside.sidebar .logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--heading);
  text-decoration: none;
  display: block;
  padding: 0 8px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
aside.sidebar .play-button {
  display: block;
  background: var(--accent);
  color: #ffffff !important;
  text-align: center;
  padding: 12px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  margin-bottom: 16px;
}
aside.sidebar .play-button:hover {
  background: var(--accent-hover);
}
aside.sidebar ul {
  list-style: none;
  flex: 1;
}
aside.sidebar li { margin-bottom: 2px; }
aside.sidebar a {
  display: block;
  padding: 9px 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
}
aside.sidebar a:hover {
  background: var(--card-bg);
  color: var(--accent);
}
aside.sidebar .theme-toggle {
  width: 100%;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  margin-top: 16px;
}
aside.sidebar .theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

main {
  margin-left: var(--sidebar-width);
  max-width: 880px;
  padding: 48px 32px 80px;
}
main.play-main {
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}
main.play-main > * {
  width: 100%;
  max-width: 1200px;
}

.hero {
  text-align: center;
  padding: 64px 0 48px;
}
.hero h1 {
  font-size: 56px;
  color: var(--heading);
  margin-bottom: 12px;
  letter-spacing: -1px;
}
.hero .tagline {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 36px;
}
.btn-play {
  display: inline-block;
  background: var(--accent);
  color: #ffffff;
  padding: 14px 40px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 17px;
  font-weight: 700;
  transition: background 0.15s;
}
.btn-play:hover { background: var(--accent-hover); }

/* 公開までプレイボタンを無効化(準備中表示)。公開時はこのブロック削除＋index.htmlのspanをaに戻す */
.play-button.disabled,
.btn-play.disabled {
  background: #888 !important;
  color: #eee !important;
  cursor: not-allowed;
  opacity: 0.65;
  pointer-events: none;
}

.page-header {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.page-header h1 {
  font-size: 36px;
  color: var(--heading);
  margin-bottom: 4px;
}
.page-header p { color: var(--muted); }

section {
  margin-bottom: 56px;
  scroll-margin-top: 24px;
}
section h2 {
  font-size: 26px;
  color: var(--heading);
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
section p { margin-bottom: 12px; }
section p:last-child { margin-bottom: 0; }

table.controls {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: 6px;
  overflow: hidden;
  margin: 16px 0;
}
table.controls th,
table.controls td {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
table.controls thead th {
  font-weight: 700;
  color: var(--heading);
  background: rgba(255,255,255,0.04);
  font-size: 14px;
}
body.light table.controls thead th { background: rgba(0,0,0,0.08); }
table.controls tbody tr:last-child td { border-bottom: none; }
table.controls td:first-child {
  width: 160px;
  font-weight: 600;
  color: var(--heading);
  font-family: ui-monospace, "SF Mono", "Consolas", monospace;
}

.screenshots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.shot {
  aspect-ratio: 16 / 10;
  background: var(--card-bg);
  border: 1px dashed var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}

.faq dt {
  font-weight: 700;
  color: var(--heading);
  margin-top: 16px;
  margin-bottom: 4px;
}
.faq dd { padding-left: 16px; color: var(--text); }
.faq dt:first-child { margin-top: 0; }

.community-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.community-button {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
.community-button:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.community-button .icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}
.community-button .label strong {
  display: block;
  color: var(--heading);
  font-size: 15px;
  font-weight: 700;
}
.community-button .label small {
  color: var(--muted);
  font-size: 12px;
}

/* お知らせ (トップ用の一覧) */
.news-list {
  list-style: none;
  padding: 0;
}
.news-list li {
  display: flex;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.news-list li:last-child { border-bottom: none; }
.news-list time {
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", "Consolas", monospace;
  font-size: 13px;
  flex-shrink: 0;
  width: 100px;
}
.news-list a {
  color: var(--text);
  text-decoration: none;
}
.news-list a:hover { color: var(--accent); }
.news-more {
  display: inline-block;
  margin-top: 16px;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}
.news-more:hover { text-decoration: underline; }

/* プレイページ用 (play.html 用) */
html.play-html,
html.play-html body.play-page {
  overflow: hidden !important;
  height: 100vh !important;
  width: 100vw !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.play-page main.play-main {
  position: fixed !important;
  top: 0 !important;
  left: var(--sidebar-width) !important;
  right: 0 !important;
  bottom: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  background: transparent !important;
  max-width: none !important;
  overflow: hidden !important;
}
body.play-page aside.sidebar { z-index: 100; }
body.play-page footer { display: none; }
body.play-page .game-frame {
  /* 残りスペースを取って iframe を中央配置。サイズはコンテナに合わせて維持。 */
  flex: 1 1 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: static !important;
  width: auto !important;
  height: auto !important;
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  overflow: hidden !important;
  min-height: 0 !important;
}
body.play-page .game-frame iframe {
  width: 600px !important;
  height: 400px !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border: none !important;
  display: block !important;
  flex: 0 0 auto !important;
}
body.play-page .play-notice {
  /* 通常フローで main.play-main の最上段、左寄せに配置 (flex item) */
  flex: 0 0 auto;
  align-self: flex-start;       /* 左寄せ */
  position: static;
  margin: 12px 0 0 20px;
  max-width: 520px;             /* 必要分の幅で止める */
  padding: 10px 14px;
  background: rgba(220, 80, 80, 0.15);
  border: 1px solid rgba(220, 80, 80, 0.55);
  border-radius: 6px;
  color: #ff9696;
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
  box-sizing: border-box;
  z-index: 200;
}
body.play-page .play-notice-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  color: #ffb4b4;
}
body.play-page .play-notice ul {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
}
body.play-page .play-notice li {
  margin: 2px 0;
  line-height: 1.5;
}
/* ライトモード時は濃いめの赤で警告色を強調する */
body.play-page.light .play-notice {
  background: #fde2e2;            /* 薄いピンクのベタ塗り */
  border: 1px solid #c0392b;      /* 強い赤の枠 */
  color: #6e1a1a;                 /* 濃い赤 */
  font-weight: 600;
}
body.play-page.light .play-notice-title {
  color: #4d0d0d;
  font-weight: 800;
}

/* お知らせ詳細 (news.html 用) */
article.news-entry {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
article.news-entry:last-child { border-bottom: none; }
article.news-entry time {
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", "Consolas", monospace;
  font-size: 13px;
}
article.news-entry h3 {
  color: var(--heading);
  font-size: 20px;
  margin: 4px 0 12px;
}
article.news-entry p { margin-bottom: 8px; }
article.news-entry p:last-child { margin-bottom: 0; }
article.news-entry ul {
  margin-left: 20px;
  margin-top: 8px;
}

footer {
  margin-left: var(--sidebar-width);
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
footer a {
  color: var(--muted);
  margin: 0 8px;
  text-decoration: none;
}
footer a:hover { color: var(--accent); }

@media (max-width: 768px) {
  aside.sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 16px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  aside.sidebar .logo {
    border: none;
    padding: 0;
    margin: 0 12px 0 0;
    font-size: 18px;
  }
  aside.sidebar ul {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    flex: 1;
  }
  aside.sidebar a { padding: 6px 10px; font-size: 13px; }
  aside.sidebar .theme-toggle {
    width: auto;
    margin: 0;
    padding: 6px 10px;
  }
  main, footer { margin-left: 0; }
  main { padding: 32px 16px 48px; }
  .hero { padding: 40px 0 32px; }
  .hero h1 { font-size: 40px; }
  .hero .tagline { font-size: 16px; }
  .news-list li { flex-direction: column; gap: 4px; }
  .news-list time { width: auto; }

  /* プレイページ: サイドバーが上に来るので、main は fixed をやめて通常フローへ */
  body.play-page main.play-main {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 60vh !important;
  }
  body.play-page .play-notice {
    margin: 8px 12px;
    max-width: none;
  }
}
