/* ═══════════════════════════════════════════
   TOL Diagnostic - styles.css
   ═══════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Base ── */
body {
  background: #000;
  color: #fff;
  font-family: Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
}

button:focus {
  outline: none;
}

input:focus {
  border-color: rgba(155, 93, 229, 0.4) !important;
  outline: none;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(155, 93, 229, 0.15); }

/* ── CRT Effects (exact TOL match) ── */
.crt-scanlines {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background:
    linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,0.25) 50%),
    linear-gradient(90deg, rgba(255,0,0,0.06), rgba(0,255,0,0.02), rgba(0,0,255,0.06));
  background-size: 100% 2px, 3px 100%;
}

.crt-flicker {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: rgba(18,16,16,0.1);
  animation: flicker 0.5s infinite;
}

/* ── Layout ── */
.header {
  display: flex;
  justify-content: space-between;
  padding: 20px 20px 0 20px;
  position: relative;
  z-index: 500;
}

.header-logo {
  font-size: 28px;
  font-weight: bold;
}

.header-menu-btn {
  cursor: pointer;
  position: relative;
  bottom: 10px;
  z-index: 600;
  user-select: none;
}

.header-menu-btn.open {
  font-size: 48px;
  right: 4px;
}

.header-menu-btn:not(.open) {
  font-size: 38px;
  right: 0;
}

.menu-overlay {
  position: fixed;
  top: -90px;
  left: 0;
  width: 100%;
  height: 120vh;
  background: rgba(0,0,0,1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 400;
}

.menu-item {
  margin: 20px 0;
  font-size: 24px;
  cursor: pointer;
}

.menu-item a {
  color: #fff;
  text-decoration: none;
}

.content-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 20px 40px;
  position: relative;
  z-index: 10;
}

.link-top {
  display: inline-block;
  color: rgba(255,255,255,0.35);
  font-size: 12px;
  text-decoration: none;
  letter-spacing: 1px;
  padding: 10px 24px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
}

.link-top:hover {
  color: rgba(255,255,255,0.6);
  border-color: rgba(255,255,255,0.25);
}

.footer {
  text-align: center;
  padding: 16px;
  font-size: 10px;
  color: #333;
  letter-spacing: 1px;
  position: relative;
  z-index: 10;
}

/* ── Purple palette ── */
:root {
  --p-label: #d4aaff;
  --p-label-dim: #b088dd;
  --p-accent: #9b5de5;
  --p-glow: #e8d5ff;
  --p-border: rgba(155, 93, 229, 0.3);
  --p-border-dim: rgba(155, 93, 229, 0.12);
  --p-bg: rgba(155, 93, 229, 0.04);
}

/* ── Labels (monospace) ── */
.label {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--p-label);
  font-family: monospace;
}

.label-dim {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--p-label-dim);
  font-family: monospace;
}

.label-upper {
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--p-label);
  text-transform: uppercase;
  font-family: monospace;
}

/* ── Bear image ── */
.bear {
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  image-rendering: pixelated;
}

.bear-light {
  background: linear-gradient(135deg, #f0ece4, #d8d4cc);
  border: 2px solid #555;
  box-shadow: 0 0 8px rgba(255,255,255,0.08);
}

.bear-dark {
  background: linear-gradient(135deg, #1a0a2e, #0d0d0d);
  border: 2px solid #9b5de5;
  box-shadow: 0 0 20px rgba(155,93,229,0.35);
}

.bear-grid {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  pointer-events: none;
}

.bear-grid-light {
  background:
    repeating-linear-gradient(0deg, transparent 0px, transparent 3px, rgba(0,0,0,0.3) 3px, rgba(0,0,0,0.3) 4px),
    repeating-linear-gradient(90deg, transparent 0px, transparent 3px, rgba(0,0,0,0.3) 3px, rgba(0,0,0,0.3) 4px);
}

.bear-grid-dark {
  background:
    repeating-linear-gradient(0deg, transparent 0px, transparent 3px, rgba(155,93,229,0.5) 3px, rgba(155,93,229,0.5) 4px),
    repeating-linear-gradient(90deg, transparent 0px, transparent 3px, rgba(155,93,229,0.5) 3px, rgba(155,93,229,0.5) 4px);
}

.bear-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 10px;
  border: 1px solid rgba(155,93,229,0.3);
  animation: darkPulse 2s ease-in-out infinite;
}

.bear-emoji {
  position: relative;
  z-index: 2;
}

.bear-emoji-dark {
  filter: hue-rotate(270deg) saturate(2) brightness(0.8);
}

.bear-img {
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: cover;
  image-rendering: pixelated;
}

.bear-img-light {
  border: 2px solid #555;
  box-shadow: 0 0 8px rgba(255,255,255,0.08);
}

.bear-img-dark {
  border: 2px solid #9b5de5;
  box-shadow: 0 0 20px rgba(155,93,229,0.35);
}

/* ── Transform ── */
.transform-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
}

