:root {
  --bg: #f39ad1;
  --paper: #f4f1f3;
  --paper-strong: #fffafc;
  --ink: #150f14;
  --muted: #615c63;
  --line: rgba(21, 15, 20, 0.22);
  --soft-line: rgba(21, 15, 20, 0.12);
  --red: #cc0027;
  --pink: #ee6dcc;
  --green: #219b6f;
  --green-bright: #b8ff31;
  --shadow: 0 22px 60px rgba(130, 42, 94, 0.18);
  font-family: "Euclid Circular A", "Inter", "Pretendard Variable", Pretendard, system-ui, sans-serif;
  letter-spacing: 0;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0;
}

body::before {
  content: none;
}

button,
textarea {
  font: inherit;
}

button { cursor: pointer; }

img {
  display: block;
  max-width: 100%;
}

.poc-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  height: 100svh;
  margin: 0 auto;
  padding: 10px 0 8px;
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr) 24px;
}

.site-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px;
}

.ateez-logo {
  display: inline-flex;
  align-items: center;
  width: 112px;
  text-decoration: none;
}

.ateez-logo img {
  width: 112px;
  height: auto;
}

.album-tag {
  width: 178px;
  display: inline-flex;
  justify-content: flex-end;
}

.album-tag img {
  width: 178px;
  height: auto;
}

.main-card {
  position: relative;
  min-height: 0;
  border: 1px solid rgba(21, 15, 20, 0.28);
  border-left: 0;
  border-right: 0;
  padding: 13px 18px 14px;
  color: var(--ink);
  background: rgba(255, 245, 251, 0.78);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.main-card::before {
  content: none;
}

.main-card > * {
  position: relative;
  z-index: 1;
}

.bgm-pill {
  width: 128px;
  height: 40px;
  border: 1px solid rgba(21,15,20,0.22);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink);
  background: rgba(255,255,255,0.56);
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.34);
}

.bgm-pill b { color: var(--green); }

.bgm-pill[aria-pressed="true"] {
  color: #fff;
  border-color: rgba(21,15,20,0.78);
  background: #171215;
}

.bgm-pill[aria-pressed="true"] b { color: var(--green-bright); }

.eq {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  color: var(--green);
}

.bgm-pill[aria-pressed="true"] .eq { color: var(--green-bright); }

.eq i {
  width: 3px;
  border-radius: 999px;
  background: currentColor;
}

.eq i:nth-child(1) { height: 9px; }
.eq i:nth-child(2) { height: 19px; }
.eq i:nth-child(3) { height: 13px; }

.bgm-pill[aria-pressed="true"] .eq i {
  animation: equalize 780ms ease-in-out infinite alternate;
}

.bgm-pill[aria-pressed="true"] .eq i:nth-child(2) { animation-delay: 120ms; }
.bgm-pill[aria-pressed="true"] .eq i:nth-child(3) { animation-delay: 240ms; }

.view-stack {
  position: relative;
  height: calc(100% - 47px);
  margin-top: 7px;
}

.view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition: transform 420ms cubic-bezier(.2,.8,.2,1), opacity 260ms ease;
}

.input-view {
  position: relative;
  isolation: isolate;
  transform: translateX(0);
  opacity: 1;
}

.input-view {
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.input-view::-webkit-scrollbar {
  display: none;
}

.concept-photo {
  position: relative;
  z-index: 1;
  width: min(100%, 335px);
  aspect-ratio: 900 / 652;
  height: auto;
  margin: -2px auto 10px;
  border: 1px solid rgba(21,15,20,0.28);
  border-radius: 15px;
  overflow: hidden;
  background: rgba(255,255,255,0.56);
  box-shadow: 0 10px 24px rgba(21,15,20,0.13);
}

.input-view .title-block,
.input-view .translator {
  position: relative;
  z-index: 1;
}

.concept-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(238,109,204,0.12), rgba(33,155,111,0.08));
}

.concept-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: saturate(1.06) contrast(1.03);
}

.result-view {
  transform: translateX(110%);
  opacity: 0;
  pointer-events: none;
}

.main-card.show-result .input-view {
  transform: translateX(-110%);
  opacity: 0;
  pointer-events: none;
}

