/* ===================================================
   職業適性診断 スタイルシート
   モバイルファースト・レスポンシブ対応
   =================================================== */

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

:root {
  --brand: #4f46e5;
  --brand-dark: #3730a3;
  --brand-light: #eef2ff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== SCREEN SYSTEM ===== */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ===== COVER SCREEN ===== */
#screen-cover {
  display: none;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  min-height: 100vh;
  justify-content: center;
  align-items: center;
}
#screen-cover.active { display: flex; }

.cover-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.1) 0%, transparent 40%);
  pointer-events: none;
}

.cover-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 48px 24px;
  max-width: 480px;
  width: 100%;
}

.cover-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.3);
}

.cover-title {
  font-size: clamp(32px, 8vw, 52px);
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 16px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.cover-sub {
  font-size: clamp(15px, 4vw, 19px);
  color: rgba(255,255,255,0.9);
  margin-bottom: 32px;
  line-height: 1.7;
}

.cover-features {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 8px 16px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}

.feature-icon { font-size: 16px; }

.btn-start {
  display: inline-block;
  background: #fff;
  color: var(--brand-dark);
  font-size: 18px;
  font-weight: 700;
  padding: 16px 48px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.3);
}
.btn-start:active { transform: translateY(0); }

.cover-note {
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  margin-top: 20px;
}

/* ===== TEST HEADER ===== */
.test-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  box-shadow: 0 1px 12px rgba(0,0,0,0.08);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
}

.header-logo {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
}

.header-progress-text {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.progress-bar-wrap {
  height: 4px;
  background: #e9ecef;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #7c3aed);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
}

/* ===== TEST MAIN ===== */
.test-main {
  max-width: 600px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}

/* ===== QUESTION CARD ===== */
.question-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s, transform 0.3s;
}

.question-card.slide-in {
  opacity: 1;
  transform: translateY(0);
}

.question-type-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
}

.question-number {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.question-text {
  font-size: clamp(15px, 4vw, 17px);
  font-weight: 500;
  line-height: 1.75;
  color: var(--text-main);
  margin-bottom: 24px;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.scale-labels span {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
  max-width: 70px;
}

/* ===== SCORE BUTTONS ===== */
.score-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}

.score-btn {
  flex: 1;
  max-width: 68px;
  aspect-ratio: 1;
  border: 2.5px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: inherit;
}

.score-btn:hover {
  border-color: var(--brand);
  background: var(--brand-light);
  transform: scale(1.06);
}

.score-btn.selected {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(79,70,229,0.35);
}

.score-num {
  font-size: 20px;
  font-weight: 700;
}

.score-hint {
  text-align: center;
  font-size: 12px;
  color: #999;
  min-height: 20px;
  transition: color 0.2s;
}

/* ===== NAV BUTTONS ===== */
.nav-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}

.btn-nav {
  padding: 12px 24px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-nav:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-next {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.btn-next:hover:not(:disabled) {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

.btn-result {
  display: block;
  width: 100%;
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 24px rgba(79,70,229,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  animation: pulse-glow 2s ease-in-out infinite;
}

.btn-result:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(79,70,229,0.5);
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 6px 24px rgba(79,70,229,0.4); }
  50% { box-shadow: 0 6px 32px rgba(79,70,229,0.6); }
}

/* ===== RESULT HEADER ===== */
.result-header {
  background: #fff;
  box-shadow: 0 1px 12px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.btn-retake {
  background: var(--brand-light);
  color: var(--brand);
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-retake:hover { background: var(--brand); color: #fff; }

/* ===== RESULT MAIN ===== */
.result-main {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 0 60px;
}

/* ===== RESULT TOP SECTION ===== */
.result-top {
  padding: 36px 24px 28px;
  text-align: center;
  margin-bottom: 0;
  background: linear-gradient(135deg, #eef2ff, #faf0ff);
}

.result-rank-badge {
  display: inline-block;
  background: rgba(79,70,229,0.1);
  color: var(--brand);
  padding: 5px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.result-type-title {
  font-size: clamp(22px, 6vw, 32px);
  font-weight: 900;
  margin-bottom: 12px;
  line-height: 1.3;
}

.result-type-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 480px;
  margin: 0 auto 24px;
}

.result-types-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.type-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  min-width: 90px;
  gap: 2px;
}

.rank-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.type-emoji { font-size: 24px; }

.type-name {
  font-size: 13px;
  font-weight: 700;
}

.type-score {
  font-size: 11px;
  font-weight: 600;
}

/* ===== SECTION COMMON ===== */
.result-chart-section,
.result-scores-section,
.result-jobs-section,
.result-market-section {
  padding: 28px 16px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-main);
}

/* ===== RADAR CHART ===== */
.chart-wrap {
  max-width: 360px;
  margin: 0 auto;
  position: relative;
  height: 320px;
}

/* ===== SCORE CARDS ===== */
.score-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.score-card {
  padding: 14px 16px;
  border-radius: var(--radius);
  border-left: 4px solid;
  background: #fff;
  box-shadow: var(--shadow);
}

.score-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.score-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sc-emoji { font-size: 20px; }

.sc-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.sc-category {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.score-card-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sc-rank {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: currentColor;
  color: #fff;
  /* override with inline style */
}

.sc-score {
  font-size: 20px;
  font-weight: 800;
}

.sc-score small {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.sc-ratio {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.score-bar-wrap {
  height: 6px;
  background: #f0f0f0;
  border-radius: 999px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== JOBS SECTION ===== */
.jobs-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.jobs-card {
  background: #fff;
  border-radius: var(--radius);
  border-top: 3px solid;
  padding: 18px;
  box-shadow: var(--shadow);
}

.jobs-combo {
  background: linear-gradient(135deg, #f0f3ff 0%, #faf0ff 100%);
}

.jobs-card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.jobs-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 12px;
}

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

.job-tag {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
}

/* ===== MARKET SECTION ===== */
.market-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 520px) {
  .market-grid { grid-template-columns: 1fr; }
}

.market-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.market-card h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
  line-height: 1.4;
}

.market-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.market-item {}

.market-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 3px;
}

.market-rank-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.market-name {
  font-size: 12px;
  font-weight: 700;
  flex: 1;
  line-height: 1.4;
}

.market-ratio {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  padding: 2px 7px;
  border-radius: 4px;
}

.market-ratio-easy {
  background: #dcfce7;
  color: #16a34a;
}

.market-ratio-hard {
  background: #fee2e2;
  color: #dc2626;
}

.market-reason {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== RETAKE WRAP ===== */
.retake-wrap {
  padding: 32px 24px;
  text-align: center;
}

/* ===== SCORE RANK COLOR ===== */
.sc-rank {
  background: transparent;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-top { animation: fadeUp 0.5s ease; }
.result-chart-section { animation: fadeUp 0.5s 0.1s ease both; }
.result-scores-section { animation: fadeUp 0.5s 0.2s ease both; }
.result-jobs-section { animation: fadeUp 0.5s 0.3s ease both; }
.result-market-section { animation: fadeUp 0.5s 0.4s ease both; }

/* ===== RESPONSIVE ===== */
@media (min-width: 600px) {
  .score-buttons { gap: 14px; }
  .score-btn { max-width: 80px; }
  .score-num { font-size: 24px; }
  .test-main { padding: 36px 24px 60px; }
  .result-main { padding: 0 0 80px; }
}

@media (min-width: 768px) {
  .question-card { padding: 36px 32px 28px; }
  .result-top { padding: 48px 32px 36px; }
  .result-chart-section,
  .result-scores-section,
  .result-jobs-section,
  .result-market-section {
    padding: 36px 32px;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
