:root {
  color-scheme: dark;
  font-family: "Pretendard Variable", Pretendard, "SUIT Variable", SUIT, "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  background: #080909;
  color: #f5efe8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, #30231d 0%, #101212 42%, #060707 100%);
}

button {
  font: inherit;
}

button:disabled {
  opacity: .42;
  cursor: default;
}

#app,
#scene {
  width: 100%;
  height: 100dvh;
}

#scene {
  display: block;
  touch-action: none;
}

.scene-tabs {
  position: fixed;
  z-index: 2;
  top: max(20px, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  gap: 4px;
  padding: 4px;
  transform: translateX(-50%);
  border: 1px solid #ffffff20;
  border-radius: 16px;
  background: #101212d9;
  box-shadow: 0 12px 40px #0007;
  backdrop-filter: blur(18px);
}

.scene-tab {
  width: auto;
  min-width: 104px;
  margin: 0;
  padding: 9px 14px;
  border-radius: 12px;
  background: transparent;
  color: #bdb4ac;
  font-size: 13px;
}

.scene-tab.active {
  background: #ff6939;
  color: #180a05;
}

.intro {
  position: fixed;
  top: max(24px, env(safe-area-inset-top));
  left: max(24px, env(safe-area-inset-left));
  width: min(540px, calc(100vw - 48px));
  pointer-events: none;
  text-shadow: 0 2px 20px #000;
}

.eyebrow {
  margin: 0 0 12px;
  color: #ff9a5c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .2em;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 4.8vw, 62px);
  font-weight: 760;
  line-height: 1.1;
  letter-spacing: -.035em;
  text-wrap: balance;
}

h2,
h3 {
  margin: 0;
}

.intro > p:last-child {
  max-width: 390px;
  color: #d5cbc1;
  font-size: 15px;
  font-weight: 450;
  line-height: 1.7;
  letter-spacing: -.012em;
}

.controls {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: min(300px, calc(100vw - 40px));
  padding: 16px;
  border: 1px solid #ffffff20;
  border-radius: 22px;
  background: #101212d9;
  box-shadow: 0 18px 60px #0008;
  backdrop-filter: blur(18px);
}

.cooling-panel {
  position: fixed;
  left: max(24px, env(safe-area-inset-left));
  bottom: max(24px, env(safe-area-inset-bottom));
  width: min(360px, calc(100vw - 48px));
  padding: 16px 18px;
  border: 1px solid #ffffff20;
  border-radius: 18px;
  background: #101212d9;
  box-shadow: 0 18px 60px #0008;
  backdrop-filter: blur(18px);
}

.cooling-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.cooling-labels span,
.cooling-panel p {
  color: #bdb4ac;
  font-size: 12px;
}

.cooling-track {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #ffffff14;
}

.cooling-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff5b24, #8297a4);
  transition: width .15s linear;
}

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

.status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  color: #d8cec5;
  font-size: 13px;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff5a26;
  box-shadow: 0 0 0 0 #ff5a2688;
  animation: pulse 1.5s infinite;
}

button {
  width: 100%;
  margin-top: 8px;
  padding: 13px 15px;
  border: 0;
  border-radius: 14px;
  background: #ff6939;
  color: #180a05;
  font-weight: 900;
  cursor: pointer;
}

button.secondary {
  background: #ffffff10;
  color: #eee7df;
}

#cool {
  background: #6f8290;
  color: #f5fbff;
}

.hint {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  color: #d5cbc1;
  font-size: 12px;
  pointer-events: none;
}