.main-card.show-result .result-view {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.title-block {
  margin: 6px 0 11px;
  text-align: center;
}

.title-block p {
  display: flex;
  justify-content: center;
  margin: 0 0 8px;
}

.mini-album-logo {
  width: 168px;
  height: auto;
}

.title-lockup {
  margin: 0;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 9px;
  color: var(--ink);
  white-space: nowrap;
}

.bad-logo {
  width: clamp(112px, 32vw, 136px);
  height: auto;
  flex: 0 0 auto;
  filter: drop-shadow(2px 2px 0 rgba(21,15,20,0.18));
}

.translator-word {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: clamp(34px, 10.4vw, 47px);
  line-height: 0.98;
  font-weight: 950;
  letter-spacing: 0;
}

.title-block strong {
  display: block;
  margin-top: 10px;
  color: #2b242b;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 900;
}

.title-block small {
  display: flex;
  justify-content: center;
  margin-top: 7px;
}

.album-logo-small {
  width: 190px;
  height: auto;
  opacity: 0.76;
}

.translator {
  display: grid;
  gap: 12px;
}

.input-box {
  position: relative;
  min-height: 132px;
  border: 1px solid rgba(21,15,20,0.28);
  border-radius: 17px;
  background: rgba(255,255,255,0.58);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.42);
}

textarea {
  width: 100%;
  min-height: 132px;
  border: 0;
  resize: none;
  outline: none;
  padding: 24px 24px 40px;
  color: var(--ink);
  background: transparent;
  font-family: "Pretendard Variable", Pretendard, system-ui, sans-serif;
  font-size: clamp(16px, 4.4vw, 18px);
  line-height: 1.42;
  font-weight: 800;
}

textarea::placeholder { color: rgba(21,15,20,0.48); }

#charCount {
  position: absolute;
  right: 20px;
  bottom: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

.language-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.lang-option {
  height: 34px;
  border: 1px solid rgba(21,15,20,0.16);
  border-radius: 999px;
  color: rgba(21,15,20,0.7);
  background: rgba(255,255,255,0.5);
  font-size: 13px;
  font-weight: 950;
}

.lang-option.active {
  color: #071a12;
  border-color: transparent;
  background: var(--green-bright);
  box-shadow: 0 10px 26px rgba(97,164,25,0.18);
}

.convert-button {
  height: 58px;
  border: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: #1b0710;
  background:
    linear-gradient(90deg, rgba(184,255,49,0.92) 0 13%, transparent 13% 100%),
    linear-gradient(90deg, #ee5fc3 0%, #ff8ad8 100%);
  box-shadow: 0 18px 44px rgba(238,109,204,0.24);
  font-size: 22px;
  font-weight: 950;
}

.convert-button:disabled {
  filter: grayscale(0.35);
  cursor: wait;
}

.convert-button svg,
.ghost-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 9px;
}

.result-head strong {
  color: var(--green);
  font-size: 18px;
  font-weight: 950;
}

#apiStatus {
  color: rgba(21,15,20,0.54);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.compare-box {
  display: grid;
  gap: 8px;
}

.compare-row {
  border: 1px solid rgba(21,15,20,0.17);
  border-radius: 13px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.58);
}

.compare-row span {
  display: block;
  margin-bottom: 6px;
  color: rgba(21,15,20,0.56);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0;
}

.compare-row p {
  margin: 0;
  word-break: keep-all;
}

.original-row p {
  color: rgba(21,15,20,0.84);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 800;
}

.bad-row {
  background:
    linear-gradient(90deg, rgba(33,155,111,0.14), transparent 42%),
    rgba(255,255,255,0.78);
}

.result-text {
  color: var(--green);
  text-shadow: 0 0 1px rgba(21,15,20,0.12);
  font-size: clamp(22px, 6.3vw, 28px);
  line-height: 1.14;
  font-weight: 950;
}

.result-text.typing::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1em;
  margin-left: 6px;
  vertical-align: -0.13em;
  background: var(--green);
  animation: blink 0.75s steps(2, start) infinite;
}

