:root {
  color-scheme: light;
  --page: #fff8fa;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-soft: #fff1f5;
  --line: #f4dce4;
  --line-strong: #eebdcd;
  --ink: #33242a;
  --muted: #8b747d;
  --pink: #df6d95;
  --pink-dark: #bd4f78;
  --pink-soft: #f8ccda;
  --pink-pale: #fff0f5;
  --success: #43a477;
  --danger: #c84968;
  --shadow: 0 22px 60px rgba(140, 74, 98, 0.1);
  --shadow-soft: 0 10px 30px rgba(140, 74, 98, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(248, 204, 218, 0.45), transparent 29rem),
    radial-gradient(circle at 90% 92%, rgba(255, 223, 232, 0.52), transparent 31rem),
    var(--page);
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

button:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  color: var(--ink);
  background: #fffafb;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder {
  color: #b9a3ab;
}

input:hover {
  border-color: var(--line-strong);
}

input:focus {
  background: var(--surface-solid);
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(223, 109, 149, 0.12);
}

input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(200, 73, 104, 0.1);
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  filter: blur(10px);
  pointer-events: none;
}

.ambient-one {
  top: 18%;
  left: -110px;
  background: rgba(250, 200, 217, 0.23);
}

.ambient-two {
  right: -90px;
  bottom: 10%;
  background: rgba(255, 214, 225, 0.28);
}

.app-shell {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  border-bottom: 1px solid rgba(238, 189, 205, 0.58);
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #ec8bad, #cc5f87);
  border-radius: 14px;
  box-shadow: 0 9px 22px rgba(204, 95, 135, 0.24);
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  transform: rotate(-3deg);
}

.brand-mark-large {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 18px;
  font-size: 28px;
}

.brand-name,
.brand-caption,
.eyebrow,
.section-kicker,
.hero-copy p,
.modal-description,
.field-message,
footer {
  margin: 0;
}

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-caption {
  margin-top: -2px;
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
}

.room-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  color: #8c6573;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.dj-claim-status {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.button-dj-claim {
  min-height: 36px;
  margin: 0;
  padding: 0 13px;
  color: #fff;
  background: linear-gradient(145deg, #ec84a8, #c95782);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(201, 87, 130, 0.2);
  font-size: 12px;
  font-weight: 800;
}

