:root {
  color-scheme: dark;
  --bg: #07080f;
  --surface: rgba(10, 12, 18, 0.54);
  --surface-strong: rgba(8, 9, 13, 0.76);
  --line: rgba(255, 255, 255, 0.13);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.48);
  --soft: rgba(255, 255, 255, 0.32);
  --accent: #ffc1df;
  --accent-2: #a9b8ff;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app {
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

.background {
  position: fixed;
  inset: -24px;
  background:
    linear-gradient(180deg, rgba(12, 7, 20, 0.32), rgba(0, 0, 0, 0.78)),
    url("https://today-hangang.pages.dev/images/hangang-night-premium-820.webp") center / cover;
  filter: blur(14px) saturate(0.9);
  transform: scale(1.04);
}

.background::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 12%, rgba(168, 128, 255, 0.2), transparent 34%),
    radial-gradient(circle at 76% 44%, rgba(120, 172, 255, 0.13), transparent 32%),
    rgba(3, 4, 8, 0.38);
}

.shell {
  min-height: 100vh;
  position: relative;
  z-index: 1;
  padding: 22px;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto 24px;
  max-width: 1180px;
}

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

.brand-mark {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  display: inline-flex;
  font-weight: 850;
  height: 46px;
  justify-content: center;
  width: 46px;
}

.brand strong {
  display: block;
  font-size: 16px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.brand small,
.account {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 5px;
}

.workspace {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(320px, 500px) minmax(360px, 480px);
  justify-content: center;
  margin: 0 auto;
  max-width: 1180px;
}

.preview-wrap {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: calc(100vh - 120px);
}

canvas {
  background: #06070d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 38px 120px rgba(0, 0, 0, 0.58);
  display: block;
  height: min(calc(100vh - 128px), 760px);
  max-width: 100%;
  object-fit: contain;
  width: auto;
}

canvas[hidden] {
  display: none !important;
}

#feedCanvas {
  height: min(calc(100vh - 160px), 620px);
}

.panel {
  align-self: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.36);
  padding: 24px;
  backdrop-filter: blur(26px) saturate(1.2);
  -webkit-backdrop-filter: blur(26px) saturate(1.2);
}

.panel-head p {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.18em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.panel-head h1 {
  font-size: clamp(30px, 5vw, 46px);
  letter-spacing: -0.05em;
  line-height: 1.04;
  margin: 0 0 24px;
}

.metrics {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 20px;
}

.metrics div {
  padding: 16px 12px 16px 0;
}

.metrics div + div {
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.metrics span,
.field span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 680;
  margin-bottom: 8px;
}

.metrics strong {
  display: block;
  font-size: 16px;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field {
  display: block;
  margin-top: 16px;
}

textarea {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  color: var(--text);
  outline: none;
  padding: 15px 16px;
  resize: vertical;
  width: 100%;
}

textarea:focus {
  border-color: rgba(255, 193, 223, 0.56);
}

.format-switch {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 18px;
  overflow: hidden;
}

.format-switch button,
.actions button {
  border: 0;
  cursor: pointer;
}

.format-switch button {
  background: transparent;
  color: var(--muted);
  min-height: 48px;
}

.format-switch button.is-active {
  background: rgba(255, 255, 255, 0.84);
  color: #111219;
  font-weight: 800;
}

.actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
}

.actions button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: var(--text);
  min-height: 50px;
}

.actions button:first-child {
  background: rgba(255, 255, 255, 0.88);
  color: #101117;
  font-weight: 760;
}

.status {
  color: var(--soft);
  font-size: 13px;
  line-height: 1.6;
  margin: 16px 0 0;
}

@media (max-width: 880px) {
  .shell {
    padding: 16px;
  }

  .topbar {
    margin-bottom: 16px;
  }

  .account {
    display: none;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .preview-wrap {
    min-height: auto;
  }

  canvas {
    height: auto;
    max-height: 62vh;
    width: min(100%, 318px);
  }

  #feedCanvas {
    width: min(100%, 360px);
  }

  .panel {
    border-radius: 24px;
    padding: 20px;
    width: 100%;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .metrics div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
  }
}
