@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700;900&display=swap');

:root {
  --bg-page: #ffffff;
  --bg-footer: #262626;
  --bg-btn: rgba(240, 240, 240, 0.85);

  --border-outer: #e0e0e0;
  --border-inner: rgba(180, 180, 180, 0.5);

  --gold-primary: #b4a177;
  --gold-light: #d2c2a0;
  --gold-bright: #e4c680;
  --dark-icon: #0c0b07;

  --text-main: #161616;
  --text-inverse: #f0f0f0;
  --text-desc: #666666;

  --pad: 28px;
  --sys-font: 'Noto Sans SC', system-ui, -apple-system, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--sys-font);
  color: var(--text-main);
  background-color: var(--bg-page);
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

#app {
  position: relative;
  width: 100%;
  max-width: 1200px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  background: var(--bg-page);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--pad);
}

.screen.active {
  opacity: 1;
  visibility: visible;
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.button {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 15px auto;
  padding: 0 24px;
  width: 100%;
  max-width: 280px;
  height: 60px;
  border: 4px solid var(--border-outer);
  border-radius: 35px;
  background: var(--bg-btn);
  color: var(--text-main);
  font-size: 20px;
  font-weight: bold;
  user-select: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.button::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 95%;
  height: 82%;
  border: 2.5px solid var(--border-inner);
  border-radius: 28px;
  content: '';
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.button:active {
  background: #ffffff;
  transform: scale(0.96);
}

.button .icon {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 12px;
  width: 30px;
  height: 30px;
  border: 2.5px solid var(--gold-primary);
  border-radius: 50%;
  background: var(--dark-icon);
  color: var(--gold-light);
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

.button span {
  margin-bottom: 1px;
}

.loading-screen,
.calculating-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
}

.loading-screen.active,
.calculating-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border-inner);
  border-top-color: var(--gold-primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 18px;
}

.loading-text,
.calculating-text {
  color: var(--text-desc);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

.landing {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 20px;
}

.landing-stars {
  color: var(--gold-primary);
  font-size: 1.4rem;
  letter-spacing: 10px;
}

.landing-logo {
  position: relative;
}

.logo-symbol {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  color: var(--gold-bright);
  opacity: 0.15;
  z-index: -1;
}

.landing-logo h1 {
  font-size: 3.2rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1;
  letter-spacing: 2px;
  font-style: italic;
  padding-bottom: 6px;
  border-bottom: 4px solid var(--border-outer);
  margin-bottom: 10px;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-desc);
  font-weight: bold;
}

.landing-desc {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-desc);
  padding: 0 10px;
  max-width: 500px;
}

.landing-desc em {
  font-style: normal;
  color: var(--gold-primary);
  font-weight: bold;
}

.landing-meta {
  display: flex;
  gap: 24px;
  color: #999;
  font-size: 0.88rem;
  font-weight: 500;
}

.quiz {
  justify-content: flex-start;
  align-items: center;
}

.quiz>* {
  width: 100%;
  max-width: 540px;
}

.quiz-progress {
  margin-bottom: 24px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--text-desc);
}

.progress-count {
  color: var(--text-main);
}

.progress-bar {
  height: 5px;
  background: #eeeeee;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gold-primary);
  border-radius: 3px;
  transition: width 0.4s ease-out;
}

.quiz-question {
  margin-bottom: 16px;
}

.question-text {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #eeeeee;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-card {
  position: relative;
  background: #fafafa;
  border: 3px solid var(--border-outer);
  border-radius: 12px;
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.option-card::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border: 2px solid var(--border-inner);
  border-radius: 8px;
  pointer-events: none;
  transition: border-color 0.2s;
}

.option-card .option-label {
  font-weight: 900;
  color: var(--gold-primary);
  margin-right: 14px;
  font-size: 1.15rem;
  width: 20px;
  flex-shrink: 0;
}

.option-card .option-text {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
}

.option-card:hover {
  background: #ffffff;
  border-color: #d0d0d0;
}

.option-card.selected {
  background: var(--bg-footer);
  border-color: var(--gold-primary);
  color: var(--gold-light);
  transform: translateX(4px);
}

.option-card.selected::before {
  border-color: rgba(180, 161, 119, 0.3);
}

.option-card.selected .option-label {
  color: var(--gold-bright);
}

.quiz-nav {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  justify-content: flex-start;
}

.quiz .button {
  margin: 0;
  height: 46px;
  font-size: 16px;
  max-width: 140px;
}

.quiz .button .icon {
  width: 22px;
  height: 22px;
  font-size: 11px;
}

