/* 0. 공통 (폰트, 리셋 등) */
:root {
  --font-main: "dm-mono", system-ui, -apple-system, "Apple SD Gothic Neo",
    "Noto Sans KR", "Pretendard", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-bold: ;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-main);
  line-height: 1.4;
  font-size: 18px;
  color: black;
  font-weight: 400;
}

button,
input {
  font-family: var(--font-main);
}

span {
  font-size: 18px;
}

a {
  text-decoration: none;
  color: #000;
  font-family: var(--font-main);
}

/* 공통 요소들 (레이아웃 말고) */
.toHome {
  width: 50px;
  height: 50px;
  background-image: url("/static/image/close.png");
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: contain;
  position: absolute;
  right: 20px;
  top: 20px;
}

.sheep-frame {
  box-sizing: border-box;
  min-height: 100vh;
  overflow: hidden;
}

.sheep-canvas {
  position: relative;
  background: transparent;
  height: 100vh;
  box-sizing: border-box;
  overflow: hidden;
}

/* 랜덤 점 영역 */
.sheep-field {
  position: absolute;
  inset: 0;
}

/* 점 하나 스타일 */
.pixel-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #000;
}

.shit-rect {
  position: absolute;
  width: 30px;
  height: 30px;
  background-image: url("/static/image/poop.png");
}

/* 좌상단 텍스트 */
.sheep-hello {
  position: absolute;
  top: 24px;
  left: 40px;
  font-size: 1.4rem;
  z-index: 99999999999;
}

/* 말풍선 + 양 묶음 */
.sheep-ui {
  position: absolute;
  display: none; /* 기본 숨김 */
  pointer-events: auto;
  flex-direction: column;
}

/* 말풍선 공통 스타일 */
.speech-bubble {
  display: inline-block;
  background: #e5e5e5;
  padding: 8px 16px;
  margin-bottom: 10px;
  font-size: 1rem;
  color: #000;
  text-decoration: none;
  position: relative;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

/* 말풍선 꼬리 */
.speech-bubble::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background: #e5e5e5;
  transform: rotate(45deg);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.15);
}

.speech-question::after,
.speech-works::after,
.speech-get-brief::after,
.speech-list-brief::after {
  bottom: -4px;
  left: 8px;
}

/* 픽셀 양 */
.sheep-sprite {
  width: 240px;
  height: 240px;
  background-color: transparent !important;
  position: absolute;
  cursor: pointer;
  background-image: url("/static/image/sheep_basic.png");
  background-repeat: no-repeat;
  background-position: 0 0;
  image-rendering: pixelated;
  transition: none;
  animation: sheepWalk 6s steps(36) infinite;
}

@keyframes sheepWalk {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -8640px 0;
  }
}

/* 달리는 양 */
@keyframes sheep-move {
  from {
    transform: translate(-50%, -50%) translateX(0);
  }
  to {
    transform: translate(-50%, -50%) translateX(120vw);
  }
}
@keyframes sheepRunning {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -1440px 0;
  }
}
.sheep-sprite-move {
  position: absolute;
  width: 240px;
  height: 240px;
  background-image: url("/static/image/sheep_running.png");
  background-repeat: no-repeat;
  image-rendering: pixelated;
  animation: sheep-move 4s linear forwards, sheepRunning 0.5s steps(6) infinite;
}

/* 공통 컨텐츠 박스들 */
.project {
  display: flex;
  flex-direction: column;
}

.row {
  padding: 5px 0px;
  border-bottom: solid black 2px;
  display: grid;
  grid-template-columns: 3fr 2px 2fr 2px 1fr;
  height: 30px;
}

.bold {
  border-bottom: solid black 4px;
  font-size: 1.4rem;
}
.row > div {
  text-overflow: hidden;
  overflow: hidden;
  padding: 5px 10px;
  text-overflow: ellipsis;
}

.divider {
  background-color: #000;
  padding: 0 !important;
}

.noBorder > .divider {
  background-color: transparent;
}

.noBorder {
  border: 0px;
  grid-template-columns: 3fr 4px 2fr 4px 1fr;
  height: auto;
}

.hiddenItem {
  display: none !important;
}

