/* ===== 周期表ジェネレータ カスタムスタイル ===== */

* {
  -webkit-tap-highlight-color: transparent;
}

body {
  background: radial-gradient(circle at 20% 10%, #1e293b 0%, #0f172a 55%, #020617 100%);
  background-attachment: fixed;
}

/* スクロールバー */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ===== 周期表セル ===== */
.pt-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  border: 1px solid rgba(255,255,255,.12);
  user-select: none;
}

.pt-cell:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 25px rgba(0,0,0,.55);
  z-index: 20;
  filter: brightness(1.12);
}

.pt-cell.selected {
  outline: 3px solid #fbbf24;
  outline-offset: 1px;
  z-index: 25;
}

.pt-cell .pt-number {
  font-size: .55em;
  opacity: .75;
  line-height: 1;
}
.pt-cell .pt-symbol {
  font-weight: 800;
  line-height: 1.05;
  word-break: break-word;
}
.pt-cell .pt-name {
  font-size: .5em;
  opacity: .9;
  line-height: 1.1;
  word-break: break-word;
}
.pt-cell .pt-sub {
  font-size: .45em;
  opacity: .75;
  line-height: 1;
}

/* 空セル（ドロップ可能） */
.pt-empty {
  border: 1px dashed rgba(148,163,184,.25);
  background: rgba(255,255,255,.015);
  border-radius: 6px;
  transition: background .12s ease;
}
.pt-empty:hover {
  background: rgba(148,163,184,.10);
  border-color: rgba(148,163,184,.5);
}
.pt-empty.drag-over {
  background: rgba(251,191,36,.15);
  border-color: #fbbf24;
}
.pt-cell.drag-over {
  outline: 3px dashed #fbbf24;
}

.pt-cell.dragging { opacity: .4; }

/* グリッドアニメーション */
.fade-in { animation: fadeIn .35s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* モーダル */
.modal-backdrop {
  background: rgba(2,6,23,.7);
  backdrop-filter: blur(4px);
}

/* トースト */
#toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: toastIn .25s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* カラーピッカースウォッチ */
.swatch {
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .1s ease;
}
.swatch:hover { transform: scale(1.15); }
.swatch.active { border-color: #fff; box-shadow: 0 0 0 2px #fbbf24; }

/* 凡例チップ */
.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
}
.legend-dot { width: 12px; height: 12px; border-radius: 3px; }

/* ボタン */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: all .15s ease;
  cursor: pointer;
  white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-ghost { background: rgba(255,255,255,.06); color: #e2e8f0; border: 1px solid rgba(255,255,255,.1); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }

input, select, textarea {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 8px 10px;
  color: #e2e8f0;
  font-size: 14px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,.3);
}

/* 検索ハイライト（非マッチを薄く） */
.pt-cell.dimmed { opacity: .15; filter: grayscale(.8); }

/* キャプチャ用：エクスポート時のクリーン背景 */
#capture-area.exporting .pt-empty { border-color: transparent; background: transparent; }
#capture-area.exporting .pt-cell { box-shadow: none !important; transform: none !important; }
