@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

* {
  box-sizing: border-box;
}

:root {
  --scratch-overlay-color: #a4a4a4;

  --scratch-brush-size: 15;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Pretendard Variable", "Pretendard", sans-serif;
  font-weight: 400;
}

body {
  background: linear-gradient(to top,
      #c9c9c9 0%,
      #f1f1f1 35%,
      #ececec 70%,
      #6c6b6b 100%);
  color: #111;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(20px);
}

.intro-overlay.is-hidden {
  display: none;
}

.intro-hero {
  width: min(96vw, 500px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.intro-scratch-box {
  position: relative;
  width: min(92vw, 300px);
  max-width: 100%;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

.intro-poster-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.18));
  pointer-events: none;
}

.scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.intro-marquee {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: none;
  overflow: hidden;
  background: rgba(255, 255, 255, 0);
  z-index: 3;
  pointer-events: none;
}

.intro-marquee__track {
  display: flex;
  width: max-content;
  gap: 0;
  padding: 8px 0 10px;
  animation: intro-marquee-move 12s linear infinite;
}

.intro-marquee__track span {
  display: block;
  white-space: nowrap;
  padding-right: 56px;
  font-size: 15px;
  line-height: 1.4;
  color: #000000;
  font-weight: 450;
  letter-spacing: 0.01em;
}

@keyframes intro-marquee-move {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

.top-ui {
  position: fixed;
  top: 18px;
  left: 18px;
  right: 18px;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.top-ui__left,
.top-ui__right {
  pointer-events: auto;
}

.top-ui__left {
  width: min(380px, calc(100vw - 118px));
}

.top-ui__right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.guide-box {
  width: 100%;
  padding: 7px 10px 5px;
  border-radius: 16px;
  border: 0.5px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 25px rgba(89, 136, 167, 0.1);
  color: #dfdfdf;
}

.guide-box__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.guide-box__body {
  margin-top: 12px;
  max-height: 140px;
  overflow: hidden;
  opacity: 1;
  transition:
    max-height 0.24s ease,
    opacity 0.24s ease,
    margin-top 0.24s ease;
}

.guide-box.is-collapsed .guide-box__body {
  margin-top: 0;
  max-height: 0;
  opacity: 0;
}

.guide-box.is-collapsed {
  width: 100%;
  border-radius: 999px;
}

.mini-label {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  color: #dfdfdf;
  white-space: nowrap;
  flex: 0 0 auto;
}

.guide-toggle-btn {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #dfdfdf;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  white-space: nowrap;
  flex: 0 0 auto;
}

.guide-text {
  margin: 0;
  font-size: 12px;
  font-weight: 350;
  line-height: 1.2;
  color: #f2f2f2;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: normal;
}

.guide-line {
  display: block;
}

.guide-line+.guide-line {
  margin-top: 4px;
}

.ghost-btn {
  padding: 7px 10px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #dfdfdf;
  border: 0.5px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 25px rgba(89, 136, 167, 0.1);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  word-break: normal;
}

.sound-status {
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: #4f7187;
}

.mobile-controls {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 12;
  width: 162px;
  height: 162px;
  pointer-events: none;
}

.move-btn {
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #c6c5c5;
  border: 0.5px solid rgba(255, 255, 255, 0.5);
  font-size: 22px;
  font-weight: 700;
  outline: none;
  box-shadow: 0 4px 4px rgba(86, 86, 86, 0.15);
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.move-btn--up {
  left: 52px;
  top: 0;
}

.move-btn--left {
  left: 0;
  top: 52px;
}

.move-btn--right {
  right: 0;
  top: 52px;
}

.move-btn--down {
  left: 52px;
  bottom: 0;
}

@media (hover: hover) and (pointer: fine) {
  .mobile-controls {
    display: none;
  }
}

@media (max-width: 768px) {
  .intro-hero {
    gap: 10px;
  }

  .intro-scratch-box {
    width: min(78vw, 420px);
  }

  .intro-marquee {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 0;
  }

  .intro-marquee__track {
    padding: 0;
  }

  .intro-marquee__track span {
    font-size: 15px;
    padding-right: 40px;
  }

  .top-ui {
    top: 14px;
    left: 14px;
    right: 14px;
    gap: 10px;
  }

  .top-ui__left {
    width: min(320px, calc(100vw - 108px));
  }

  .guide-box {
    width: 100%;
    padding: 7px 10px 5px;
    border-radius: 16px;
  }

  .guide-box.is-collapsed {
    width: 100%;
    border-radius: 999px;
  }

  .guide-text {
    font-size: 13px;
    line-height: 1.2;
  }

  .guide-toggle-btn,
  .ghost-btn,
  .mini-label {
    font-size: 11px;
  }
}

.a-canvas,
.a-canvas:hover,
.scratch-canvas,
.scratch-canvas:hover,
.intro-overlay,
.intro-overlay * {
  cursor: grab !important;
  cursor: -webkit-grab !important;
  cursor: -moz-grab !important;
}

body.is-scratching .a-canvas,
body.is-scratching .a-canvas:hover,
body.is-scratching .scratch-canvas,
body.is-scratching .scratch-canvas:hover,
body.is-scratching .intro-overlay,
body.is-scratching .intro-overlay * {
  cursor: grabbing !important;
  cursor: -webkit-grabbing !important;
  cursor: -moz-grabbing !important;
}

#scene,
.a-canvas {
  touch-action: none;
}