:root {
  --bg: #11110f;
  --panel: #1b1a17;
  --panel-2: #242019;
  --text: #fff8df;
  --muted: #cfc3a3;
  --line: #4a4030;
  --poop: #8b5a2b;
  --pee: #ffd43b;
  --pink: #ff4d8d;
  --cyan: #00d4c8;
  --lime: #b7ff5a;
  --danger: #ff6b35;
  --shadow: 0 18px 48px rgba(0, 0, 0, .35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(90deg, rgba(255, 212, 59, .05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 212, 200, .045) 1px, transparent 1px),
    repeating-linear-gradient(135deg, #11110f 0, #11110f 28px, #15130f 28px, #15130f 56px);
  background-size: 34px 34px, 34px 34px, auto;
}

button,
a {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.top-band {
  min-height: 72vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr);
  gap: 26px;
  align-items: center;
  border-bottom: 2px solid var(--line);
  padding: 22px 0 34px;
}

.brand-block {
  min-width: 0;
}

.kicker {
  margin: 0 0 12px;
  color: var(--lime);
  font-size: .88rem;
  font-weight: 900;
}

.brand-logo {
  position: relative;
  width: min(760px, 100%);
  min-height: 160px;
  margin: 0;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  transform: rotate(-1deg);
}

.brand-logo::before,
.brand-logo::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.brand-logo::before {
  width: 66px;
  height: 44px;
  left: 12px;
  top: -12px;
  border-top: 7px solid var(--pee);
  border-left: 7px solid var(--pee);
  transform: rotate(-16deg);
  opacity: .9;
}

.brand-logo::after {
  width: min(520px, 86%);
  height: 18px;
  left: 8px;
  bottom: -8px;
  background:
    linear-gradient(90deg, var(--pink), var(--pee), var(--cyan));
  border: 3px solid #0f0c08;
  box-shadow: 6px 6px 0 var(--poop);
  transform: skewX(-12deg);
}

.logo-word,
.logo-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 4px solid #0f0c08;
  border-radius: 8px;
  letter-spacing: 0;
  color: #1a1108;
}

.logo-word {
  min-height: 128px;
  padding: 4px 18px 14px;
  font-size: 6rem;
  line-height: .9;
  font-weight: 1000;
  background:
    linear-gradient(180deg, #fff3a8 0%, var(--pee) 48%, #f0a819 100%);
  text-shadow:
    4px 0 0 #fff8df,
    -4px 0 0 #fff8df,
    0 4px 0 #fff8df,
    0 -4px 0 #fff8df,
    7px 7px 0 var(--pink);
  box-shadow:
    10px 10px 0 var(--poop),
    -6px -6px 0 rgba(0, 212, 200, .75);
}

.logo-word::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  right: 22px;
  top: 16px;
  border-radius: 50%;
  background: var(--pink);
  border: 3px solid #0f0c08;
}

.logo-badge {
  min-height: 82px;
  padding: 8px 13px 10px;
  margin-bottom: 14px;
  font-size: 2.6rem;
  line-height: 1;
  font-weight: 1000;
  background: var(--pink);
  color: var(--text);
  text-shadow: 3px 3px 0 #0f0c08;
  box-shadow:
    8px 8px 0 #0f0c08,
    13px 13px 0 var(--cyan);
  transform: rotate(5deg);
}

.lead {
  width: min(620px, 100%);
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.8;
  font-weight: 700;
}

.axis-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 24px 0;
}

.axis-strip span {
  min-height: 44px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 7px solid var(--pee);
  border-radius: 8px;
  padding: 9px 11px;
  background: rgba(36, 32, 25, .82);
  color: var(--text);
  font-size: .92rem;
  font-weight: 800;
}

.hero-visual {
  margin: 0;
  min-height: 360px;
  min-width: 0;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 212, 59, .2), rgba(0, 212, 200, .08)),
    #1b1a17;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-visual img {
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 0;
  display: block;
  object-fit: contain;
  background: #14100b;
}

.primary-action,
.ghost-action,
.answer-button,
.type-chip {
  min-height: 48px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  font-weight: 900;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 20px;
  color: #181107;
  background: linear-gradient(90deg, var(--pee), var(--lime), var(--cyan));
  box-shadow: 0 12px 0 rgba(139, 90, 43, .85);
  text-decoration: none;
}

.primary-action:hover,
.ghost-action:hover,
.answer-button:hover,
.type-chip:hover {
  transform: translateY(-2px);
}

.ghost-action {
  padding: 11px 16px;
  color: var(--text);
  background: #25221c;
  border-color: var(--line);
}

.ghost-action:disabled {
  cursor: not-allowed;
  opacity: .42;
  transform: none;
}

.quiz-area,
.result-area {
  max-width: 900px;
  margin: 24px auto 0;
}

.quiz-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-weight: 900;
}

#axisPill {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--lime);
}

.progress-track {
  height: 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  margin: 16px 0 26px;
  background: #090907;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--pee), var(--cyan));
  transition: width .18s ease;
}

#questionText {
  min-height: 96px;
  margin: 0 0 18px;
  padding: 22px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-size: 1.8rem;
  line-height: 1.45;
}

.answer-list {
  display: grid;
  gap: 12px;
}

.answer-button {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  color: var(--text);
  background: #201d18;
  border-color: var(--line);
  text-align: left;
}

.answer-button span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #1b1408;
  background: var(--pee);
}

.answer-button strong {
  min-width: 0;
  line-height: 1.55;
}

.answer-button:hover {
  border-color: var(--cyan);
  background: #29241c;
}