.button-dj-claim:not(:disabled):hover {
  background: linear-gradient(145deg, #ee8bad, #c34f7b);
  transform: translateY(-1px);
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(67, 164, 119, 0.12);
}

.hero-copy {
  max-width: 680px;
  padding: 68px 0 44px;
}

.eyebrow,
.section-kicker {
  color: var(--pink-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.hero-copy h1 {
  margin: 14px 0 18px;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.hero-copy h1 span {
  color: var(--pink);
}

.hero-copy > p:last-child {
  max-width: 510px;
  color: var(--muted);
  font-size: 16px;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.8fr);
  gap: 22px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(244, 220, 228, 0.9);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.playlist-panel {
  min-height: 440px;
  padding: 30px;
}

.presence-panel {
  padding: 30px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 5px 0 0;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.section-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--pink-dark);
  background: var(--pink-pale);
  border-radius: 14px;
  font-size: 20px;
}

.member-count {
  padding: 6px 10px;
  color: var(--pink-dark);
  background: var(--pink-pale);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.add-track {
  margin-bottom: 24px;
  padding: 14px;
  background: linear-gradient(135deg, #fff3f7, #fff8fa);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.input-action {
  display: flex;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

.button:focus-visible,
.control-button:focus-visible,
.track-main:focus-visible {
  outline: 3px solid rgba(223, 109, 149, 0.25);
  outline-offset: 3px;
}

.button-primary {
  color: white;
  background: linear-gradient(135deg, #e67da1, #ce5f88);
  box-shadow: 0 12px 24px rgba(206, 95, 136, 0.23);
}

.button-primary:not(:disabled):hover {
  box-shadow: 0 15px 30px rgba(206, 95, 136, 0.3);
}

.button-secondary {
  flex: 0 0 auto;
  color: white;
  background: var(--pink);
}

.button-full {
  width: 100%;
}

.field-message {
  min-height: 20px;
  padding: 5px 3px 0;
  color: var(--muted);
  font-size: 12px;
}

.error-message,
.field-message.is-error {
  color: var(--danger);
}

.field-message.is-success {
  color: var(--success);
}

.track-list,
.presence-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.track-item,
.member-item {
  overflow: hidden;
  background: rgba(255, 250, 252, 0.75);
  border: 1px solid transparent;
  border-radius: 17px;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.track-main {
  display: flex;
  width: 100%;
  min-height: 68px;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  color: inherit;
  text-align: left;
  background: transparent;
  border-radius: inherit;
}

button.track-main:hover {
  background: var(--pink-pale);
}

.track-item:has(button.track-main):hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.track-number {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  color: var(--pink-dark);
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
}

.track-copy,
.member-copy {
  min-width: 0;
}

.track-copy {
  display: grid;
  gap: 3px;
  flex: 1;
}

.track-title,
.member-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-title {
  font-size: 14px;
  font-weight: 750;
}

.track-meta,
.member-role {
  color: var(--muted);
  font-size: 11px;
}

.track-cue {
  color: var(--pink);
  font-size: 18px;
}

.empty-state {
  display: grid;
  min-height: 205px;
  place-items: center;
  align-content: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 248, 250, 0.56);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}

.empty-state-icon {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  place-items: center;
  color: var(--pink);
  background: var(--pink-pale);
  border-radius: 18px;
  font-size: 24px;
}

.empty-state strong {
  color: var(--ink);
  font-size: 15px;
}

.empty-state span:last-child {
  margin-top: 5px;
  font-size: 13px;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.control-button {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--pink-dark);
  background: var(--pink-pale);
  border-radius: 50%;
  font-size: 15px;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.control-button:not(:disabled):hover {
  background: #fce2eb;
  transform: translateY(-2px);
}

.control-button-main {
  width: 62px;
  height: 62px;
  padding-left: 4px;
  color: white;
  background: linear-gradient(145deg, #ec84a8, #c95782);
  box-shadow: 0 13px 30px rgba(201, 87, 130, 0.27);
  font-size: 18px;
}

.control-button-main[data-state="playing"] {
  padding-left: 0;
}

.control-button-main:not(:disabled):hover {
  background: linear-gradient(145deg, #ee8bad, #c34f7b);
}

.member-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px;
}

.member-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  color: var(--pink-dark);
  background: linear-gradient(145deg, #ffe9f0, #f9cfdd);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
}

.member-copy {
  display: grid;
  gap: 1px;
  flex: 1;
}

.member-name {
  font-size: 13px;
  font-weight: 750;
}

.badge-dj {
  padding: 4px 8px;
  color: #a03b65;
  background: #ffe1eb;
  border: 1px solid #f7c0d2;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.delegate-button {
  min-height: 32px;
  padding: 0 9px;
  color: var(--pink-dark);
  background: var(--pink-pale);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
}

.delegate-button:hover {
  background: #fbdfe8;
}

.room-note {
  display: flex;
  gap: 9px;
  margin-top: 22px;
  padding: 14px;
  color: var(--muted);
  background: var(--pink-pale);
  border-radius: 15px;
  font-size: 12px;
}

.room-note span {
  color: var(--pink);
  font-size: 16px;
}

.modal {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(255, 247, 250, 0.82);
  backdrop-filter: blur(18px);
}

.modal-content {
  width: min(100%, 430px);
  padding: 42px;
  text-align: center;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(238, 189, 205, 0.72);
  border-radius: 30px;
  box-shadow: 0 28px 80px rgba(139, 75, 99, 0.17);
  animation: modal-in 320ms ease both;
}

.modal-content-compact {
  width: min(100%, 410px);
}

.modal-content h2 {
  margin: 10px 0 14px;
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1.22;
  letter-spacing: -0.045em;
}

.modal-description {
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 14px;
}

.modal-content input {
  text-align: center;
}

.modal-content .button {
  margin-top: 8px;
}

.startup-error {
  width: min(100%, 520px);
  margin: 18vh auto 0;
  padding: 50px 34px;
  text-align: center;
}

.startup-error .empty-state-icon {
  margin: 0 auto 16px;
}

.startup-error h1 {
  margin: 0 0 10px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.startup-error p {
  margin: 0 0 24px;
  color: var(--muted);
}

.pulse-icon {
  position: relative;
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 22px;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #ef91b1, #ca5984);
  border-radius: 50%;
  box-shadow: 0 14px 32px rgba(202, 89, 132, 0.25);
  font-family: Georgia, serif;
  font-size: 28px;
}

.pulse-icon::after {
  position: absolute;
  inset: -8px;
  content: "";
  border: 1px solid var(--pink-soft);
  border-radius: inherit;
  animation: pulse 2s ease-out infinite;
}

.visually-hidden-player {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0.001;
  pointer-events: none;
}

footer {
  padding: 38px 0 30px;
  color: #aa8c97;
  text-align: center;
  font-size: 12px;
}

footer span {
  margin-right: 4px;
  color: var(--pink);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse {
  from { opacity: 0.7; transform: scale(0.88); }
  to { opacity: 0; transform: scale(1.22); }
}

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

  .presence-panel {
    order: -1;
  }

  .hero-copy {
    padding: 52px 0 34px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 24px, 1160px);
  }

  .topbar {
    min-height: 76px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .brand-caption {
    display: none;
  }

  .room-status {
    padding: 8px 10px;
    font-size: 9px;
  }

  .dj-claim-status {
    display: none;
  }

  .button-dj-claim {
    min-height: 34px;
    padding: 0 10px;
    font-size: 11px;
  }

  .hero-copy h1 {
    font-size: 40px;
  }

  .hero-copy > p:last-child {
    font-size: 14px;
  }

  .playlist-panel,
  .presence-panel {
    padding: 20px;
    border-radius: 22px;
  }

  .input-action {
    align-items: stretch;
  }

  .input-action .button {
    min-width: 78px;
    padding: 0 12px;
  }

  .modal {
    padding: 14px;
  }

  .modal-content {
    padding: 34px 24px;
    border-radius: 25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
