:root {
  --bg: #0d1324;
  --bg-elevated: #141d33;
  --bg-soft: #1a2540;
  --text: #f8f3e9;
  --text-muted: #c9c2b4;
  --line: rgba(255, 255, 255, 0.08);
  --gold: #d4a84f;
  --gold-strong: #f0c46a;
  --danger: #ca6f59;
  --success: #7ab88c;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --container: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top, rgba(212, 168, 79, 0.08), transparent 28%),
    linear-gradient(180deg, #0d1324 0%, #0a1020 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
}

.container {
  width: min(calc(100% - 32px), var(--container));
  margin: 0 auto;
}

.narrow-container {
  width: min(calc(100% - 32px), 860px);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10, 16, 32, 0.74);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.site-logo {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  gap: 16px;
  color: var(--text-muted);
}

.site-nav a:hover {
  color: var(--gold-strong);
}

.site-footer {
  padding: 28px 0 42px;
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
}

.site-footer__link {
  display: inline-block;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.site-footer__link:hover {
  color: var(--gold-strong);
}

.adfit-banner-pc {
  width: 728px;
  height: 90px;
  margin: 0 auto 20px;
  overflow: hidden;
}

.section {
  padding: 64px 0;
}

.section-tight {
  padding: 40px 0 64px;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h1,
.section-heading h2,
.hero-copy h1 {
  margin: 0 0 12px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-heading p,
.hero-description,
.panel-subtext,
.result-description,
.game-result-copy {
  margin: 0;
  color: var(--text-muted);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--gold-strong);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel,
.stat-card,
.distribution-item,
.mini-panel,
.game-status-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow);
}

.hero-section {
  padding: 72px 0 48px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 6vw, 4.6rem);
}

.hero-description {
  max-width: 680px;
  font-size: 1.08rem;
}

.live-counter,
.result-participants {
  margin: 18px 0 0;
  color: var(--gold-strong);
  font-size: 1.05rem;
  font-weight: 700;
}

.result-participants {
  margin: 0 0 12px;
}

.result-count-num {
  color: #c62828;
  font-weight: 700;
}

.hero-actions,
.result-actions,
.game-actions,
.test-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: 0.18s ease;
  font-weight: 700;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-strong) 100%);
  color: #20170a;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(212, 168, 79, 0.4);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-muted);
}

.hero-panel {
  padding: 28px;
}

.hero-poster-panel {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-poster {
  width: 100%;
  max-height: 640px;
  object-fit: cover;
  border-radius: 20px;
}

.panel-label {
  margin: 0 0 10px;
  color: var(--text-muted);
}

.hero-panel__value {
  display: block;
  margin-bottom: 10px;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1;
}

.hero-panel__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.hero-panel__stats span,
.result-stat span,
.stat-card__label,
.game-summary span,
.game-status-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.hero-panel__stats strong,
.result-stat strong,
.game-summary strong,
.game-status-card strong {
  font-size: 1.05rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.character-card {
  padding: 18px;
  text-align: center;
}

.character-card img,
.result-character-image,
.event-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.character-card h3 {
  margin: 14px 0 8px;
}

.character-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.stat-card {
  padding: 22px;
}

.stat-card__value {
  font-size: 1.4rem;
}

.emotion-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.emotion-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(212, 168, 79, 0.28);
  border-radius: 999px;
  background: rgba(212, 168, 79, 0.08);
  color: var(--text);
}

.emotion-tag small {
  color: var(--gold-strong);
}

.emotion-tag.is-empty {
  border-style: dashed;
  color: var(--text-muted);
}

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

.distribution-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
}

.distribution-item__copy {
  flex: 1;
}

.distribution-item p {
  margin: 4px 0 0;
  color: var(--text-muted);
}

.distribution-bar {
  margin-top: 10px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.distribution-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold) 0%, #8f6a2a 100%);
}

.mini-panel {
  margin-top: 18px;
  padding: 18px 20px;
}

.mini-panel__title {
  margin: 0 0 10px;
  color: var(--text-muted);
}

.mini-panel__records {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.intro-panel {
  padding: 28px;
}

.test-shell,
.game-panel,
.result-card,
.result-actions-panel {
  padding: 24px;
}

.test-topbar {
  margin-bottom: 20px;
}

.test-progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-strong) 100%);
  transition: width 0.2s ease;
}

.question-index {
  margin: 0 0 10px;
  color: var(--gold-strong);
  font-weight: 700;
}

.question-text {
  margin: 0 0 20px;
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1.25;
}

.options-list,
.emotion-grid {
  display: grid;
  gap: 12px;
}

.option-button,
.emotion-button {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-align: left;
  transition: 0.18s ease;
}

