@import url("https://cdn.jsdelivr.net/gh/MonadABXY/mona-font/web/mona.css");
@import url("https://cdn.rawgit.com/moonspam/NanumSquare/master/nanumsquare.css");
@import url("https://cdn.jsdelivr.net/gh/wanteddev/wanted-sans@v1.0.1/packages/wanted-sans/fonts/webfonts/variable/split/WantedSansVariable.min.css");
@import url("https://cdn.jsdelivr.net/npm/font-kopubworld@1.0.3/css/all.min.css");
@import url("https://cdn.jsdelivr.net/npm/galmuri@latest/dist/galmuri.css");

@font-face {
  font-family: "DearFromsol";
  src: url("https://cdn.jsdelivr.net/gh/Project-Noonnu/2607161334@griun-fromsol-rg/griun-fromsol-rg/Griun_Fromsol-Rg.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IsYun";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2202-2@1.0/LeeSeoyun.woff") format("woff");
  font-weight: normal;
  font-display: swap;
}

@font-face {
  font-family: "MitmiFont";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2402_1@1.0/Ownglyph_meetme-Rg.woff2") format("woff2");
  font-weight: normal;
  font-display: swap;
}

@font-face {
  font-family: "OngleipKonkon";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2412-1@1.0/Ownglyph_corncorn-Rg.woff2") format("woff2");
  font-weight: normal;
  font-display: swap;
}

@font-face {
  font-family: "OngleipParkDahyeon";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2411-3@1.0/Ownglyph_ParkDaHyun.woff2") format("woff2");
  font-weight: normal;
  font-display: swap;
}

@font-face {
  font-family: "Paperozi";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-1Thin.woff2") format("woff2");
  font-weight: 100;
  font-display: swap;
}

@font-face {
  font-family: "Paperozi";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-2ExtraLight.woff2") format("woff2");
  font-weight: 200;
  font-display: swap;
}

@font-face {
  font-family: "Paperozi";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-3Light.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Paperozi";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-4Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Paperozi";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-5Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Paperozi";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-6SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Paperozi";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-7Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Paperozi";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-8ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Paperozi";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-9Black.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Thin.woff2") format("woff2");
  font-weight: 100;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-ExtraLight.woff2") format("woff2");
  font-weight: 200;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Light.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Black.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: "ChosunIlboMyungjo";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_one@1.0/Chosunilbo_myungjo.woff") format("woff");
  font-weight: normal;
  font-display: swap;
}

@font-face {
  font-family: "GMarketSans";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansLight.woff") format("woff");
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "GMarketSans";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansMedium.woff") format("woff");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "GMarketSans";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansBold.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "JoseonGulim";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@1.0/ChosunGu.woff") format("woff");
  font-weight: normal;
  font-display: swap;
}

@font-face {
  font-family: "Netmarble";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_four@1.1/netmarbleL.woff") format("woff");
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Netmarble";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_four@1.1/netmarbleM.woff") format("woff");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Netmarble";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_four@1.1/netmarbleB.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "NexonLv2Gothic";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@2.1/NEXON%20Lv2%20Gothic%20Light.woff") format("woff");
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "NexonLv2Gothic";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@2.1/NEXON%20Lv2%20Gothic.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "NexonLv2Gothic";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@2.1/NEXON%20Lv2%20Gothic%20Bold.woff") format("woff");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "NotGothicButGoding";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/naverfont_05@1.0/Gothic_Goding.woff") format("woff");
  font-weight: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #050508;
  --panel: rgba(15, 15, 26, 0.78);
  --panel-2: rgba(26, 26, 46, 0.9);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f3edf8;
  --muted: #a098b0;
  --accent: #ff2d78;
  --sub: #00ffcc;
  --tertiary: #ffe04a;
  --danger: #ff6f7d;
  --radius: 4px;
  --font-ui: "Pretendard", "Wanted Sans Variable", "Paperozi", system-ui, sans-serif;
  --font-tech: "Mona12", "Wanted Sans Variable", "Pretendard", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 18% 22%, rgba(255, 45, 120, 0.12), transparent 34%),
    radial-gradient(circle at 82% 72%, rgba(0, 255, 204, 0.08), transparent 36%),
    linear-gradient(rgba(255, 45, 120, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 204, 0.018) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
  color: var(--text);
  font-family: var(--font-ui);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(255, 45, 120, 0.08), transparent);
  height: 4px;
  animation: scan 6s linear infinite;
}

@keyframes scan {
  from {
    transform: translateY(-8vh);
  }

  to {
    transform: translateY(108vh);
  }
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  letter-spacing: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 8, 0.9);
  position: sticky;
  top: 0;
  z-index: 4;
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent);
  font-family: var(--font-tech);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255, 45, 120, 0.76);
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.05;
  font-weight: 900;
}

.creator-credit {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-family: var(--font-tech);
  font-size: 11px;
  font-weight: 800;
}

h2 {
  font-size: 14px;
  font-weight: 900;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: center;
}

.icon-button,
.primary-button,
.ghost-button,
.mini-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(0, 0, 0, 0.36);
  border-radius: var(--radius);
  min-height: 40px;
  padding: 0 14px;
  font-family: var(--font-tech);
  font-size: 12px;
  font-weight: 800;
  transition: border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.icon-button:hover,
