* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, "Noto Sans KR", sans-serif;
  color: #17202a;
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 214, 102, 0.35), transparent 28%),
    radial-gradient(circle at 90% 0%, rgba(45, 156, 219, 0.24), transparent 30%),
    linear-gradient(135deg, #f8fbff 0%, #f2f4ea 100%);
}

body.modal-open {
  overflow: hidden;
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.app {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
  gap: 20px;
}

.draw-panel,
.list-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(23, 32, 42, 0.1);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(42, 54, 71, 0.12);
}

.draw-panel {
  padding: 28px;
}

.list-panel {
  padding: 22px;
}

.title-row,
.list-header,
.song-item,
.song-actions {
  display: flex;
  align-items: center;
}

.title-row,
.list-header,
.song-item {
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #25745f;
  font-size: 14px;
  font-weight: 800;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(36px, 7vw, 72px);
  line-height: 0.95;
}

h2 {
  font-size: 22px;
}

.secondary-button,
.song-actions button {
  background: #edf5f2;
  color: #145746;
  padding: 11px 14px;
}

.secondary-button:hover,
.song-actions button:hover {
  background: #dceee8;
}

.primary-button {
  width: 100%;
  margin: 18px 0;
  padding: 18px;
  background: #f2be22;
  color: #1d252c;
  font-size: 22px;
  box-shadow: 0 12px 24px rgba(204, 144, 11, 0.25);
}

.primary-button:hover {
  background: #e8af12;
}

.result-box {
  margin-top: 28px;
  min-height: 130px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  border: 2px dashed #9ccfc0;
  border-radius: 8px;
  background: #fbfdf9;
}

.label,
#songCount,
.empty-message,
#playerHint {
  color: #66717d;
}

.label {
  font-size: 14px;
  font-weight: 800;
}

#pickedSong {
  overflow-wrap: anywhere;
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.1;
}

#pickedSong.waiting-text {
  color: #66717d;
  font-size: clamp(18px, 3vw, 28px);
}

.youtube-box {
  padding: 18px;
  border-radius: 8px;
  background: #f5f8fb;
  border: 1px solid #e1e7ec;
}

.youtube-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  margin-bottom: 12px;
  border: 0;
  border-radius: 8px;
  background: #101820;
}

.youtube-button {
  width: 100%;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  border-radius: 8px;
  background: #d92525;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.youtube-button:hover {
  background: #bd1f1f;
  transform: translateY(-1px);
}

.youtube-button.disabled {
  pointer-events: none;
  opacity: 0.45;
}

#playerHint {
  min-height: 22px;
  margin: 10px 0 0;
  font-size: 14px;
}

.song-list {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.song-item {
  min-height: 58px;
  padding: 12px;
  border: 1px solid #e1e7ec;
  border-radius: 8px;
  background: #ffffff;
}

.song-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.song-actions {
  flex-shrink: 0;
  gap: 8px;
}

.song-actions button {
  min-width: 76px;
  padding: 9px 10px;
  font-size: 14px;
}

.song-actions .danger-button {
  background: #fff0ed;
  color: #a33d2f;
}

.song-actions .danger-button:hover {
  background: #ffe0da;
}

.empty-message {
  margin: 22px 0 0;
  line-height: 1.5;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(19, 26, 36, 0.46);
  backdrop-filter: blur(8px);
}

.input-modal {
  position: relative;
  width: min(100%, 680px);
  padding: 30px 22px 24px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(20, 27, 39, 0.28);
}

.input-modal h2 {
  margin: 0 62px 30px 0;
  color: #11162c;
  font-size: clamp(28px, 5vw, 36px);
  line-height: 1.1;
}

.input-modal label {
  display: block;
  margin-bottom: 14px;
  color: #1d2635;
  font-size: 18px;
}

.modal-input {
  width: 100%;
  height: 58px;
  padding: 0 16px;
  border: 2px solid #111111;
  border-radius: 15px;
  outline: none;
  font: inherit;
  font-size: 22px;
}

.modal-input:focus {
  border-color: #f0b51a;
  box-shadow: 0 0 0 4px rgba(242, 190, 34, 0.22);
}

.modal-error {
  min-height: 22px;
  margin: 10px 0 12px;
  color: #66717d;
  font-size: 14px;
  font-weight: 700;
}

.modal-close-button {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #f0f1ff;
  color: #0f1730;
  font-size: 34px;
  line-height: 1;
}

.modal-close-button:hover {
  background: #e3e6ff;
}

.modal-actions {
  display: grid;
  gap: 10px;
}

.modal-actions.two-buttons {
  grid-template-columns: 1fr 1fr;
}

.modal-confirm-button,
.modal-cancel-button {
  width: 100%;
  min-height: 70px;
  margin-top: 20px;
  border-radius: 18px;
  font-size: 22px;
}

.modal-confirm-button {
  background: linear-gradient(135deg, #ffe76a 0%, #f2be22 48%, #d89300 100%);
  color: #11162c;
  box-shadow: 0 12px 26px rgba(216, 147, 0, 0.25);
}

.modal-confirm-button:hover {
  background: linear-gradient(135deg, #fff08d 0%, #f7c82e 48%, #e0a010 100%);
}

.modal-cancel-button {
  background: #eef2f6;
  color: #202936;
}

.modal-cancel-button:hover {
  background: #e0e7ef;
}

[hidden] {
  display: none;
}

@media (max-width: 820px) {
  .app {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 620px);
    padding: 18px 0;
  }

  .draw-panel,
  .list-panel {
    padding: 18px;
  }

  .title-row,
  .song-item {
    align-items: stretch;
    flex-direction: column;
  }

  .secondary-button,
  .song-actions,
  .song-actions button {
    width: 100%;
  }

  .input-modal {
    padding: 26px 18px 20px;
  }

  .modal-confirm-button {
    min-height: 62px;
  }
}