.quiz-actions,
.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.result-hero {
  padding: 22px 0 26px;
  border-bottom: 2px solid var(--line);
}

.result-visual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 22px;
  align-items: center;
}

.character-card {
  margin: 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #100d09;
  box-shadow: 8px 8px 0 rgba(139, 90, 43, .75);
  overflow: hidden;
}

.character-card img {
  width: 100%;
  display: block;
}

.code-box {
  width: min(100%, 560px);
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 4px solid var(--pee);
  border-radius: 8px;
  color: var(--pee);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .055) 0, rgba(255, 255, 255, .055) 8px, transparent 8px, transparent 18px),
    #17110b;
  box-shadow: 8px 8px 0 var(--poop);
  font-size: 4.3rem;
  font-weight: 1000;
}

.mbti-line {
  margin: 18px 0 6px;
  color: var(--cyan);
  font-weight: 900;
}

.result-hero h2 {
  margin: 0;
  font-size: 2.5rem;
  line-height: 1.2;
}

.result-copy {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.85;
  font-weight: 700;
}

.result-section {
  padding: 24px 0;
  border-bottom: 2px solid var(--line);
}

.result-section h3,
.all-types h3 {
  margin: 0 0 12px;
  color: var(--pee);
  font-size: 1.45rem;
}

#resultAnalysis {
  max-width: 790px;
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.95;
  font-weight: 650;
}

.trait-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.trait-list li {
  padding: 13px 14px;
  border-left: 8px solid var(--pink);
  border-radius: 8px;
  background: var(--panel);
  line-height: 1.65;
  font-weight: 750;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.score-row {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.score-row span,
.score-row small {
  display: block;
  color: var(--muted);
  line-height: 1.55;
}

.score-row strong {
  display: block;
  margin: 3px 0;
  color: var(--lime);
  font-size: 1.14rem;
}

.match-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 24px 0;
  border-bottom: 2px solid var(--line);
}

.match-panel {
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.match-panel.good {
  border-color: var(--lime);
}

.match-panel.bad {
  border-color: var(--danger);
}

.match-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 900;
}

.match-layout {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.match-img {
  width: 84px;
  height: 84px;
  border: 2px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #100d09;
}

.match-panel strong {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 5px 8px;
  border-radius: 8px;
  color: #17110b;
  background: var(--pee);
  font-size: 1.1rem;
}

.match-panel h3 {
  margin: 0 0 4px;
  font-size: 1.35rem;
}

.match-panel small {
  color: var(--cyan);
  font-weight: 900;
}

.match-panel p:last-child {
  margin: 12px 0 0;
  color: var(--text);
  line-height: 1.75;
  font-weight: 650;
}

.link-action {
  min-width: 136px;
}

.all-types {
  padding: 24px 0 0;
}

.type-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.type-chip {
  display: inline-grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  max-width: 270px;
  padding: 8px 10px;
  color: var(--text);
  background: #242019;
  border-color: var(--line);
  font-size: .86rem;
  text-align: left;
}

.type-chip.active {
  color: #17110b;
  background: var(--lime);
  border-color: var(--lime);
}

.type-chip img {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
}

.type-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-footer {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.7;
}

@media (max-width: 820px) {
  .top-band {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .brand-logo {
    min-height: 132px;
    gap: 12px;
  }

  .logo-word {
    min-height: 104px;
    font-size: 4.1rem;
  }

  .logo-badge {
    min-height: 68px;
    margin-bottom: 12px;
    font-size: 2rem;
  }

  .axis-strip,
  .score-grid,
  .match-grid,
  .result-visual {
    grid-template-columns: 1fr;
  }

  .character-card {
    width: min(320px, 100%);
  }

  .hero-visual {
    min-height: 260px;
  }

  #questionText {
    font-size: 1.45rem;
    min-height: 82px;
  }

  .code-box {
    min-height: 98px;
    font-size: 3.2rem;
  }

  .result-hero h2 {
    font-size: 2rem;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(1120px, calc(100% - 18px));
    padding-top: 14px;
  }

  .brand-logo {
    min-height: 112px;
    gap: 8px;
    transform: rotate(-.5deg);
  }

  .brand-logo::before {
    width: 44px;
    height: 30px;
    border-width: 5px;
  }

  .brand-logo::after {
    height: 12px;
    bottom: -4px;
    box-shadow: 4px 4px 0 var(--poop);
  }

  .logo-word {
    min-height: 76px;
    padding: 3px 10px 9px;
    font-size: 3rem;
    text-shadow:
      3px 0 0 #fff8df,
      -3px 0 0 #fff8df,
      0 3px 0 #fff8df,
      0 -3px 0 #fff8df,
      5px 5px 0 var(--pink);
    box-shadow:
      6px 6px 0 var(--poop),
      -4px -4px 0 rgba(0, 212, 200, .72);
  }

  .logo-word::after {
    width: 14px;
    height: 14px;
    right: 13px;
    top: 9px;
  }

  .logo-badge {
    min-height: 50px;
    padding: 7px 9px 8px;
    margin-bottom: 8px;
    font-size: 1.45rem;
    box-shadow:
      5px 5px 0 #0f0c08,
      8px 8px 0 var(--cyan);
  }

  .lead {
    font-size: 1rem;
  }

  .quiz-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .answer-button {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    padding: 11px;
  }

  .answer-button span {
    width: 34px;
    height: 34px;
  }

  #questionText {
    padding: 16px;
    font-size: 1.25rem;
  }

  .code-box {
    font-size: 2.45rem;
    box-shadow: 5px 5px 0 var(--poop);
  }

  .hero-visual img {
    content: url("assets/characters/unko.png?v=logo1");
  }
}