.btn-prev {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.btn-prev.visible {
  opacity: 1;
  pointer-events: auto;
}

.slide-in-right {
  animation: slideInRight 0.35s ease forwards;
}

.slide-in-left {
  animation: slideInLeft 0.35s ease forwards;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(25px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-25px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.result {
  padding: 0;
  overflow-y: auto;
}

.result-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.result-content-grid {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.result-left-col,
.result-right-col {
  width: 100%;
}

.result-header {
  text-align: center;
  font-weight: bold;
  color: rgba(5, 3, 0, 1);
  font-size: 18px;
  padding: 28px var(--pad) 12px;
  letter-spacing: 1px;
}

.result-image-wrapper {
  position: relative;
  width: 100%;
  height: 260px;
  background: linear-gradient(to bottom, transparent 98%, var(--bg-footer));
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.result-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.result-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: rgba(255, 255, 255, 0.15);
  font-size: 3.5rem;
}

.placeholder-text {
  font-size: 0.9rem;
  margin-top: 8px;
  letter-spacing: 2px;
}

.result-character {
  text-align: center;
  background: var(--bg-footer);
  padding: 24px var(--pad);
  border-bottom: 3px solid var(--gold-primary);
  position: relative;
}

.result-character::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, transparent, var(--gold-primary), transparent);
  opacity: 0.5;
}

.result-left-decoration {
  display: none;
}

.result-name {
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold-bright);
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.result-ism {
  font-size: 1.05rem;
  color: var(--text-inverse);
  font-weight: 500;
}

.result-desc-section {
  padding: 0 var(--pad);
  margin-top: 24px;
}

.result-desc-section+.result-desc-section {
  margin-top: 16px;
}

.hsr-window {
  position: relative;
  background: #fdfdfd;
  border-radius: 0 40px 0 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 24px;
}

.hsr-window-wrapper {
  position: relative;
  padding: 24px 24px;
  border-radius: 0 40px 0 0;
  z-index: 1;
}

.hsr-window::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: -6px;
  box-sizing: border-box;
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  border: 3px solid rgba(180, 161, 119, 0.3);
  pointer-events: none;
  clip-path: polygon(0 0, 15px 0, 100% calc(100% - 15px), 100% 100%, 0 100%);
  z-index: 0;
}

.desc-card-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 12px;
  letter-spacing: 1px;
  display: inline-block;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--gold-primary);
}

.desc-card-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-desc);
  text-align: justify;
}

.result-actions {
  padding: 0 var(--pad);
  margin-top: 10px;
  margin-bottom: 40px;
  display: flex;
  gap: 12px;
}

.result-actions .button {
  margin: 0;
  flex: 1;
  max-width: 100%;
  padding: 0 10px;
  font-size: clamp(14px, 4vw, 18px);
}

.result-actions .button span {
  white-space: nowrap;
}

.result-actions .button .icon {
  margin-right: 6px;
}

.site-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  padding: 16px var(--pad);
  font-size: 0.8rem;
  color: #999;
  line-height: 1.8;
  letter-spacing: 0.5px;
}

.footer-sep {
  margin: 0 6px;
  opacity: 0.4;
}

.footer-link {
  color: var(--gold-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--gold-bright);
}

.footer-disclaimer {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: #bbb;
}

.result-footer {
  position: static;
  margin-top: 10px;
  padding: 24px var(--pad) 32px;
  border-top: 1px solid rgba(180, 161, 119, 0.15);
}

::-webkit-scrollbar {
  width: 5px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(180, 180, 180, 0.6);
  border-radius: 3px;
}

.result-chart-section {
  padding: 0 var(--pad);
  margin-top: 24px;
}

.result-radar-wrapper {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto 20px;
  aspect-ratio: 1;
}

#radar-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.dim-indicators {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dim-indicator {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dim-indicator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: bold;
}

.dim-indicator-label {
  color: var(--text-desc);
  letter-spacing: 0.5px;
}

.dim-indicator-value {
  color: var(--gold-primary);
  font-weight: 700;
}

.dim-indicator-track {
  position: relative;
  height: 6px;
  background: #eeeeee;
  border-radius: 3px;
  overflow: hidden;
}

.dim-indicator-fill-neg,
.dim-indicator-fill-pos {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease-out;
}

.dim-indicator-fill-neg {
  right: 50%;
  background: linear-gradient(to left, var(--gold-light), var(--gold-primary));
}

.dim-indicator-fill-pos {
  left: 50%;
  background: linear-gradient(to right, var(--gold-primary), var(--gold-bright));
}

.dim-indicator-scale {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 10px;
  background: var(--text-desc);
  border-radius: 1px;
  opacity: 0.4;
}

.dim-indicator-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #999;
  padding: 0 2px;
}

.dim-indicator-labels span:first-child {
  color: var(--gold-light);
}

.dim-indicator-labels span:last-child {
  color: var(--gold-bright);
}

@media (min-width: 800px) {
  .result-content-grid {
    flex-direction: row;
    gap: 40px;
    padding: 0 40px 40px;
    align-items: stretch;
  }

  .result-header {
    font-size: 1rem;
    padding: 40px 0 20px;
    text-align: left;
    margin-left: 40px;
  }

  .result-left-col {
    width: 360px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: relative;
  }

  .result-image-wrapper {
    height: 400px;
    background: transparent;
    border: none;
  }

  .result-image-wrapper img {
    -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
  }

  .result-character {
    border-bottom: none;
    background: transparent;
    text-align: left;
    padding: 0;
  }

  .result-character::before {
    display: none;
  }

  .result-name {
    font-size: 3rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }

  .result-ism {
    color: var(--gold-primary);
    font-size: 1.2rem;
    font-weight: 700;
  }

  .result-left-decoration {
    display: block;
    margin-top: 20px;
    position: relative;
  }

  .result-left-decoration .dec-line {
    width: 60px;
    height: 4px;
    background: var(--gold-primary);
    margin-bottom: 8px;
  }

  .result-left-decoration .dec-square {
    width: 12px;
    height: 12px;
    background: var(--dark-icon);
  }

  .result-right-col {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 0;
    margin-top: 15px;
  }

  .result-desc-section,
  .result-chart-section {
    padding: 0;
  }

  .chart-window .hsr-window-wrapper {
    display: flex;
    flex-direction: column;
  }

  .result-radar-wrapper {
    max-width: 250px;
    margin: 20px auto;
  }

  .result-actions {
    padding: 0;
    margin-top: 20px;
  }

  .result-actions .button {
    max-width: 280px;
    flex: 1;
    padding: 0 24px;
    font-size: 20px;
  }

  .result-actions .button .icon {
    margin-right: 12px;
  }
}