:root {
  color-scheme: light;
  background: #f7efe7;
  color: #251f1b;
  font-family: Arial, "Noto Sans KR", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
.particle-study {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.particle-study {
  position: relative;
  min-width: 320px;
  min-height: 480px;
  background: #f7efe7;
}

.particle-study__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.particle-study__status {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: 0;
  color: rgb(37 31 27 / 55%);
  font-size: 11px;
  letter-spacing: 0.12em;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.particle-study[data-state="ready"] .particle-study__status {
  display: none;
}

.particle-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  width: 360px;
  max-height: calc(100vh - 40px);
  padding: 16px;
  overflow: auto;
  border: 1px solid rgb(37 31 27 / 14%);
  border-radius: 10px;
  background: rgb(250 246 241 / 88%);
  box-shadow: 0 18px 52px rgb(65 47 34 / 12%);
  backdrop-filter: blur(16px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.particle-panel[hidden] {
  display: none;
}

.particle-panel__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgb(37 31 27 / 11%);
}

.particle-panel__header small,
.particle-panel__header strong {
  display: block;
}

.particle-panel__header small {
  margin-bottom: 4px;
  color: rgb(37 31 27 / 48%);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.particle-panel__header strong {
  font-size: 14px;
  letter-spacing: 0.035em;
}

.particle-panel__header > output {
  color: rgb(37 31 27 / 60%);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.particle-panel__modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 12px;
  padding: 4px;
  border-radius: 7px;
  background: rgb(37 31 27 / 6%);
}

.particle-panel button {
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  color: rgb(37 31 27 / 66%);
  background: transparent;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.particle-panel__modes button[aria-pressed="true"] {
  color: #251f1b;
  background: #fffdf9;
  box-shadow: 0 2px 9px rgb(37 31 27 / 8%);
}

.particle-panel button:focus-visible,
.particle-panel input:focus-visible,
.particle-panel-opener:focus-visible {
  outline: 2px solid #251f1b;
  outline-offset: 2px;
}

.particle-panel__controls {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.particle-control {
  min-width: 0;
}

.particle-control > span:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: rgb(37 31 27 / 64%);
  font-size: 10px;
}

.particle-control output {
  color: #251f1b;
  font-variant-numeric: tabular-nums;
}

.particle-control__inputs {
  display: grid;
  grid-template-columns: 1fr 58px;
  align-items: center;
  gap: 10px;
}

.particle-control input[type="range"] {
  display: block;
  width: 100%;
  margin: 0;
  accent-color: #5f4b38;
  cursor: pointer;
}

.particle-control input[type="number"] {
  width: 58px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid rgb(37 31 27 / 16%);
  border-radius: 5px;
  color: #251f1b;
  background: rgb(255 253 249 / 78%);
  font: inherit;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.particle-control--color {
  display: grid;
  grid-template-columns: 1fr 42px;
  align-items: end;
  gap: 10px;
  padding-top: 2px;
}

.particle-control--color > span:first-child {
  margin: 0;
}

.particle-control input[type="color"] {
  width: 42px;
  height: 30px;
  padding: 2px;
  border: 1px solid rgb(37 31 27 / 16%);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}

.particle-panel__footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid rgb(37 31 27 / 11%);
}

.particle-panel__footer button {
  border: 1px solid rgb(37 31 27 / 11%);
  background: rgb(255 253 249 / 72%);
}

.particle-panel-opener {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  display: none;
  min-width: 60px;
  min-height: 34px;
  border: 1px solid rgb(37 31 27 / 14%);
  border-radius: 7px;
  color: #251f1b;
  background: rgb(250 246 241 / 88%);
  box-shadow: 0 10px 28px rgb(65 47 34 / 10%);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.particle-study[data-panel="closed"] .particle-panel-opener {
  display: block;
}

@media (max-width: 520px) {
  .particle-panel {
    top: 12px;
    right: 12px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .particle-panel-opener {
    top: 12px;
    right: 12px;
  }
}