.share-card {
  position: relative;
  flex: 1 1 auto;
  min-height: clamp(208px, 31svh, 292px);
  margin-top: 9px;
  border: 2px solid rgba(21,15,20,0.24);
  border-radius: 15px;
  padding: 14px 16px 15px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 78% 18%, rgba(238,109,204,0.38), transparent 28%),
    linear-gradient(135deg, rgba(255,255,255,0.84), rgba(210,211,219,0.72)),
    #dbdbe2;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7), 0 16px 34px rgba(55,47,58,0.18);
  overflow: hidden;
}

.share-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.share-card::after {
  border-radius: 13px;
  box-shadow: inset 0 0 46px rgba(255,255,255,0.35);
}

.share-card-top,
.share-card-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--red);
  font-size: 10px;
  font-weight: 950;
}

.share-logo {
  width: auto;
  object-fit: contain;
}

.album-card-logo {
  width: 176px;
  height: auto;
}
.ateez-card-logo { height: 18px; }

.share-card-text {
  position: relative;
  z-index: 1;
  max-width: 100%;
  margin: auto 0;
  color: var(--red);
  font-size: clamp(25px, 7.4vw, 32px);
  line-height: 1.05;
  font-weight: 950;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.barcode {
  display: none;
}

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

.ghost-button {
  min-height: 45px;
  border: 1px solid rgba(21,15,20,0.18);
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--ink);
  background: rgba(255,255,255,0.54);
  font-size: 14px;
  font-weight: 900;
}

.ghost-button:disabled {
  color: rgba(21,15,20,0.34);
  background: rgba(255,255,255,0.26);
  cursor: not-allowed;
}

.share-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 9px;
}

.share-panel[hidden] {
  display: none;
}

.share-panel button {
  height: 39px;
  border: 1px solid rgba(21,15,20,0.18);
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #171215;
  font-size: 11px;
  font-weight: 950;
}

.share-panel button[data-share="instagram"] {
  border: 0;
  background: radial-gradient(circle at 30% 100%, #ffd84d 0 18%, #ff3d7f 48%, #6c3cff 100%);
}

.result-footer {
  margin-top: 9px;
  padding-top: 0;
  display: grid;
}

.back-button {
  width: 100%;
  min-width: 82px;
  height: 38px;
  border: 1px solid rgba(21,15,20,0.2);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255,255,255,0.5);
  font-size: 13px;
  font-weight: 900;
}