.transform-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 280px;
}

.transform-bear-area {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.transform-text-area {
  min-height: 140px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 24px;
}

.transform-text {
  font-size: 15px;
  line-height: 2.2;
  color: #ddd;
  margin: 0;
  animation: fadeInSlow 0.8s ease;
}

.transform-text-dark {
  font-size: 15px;
  line-height: 2.2;
  color: var(--p-glow);
  text-shadow: 0 0 16px rgba(155,93,229,0.35);
  margin: 0;
  animation: fadeInSlow 0.8s ease;
}

.flash-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: #fff;
  animation: flashBang 1.1s ease-out forwards;
}

.loading-dots {
  color: #333;
  font-size: 24px;
  animation: blink 1s infinite;
}

/* ── Sparkles ── */
.sparkle {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px #fff, 0 0 12px #d4aaff, 0 0 20px #9b5de5;
}

/* ── Dialogue bar ── */
.dialogue-bar {
  background: rgba(10,0,20,0.85);
  border: 1px solid var(--p-border);
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.dialogue-bar-text {
  font-size: 13px;
  line-height: 1.8;
  color: #ddd;
}

/* ── Bear hint (quiz) ── */
.bear-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.55;
  animation: fadeIn 0.3s ease;
}

.bear-hint-text {
  font-size: 11px;
  color: var(--p-label);
  font-style: italic;
}

/* ── Intro ── */
.intro-wrap {
  animation: fadeIn 0.8s ease;
  padding-top: 40px;
}

.intro-title {
  font-size: 20px;
  font-weight: bold;
  line-height: 1.5;
  letter-spacing: 2px;
  margin: 0 0 10px;
}

.intro-sub {
  font-size: 14px;
  color: #888;
  line-height: 1.8;
  margin: 0 0 36px;
}

.btn-enter {
  padding: 10px 20px;
  background: rgba(255,255,255,0.8);
  border-radius: 20px;
  color: #000;
  font-size: inherit;
}

/* ── Quiz ── */
.quiz-wrap {
  animation: fadeIn 0.4s ease;
  padding-top: 12px;
}

.progress-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
}

.progress-seg {
  flex: 1;
  height: 2px;
  transition: background 0.3s;
}

.progress-seg-active {
  background: var(--p-accent);
  box-shadow: 0 0 6px var(--p-border);
}

.progress-seg-inactive {
  background: rgba(255,255,255,0.06);
}

.quiz-counter {
  font-size: 10px;
  color: var(--p-label-dim);
  letter-spacing: 3px;
  margin-bottom: 10px;
  font-family: monospace;
}

