:root {
  --bg: #0f1117;
  --panel: #171a22;
  --panel-soft: rgba(23, 26, 34, 0.94);
  --panel-2: #222633;
  --line: #303543;
  --text: #f5f6fa;
  --sub: #aeb6c5;
  --muted: #858b99;
  --point: #8b5cf6;
  --point-dark: #6d45d8;
  --point-2: #38bdf8;
  --danger: #ff5b6e;
  --success: #38d996;
  --input: #10131b;
  --input-focus: #131724;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans KR",
    Arial,
    sans-serif;
  color: var(--text);
  line-height: 1.5;
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.13), transparent 32%),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app {
  width: min(1180px, 94%);
  margin: 0 auto;
  padding: 34px 0 60px;
}

.header {
  margin-bottom: 20px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.nav a {
  color: var(--sub);
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 14px;
}

.nav a.active {
  color: #fff;
  border-color: rgba(139, 92, 246, 0.7);
  background: rgba(139, 92, 246, 0.18);
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr;
  gap: 18px;
  align-items: stretch;
  background: rgba(23, 26, 34, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  border-radius: 26px;
  padding: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #8ef6ff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 46px);
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.lead {
  margin: 14px 0 0;
  color: var(--sub);
  font-size: 16px;
  max-width: 720px;
}

.save-panel {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 16px;
}

.save-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.form-panel {
  min-width: 0;
}

.result-panel {
  min-width: 0;
}

.card {
  background: var(--panel-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card + .card {
  margin-top: 18px;
}

.sticky-card {
  position: sticky;
  top: 20px;
}

h2 {
  margin: 0 0 16px;
  font-size: 20px;
  letter-spacing: -0.03em;
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--sub);
  font-size: 14px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--input);
  color: var(--text);
  padding: 12px 13px;
  font-size: 15px;
  outline: none;
  transition: 0.18s;
}

input::placeholder,
textarea::placeholder {
  color: #70798b;
}

input:focus,
select:focus,
textarea:focus {
  background: var(--input-focus);
  border-color: rgba(56, 189, 248, 0.95);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #151923;
  color: #6f7788;
  cursor: not-allowed;
}

textarea {
  resize: vertical;
  min-height: 88px;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #aeb6c5 50%),
    linear-gradient(135deg, #aeb6c5 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.form-grid.single {
  grid-template-columns: 1fr;
}

.music-top-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.ratio-card,
.language-card {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.language-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 14px;
}

.ratio-header,
.language-ratio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 14px;
}

.ratio-header span,
.language-ratio-header span {
  color: var(--sub);
  font-weight: 800;
}

.ratio-header strong,
.language-ratio-header strong {
  color: var(--text);
  font-size: 14px;
}

input[type="range"] {
  padding: 0;
  cursor: pointer;
  accent-color: var(--point);
}

.btn {
  border: 0;
  border-radius: 13px;
  padding: 12px 15px;
  background: var(--panel-2);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  font-size: 14px;
  transition: 0.18s;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn.primary {
  background: linear-gradient(135deg, var(--point), var(--point-2));
}

.btn.danger {
  background: rgba(255, 91, 110, 0.18);
  color: #ff9aa6;
  border: 1px solid rgba(255, 91, 110, 0.28);
}

.btn.success {
  background: rgba(56, 217, 150, 0.18);
  color: #9ff4ce;
  border: 1px solid rgba(56, 217, 150, 0.25);
}

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.result-header h2 {
  margin: 0;
}

.result-guide {
  margin: 6px 0 0;
  color: var(--sub);
  font-size: 14px;
}

#generateBtn {
  white-space: nowrap;
}

.result-box {
  padding: 16px;
  border-radius: 16px;
  background: #0d0f15;
  border: 1px solid var(--line);
}

.result-box textarea {
  min-height: 640px;
  background: #0d0f15;
  color: var(--text);
  border-color: var(--line);
  font-size: 14px;
  line-height: 1.65;
}

.copy-btn {
  width: 100%;
  margin-top: 12px;
  padding: 13px 14px;
  border-radius: 14px;
  background: #ffffff;
  color: #111827;
  font-weight: 900;
  transition: 0.2s ease;
}

.copy-btn:hover {
  background: #dbeafe;
  color: #111827;
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #fff;
  color: #111;
  padding: 11px 16px;
  border-radius: 999px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: 0.22s;
  font-weight: 900;
  font-size: 14px;
  z-index: 300;
}

.toast.show {
  opacity: 1;
  bottom: 42px;
}

::selection {
  background: rgba(139, 92, 246, 0.35);
}

@media (max-width: 980px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .sticky-card {
    position: static;
  }

  .music-top-row {
    grid-template-columns: 1fr;
  }

  .result-box textarea {
    min-height: 520px;
  }
}

@media (max-width: 640px) {
  .app {
    width: min(100% - 24px, 1180px);
    padding-top: 18px;
  }

  .hero,
  .card {
    padding: 17px;
    border-radius: 18px;
  }

  .form-grid,
  .save-grid,
  .language-row {
    grid-template-columns: 1fr;
  }

  .top-actions .btn,
  .save-grid .btn {
    width: 100%;
  }

  .result-header {
    flex-direction: column;
    align-items: stretch;
  }

  #generateBtn {
    width: 100%;
  }

  .result-box textarea {
    min-height: 460px;
  }
}