.magicWand svg :is(path, circle, rect, line, polyline, polygon) {
  vector-effect: non-scaling-stroke;
  stroke: #e3ffb5;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 1;
  animation: wand-glow 3200ms ease-in-out 180ms infinite;
}

@keyframes wand-appear {
  to {
    opacity: 1;
  }
}

@keyframes wand-glow {
  0%,
  100% {
    stroke-width: 1;
  }
  50% {
    stroke-width: 5;
  }
}

.intro {
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.toForm {
  cursor: pointer;
  background-color: #d9d9d9;
  width: 60%;
  height: 50px;
  animation: button-glow 3200ms ease-in-out 180ms infinite;
}

@keyframes button-glow {
  0%,
  100% {
    background-color: #d9d9d9;
  }
  50% {
    background-color: #e3ffb5;
  }
}

.generateForm h3 {
  text-align: center;
}

p label {
  display: none;
}

.form-input {
  height: 30px;
  padding: 5px 5px;
  border: none;
}

.loadingOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheepField {
  position: absolute;
  inset: 0;
  display: flex;
}

.loadingText {
  color: black;
  opacity: 1;
  z-index: 999999;
  font-size: 32px;
  font-weight: 800;
  background-color: white;
  padding: 10px;
  position: absolute;
  left: 50%;
  top: 50%;
  animation: float 1.8s ease-in-out infinite;
}

@keyframes float {
  0% {
    transform: translate(-50%, -50%) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-6px);
  }
  100% {
    transform: translate(-50%, -50%) translateY(0);
  }
}

.briefResult h1,
.briefResult h2,
.briefResult h3 {
  text-align: center;
}

.briefResult * {
  margin: 0;
}

.briefResult p {
  background-color: white;
  padding: 10px;
}

.borderTop {
  border-top: 4px solid black;
  border-bottom: 2px solid black;
  margin-top: 5px;
  margin-bottom: 20px;
}

.textCenter {
  text-align: center;
}

.utils {
  margin-top: auto;
  text-align: center;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.sprite {
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: contain;
  background-color: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.regenerateBtn {
  width: 70px;
  height: 60px;
  background-image: url("/static/image/again.png");
  margin-bottom: 20px;
  background-size: contain;
}

.printBtn {
  width: 90px;
  height: 60px;
  margin-bottom: 20px;
  background-image: url("/static/image/print.png");
  background-size: contain;
}

.mailBtn {
  width: 70px;
  height: 60px;
  margin-bottom: 20px;
  background-image: url("/static/image/mail.png");
  background-size: contain;
}

.sr-only {
  font-family: var(--font-main);
  text-align: center;
  font-size: 18px;
  line-height: 1;
}

.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.sticky {
  position: sticky !important;
  top: 0;
  margin-left: auto;
  display: block;
}

.listHeader {
  background-color: #d9d9d9;
  padding: 60px 60px 0px 60px;
}

.headerWand {
  background-image: url("/static/image/magicWandList.png");
  height: 39px;
  width: 150px;
  background-repeat: no-repeat;
  background-size: contain;
  flex: 0 0 auto;
}

.listHeaderText {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 0px 60px 30px 60px;
}

.headerText {
  padding: 20px;
  background-color: #e3ffb5;
  border: 2px solid black;
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}

#wand-2 {
  transform: scale(-1);
}

/* =======================
   2) PC 전용 (>=769px)
========================*/
@media (min-width: 769px) {
  .contentArea {
    position: absolute;
    display: flex;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    z-index: 20;
  }

  .about {
    width: 30%;
    background-color: #e3ffb5;
    position: relative;
    padding: 60px;
  }

  .listBrief {
    width: clamp(820px, 60%, 60%);
    height: 80%;
    background-color: #d9d9d9;
    position: relative;
    overflow: scroll;
  }

  .generateForm {
    width: 30%;
    background-color: #d9d9d9;
    position: relative;
    padding: 60px;
    opacity: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .briefResult {
    padding: 60px;
    width: clamp(320px, 40%, 720px);
    height: 80%;
    background-color: #e3ffb5;
    overflow-y: scroll;
  }
}