/* =====================================================================
   style.css — CSSアニメーション（@keyframes）ジェネレーター 固有の微調整。
   共通スタイルは /_shared/shirugear.css に任せる。
   ===================================================================== */

/* 設定カードとプレビューを横並び（広い画面のみ） */
.sg-anim-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sg-space-4, 16px);
}
@media (min-width: 860px) {
  .sg-anim-layout {
    grid-template-columns: 1.35fr 1fr;
    align-items: start;
  }
}

/* プリセットボタン */
.sg-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--sg-space-1, 4px);
}
.sg-preset,
.sg-btn-sub {
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--sg-border, #e2e6ee);
  background: var(--sg-surface-2, #f4f6fb);
  color: var(--sg-fg, #222);
}
.sg-preset:hover,
.sg-btn-sub:hover {
  border-color: var(--sg-accent, #3b5bdb);
}
.sg-btn-sub {
  margin-top: var(--sg-space-2, 8px);
}

/* キーフレーム行 */
.sg-keyframes {
  display: flex;
  flex-direction: column;
  gap: var(--sg-space-3, 12px);
  margin-top: var(--sg-space-1, 4px);
}
.sg-kf-row {
  border: 1px solid var(--sg-border, #e2e6ee);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--sg-surface, #fff);
}
.sg-kf-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.sg-kf-pos {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}
.sg-kf-pos__input {
  width: 5em;
}
.sg-kf-del {
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--sg-border, #e2e6ee);
  background: transparent;
  color: var(--sg-muted, #777);
}
.sg-kf-del:hover:not(:disabled) {
  border-color: #d9534f;
  color: #d9534f;
}
.sg-kf-del:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.sg-kf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px 12px;
}
.sg-kf-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sg-kf-field .sg-help {
  margin: 0;
}
.sg-kf-color {
  padding: 2px;
  height: 34px;
}

/* animation プロパティ */
.sg-props {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px 12px;
  margin-top: var(--sg-space-1, 4px);
}
.sg-prop {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sg-prop .sg-help {
  margin: 0;
}
.sg-prop--bezier {
  grid-column: 1 / -1;
}
.sg-bezier-inputs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

/* プレビュー */
.sg-anim-preview {
  position: sticky;
  top: 12px;
}
.sg-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  border-radius: 10px;
  background:
    linear-gradient(45deg, var(--sg-surface-2, #f0f2f7) 25%, transparent 25%) -10px 0,
    linear-gradient(-45deg, var(--sg-surface-2, #f0f2f7) 25%, transparent 25%) -10px 0,
    linear-gradient(45deg, transparent 75%, var(--sg-surface-2, #f0f2f7) 75%),
    linear-gradient(-45deg, transparent 75%, var(--sg-surface-2, #f0f2f7) 75%);
  background-size: 20px 20px;
  background-color: var(--sg-surface, #fff);
  overflow: hidden;
}
.sg-preview-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 12px;
  background-color: #3b5bdb;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  will-change: transform, opacity;
}

/* 生成CSS */
.sg-code {
  white-space: pre;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--sg-surface-2, #f4f6fb);
  border: 1px solid var(--sg-border, #e2e6ee);
  margin: var(--sg-space-2, 8px) 0;
}