.comparison,
.quiz {
  position: fixed;
  z-index: 5;
  inset: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1080px;
  max-height: 760px;
  margin: auto;
  padding: clamp(20px, 3vw, 34px);
  overflow: auto;
  border: 1px solid #ffffff24;
  border-radius: 28px;
  background: #0d0f0ff2;
  box-shadow: 0 24px 100px #000d;
  backdrop-filter: blur(22px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(.985);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}

.comparison.open,
.quiz.open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.comparison-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.comparison-header h2 {
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: -.05em;
}

.comparison-header p:last-child,
.rock-card p {
  color: #bdb4ac;
  line-height: 1.6;
}

.comparison-header button {
  width: auto;
  min-width: 72px;
  height: fit-content;
}

.rock-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.rock-card {
  overflow: hidden;
  border: 1px solid #ffffff20;
  border-radius: 22px;
  background: #ffffff08;
}

.rock-card img {
  width: 100%;
  height: clamp(160px, 24vh, 240px);
  display: block;
  object-fit: cover;
}

.rock-card div {
  padding: 18px 20px 20px;
}

.rock-location {
  color: #ff9a5c;
  font-size: 12px;
  font-weight: 800;
}

.rock-card h3 {
  margin: 5px 0 10px;
  font-size: 30px;
}

.rock-card strong {
  color: #f4d2bc;
}

.comparison-rule {
  display: grid;
  grid-template-columns: auto 1fr minmax(220px, auto) 1fr auto;
  align-items: center;
  gap: 12px;
  color: #bdb4ac;
  font-size: 12px;
  text-align: center;
}

.comparison-rule div {
  height: 3px;
  border-radius: 9px;
  background: linear-gradient(90deg, #ff6939, #aebbc2);
}

.comparison-rule div:last-of-type {
  transform: scaleX(-1);
}

.comparison-rule strong {
  color: #f5efe8;
  font-size: 14px;
}

.quiz-start {
  width: min(360px, 100%);
  margin: auto auto 0;
}

.quiz {
  max-width: 760px;
  max-height: 680px;
  gap: 14px;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.quiz-header h2 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -.05em;
}

.quiz-header button {
  width: auto;
  min-width: 72px;
  height: fit-content;
}

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #bdb4ac;
  font-size: 12px;
}

.quiz-progress > div {
  flex: 1;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #ffffff12;
}

.quiz-progress i {
  display: block;
  width: 33.33%;
  height: 100%;
  border-radius: inherit;
  background: #ff6939;
  transition: width .25s ease;
}

.quiz-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: clamp(16px, 2.4vw, 22px);
  border: 1px solid #ffffff18;
  border-radius: 22px;
  background: #ffffff06;
}

.quiz-topic {
  color: #ff9a5c;
  font-size: 12px;
  font-weight: 800;
}

.quiz-body h3 {
  max-width: 620px;
  font-size: clamp(23px, 3.2vw, 32px);
  line-height: 1.25;
}

.quiz-options {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.quiz-option {
  margin: 0;
  padding-block: 11px;
  border: 1px solid #ffffff18;
  background: #ffffff0a;
  color: #eee7df;
  text-align: left;
}

.quiz-option:hover:not(:disabled) {
  background: #ffffff14;
}

.quiz-option.correct {
  border-color: #87b99b;
  background: #315c4166;
  color: #dff7e7;
}

.quiz-option.wrong {
  border-color: #d87565;
  background: #70362e66;
  color: #ffe4df;
}

.quiz-feedback {
  min-height: 48px;
  margin: 2px 0 0;
  color: #c9c0b8;
  line-height: 1.6;
}

.quiz-actions {
  display: flex;
  justify-content: flex-end;
}

.quiz-actions button {
  width: min(220px, 100%);
}

.quiz-result {
  text-align: center;
}

.quiz-result strong {
  color: #ff9a5c;
  font-size: clamp(42px, 8vw, 76px);
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 10px #ff5a2600; }
  100% { box-shadow: 0 0 0 0 #ff5a2600; }
}

@media (max-width: 700px) {
  .scene-tabs {
    top: max(12px, env(safe-area-inset-top));
  }

  .scene-tab {
    min-width: 92px;
    padding: 8px 11px;
    font-size: 12px;
  }

  .intro {
    top: 72px;
  }

  .intro > p:last-child {
    display: none;
  }

  .controls {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .cooling-panel {
    left: 16px;
    bottom: 100px;
    width: calc(100vw - 32px);
    padding: 12px 14px;
  }

  .cooling-panel p {
    display: none;
  }

  .status {
    display: none;
  }

  button {
    margin: 0;
    padding-inline: 8px;
    font-size: 13px;
  }

  .hint {
    display: none;
  }

  .comparison,
  .quiz {
    gap: 14px;
    padding: 18px;
    border-radius: 20px;
  }

  .rock-cards {
    grid-template-columns: 1fr;
  }

  .rock-card {
    display: grid;
    grid-template-columns: 120px 1fr;
  }

  .rock-card img {
    height: 100%;
    min-height: 150px;
  }

  .rock-card h3 {
    font-size: 24px;
  }

  .comparison-rule {
    display: block;
  }

  .comparison-rule div {
    display: none;
  }

  .quiz-body {
    padding: 18px;
  }
}
