* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@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: "Romain";
  src: url("font/RomainduRoi.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

body {
  background-color: #ffffff;
  font-family: "pretendard", sans-serif;
  font-size: 16px;
  line-height: 1.48;
  color: #000000;
  overflow: hidden;
  user-select: text;
  -webkit-user-select: text;
  width: 100vw;
  height: 100vh;
  transition: transform 0.5s ease;
}

.container {
  display: flex;
  width: 100vw;
  height: 100vh;
  margin: 0 auto;
}

::selection {
  background-color: #000000;
  color: #ffffff;
}

#rotate-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;

  border: 1px solid #000000;
  background-color: #ffffff;
  color: #000000;
  font-family: "Pretendard", sans-serif;
  font-weight: 400;
  font-size: 16px;

  padding: 4px 12px;
  border-radius: 0;
  cursor: pointer;
}

#div1 {
  width: 286px;
  height: 100%;
  padding: 20px 20px;
  border-right: 1px solid #000;
  display: flex;
  flex-direction: column;
}

.fixed-header {
  position: sticky;
  top: 0;
  background-color: #fff;
  padding: 20px 20px 0;
  margin: 0 -20px;
  z-index: 100;
}

#div1 h1 {
  font-size: 24px;
  font-family: "Romain";
  font-variation-settings: "wght" 0, "wdth" 0, "opsz" 0, "ital" 0, "slnt" 0,
    "XOPQ" 0;
  text-align: center;
  margin-bottom: 0px;
  flex-shrink: 0;
}

.separator {
  width: 100%;
  height: 0;
  border-top: 1px solid #000;
  margin: 20px 0;
}

.scroll-content {
  flex-grow: 1;
  overflow-y: auto;
  padding-bottom: 20px;
  padding-right: 18px;
  margin-right: -18px;
}

#div1::-webkit-scrollbar {
  width: 6px;
  background-color: transparent;
}
#div1::-webkit-scrollbar-track {
  background-color: #d4d4d4;
}
#div1::-webkit-scrollbar-thumb {
  background-color: #e4e4e4;
  border-radius: 3px;
}

.description {
  word-break: break-all;
  text-align: justify;
}

.input-area label {
  display: block;
  font-size: 16px;
  margin-bottom: 16px;
}
.input-area textarea {
  width: 100%;
  height: 150px;
  border: 1px solid #000;
  padding: 4px 8px;
  font-family: "pretendard";
  font-size: 16px;
  line-height: 1.48;
  word-break: keep-all;
  resize: none;
}
.input-area textarea:focus {
  outline: none;
}

.controls {
  margin-top: 0;
}
.controls h3 {
  font-size: 16px;
  margin-bottom: 20px;
  font-family: "pretendard";
  font-weight: 400;
}
.slider-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 30px;
  margin-bottom: 10px;
}
.slider-row span {
  font-size: 24px;
  font-family: "romain";
  font-variation-settings: "wght" 0, "wdth" 0, "opsz" 0, "ital" 0, "slnt" 0,
    "XOPQ" 0;
  width: 80px;
  flex-shrink: 0;
}
.slider-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 12px;
  background-color: transparent;
  cursor: default;
}
.slider-row input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 0px;
  border-bottom: 1px solid #000;
  background: transparent;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 10px;
  width: 10px;
  border-radius: 50%;
  background: #000;
  margin-top: -5px;
  border: none;
}

.right-panel {
  flex: 1;
  display: flex;
  position: relative;
  flex-direction: column;
  padding: 20px;
  gap: 20px;
  overflow: hidden;
}
#div2 {
  flex: 0 0 45%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 20px;
}
.display-text {
  font-family: "Romain";
  line-height: 1.2;
  width: 100%;
  word-break: keep-all;
  white-space: pre-wrap;
  margin: 0;
  flex-shrink: 1;
}
#caption-container {
  pointer-events: none;
  z-index: 10;
  margin-top: 30px;
  position: static;
  transform: none;
}
.caption-text {
  font-family: "Romain";
  font-size: 32px;
  display: block;
}
#div3 {
  flex: 1;
  position: relative;
  background-color: #f0f0f0;
  overflow: hidden;
}