.quiz-question {
  font-size: 18px;
  font-weight: bold;
  line-height: 1.6;
  margin: 0 0 20px;
  animation: slideIn 0.4s ease;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-option {
  background: rgba(255,255,255,0.02);
  color: #ccc;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 14px 16px;
  font-size: 13px;
  text-align: left;
  transition: all 0.25s ease;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

/* hover装飾はマウス端末だけ */
@media (hover: hover) and (pointer: fine) {
  .quiz-option:hover {
    border-color: rgba(255,255,255,0.25);
    color: #fff;
  }
}

/* タッチ端末ではhover無効 */
@media (hover: none) {
  .quiz-option:hover {
    border-color: rgba(255,255,255,0.08);
    color: #ccc;
    background: rgba(255,255,255,0.02);
    outline: none;
    box-shadow: none;
  }
}

/* タップ/クリックのfocus枠は消す */
.quiz-option:focus {
  outline: none;
  border-color: rgba(255,255,255,0.08);
  box-shadow: none;
}

/* キーボード操作（Tab移動）の時だけ出す */
.quiz-option:focus-visible {
  outline: 2px solid rgba(155, 93, 229, 0.9);
  outline-offset: 2px;
}

.quiz-option:active {
  outline: none;
  box-shadow: none;
}

.quiz-option-selected {
  background: rgba(155, 93, 229, 0.3) !important;
  color: #fff !important;
  border-color: rgba(155, 93, 229, 0.6) !important;
  transition: all 0.15s ease;
}

.quiz-option-dimmed {
  opacity: 0.15 !important;
  transition: opacity 0.3s ease;
}

/* ── Result ── */
.result-wrap {
  animation: fadeIn 0.8s ease;
  padding-top: 12px;
}

.result-emoji {
  font-size: 48px;
  margin-bottom: 12px;
}

.result-name {
  font-size: 24px;
  font-weight: bold;
  margin: 0 0 6px;
  letter-spacing: 2px;
}

.result-sub {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--p-label-dim);
  margin-bottom: 28px;
  font-family: monospace;
}

.result-desc {
  border-top: 1px solid var(--p-border-dim);
  border-bottom: 1px solid var(--p-border-dim);
  padding: 20px 0;
  margin-bottom: 20px;
}

.result-desc p {
  font-size: 13px;
  line-height: 2.0;
  color: #bbb;
  margin: 0;
}

.result-section {
  margin-bottom: 20px;
}

.result-section p {
  font-size: 12px;
  line-height: 2.0;
  color: #aaa;
  margin: 0;
}

/* ── Jobs ── */
.jobs-section {
  margin-bottom: 24px;
}

.jobs-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.job-tag {
  font-size: 12px;
  color: #ddd;
  padding: 8px 14px;
  background: var(--p-bg);
  border: 1px solid var(--p-border-dim);
  line-height: 1.4;
}

/* ── Work style ── */
.workstyle-section {
  margin-bottom: 24px;
}

.workstyle-text {
  font-size: 12px;
  line-height: 2.0;
  color: #bbb;
  margin: 0;
}

/* ── Dark side ── */
.btn-dark-reveal {
  background: transparent;
  border: 1px solid var(--p-accent);
  color: var(--p-label);
  padding: 14px 24px;
  font-size: 12px;
  letter-spacing: 1px;
  margin-bottom: 24px;
  width: 100%;
}

.dark-content {
  margin-bottom: 24px;
  animation: fadeIn 0.6s ease;
  border-left: 2px solid var(--p-border);
  padding-left: 16px;
}

.dark-text {
  font-size: 12px;
  line-height: 2.0;
  color: #cc9999;
  margin: 0;
}

/* ── Comments ── */
.comments-section {
  margin-bottom: 24px;
}

.comments-title {
  font-size: 13px;
  color: #ddd;
  margin-bottom: 4px;
}

.comments-sub {
  font-size: 11px;
  color: #888;
  margin-bottom: 14px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  max-height: 180px;
  overflow-y: auto;
}

.comment-item {
  font-size: 12px;
  color: #ccc;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid var(--p-border);
  line-height: 1.6;
}

.comment-marker {
  color: var(--p-label-dim);
  margin-right: 6px;
  font-size: 10px;
}

.comment-input-wrap {
  display: flex;
  gap: 8px;
}

.comment-input {
  flex: 1;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  color: #ddd;
  padding: 12px 14px;
  font-size: 13px;
  font-family: inherit;
}

.comment-submit {
  padding: 12px 20px;
  font-size: 12px;
}

.comment-submit-active {
  background: rgba(255,255,255,0.85);
  color: #000;
}

.comment-submit-inactive {
  background: rgba(255,255,255,0.05);
  color: #444;
  cursor: default;
}

.comment-thanks {
  font-size: 12px;
  color: var(--p-label);
  text-align: center;
  padding: 12px;
  animation: fadeIn 0.4s ease;
}

/* ── Buttons ── */
.btn-row {
  display: flex;
  gap: 8px;
}

.btn-primary {
  flex: 1;
  padding: 12px 20px;
  background: rgba(255,255,255,0.8);
  border-radius: 20px;
  color: #000;
  font-size: 13px;
}

.btn-secondary {
  flex: 1;
  padding: 12px 20px;
  background: transparent;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  color: #888;
  font-size: 12px;
}

/* ── Ad slot ── */
.ad-slot {
  max-width: 100%;
  margin: 0 auto;
  background: rgba(18,18,18,0.6);
  border: 1px solid rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #2a2a2a;
  letter-spacing: 2px;
  font-family: monospace;
}

/* ═══ Animations ═══ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInSlow {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes flicker {
  0% { opacity: 0.1; }
  50% { opacity: 0.2; }
  100% { opacity: 0.1; }
}

@keyframes flashBang {
  0% { opacity: 0; }
  5% { opacity: 1; }
  15% { opacity: 0.1; }
  25% { opacity: 0.9; }
  40% { opacity: 0.05; }
  50% { opacity: 0.7; }
  70% { opacity: 0; }
  100% { opacity: 0; }
}

@keyframes darkReveal {
  0% { opacity: 0; transform: scale(0.3); filter: brightness(4); }
  40% { opacity: 1; transform: scale(1.2); filter: brightness(1.8); }
  70% { transform: scale(0.95); filter: brightness(1.1); }
  100% { opacity: 1; transform: scale(1); filter: brightness(1); }
}

@keyframes sparkle {
  0% { opacity: 0; transform: scale(0); }
  30% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(0) translateY(-30px); }
}

@keyframes darkPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(155,93,229,0.1); }
  50% { box-shadow: 0 0 20px rgba(155,93,229,0.35); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* ═══════════════════════════════════════════
   Type Navigation Block - 誘導ブロック
   コメントセクションの下、ボタンの上に表示
   ═══════════════════════════════════════════ */

.type-nav {
  background: rgba(10,0,20,0.85);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 16px;
  margin-bottom: 24px;
  animation: fadeIn 0.6s ease;
}

.type-nav--inner {
  border-color: rgba(155,93,229,0.25);
}

.type-nav__header {
  display: flex;
  gap: 12px;
  align-items: center;
}

.type-nav__bear {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 2px solid #9b5de5;
  box-shadow: 0 0 16px rgba(155,93,229,0.3);
  flex-shrink: 0;
  image-rendering: pixelated;
  object-fit: cover;
}

.type-nav__text {
  font-size: 12px;
  line-height: 1.9;
  color: #ccc;
  margin: 0;
}

.type-nav--inner .type-nav__text {
  color: #e8d5ff;
}

/* ── YouTube埋め込み ── */
.type-nav__youtube {
  margin-top: 14px;
}

.type-nav__youtube-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #111;
}

.type-nav__youtube-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.type-nav__youtube-label {
  font-size: 10px;
  color: #555;
  margin-top: 6px;
  letter-spacing: 1px;
}

/* ── お悩み相談リンク（全幅ブロック） ── */
.type-nav__advice-link {
  display: block;
  margin-top: 14px;
  padding: 14px 16px;
  text-decoration: none;
  background: rgba(155,93,229,0.06);
  border: 1px solid rgba(155,93,229,0.3);
  text-align: center;
  transition: all 0.25s ease;
}

.type-nav__advice-link:active {
  background: rgba(155,93,229,0.12);
}

@media (hover: hover) and (pointer: fine) {
  .type-nav__advice-link:hover {
    background: rgba(155,93,229,0.12);
    border-color: rgba(155,93,229,0.5);
  }
}

.type-nav__advice-title {
  font-size: 13px;
  color: #d4aaff;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.type-nav__advice-sub {
  font-size: 10px;
  color: rgba(155,93,229,0.5);
  letter-spacing: 1px;
}