.copyright {
  display: grid;
  place-items: center;
  color: rgba(21,15,20,0.56);
  font-size: 10px;
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 10;
  transform: translate(-50%, 18px);
  max-width: calc(100% - 28px);
  border: 1px solid rgba(21,15,20,0.14);
  border-radius: 999px;
  padding: 11px 15px;
  color: var(--ink);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 16px 44px rgba(36,29,38,0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  font-size: 13px;
  font-weight: 850;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.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;
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes equalize {
  0% { transform: scaleY(0.58); }
  100% { transform: scaleY(1.08); }
}

@media (max-height: 860px) {
  .poc-shell {
    grid-template-rows: 40px minmax(0, 1fr) 18px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .main-card {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .bgm-pill {
    width: 118px;
    height: 30px;
    font-size: 12px;
  }

  .view-stack {
    height: calc(100% - 34px);
    margin-top: 4px;
  }

  .title-block {
    margin-top: 0;
    margin-bottom: 6px;
  }

  .title-block p {
    margin-bottom: 4px;
  }

  .mini-album-logo {
    width: 128px;
  }

  .bad-logo {
    width: clamp(84px, 25vw, 104px);
  }

  .translator-word {
    font-size: clamp(27px, 8vw, 35px);
  }

  .title-block strong {
    margin-top: 6px;
    font-size: 14px;
  }

  .title-block small {
    margin-top: 4px;
  }

  .album-logo-small {
    width: 144px;
  }

  .input-box,
  textarea {
    min-height: 86px;
  }

  textarea {
    padding: 15px 20px 28px;
    font-size: 15px;
  }

  #charCount {
    right: 18px;
    bottom: 8px;
    font-size: 13px;
  }

  .translator {
    gap: 7px;
  }

  .lang-option {
    height: 30px;
  }

  .convert-button {
    height: 48px;
    border-radius: 12px;
    font-size: 18px;
  }

  .compare-row {
    padding: 10px 12px;
  }

  .result-text {
    font-size: clamp(20px, 5.8vw, 24px);
  }

  .share-card {
    min-height: clamp(170px, 25svh, 220px);
  }

  .concept-photo {
    width: min(100%, 250px);
    height: auto;
    margin-top: -1px;
    margin-bottom: 6px;
  }

  .share-card-text {
    font-size: clamp(22px, 6.5vw, 27px);
  }

  .ghost-button {
    min-height: 40px;
  }
}

@media (max-height: 620px) {
  .poc-shell {
    grid-template-rows: 36px minmax(0, 1fr) 16px;
    padding-top: 3px;
    padding-bottom: 3px;
  }

  .site-top {
    padding: 0 14px;
  }

  .ateez-logo,
  .ateez-logo img {
    width: 96px;
  }

  .album-tag,
  .album-tag img {
    width: 144px;
  }

  .main-card {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .bgm-pill {
    width: 108px;
    height: 28px;
    gap: 6px;
  }

  .view-stack {
    height: calc(100% - 31px);
    margin-top: 3px;
  }

  .input-view {
    overflow-y: auto;
    padding-bottom: 4px;
  }

  .title-block {
    margin-bottom: 4px;
  }

  .mini-album-logo {
    width: 106px;
  }

  .bad-logo {
    width: clamp(70px, 23vw, 86px);
  }

  .translator-word {
    font-size: clamp(24px, 7.5vw, 30px);
  }

  .title-block strong {
    margin-top: 4px;
    font-size: 13px;
  }

  .title-block small {
    margin-top: 2px;
  }

  .album-logo-small {
    width: 120px;
  }

  .concept-photo {
    width: min(100%, 212px);
    margin-bottom: 5px;
  }

  .input-box,
  textarea {
    min-height: 74px;
  }

  textarea {
    padding: 12px 16px 24px;
  }

  #charCount {
    right: 16px;
    bottom: 7px;
  }

  .translator {
    gap: 6px;
  }

  .lang-option {
    height: 28px;
  }

  .convert-button {
    height: 44px;
    font-size: 17px;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .poc-shell {
    grid-template-rows: 26px minmax(0, 1fr) 0;
    padding-top: 2px;
    padding-bottom: 0;
  }

  .site-top {
    padding: 0 12px;
  }

  .ateez-logo,
  .ateez-logo img {
    width: 76px;
  }

  .album-tag,
  .album-tag img {
    width: 110px;
  }

  .copyright {
    display: none;
  }

  .main-card {
    padding: 4px 12px 5px;
  }

  .bgm-pill {
    width: 94px;
    height: 24px;
    gap: 4px;
    font-size: 11px;
  }

  .eq {
    height: 16px;
  }

  .view-stack {
    height: calc(100% - 26px);
    margin-top: 2px;
  }

  .title-block {
    margin: 0 0 3px;
  }

  .title-block p,
  .title-block strong,
  .title-block small,
  .concept-photo {
    display: none;
  }

  .title-lockup {
    gap: 6px;
  }

  .bad-logo {
    width: 70px;
  }

  .translator-word {
    margin-bottom: 1px;
    font-size: 26px;
    line-height: 0.95;
  }

  .translator {
    gap: 4px;
  }

  .input-box,
  textarea {
    min-height: 56px;
  }

  textarea {
    padding: 9px 14px 20px;
    font-size: 14px;
    line-height: 1.25;
  }

  #charCount {
    right: 12px;
    bottom: 4px;
    font-size: 11px;
  }

  .language-row {
    gap: 6px;
  }

  .lang-option {
    height: 24px;
    font-size: 11px;
  }

  .convert-button {
    height: 42px;
    gap: 10px;
    border-radius: 10px;
    font-size: 16px;
  }

  .convert-button svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 360px) {
  .site-top {
    padding: 0 14px;
  }

  .ateez-logo,
  .ateez-logo img {
    width: 100px;
  }

  .album-tag,
  .album-tag img {
    width: 150px;
  }

  .main-card {
    padding-left: 14px;
    padding-right: 14px;
  }
}

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