@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@800;900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500&display=swap");

/* Edit these values first when changing the page spacing. */
:root {
  --background: #6e0c0c;
  --page-padding: 40px;
  --scene-height: clamp(300px, 51svh, 480px);
  --scene-to-controls: 28px;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--background);
  color: #fff;
}
body {
  font-family: "Noto Sans KR", sans-serif;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.7;
}
button:focus-visible,
a:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
.design {
  width: min(100%, 1440px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 0 var(--page-padding);
  display: grid;
  grid-template-rows: auto 1fr auto;
}
header {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  display: block;
  flex-shrink: 0;
}
.logo img {
  display: block;
  width: 170px;
  height: auto;
}
nav {
  display: flex;
  align-items: center;
  gap: 22px;
  white-space: nowrap;
}
nav,
nav button {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.55px;
}
nav button {
  padding: 0;
  border: 0;
  background: transparent;
}
nav .current {
  position: relative;
}
nav .current img {
  position: absolute;
  left: 0;
  top: 23px;
}
main {
  min-width: 0;
  padding: 20px 0 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#stage {
  width: min(100%, 560px);
  height: var(--scene-height);
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  margin-bottom: var(--scene-to-controls);
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
canvas:active {
  cursor: grabbing;
}
#loading,
#failure {
  position: absolute;
  top: 42%;
  left: 0;
  right: 0;
  margin: 0;
  padding: 20px;
  text-align: center;
  font-size: 12px;
  line-height: 2;
  pointer-events: none;
}
#failure {
  background: var(--background);
}
/* The original Figma toolbar is retained at its natural size. */
.tools {
  position: relative;
  width: 430px;
  height: 62px;
  flex-shrink: 0;
}
.icon-art {
  position: absolute;
  left: 0;
  top: 0;
  width: 108px;
  height: 62px;
}
.icon-art img {
  width: 108px;
  height: 62px;
  display: block;
}
.icon-button {
  position: absolute;
  top: 5px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.reset {
  left: 7px;
}
.sound {
  left: 60px;
}
.mute {
  position: absolute;
  inset: 4px;
  font-size: 25px;
  text-shadow: 1px 1px var(--background);
}
.modes {
  position: absolute;
  left: 111px;
  top: 0;
  width: 318px;
  height: 46px;
  display: flex;
}
.modes > img {
  position: absolute;
  left: -1px;
  top: -1px;
  pointer-events: none;
}
.modes button {
  width: 106px;
  position: relative;
  border: 0;
  padding: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.55px;
}
.rotate-button {
  margin-top: 13px;
  border: 1px solid #ffffff60;
  border-radius: 30px;
  background: transparent;
  min-width: 116px;
  padding: 9px 20px;
  font-size: 11px;
}
.rotate-button[aria-pressed="true"] {
  color: var(--background);
  background: #fff;
  border-color: #fff;
}
.hint {
  min-height: 16px;
  margin: 14px 0 0;
  color: #ffffff90;
  font-size: 10px;
  line-height: 1.7;
  text-align: center;
}
footer {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 15px;
  min-height: 72px;
  padding: 16px 0;
}
footer img {
  display: block;
  max-width: none;
  margin: 0;
}
footer .footer-left,
footer .footer-right {
  max-width: 100%; /* Original SVG dimensions are retained; extra width becomes breathing room. */
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (max-width: 680px) {
  :root {
    --page-padding: 20px;
    --scene-height: clamp(280px, 45svh, 400px);
    --scene-to-controls: 24px;
  }
  header {
    min-height: 116px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px 0 12px;
    gap: 22px;
  }
  .logo img {
    width: 160px;
  }
  nav {
    width: 100%;
    justify-content: center;
    gap: 18px;
  }
  nav,
  nav button {
    font-size: 10px;
  }
  main {
    padding-top: 24px;
  }
  .tools {
    width: 320px;
    height: 108px;
  }
  .icon-art {
    left: 106px;
  }
  .reset {
    left: 113px;
  }
  .sound {
    left: 166px;
  }
  .modes {
    left: 1px;
    top: 62px;
  }
  .rotate-button {
    margin-top: 14px;
  }
  footer {
    gap: 10px;
    min-height: 66px;
  }
}
/* Full fanpage shell, matching the supplied burgundy page compositions. */

.design {
  max-width: 1280px;
}
header .logo {
  width: 125px;
}
header .logo img {
  display: none;
}
header .logo::before {
  content: "XIA / FANPAGE";
  font-family: "Barlow Condensed", sans-serif;
  font-size: 23px;
}
nav a {
  color: #fff;
  text-decoration: none;
  font-size: 11px;
  white-space: nowrap;
}
nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 10px;
}
body.home header {
  display: none;
}
.home-page {
  display: grid;
  place-items: center;
  min-height: calc(100svh - 90px);
  padding: 40px 0 10px;
}
.home-page a {
  display: flex;
  align-items: center;
  flex-direction: column;
  width: min(100%, 640px);
  text-decoration: none;
}
.hero-logo {
  width: 78%;
  height: auto;
  z-index: 1;
}
.hero-coconut {
  width: 78%;
  margin-top: -20px;
  transition: transform 0.35s;
}
.home-page a:hover .hero-coconut {
  transform: rotate(-4deg) scale(1.02);
}
body.home footer {
  width: min(100%, 500px);
  margin: auto;
}
.lottery-page {
  display: grid;
  grid-template-columns: 240px minmax(280px, 1fr) 180px;
  gap: 18px;
  padding: 12px 0 24px;
  align-items: end;
}
.small-logo {
  width: 170px;
}
.small-coconut {
  width: 170px;
  display: block;
  margin: -8px 0 12px;
}
.lottery-settings label {
  display: grid;
  grid-template-columns: 75px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  margin: 12px 0;
}
input,
textarea,
select {
  color: #fff;
  background: transparent;
  border: 1px solid #ffffff60;
  border-radius: 3px;
  padding: 7px;
  font: inherit;
  min-width: 0;
}
select option {
  background: #6e0c0c;
}
textarea {
  resize: vertical;
}
.cream-button {
  border: 0;
  border-radius: 4px;
  background: #f7eddb;
  color: #6e0c0c;
  padding: 9px 13px;
  font-weight: 600;
}
#start-draw {
  width: 100%;
}
.wave-button,
.link-settings {
  background: transparent;
  color: #fff;
  border: 0;
  padding: 14px 0;
  font-size: 11px;
}
.lottery-pool {
  position: relative;
  height: 560px;
  overflow: hidden;
  background: linear-gradient(#edc2a6 75%, #b8a17c 88%, #49b9b9 98%);
}
#lottery-canvas {
  width: 100%;
  height: 100%;
}
.palm {
  position: absolute;
  bottom: 12px;
  right: 0;
  font-size: 100px;
  pointer-events: none;
}
.draw-message {
  position: absolute;
  top: 12px;
  left: 8px;
  right: 8px;
  text-align: center;
  font-size: 11px;
  color: #6e0c0c;
  pointer-events: none;
}
.ranking h2 {
  font-size: 12px;
  font-weight: 400;
}
.ranking ol {
  border: 1px solid #ffffff80;
  border-radius: 4px;
  min-height: 260px;
  padding: 16px 16px 16px 34px;
  font-size: 12px;
  line-height: 2;
}
.wiki-page {
  display: grid;
  grid-template-columns: 322fr 512fr;
  gap: 30px;
  padding: 15px 0 30px;
  align-items: center;
}
.profile-photo {
  aspect-ratio: 322/430;
  position: relative;
  overflow: hidden;
  border: 1px solid #fff;
}
.profile-photo img {
  position: absolute;
  width: 298.1366%;
  max-width: none;
  left: -12.42236%;
  top: -15.11628%;
}
.profile-logo {
  width: 90%;
  margin-bottom: 30px;
}
.wiki-content p {
  font-size: 13px;
  line-height: 1.8;
}
.wiki-content p small {
  font-size: 11px;
  color: #dfb1a7;
}
.wiki-content h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  letter-spacing: 4px;
  font-size: 10px;
  font-weight: 500;
}
.wiki-content h2 span {
  height: 1px;
  background: #ffffff60;
  flex: 1;
}
.channel-row {
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid #ffffff60;
  padding: 14px 5px;
  color: #fff;
  text-decoration: none;
  font-size: 12px;
}
.channel-row .symbol {
  font-size: 20px;
  width: 24px;
  text-align: center;
}
.channel-row .arrow {
  margin-left: auto;
}
.channel-row[aria-disabled="true"] {
  opacity: 0.5;
}
.link-settings {
  opacity: 0.6;
}
dialog {
  background: #6e0c0c;
  color: #fff;
  border: 1px solid #fff;
  max-width: 550px;
  width: 90%;
}
dialog::backdrop {
  background: #0009;
}
dialog h2 {
  font-size: 18px;
}
dialog p {
  font-size: 12px;
}
dialog label {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  font-size: 12px;
  margin: 10px 0;
}
dialog button {
  color: #6e0c0c;
  background: #f7eddb;
  padding: 8px 16px;
  border: 0;
  margin-top: 15px;
}
.cinema-page {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 18px;
  padding: 8px 0 30px;
}
.cinema-main h1 {
  font-family: "CondorComp", "Barlow Condensed", Impact, sans-serif;
  font-size: clamp(48px, 6.5vw, 90px);
  line-height: 1;
  margin: 0 0 8px;
  letter-spacing: -2px;
}
.screen {
  aspect-ratio: 16/9;
  background: #090909;
  display: grid;
  place-items: center;
}
.screen p {
  color: #ddd;
  text-align: center;
  font-size: 13px;
  line-height: 2;
}
.screen iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.cinema-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  font-size: 12px;
}
.cinema-actions span {
  margin-right: auto;
}
.cinema-actions button,
.cinema-tabs button,
#add-video button {
  background: transparent;
  border: 1px solid #ffffff50;
  padding: 5px 10px;
  font-size: 10px;
}
.cinema-sidebar {
  padding-top: 117px;
}
.cinema-sidebar form {
  display: flex;
  gap: 6px;
  font-size: 11px;
}
.cinema-sidebar input {
  flex: 1;
  width: 0;
}
.cinema-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}
.playlist-panel {
  background: #101010;
  border: 1px solid #555;
  padding: 10px;
  min-height: 400px;
}
.playlist-panel h2 {
  font-size: 15px;
  margin: 0 0 14px;
}
#add-video {
  flex-wrap: wrap;
}
#add-video input {
  min-width: 100px;
}
#playlist {
  list-style: none;
  padding: 0;
}
#playlist li {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #555;
  margin: 8px 0;
  padding: 9px;
  font-size: 11px;
}
#playlist li img {
  width: 85px;
  aspect-ratio: 16/9;
  object-fit: cover;
}
#playlist li button {
  background: none;
  border: 0;
  color: #fff;
}
#playlist li .play-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  text-align: left;
}
#playlist-empty {
  font-size: 10px;
  color: #aaa;
}
.cinema-wide .cinema-page {
  grid-template-columns: 1fr;
}
.cinema-wide .cinema-sidebar {
  display: none;
}
@media (max-width: 850px) {
  .lottery-page {
    grid-template-columns: 180px 1fr;
  }
  .ranking {
    grid-column: 1/-1;
  }
  .ranking ol {
    min-height: 80px;
  }
  .small-logo,
  .small-coconut {
    width: 150px;
  }
  .wiki-page {
    gap: 20px;
  }
  .profile-logo {
    margin-bottom: 15px;
  }
  .channel-row {
    padding: 10px 2px;
  }
  .cinema-page {
    grid-template-columns: 1fr;
  }
  .playlist-panel {
    min-height: 200px;
  }
  .cinema-sidebar {
    padding-top: 0;
  }
}
@media (max-width: 540px) {
  .lottery-page {
    grid-template-columns: 1fr;
  }
  .lottery-settings {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
  }
  .small-logo {
    width: 100px;
    grid-column: 1;
  }
  .small-coconut {
    grid-column: 1;
    width: 100px;
    grid-row: 2;
  }
  .lottery-settings form {
    grid-column: 2;
    grid-row: 1/4;
  }
  .wave-button {
    grid-column: 1;
  }
  .lottery-pool {
    height: 450px;
  }
  .wiki-page {
    grid-template-columns: 1fr;
  }
  .profile-photo {
    max-width: 300px;
    width: 100%;
    margin: auto;
  }
  .wiki-content {
    padding: 10px;
  }
  .profile-logo {
    max-width: 330px;
  }
  .home-page a {
    width: 100%;
  }
  nav {
    gap: 16px;
  }
  .hero-logo,
  .hero-coconut {
    width: 92%;
  }
}

