/* 全体リセットと基本設定 */
* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0; padding: 0;
  background-color: #f9f9f9;
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.dark {
  background-color: #121212;
  color: #ddd;
}

/* ヘッダー */
header {
  background-color: #3a3f51;
  color: white;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
}

nav a {
  color: white;
  text-decoration: none;
  margin-left: 15px;
  font-weight: 600;
}

nav a:hover {
  text-decoration: underline;
}

nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* メインコンテンツ */
main {
  flex: 1 0 auto;
  padding: 20px;
  max-width: 960px;
  margin: 0 auto;
}

.money-display {
  font-size: 2rem;
  margin-bottom: 20px;
  font-weight: 700;
}

.click-button {
  font-size: 1.25rem;
  padding: 12px 30px;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  background-color: #4caf50;
  color: white;
  transition: background-color 0.3s ease;
  user-select: none;
}

.click-button:hover {
  background-color: #45a049;
}

.controls {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background-color: #3a3f51;
  color: white;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease;
  flex: 1 1 140px;
  text-align: center;
}

.btn:hover:not(:disabled) {
  background-color: #2a2d3b;
}

.btn:disabled {
  background-color: #888;
  cursor: default;
}

/* バージョン表記 */
.version {
  margin-top: 30px;
  font-size: 0.9rem;
  color: #666;
  text-align: center;
}

/* トースト通知コンテナ */
.toast-container {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 300px;
}

/* トースト通知本体 */
.toast {
  background-color: rgba(0,0,0,0.85);
  color: white;
  padding: 12px 20px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
  user-select: none;
  font-weight: 600;
}

/* フェードアウト時 */
.toast.fadeout {
  opacity: 0;
  transform: translateX(100%);
}

/* アップグレードページ用 */
.upgrade-item {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 12px;
  background-color: #fff;
  transition: background-color 0.3s ease;
}

body.dark .upgrade-item {
  background-color: #2a2d3b;
  border-color: #555;
}

.upgrade-item button {
  margin-top: 8px;
  padding: 8px 16px;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  background-color: #3a3f51;
  color: white;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.upgrade-item button:disabled {
  background-color: #777;
  cursor: not-allowed;
}

.upgrade-item button:hover:not(:disabled) {
  background-color: #2a2d3b;
}

/* 実績ページ用 */
.achievement-item {
  border: 1px solid #bbb;
  border-radius: 6px;
  padding: 12px 15px;
  margin-bottom: 10px;
  background-color: #fafafa;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

body.dark .achievement-item {
  background-color: #1f222a;
  border-color: #555;
}

/* ヘルプ・更新履歴ページの段落 */
main section {
  margin-bottom: 20px;
}

main h2 {
  margin-bottom: 10px;
  border-bottom: 2px solid #4caf50;
  padding-bottom: 5px;
  font-weight: 700;
  color: #3a3f51;
}

body.dark main h2 {
  color: #90ee90;
  border-color: #90ee90;
}

/* スマホレスポンシブ対応 */
@media (max-width: 600px) {
  nav {
    flex-direction: column;
    align-items: flex-start;
  }

  nav a {
    margin: 6px 0;
  }

  .controls {
    flex-direction: column;
  }

  .btn {
    flex: none;
    width: 100%;
  }

  .click-button {
    width: 100%;
  }
}