/* ============================================================
   高級感ダーク × ゴールドテーマ（豪華プレビュー＋アニメ付き）
   ============================================================ */

:root {
  --bg-main: #05060a;
  --bg-card: #10121a;
  --bg-input: #151824;
  --accent: #d4af37;
  --accent-soft: rgba(212,175,55,0.18);
  --text-main: #f5f5f7;
  --text-sub: #a0a3b5;
  --border-soft: #262938;
  --error: #ff5c5c;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 18px 45px rgba(0,0,0,0.55);
  --transition-fast: 0.18s ease-out;
  --transition-mid: 0.35s ease-out;
  --transition-slow: 0.6s ease-out;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ===========================
   Base
   =========================== */
body {
  margin: 0;
  background: radial-gradient(circle at top, #151827 0, #05060a 55%);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

.header,
.main,
.footer {
  max-width: 960px;
  margin: auto;
  padding: 20px;
}

/* ===========================
   Header
   =========================== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #fff 0, #f7e7b0 12%, #d4af37 40%, #7a5a1a 100%);
  box-shadow: 0 0 12px rgba(212,175,55,0.4);
}

.brand-title {
  font-size: 15px;
  letter-spacing: 0.12em;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-sub);
  letter-spacing: 0.16em;
}

.header-link {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-sub);
  text-decoration: none;
  transition: var(--transition-fast);
}

.header-link:hover {
  background: rgba(212,175,55,0.16);
  border-color: rgba(212,175,55,0.6);
  color: var(--accent);
}

/* ===========================
   Hero
   =========================== */
.hero-title span {
  background: linear-gradient(120deg, #f7e7b0, #d4af37, #f5f5f7);
  -webkit-background-clip: text;
  color: transparent;
}

.hero-sub {
  color: var(--text-sub);
  font-size: 13px;
  line-height: 1.7;
}

/* ===========================
   Layout
   =========================== */
.layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   Card
   =========================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

/* ===========================
   Lock Toggle（比率固定）
   =========================== */
.lock-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.lock-toggle input {
  display: none;
}

.toggle-slider {
  width: 40px;
  height: 20px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  position: relative;
  transition: var(--transition-fast);
}

.toggle-slider::after {
  content: "";
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 999px;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: var(--transition-fast);
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.lock-toggle input:checked + .toggle-slider {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}

.lock-toggle input:checked + .toggle-slider::after {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 12px;
  color: var(--text-sub);
}

/* ===========================
   Preset Buttons
   =========================== */
.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.preset-chip {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  color: var(--text-sub);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition-fast);
}

/* 光の走りアニメーション */
.preset-chip::before {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: skewX(-20deg);
  transition: 0.5s;
}

.preset-chip:hover::before {
  left: 120%;
}

.preset-chip:hover {
  background: rgba(212,175,55,0.16);
  border-color: rgba(212,175,55,0.7);
  color: var(--accent);
}

.preset-chip[data-active="true"] {
  background: rgba(212,175,55,0.22);
  border-color: rgba(212,175,55,0.9);
  color: var(--accent);
}

/* ===========================
   Input Fields
   =========================== */
.field-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 480px) {
  .field-group {
    grid-template-columns: 1fr;
  }
}

.field-label {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 4px;
}

.input-shell {
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  transition: var(--transition-fast);
}

.input-shell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(212,175,55,0.15);
}

input[type="number"] {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 14px;
}

/* ===========================
   Error Message
   =========================== */
.error-message {
  color: var(--error);
  font-size: 12px;
  min-height: 16px;
}

/* ===========================
   Preview Card
   =========================== */
.preview-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid rgba(212,175,55,0.4);
  box-shadow: var(--shadow-soft);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-meta {
  font-size: 12px;
  color: var(--text-sub);
  display: flex;
  gap: 10px;
}

/* ===========================
   Preview Frame
   =========================== */
.preview-frame {
  margin-top: 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.6);
  padding: 10px;
  display: flex;
  justify-content: center;
  min-height: 160px;
}

/* ===========================
   豪華プレビュー Box
   =========================== */
.preview-box {
  position: relative;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(212,175,55,0.4), rgba(0,0,0,0.9));
  box-shadow:
    0 0 20px rgba(212,175,55,0.4),
    0 0 60px rgba(212,175,55,0.2);
  transition: width 0.4s ease, height 0.4s ease, transform 0.3s ease;
  overflow: hidden;
}

/* ホバーで浮き上がる */
.preview-box:hover {
  transform: translateY(-6px) scale(1.03);
}

/* 光の反射アニメーション */
.preview-highlight {
  position: absolute;
  top: -40%;
  left: -40%;
  width: 180%;
  height: 180%;
  background: radial-gradient(circle, rgba(255,255,255,0.25), transparent 60%);
  animation: highlightMove 6s infinite linear;
  pointer-events: none;
}

@keyframes highlightMove {
  0% { transform: translate(-20%, -20%); }
  50% { transform: translate(20%, 20%); }
  100% { transform: translate(-20%, -20%); }
}

/* 内部の柔らかい光 */
.preview-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255,255,255,0.15), transparent 70%);
  pointer-events: none;
}

/* ラベル */
.preview-dim,
.preview-label {
  position: absolute;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

.preview-dim {
  top: 6px;
  left: 8px;
  background: rgba(0,0,0,0.6);
  color: white;
}

.preview-label {
  bottom: 6px;
  right: 8px;
  background: white;
  color: black;
}

/* ===========================
   Footer
   =========================== */
.footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-sub);
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}