.option-button:hover,
.emotion-button:hover,
.option-button.is-selected,
.emotion-button.is-selected {
  border-color: rgba(212, 168, 79, 0.7);
  background: rgba(212, 168, 79, 0.12);
}

.option-button__id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-right: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
  font-weight: 800;
}

.emotion-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.test-message,
.form-feedback {
  min-height: 24px;
  margin-bottom: 12px;
  color: var(--gold-strong);
  font-size: 0.95rem;
}

.is-hidden {
  display: none !important;
}

.result-shell {
  display: grid;
  gap: 18px;
}

.result-score {
  margin: 4px 0 10px;
  color: var(--gold-strong);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 800;
  line-height: 1;
}

.result-character-image {
  display: block;
  width: min(100%, 320px);
  margin: 0 auto 18px;
}

.result-type {
  margin: 0 0 14px;
  font-size: clamp(2rem, 5vw, 3rem);
}

.result-tagline {
  margin: 0 0 14px;
  font-size: 1.1rem;
  font-weight: 700;
}

.result-share-copy,
.result-share-hint {
  margin: 18px 0 0;
  color: var(--text-muted);
}

.position-visuals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.position-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.position-card__label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.position-card__value {
  display: block;
  margin-bottom: 12px;
  font-size: 1.25rem;
}

.position-card__caption {
  margin: 12px 0 0;
  color: var(--text-muted);
}

.score-meter,
.rarity-meter {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.score-meter__fill,
.rarity-meter__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-strong) 100%);
}

.score-meter__average {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 16px;
  background: #f8f3e9;
  box-shadow: 0 0 0 3px rgba(248, 243, 233, 0.15);
}

.result-game-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-game-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.result-game-buttons .btn {
  flex: 1;
  min-width: 160px;
}

.result-wordcloud-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.result-wordcloud-title {
  margin: 0 0 16px;
  font-size: 1.25rem;
}

.result-wordcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  min-height: 120px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.wordcloud-word {
  display: inline-block;
  padding: 4px 10px;
  color: var(--gold-strong);
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.15s ease;
}

.wordcloud-word:hover {
  transform: scale(1.08);
  color: var(--gold);
}

.game-rank-banner {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(212, 168, 79, 0.12);
  border: 1px solid rgba(212, 168, 79, 0.35);
  color: var(--text);
  font-weight: 700;
}

.canvas-wrap--wide {
  max-width: 960px;
}

.smile-gauge-wrap {
  display: none;
}

.smile-gauge-wrap span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.smile-gauge {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.smile-gauge span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e8b86f 0%, #ffdd87 100%);
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 6, 14, 0.72);
  z-index: 5;
}

.game-modal {
  width: min(100%, 520px);
  padding: 28px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(14, 20, 37, 0.96);
  box-shadow: var(--shadow);
  text-align: center;
}

.game-modal h2 {
  margin: 0 0 12px;
}

.game-modal p {
  margin: 0 0 18px;
  color: var(--text-muted);
}

.game-modal--result {
  width: min(100%, 620px);
}

.game-over-rank {
  color: var(--gold-strong) !important;
  font-weight: 700;
}

.game-actions--center {
  justify-content: center;
}

.canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(212, 168, 79, 0.24);
  background: #070c18;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  touch-action: none;
}

.game-summary,
.game-status-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.event-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.event-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.event-card img {
  width: 72px;
  height: 72px;
}

.event-card strong {
  display: block;
  margin-bottom: 4px;
}

.event-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.game-status-card {
  padding: 16px;
}

.game-result-copy {
  min-height: 48px;
}

@media (max-width: 900px) {
  .hero-grid,
  .stats-grid,
  .character-grid,
  .position-visuals,
  .game-summary,
  .game-status-row,
  .event-legend {
    grid-template-columns: 1fr;
  }

  .hero-section {
    padding-top: 56px;
  }

  .canvas-wrap--wide {
    max-width: 100%;
  }

 .adfit-banner-pc {
 display: none;
 }
}

@media (max-width: 640px) {
  .site-header__inner {
    min-height: 64px;
  }

  .site-nav {
    gap: 12px;
    font-size: 0.92rem;
  }

  .section {
    padding: 52px 0;
  }

  .section-tight {
    padding: 28px 0 52px;
  }

  .test-shell,
  .game-panel,
  .result-card,
  .result-actions-panel,
  .hero-panel,
  .intro-panel,
  .stat-card,
  .distribution-item,
  .mini-panel {
    padding: 20px;
  }

  .event-card {
    grid-template-columns: 60px 1fr;
  }

  .event-card img {
    width: 60px;
    height: 60px;
  }

  .emotion-grid {
    grid-template-columns: 1fr;
  }

  .test-progress-copy {
    flex-direction: column;
    gap: 6px;
  }

  .hero-actions,
  .result-actions,
  .game-actions,
  .test-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
