* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Yu Gothic UI", "Meiryo", sans-serif;
  background: linear-gradient(160deg, #f6f4ef 0%, #ece7de 100%);
  color: #2b2b30; min-height: 100vh;
}
header {
  text-align: center; padding: 40px 16px 24px;
}
header h1 { font-size: 30px; letter-spacing: 2px; }
header p { color: #6b6b72; margin-top: 8px; }

main { max-width: 860px; margin: 0 auto; padding: 0 16px 80px; }

.card {
  background: #fff; border-radius: 16px; padding: 28px;
  margin-bottom: 22px; box-shadow: 0 4px 18px rgba(40,35,20,.07);
}
.card h2 { font-size: 19px; margin-bottom: 18px; }
.step-num {
  display: inline-flex; width: 30px; height: 30px; border-radius: 50%;
  background: #2b2b30; color: #fff; align-items: center; justify-content: center;
  font-size: 15px; margin-right: 8px;
}

#drop-zone {
  border: 2.5px dashed #c5bda9; border-radius: 14px; padding: 38px 16px;
  text-align: center; cursor: pointer; transition: all .2s; background: #fbfaf7;
}
#drop-zone:hover, #drop-zone.drag { border-color: #b98a2f; background: #fdf6e8; }
#drop-zone small { color: #8a8577; }

#audio-list { margin-top: 12px; }
.audio-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: #f4f1ea; border-radius: 10px; margin-bottom: 8px; font-size: 14px;
}
.audio-item .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-item select { padding: 6px 10px; border-radius: 8px; border: 1px solid #d8d2c2; }
.audio-item button { border: none; background: none; cursor: pointer; font-size: 16px; }

.field-label { display: block; font-size: 14px; margin: 14px 0 8px; font-weight: bold; }
.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.genre-grid label {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  background: #f4f1ea; border-radius: 10px; font-size: 13.5px; cursor: pointer;
  border: 2px solid transparent;
}
.genre-grid label:has(input:checked) { border-color: #b98a2f; background: #fdf6e8; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
label { font-size: 14px; }
input[type=text], select {
  width: 100%; padding: 11px 13px; margin-top: 6px; border-radius: 10px;
  border: 1.5px solid #d8d2c2; font-size: 15px; font-family: inherit; background: #fff;
}
input[type=text]:focus, select:focus { outline: none; border-color: #b98a2f; }
input[type=file] { margin-top: 8px; font-size: 13px; }
.req { color: #c0392b; font-size: 11px; margin-left: 6px; }
.check-line { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; flex-wrap: wrap; }
.check-line input[type=text] { flex: 1; min-width: 220px; margin-top: 0; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); gap: 12px; }
.theme-card {
  border-radius: 12px; padding: 14px 8px; text-align: center; cursor: pointer;
  border: 3px solid transparent; transition: transform .15s;
}
.theme-card:hover { transform: translateY(-2px); }
.theme-card.selected { border-color: #b98a2f; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.theme-card .swatch { height: 54px; border-radius: 8px; margin-bottom: 8px; position: relative; overflow: hidden; }
.theme-card .swatch::after {
  content: "Aa"; position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-size: 22px; font-weight: bold;
}
.theme-card .tname { font-size: 14px; font-weight: bold; }
.theme-card .ten { font-size: 11px; color: #888; }

#color-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 13px; color: #777; }
#color-row[hidden] { display: none; }
#color-row input[type=color] { width: 64px; height: 40px; border: none; border-radius: 8px; cursor: pointer; }

.primary-btn {
  display: inline-block; width: 100%; padding: 17px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, #b98a2f, #8f6a1f); color: #fff; font-size: 18px;
  font-weight: bold; cursor: pointer; text-align: center; text-decoration: none;
  font-family: inherit; letter-spacing: 1px; transition: opacity .2s;
}
.primary-btn:hover { opacity: .9; }
.primary-btn:disabled { opacity: .5; cursor: wait; }
.ghost-btn {
  padding: 14px 22px; border: 2px solid #b98a2f; border-radius: 14px; background: none;
  color: #8f6a1f; font-size: 15px; cursor: pointer; font-family: inherit;
}
.btn-row { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.btn-row .primary-btn { width: auto; flex: 1; padding: 14px; font-size: 15px; }

.center { text-align: center; }
.bar { height: 14px; background: #eee7d8; border-radius: 7px; overflow: hidden; margin: 22px 0 14px; }
#bar-fill {
  height: 100%; width: 0%; border-radius: 7px; transition: width .6s;
  background: linear-gradient(90deg, #b98a2f, #e0b64f);
}
.hint { font-size: 13px; color: #8a8577; margin-top: 10px; line-height: 1.7; }
.error { color: #c0392b; margin-top: 12px; font-size: 14px; white-space: pre-wrap; }

#player { width: 100%; border-radius: 12px; background: #000; margin-bottom: 14px; }

.scene-row {
  display: grid; grid-template-columns: 88px 1fr 160px 105px 118px; gap: 10px;
  align-items: center; padding: 10px 0; border-bottom: 1px solid #f0ece2; font-size: 13px;
}
.scene-row .time { color: #8a8577; }
.scene-row input, .scene-row select { margin-top: 0; padding: 8px 10px; font-size: 13px; }
.scene-row .swap-btn {
  padding: 8px 10px; border: 1.5px solid #d8d2c2; background: #faf8f3;
  border-radius: 8px; cursor: pointer; font-size: 12.5px; font-family: inherit;
}
.scene-row .swap-btn.marked { border-color: #b98a2f; background: #fdf6e8; }
@media (max-width: 640px) { .scene-row { grid-template-columns: 1fr 1fr; } }

.claude-note {
  margin-top: 20px; padding: 16px; background: #f4f0ff; border-radius: 12px;
  font-size: 13.5px; line-height: 1.8; border-left: 4px solid #7c5cbf;
}

.history-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 6px;
  border-bottom: 1px solid #f0ece2; font-size: 14px;
}
.history-item .pname { flex: 1; }
.history-item a, .history-item button {
  font-size: 13px; padding: 7px 14px; border-radius: 8px; cursor: pointer;
  border: 1.5px solid #b98a2f; color: #8f6a1f; background: none; text-decoration: none;
  font-family: inherit;
}