body.vertical-mode {
  transform-origin: top left;
  transform: rotate(-90deg) translateX(-100%);
  width: 100vh;
  height: 100vw;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  background-color: #fff;
}

body.vertical-mode .container {
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0;
}

body.vertical-mode #rotate-btn {
  top: auto !important;
  left: auto !important;

  bottom: 40px !important;
  right: 20px !important;

  width: auto !important;
  height: auto !important;

  transform: rotate(90deg);
  transform-origin: center;
}

body.vertical-mode #div1 {
  width: 100%;
  height: 286px;
  min-height: 286px;
  max-height: 286px;
  border-right: none;
  border-bottom: 1px solid #000;
  padding: 0;
  margin-bottom: 0;

  display: grid;
  grid-template-columns: 406px 1px 195px 1px 1fr;
  grid-template-rows: 100%;
  overflow: hidden;
}

body.vertical-mode .fixed-header,
body.vertical-mode .scroll-content {
  display: contents;
}
body.vertical-mode .fixed-header .separator {
  display: none;
}

body.vertical-mode h1 {
  grid-column: 1;
  grid-row: 1;
  margin-left: 40px;
  margin-top: 20px;
  width: fit-content;
  text-align: left;
  justify-self: start;
}

body.vertical-mode .description {
  grid-column: 1;
  grid-row: 1;
  margin-top: 66px;
  margin-left: 40px;
  width: 346px;
  text-align: left;
  word-break: keep-all;
  height: 200px;
  overflow-y: auto;
  padding-right: 10px;
}

body.vertical-mode .description::-webkit-scrollbar {
  display: block;
  width: 6px;
  background-color: transparent;
}

body.vertical-mode .description::-webkit-scrollbar-track {
  background-color: #d4d4d4;
}

body.vertical-mode .description::-webkit-scrollbar-thumb {
  background-color: #e4e4e4;
  border-radius: 3px;
}

body.vertical-mode .scroll-content > .separator:nth-child(3) {
  grid-column: 2;
  grid-row: 1;
  display: block;
  width: 1px;
  height: 246px;
  margin: 20px 0 0 0;
  border-top: none;
  background-color: #000;
}

body.vertical-mode .input-area {
  grid-column: 3;
  grid-row: 1;
  position: relative;
}
body.vertical-mode .input-area label {
  position: absolute;
  top: 20px;
  left: 20px;
  margin: 0;
  text-align: left;
}
body.vertical-mode .input-area textarea {
  position: absolute;
  top: 66px;
  left: 20px;
  width: 155px;
  height: 200px;
  padding: 8px;
  margin: 0;
}

body.vertical-mode .scroll-content > .separator:nth-child(5) {
  grid-column: 4;
  grid-row: 1;
  display: block;
  width: 1px;
  height: 246px;
  margin: 20px 0 0 0;
  border-top: none;
  background-color: #000;
}

body.vertical-mode .controls {
  grid-column: 5;
  grid-row: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  height: 200px;
  margin-top: 66px;

  padding-left: 20px;
  padding-right: 40px;
  min-width: 170px;
}
body.vertical-mode .controls h3 {
  position: absolute;
  top: -46px;
  left: 20px;
  margin: 0;
}

body.vertical-mode .slider-row {
  margin: 0;
  width: 100%;
  justify-content: flex-start;
  gap: 10px;
}
body.vertical-mode .slider-row:first-of-type {
  margin-top: 0;
}
body.vertical-mode .slider-row span {
  text-align: left;
  width: 80px;
  flex-shrink: 0;
}
body.vertical-mode .slider-row input[type="range"] {
  width: auto;
  flex-grow: 1;
}

body.vertical-mode .right-panel {
  flex: 1;
  display: flex;
  flex-direction: row;
  padding: 0;
  gap: 0;
  overflow: hidden;
}

body.vertical-mode #div2 {
  flex: 0 0 45%;
  width: 45%;
  height: 100%;
  padding: 20px 40px;
  border-right: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

body.vertical-mode #div3 {
  flex: 1;
  width: auto;
  height: 100%;
  background-color: transparent;
  padding-top: 20px;
  padding-right: 40px;
  padding-bottom: 20px;
  padding-left: 20px;
  box-sizing: border-box;
}

body.vertical-mode #caption-container {
  margin-top: 20px;
  text-align: center;
}