.ghost-button:hover,
.mini-toolbar button:hover {
  border-color: color-mix(in srgb, var(--sub), transparent 30%);
  color: var(--sub);
  box-shadow: 0 0 16px rgba(0, 255, 204, 0.14), inset 0 0 12px rgba(0, 255, 204, 0.08);
  transform: translateY(-1px);
}

.icon-button {
  width: 42px;
  padding: 0;
}

.primary-button {
  border-color: color-mix(in srgb, var(--accent), white 15%);
  background: rgba(255, 45, 120, 0.13);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 0 22px rgba(255, 45, 120, 0.22);
}

.primary-button:hover {
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 22px rgba(255, 45, 120, 0.38), inset 0 0 14px rgba(255, 45, 120, 0.12);
  transform: translateY(-1px);
}

.file-action input,
.file-input {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-9999px, -9999px);
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 310px) minmax(360px, 1fr) minmax(260px, 310px);
  gap: 18px;
  padding: 18px;
  align-items: start;
  min-width: 0;
  max-width: 1840px;
  margin: 0 auto;
}

.workspace > * {
  min-width: 0;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(18px);
  box-shadow: 0 0 28px rgba(255, 45, 120, 0.08), inset 0 0 18px rgba(255, 255, 255, 0.02);
}

.controls {
  display: grid;
  gap: 1px;
}

.control-group {
  padding: 18px 18px 19px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.006));
  border-left: 2px solid transparent;
}

.control-group:focus-within {
  border-left-color: var(--accent);
}

.group-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.group-title svg {
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(255, 45, 120, 0.6));
}

.group-title span {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.24);
  font-family: var(--font-tech);
  font-size: 10px;
  font-weight: 800;
}

label,
.chip-field {
  display: grid;
  justify-items: stretch;
  gap: 7px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

input[type="text"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.42);
  color: var(--text);
  padding: 10px 11px;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

select {
  text-align-last: left;
}

select option,
select optgroup {
  background: #0b0b12;
  color: var(--text);
  text-align: left;
}

select optgroup {
  color: var(--sub);
  font-weight: 900;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.56);
  box-shadow: 0 0 12px rgba(255, 45, 120, 0.22);
}

textarea {
  resize: vertical;
  min-height: 74px;
}

input[type="color"] {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.42);
  padding: 4px;
  cursor: pointer;
}

input[type="range"] {
  accent-color: var(--accent);
  width: 100%;
  cursor: pointer;
}

.upload-row {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(0, 0, 0, 0.42);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 0;
  font: inherit;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.upload-row:hover {
  border-color: color-mix(in srgb, var(--sub), white 8%);
  background: rgba(0, 255, 204, 0.06);
  box-shadow: inset 0 0 12px rgba(0, 255, 204, 0.08);
}

.upload-row strong {
  max-width: 58%;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 6px;
  overflow: hidden;
  color: var(--text);
  background: color-mix(in srgb, var(--accent), #050508 84%);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-pair {
  display: grid;
  justify-items: stretch;
  gap: 8px;
  margin-top: 10px;
}

.crop-controls {
  display: none;
  justify-items: stretch;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
}

.crop-controls.is-visible {
  display: grid;
}

.crop-controls label {
  width: 100%;
  margin: 0;
}

.character-picker {
  display: grid;
  gap: 16px;
}

.character-block {
  display: grid;
  gap: 10px;
}

.character-block > label {
  margin: 0;
}

.skin-selects {
  display: grid;
  gap: 8px;
}

.skin-selects:empty {
  display: none;
}

.skin-selects label {
  margin: 0;
}

.segmented,
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 7px;
}

.segmented button,
.chips button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.38);
  color: var(--muted);
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.segmented button:hover,
.chips button:hover {
  border-color: color-mix(in srgb, var(--accent), white 12%);
  color: var(--text);
}

.segmented button.active,
.chips button.active {
  border-color: color-mix(in srgb, var(--accent), white 16%);
  background: linear-gradient(135deg, rgba(255, 45, 120, 0.22), rgba(0, 255, 204, 0.11));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 18px rgba(255, 45, 120, 0.18);
  transform: translateY(-1px);
}

.stage {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.stage-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 4px;
}

.stage-head strong {
  font-size: 14px;
  color: var(--muted);
}

.canvas-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(45deg, rgba(255, 45, 120, 0.055) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0, 255, 204, 0.045) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 45, 120, 0.055) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(0, 255, 204, 0.045) 75%),
    rgba(5, 5, 8, 0.72);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  min-height: 0;
  box-shadow: 0 0 28px rgba(0, 255, 204, 0.08), inset 0 0 22px rgba(255, 255, 255, 0.02);
}

canvas {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.48), 0 0 26px rgba(255, 45, 120, 0.12);
}

.mini-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

  .stage {
    grid-column: 1 / -1;
    order: -1;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
    position: static;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .primary-button {
    flex: 1 1 160px;
  }

  h1 {
    font-size: 26px;
  }

  .workspace {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 10px;
  }

  .controls {
    order: 0;
  }

  .stage {
    order: -1;
    width: 100%;
    max-width: calc(100vw - 20px);
  }

  .control-group {
    padding: 16px;
  }

  .canvas-shell {
    padding: 8px;
  }

  .canvas-shell canvas {
    width: calc(100vw - 38px);
  }

  .segmented button,
  .chips button {
    min-height: 38px;
  }
}