footer {
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto;
}
header .logo {
  display: flex;
  gap: 3px;
  align-items: center;
}
header .logo::before {
  content: none;
}
header .logo img {
  display: block;
  width: auto;
  height: auto;
}

.lottery-page {
  align-self: start;
}
.cinema-page {
  align-self: start;
}

/* v0.5: crisp vector controls, no raster icons. */
.icon-button {
  border: 1px solid #fff;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  overflow: visible;
  opacity: 1;
}
.icon-button svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.reset-caption {
  position: absolute;
  top: 44px;
  left: -5px;
  right: -5px;
  font-size: 9px;
  color: #fff;
  font-weight: 400;
  white-space: nowrap;
}
.icon-button .mute {
  position: static;
  text-shadow: none;
  font-size: inherit;
}
#sound[aria-pressed="false"] .sound-waves {
  display: none;
}

/* v0.6: render to the viewport, with the original stage controlling composition. */
body {
  overflow-x: clip;
}
main[data-page="wax"] {
  position: relative;
  isolation: isolate;
}
#stage {
  overflow: visible;
  z-index: 0;
}
#view {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 0;
}
.tools,
.rotate-button,
.hint {
  position: relative;
  z-index: 3;
}
header,
footer {
  position: relative;
  z-index: 5;
}
/* Intrinsic word widths: XIA 19px, WITH 29px, COCONUT 50px. */
footer,
body.home footer {
  position: relative;
  display: block;
  width: 100%;
  height: 72px;
  min-height: 72px;
  padding: 0;
  margin: 0;
  --footer-gap: clamp(12px, 1.6vw, 24px);
}
footer .footer-xia {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}
footer .footer-with {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
footer .footer-coconut {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
footer .footer-rule {
  position: absolute;
  top: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
  max-width: none;
}
footer .footer-left {
  left: calc(19px + var(--footer-gap));
  right: calc(50% + 14.5px + var(--footer-gap));
}
footer .footer-right {
  left: calc(50% + 14.5px + var(--footer-gap));
  right: calc(50px + var(--footer-gap));
}
#camera-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 220px;
  background: #4f0808f2;
  border: 1px solid #ffffff90;
  padding: 9px;
  z-index: 20;
  color: #fff;
  box-shadow: 0 6px 24px #0003;
}
.camera-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  gap: 7px;
  min-height: 24px;
}
.camera-head button {
  border: 0;
  background: none;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.camera-preview {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #290808;
}
#hand-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
#junsu-preset {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.preset-photo {
  position: absolute;
  width: 100%;
  aspect-ratio: 322/430;
  top: 50%;
  transform: translateY(-50%);
  overflow: hidden;
}
.preset-photo img {
  position: absolute;
  width: 298.1366%;
  max-width: none;
  left: -12.42236%;
  top: -15.11628%;
}
#junsu-custom {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
#camera-panel p {
  font-size: 9px;
  line-height: 1.8;
  margin: 7px 0 0;
}
#camera-error {
  color: #ffd9a0;
}
#avatar-picker {
  display: inline-block;
  padding: 6px 0;
  font-size: 10px;
  text-decoration: underline;
  cursor: pointer;
}
#avatar-file {
  display: none;
}
#hand-cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 15;
  box-shadow: 0 0 0 2px #6e0c0c99;
}
#hand-cursor.pinching {
  background: #fff7;
  box-shadow: 0 0 0 6px #ffffff24;
}
#hand-cursor.rotating {
  border-style: dashed;
}
@media (max-width: 600px) {
  #camera-panel {
    width: 160px;
    right: 10px;
    bottom: 10px;
  }
  .camera-preview {
    aspect-ratio: 4/3;
  }
  #camera-panel p {
    font-size: 8px;
  }
  #camera-status {
    font-size: 8px;
  }
}
