/* ======================
   StarP 共通スタイル
   ====================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #000000;
  color: white;
  overflow: hidden;
  height: 100vh;
  position: relative;
}

/* Add Form */
#addForm {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 100;
  display: flex;
  gap: 6px;
  width: 320px;
}

#addForm input {
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 4px;
}

#addForm input[type="text"] {
  width: 100px;
}

#addForm input[type="url"] {
  flex: 1;
}

#addForm button {
  padding: 5px 10px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  min-width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Settings Button (Gear) */
#settingsBtn {
  position: absolute;
  top: 70px;
  left: 12px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  z-index: 100;
}

#settingsBtn svg {
  width: 100%;
  height: 100%;
}

/* Background Toggle */
#bgToggle {
  position: absolute;
  top: 70px;
  left: 55px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  z-index: 100;
}

#bgToggle svg {
  width: 100%;
  height: 100%;
}

/* Clock */
#clock {
  position: absolute;
  left: 100px;
  top: 72px;
  font-size: 20px;
  font-weight: bold;
  z-index: 90;
  background: transparent;
}

/* Site Card */
.site {
  position: absolute;
  width: 100px;
  text-align: center;
  background: white;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  user-select: none;
  z-index: 10;
  transform-origin: top left;
}

.site.dragging {
  cursor: grabbing !important;
  opacity: 0.8;
}

.site img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.site-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 20px;
  display: block;
  margin-top: 4px;
  color: #333;
}

.actions {
  display: none;
  margin-top: 6px;
}

.site:hover .actions {
  display: block;
}

.actions button {
  width: 28px;
  height: 28px;
  margin: 0 2px;
  border: none;
  border-radius: 50%;
  background: #f0f0f0;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.actions button:hover {
  background: #e0e0e0;
}

.actions svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  justify-content: center;
  align-items: center;
}

.modal > div {
  background: white;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 360px;
}

.modal h3 {
  margin-top: 0;
  color: #333;
  font-size: 20px;
}

.modal input {
  width: 100%;
  padding: 8px;
  margin: 6px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.modal button {
  padding: 6px 12px;
  margin: 4px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

#cancelEdit,
#closeSettings {
  background: #f0f0f0;
  color: #333;
}

#saveEdit,
#exportBtn {
  background: #4CAF50;
  color: white;
  border: none;
}

#importBtn {
  background: #2196F3;
  color: white;
  border: none;
}

#resetBtn {
  background: #f44336;
  color: white;
  border: none;
  width: 100%;
  padding: 8px;
  margin: 10px 0;
}

.modal svg {
  margin-right: 6px;
}

/* Icon Size Slider */
.slider-container {
  margin: 12px 0;
}

.slider-container label {
  display: block;
  margin-bottom: 6px;
  color: #333;
}

.slider-container input[type="range"] {
  width: 100%;
}

.slider-value {
  font-size: 14px;
  color: #333;
  text-align: right;
}

#addForm a.info-link {
  font-size: 18px;
  color: #aaa;
  text-decoration: none;
  margin-left: 18px;
  align-self: center;
  white-space: nowrap;
  transition: color 0.2s;
}

#addForm a.info-link:hover {
  color: #00bfff;
}

/* ======================
   SNS Share Buttons
   ====================== */

.share-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center; /* ← これで中央寄せ - ここを削除で左寄せ */
  margin-top: 16px;
}

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  min-width: 100px;
}

.share-button:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.share-button.x {
  background-color: #000000;
}

.share-button.facebook {
  background-color: #1877F2;
}

.share-button.line {
  background-color: #00C300;
}

.share-button.bluesky {
  background-color: #0085FF;
}

.share-button.general {
  background-color: #6c757d;
}

/* ======================
   About Page Overrides
   ====================== */

/* aboutページはスクロール可能・フルスクリーン解除 */
body.about-page {
  overflow: auto;
  height: auto;
  padding-top: 20px;
}

/* ヘッダー画像 */
.header-image {
  width: 100%;
  height: auto;
  display: block;
}

/* プルダウン */
.dropdown {
  padding: 1rem;
  background-color: rgba(0,0,0,0.1);
  text-align: center;
  margin: 0 auto 2rem;
  max-width: 800px;
}

.dropdown select {
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  background-color: rgba(0,0,0,0.2);
  color: white;
  cursor: pointer;
}

/* セクション */
section {
  padding: 2rem 1rem;
  max-width: 800px;
  margin: 0 auto;
}

h2 {
  margin-bottom: 1.2rem;
  font-size: 1.6rem;
}

.accordion {
  margin-bottom: 1rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  overflow: hidden;
}

.accordion-header {
  padding: 1rem 1.2rem;
  background-color: rgba(255,255,255,0.1);
  cursor: pointer;
  font-weight: bold;
}

.accordion-content {
  padding: 1.2rem;
  display: none;
  background-color: rgba(0,0,0,0.2);
  line-height: 1.7;
}

.accordion.active .accordion-content {
  display: block;
}

.content-image {
  width: 100%;
  height: auto;
  margin: 1rem 0 1.5rem;
  border-radius: 8px;
}

ul {
  padding-left: 1.5rem;
  margin: 0.8rem 0;
}

li {
  margin-bottom: 0.4rem;
}

footer {
  text-align: center;
  padding: 2.5rem 1rem 4.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* レスポンシブ */
@media (max-width: 600px) {
  h2 {
    font-size: 1.4rem;
  }
  .dropdown select {
    width: 90%;
    max-width: 280px;
  }
}

/* 記事の共通クラス */
body.page-scroll {
  overflow: auto;
  height: auto;
  padding-top: 70px;
}

#bgToggle {
  position: absolute;
  top: 45px;
  left: 24px;
  z-index: 100;
}

body.page-scroll #bgToggle {
  position: fixed;
}

body.page-scroll #bgToggle {
  position: fixed;
  z-index: 5000;
}

/* === 背景色テーマ切替 === */
body.black-theme {
  background: #000000 !important;
  color: white !important;
}

body.cream-theme {
  background: #fdf6e3 !important;
  color: #333 !important;
}

/* 固定ヘッダーは常に黒背景 */
.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(0,0,0,0.9); /* 常に黒 */
  padding: 10px 0;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.header-nav {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  justify-content: center; /* 中央寄せ */
  gap: 20px; /* リンク間の間隔 */
  padding: 0 1rem;
}

.header-nav a {
  color: white; /* 常に白文字 */
  text-decoration: none;
  font-size: 0.95rem;
}

.header-nav a:hover {
  text-decoration: underline;
}


.category-card {
  background: rgba(255,255,255,0.05); /* 黒背景なら薄グレーのBOX */
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.category-title {
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
}

.category-desc {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.category-link {
  display: inline-block;
  color: #4DA6FF;
  text-decoration: none;
}

.category-link:hover {
  text-decoration: underline;
}

/*  */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
  padding-top: 70px; /* 固定ヘッダーの高さ分 */
  margin: 0;
  
 /* 初期は黒 */
  color: white;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem; /* 上下左右の余白を確保 */
}

h1 {
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.category-card {
  background: rgba(255,255,255,0.05);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

/* 画面スクロール */
body.page-scroll {
  overflow: auto;
  height: auto;
  padding-top: 70px; /* 固定ヘッダー分 */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
  padding-top: 70px;
  margin: 0;
  color: white;
}