:root {
  color-scheme: dark;
  --bg: #040506;
  --panel: rgba(0, 0, 0, 0.1);
  --panel-solid: rgba(15, 18, 21, 0.72);
  --border: rgba(255, 255, 255, 0.04);
  --text: rgba(238, 241, 244, 0.92);
  --muted: rgba(238, 241, 244, 0.58);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  --cursor-dot: #4dff8b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.045), transparent 36%),
    radial-gradient(circle at bottom, rgba(255, 255, 255, 0.025), transparent 42%),
    var(--bg);
  overflow: hidden;
  font-family:
    "SUIT Variable", "Pretendard Variable", "Aptos", "Segoe UI", "Helvetica Neue",
    "Noto Sans KR", sans-serif;
}

body {
  color: var(--text);
}

.has-dot-cursor,
.has-dot-cursor * {
  cursor: none !important;
}

.has-dot-cursor.is-cursor-suppressed,
.has-dot-cursor.is-cursor-suppressed * {
  cursor: auto !important;
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#dots-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.dot-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--cursor-dot);
  pointer-events: none;
  opacity: 0;
  transform: translate(-999px, -999px);
  translate: -50% -50%;
  box-shadow: 0 0 8px rgba(77, 255, 139, 0.18);
  transition:
    opacity 140ms ease,
    filter 180ms ease,
    width 160ms ease,
    height 160ms ease;
}

.dot-cursor.is-visible {
  opacity: 1;
}

.dot-cursor.is-pressed {
  width: 6px;
  height: 6px;
  filter: drop-shadow(0 0 10px rgba(77, 255, 139, 0.24));
}

.panel {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 3, 4, 0.32);
  transition: opacity 260ms ease;
}

.panel.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.panel__card {
  position: relative;
  width: min(30rem, calc(100vw - 2rem));
  max-height: min(46rem, calc(100vh - 2rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.2rem;
  border-radius: 30px;
  flex-direction: column;
  gap: 1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.01)),
    rgba(0, 0, 0, 0.1);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.065),
    inset 0 -1px 0 rgba(255, 255, 255, 0.025);
}

.panel__card--about {
  width: min(26rem, calc(100vw - 2rem));
}

.panel__card--modes {
  width: min(34rem, calc(100vw - 2rem));
}

.panel__card::-webkit-scrollbar {
  width: 10px;
}

.panel__card::-webkit-scrollbar-track {
  background: transparent;
}

.panel__card::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  background-clip: padding-box;
}

.panel__header {
  position: sticky;
  top: -1.2rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -1.2rem -1.2rem 0;
  padding: 1.2rem 1.2rem 0.9rem;
  background:
    linear-gradient(
      to bottom,
      rgba(15, 18, 21, 0.92),
      rgba(15, 18, 21, 0.62) 72%,
      transparent
    );
  backdrop-filter: blur(16px) saturate(130%);
}

.panel__header h2 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel__close {
  appearance: none;
  min-width: 2rem;
  min-height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.012);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.01);
  color: rgba(238, 241, 244, 0.5);
  padding: 0;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(12px) saturate(120%);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.panel__close:hover,
.panel__close:focus-visible {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.026);
  color: rgba(238, 241, 244, 0.74);
  transform: translateY(-1px) scale(0.985);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  outline: none;
}

.panel__action {
  appearance: none;
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.015);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.024), rgba(255, 255, 255, 0.008)),
    rgba(255, 255, 255, 0.008);
  color: rgba(238, 241, 244, 0.68);
  padding: 0.52rem 0.84rem;
  font: inherit;
  font-size: 0.71rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(14px) saturate(130%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.024);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.panel__action:hover,
.panel__action:focus-visible {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.036), rgba(255, 255, 255, 0.015)),
    rgba(255, 255, 255, 0.014);
  border-color: rgba(255, 255, 255, 0.03);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.028);
  outline: none;
}

.panel__action:disabled {
  opacity: 0.52;
  cursor: wait;
  transform: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.field input[type="range"] {
  width: 100%;
}

.field--checkbox {
  flex-direction: row;
  align-items: center;
}

.field--checkbox input:disabled {
  opacity: 0.45;
  cursor: wait;
}

.field--checkbox input:disabled + span {
  opacity: 0.48;
}

.field-group {
  margin: 0;
  padding: 0.86rem 0.96rem;
  border: 1px solid rgba(255, 255, 255, 0.012);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.016), rgba(255, 255, 255, 0.006)),
    rgba(255, 255, 255, 0.006);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.014);
}

.field-group legend {
  padding: 0 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel p {
  margin: 0;
  line-height: 1.5;
}

.panel__intro {
  color: rgba(238, 241, 244, 0.78);
  font-size: 0.8rem;
  line-height: 1.55;
}

.panel__micro {
  color: rgba(238, 241, 244, 0.52);
  font-size: 0.72rem;
  line-height: 1.5;
}

.panel__note {
  color: var(--muted);
}

.mode-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.7rem;
}

.mode-list button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.012);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0.006)),
    rgba(255, 255, 255, 0.005);
  color: var(--text);
  padding: 0.92rem 0.96rem;
  font: inherit;
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(12px) saturate(125%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.014);
  transition:
    background 180ms ease,
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.mode-list button:hover,
.mode-list button:focus-visible {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.012)),
    rgba(255, 255, 255, 0.01);
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.024);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.022),
    0 8px 18px rgba(0, 0, 0, 0.04);
  outline: none;
}

.mode-list button.is-active {
  border-color: rgba(255, 255, 255, 0.03);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.034), rgba(255, 255, 255, 0.014)),
    rgba(255, 255, 255, 0.012);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.024),
    0 10px 20px rgba(0, 0, 0, 0.045);
}

.mode-list strong,
.mode-list span,
.mode-list p,
.mode-list em {
  display: block;
}

.mode-list strong {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.mode-list span {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.mode-list p {
  margin: 0.52rem 0 0;
  color: rgba(238, 241, 244, 0.74);
  font-size: 0.74rem;
  line-height: 1.5;
}

.mode-list em {
  margin-top: 0.48rem;
  color: rgba(238, 241, 244, 0.54);
  font-size: 0.7rem;
  line-height: 1.45;
  font-style: normal;
}

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

@media (max-width: 720px) {
  .panel__card {
    max-height: calc(100vh - 1.4rem);
    padding: 1rem;
    border-radius: 22px;
  }

  .panel__header {
    top: -1rem;
    margin: -1rem -1rem 0;
    padding: 1rem 1rem 0.8rem;
  }

  .panel__card--modes,
  .panel__card--about {
    width: min(100%, calc(100vw - 1.4rem));
  }

  .mode-list {
    grid-template-columns: 1fr;
  }
}
