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

:root {
  --bg: #F6F7FA;
  --surface: #FFFFFF;
  --border: #DDE1ED;
  --text: #0E1A2E;
  --text-sub: #5A6580;
  --accent: #1A3A6B;
  --accent-light: #E8EDF8;
  --gold: #F09830;
  --card-bg: #FFFFFF;
  --shadow: 0 4px 20px rgba(26,58,107,0.10);
  --pop: #D93030;
  --hero-grad: linear-gradient(165deg, #4a2f8f 0%, #34379b 48%, #4a5fcf 100%);
  --cta-grad: linear-gradient(135deg, #FF7A4D 0%, #E5392F 100%);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

/* ===== DESKTOP: dusk city background ===== */
@media (min-width: 480px) {
  body {
    overflow: hidden;
    background-color: #2D0D5A;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 900' preserveAspectRatio='xMidYMax slice'%3E%3Cdefs%3E%3ClinearGradient id='dusk' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0%25' stop-color='%231B0942'/%3E%3Cstop offset='28%25' stop-color='%237B2FBE'/%3E%3Cstop offset='58%25' stop-color='%23C44B7F'/%3E%3Cstop offset='80%25' stop-color='%23FF6B35'/%3E%3Cstop offset='100%25' stop-color='%23FFD166'/%3E%3C/linearGradient%3E%3CradialGradient id='sglow' cx='50%25' cy='100%25' r='50%25'%3E%3Cstop offset='0%25' stop-color='%23FFEE88' stop-opacity='0.7'/%3E%3Cstop offset='45%25' stop-color='%23FF8C00' stop-opacity='0.3'/%3E%3Cstop offset='100%25' stop-color='%23FF4500' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect width='1440' height='900' fill='url(%23dusk)'/%3E%3Cellipse cx='720' cy='900' rx='520' ry='210' fill='url(%23sglow)'/%3E%3Ccircle cx='720' cy='762' r='52' fill='%23FFEE88' opacity='0.92'/%3E%3Ccircle cx='720' cy='762' r='38' fill='%23FFD700'/%3E%3Ccircle cx='200' cy='58' r='1.2' fill='%23fff' opacity='0.5'/%3E%3Ccircle cx='500' cy='38' r='0.9' fill='%23fff' opacity='0.4'/%3E%3Ccircle cx='900' cy='52' r='1' fill='%23fff' opacity='0.4'/%3E%3Ccircle cx='1200' cy='33' r='1.1' fill='%23fff' opacity='0.5'/%3E%3Ccircle cx='350' cy='75' r='0.8' fill='%23fff' opacity='0.3'/%3E%3Ccircle cx='1050' cy='45' r='0.9' fill='%23fff' opacity='0.4'/%3E%3Crect x='0' y='570' width='75' height='230' fill='%231A0830'/%3E%3Crect x='65' y='530' width='48' height='270' fill='%23150626'/%3E%3Crect x='105' y='560' width='85' height='240' fill='%231A0830'/%3E%3Crect x='182' y='490' width='58' height='310' fill='%23150626'/%3E%3Crect x='232' y='550' width='95' height='250' fill='%231A0830'/%3E%3Crect x='320' y='510' width='65' height='290' fill='%23150626'/%3E%3Crect x='378' y='540' width='105' height='260' fill='%231A0830'/%3E%3Crect x='476' y='470' width='52' height='330' fill='%23150626'/%3E%3Crect x='520' y='520' width='90' height='280' fill='%231A0830'/%3E%3Crect x='603' y='495' width='62' height='305' fill='%23150626'/%3E%3Crect x='658' y='535' width='115' height='265' fill='%231A0830'/%3E%3Crect x='766' y='480' width='72' height='320' fill='%23150626'/%3E%3Crect x='831' y='550' width='88' height='250' fill='%231A0830'/%3E%3Crect x='912' y='500' width='58' height='300' fill='%23150626'/%3E%3Crect x='963' y='530' width='105' height='270' fill='%231A0830'/%3E%3Crect x='1062' y='490' width='68' height='310' fill='%23150626'/%3E%3Crect x='1123' y='545' width='92' height='255' fill='%231A0830'/%3E%3Crect x='1208' y='510' width='78' height='290' fill='%23150626'/%3E%3Crect x='1280' y='535' width='62' height='265' fill='%231A0830'/%3E%3Crect x='1335' y='480' width='88' height='320' fill='%23150626'/%3E%3Crect x='0' y='622' width='65' height='278' fill='%230F0420'/%3E%3Crect x='55' y='592' width='42' height='308' fill='%230D031B'/%3E%3Crect x='90' y='614' width='80' height='286' fill='%230F0420'/%3E%3Crect x='163' y='564' width='52' height='336' fill='%230D031B'/%3E%3Crect x='208' y='602' width='95' height='298' fill='%230F0420'/%3E%3Crect x='296' y='574' width='58' height='326' fill='%230D031B'/%3E%3Crect x='347' y='597' width='90' height='303' fill='%230F0420'/%3E%3Crect x='430' y='547' width='48' height='353' fill='%230D031B'/%3E%3Crect x='471' y='582' width='82' height='318' fill='%230F0420'/%3E%3Crect x='546' y='560' width='58' height='340' fill='%230D031B'/%3E%3Crect x='597' y='592' width='105' height='308' fill='%230F0420'/%3E%3Crect x='695' y='550' width='68' height='350' fill='%230D031B'/%3E%3Crect x='756' y='612' width='78' height='288' fill='%230F0420'/%3E%3Crect x='827' y='570' width='52' height='330' fill='%230D031B'/%3E%3Crect x='872' y='600' width='98' height='300' fill='%230F0420'/%3E%3Crect x='963' y='557' width='62' height='343' fill='%230D031B'/%3E%3Crect x='1018' y='590' width='92' height='310' fill='%230F0420'/%3E%3Crect x='1103' y='564' width='72' height='336' fill='%230D031B'/%3E%3Crect x='1168' y='604' width='82' height='296' fill='%230F0420'/%3E%3Crect x='1243' y='574' width='68' height='326' fill='%230D031B'/%3E%3Crect x='1304' y='597' width='58' height='303' fill='%230F0420'/%3E%3Crect x='1355' y='550' width='78' height='350' fill='%230D031B'/%3E%3Crect x='16' y='590' width='6' height='8' fill='%23FFD94A' opacity='0.9'/%3E%3Crect x='28' y='590' width='6' height='8' fill='%23FF8C42' opacity='0.7'/%3E%3Crect x='16' y='606' width='6' height='8' fill='%23FF8C42' opacity='0.8'/%3E%3Crect x='190' y='510' width='7' height='9' fill='%23FFD94A' opacity='0.8'/%3E%3Crect x='204' y='510' width='7' height='9' fill='%23FF8C42' opacity='0.6'/%3E%3Crect x='190' y='526' width='7' height='9' fill='%23FFD94A' opacity='0.7'/%3E%3Crect x='490' y='490' width='6' height='8' fill='%23FFD94A' opacity='0.9'/%3E%3Crect x='502' y='490' width='6' height='8' fill='%23FF8C42' opacity='0.7'/%3E%3Crect x='490' y='506' width='6' height='8' fill='%23FFD94A' opacity='0.6'/%3E%3Crect x='680' y='554' width='7' height='9' fill='%23FFD94A' opacity='0.7'/%3E%3Crect x='694' y='554' width='7' height='9' fill='%23FF8C42' opacity='0.9'/%3E%3Crect x='680' y='570' width='7' height='9' fill='%23FFD94A' opacity='0.5'/%3E%3Crect x='780' y='498' width='7' height='9' fill='%23FF8C42' opacity='0.8'/%3E%3Crect x='794' y='498' width='7' height='9' fill='%23FFD94A' opacity='0.6'/%3E%3Crect x='978' y='550' width='6' height='8' fill='%23FFD94A' opacity='0.8'/%3E%3Crect x='990' y='550' width='6' height='8' fill='%23FF8C42' opacity='0.6'/%3E%3Crect x='1080' y='510' width='7' height='9' fill='%23FFD94A' opacity='0.9'/%3E%3Crect x='1094' y='510' width='7' height='9' fill='%23FF8C42' opacity='0.7'/%3E%3Crect x='1225' y='530' width='7' height='9' fill='%23FFD94A' opacity='0.8'/%3E%3Crect x='1239' y='530' width='7' height='9' fill='%23FF8C42' opacity='0.6'/%3E%3Crect x='0' y='840' width='1440' height='60' fill='%230D031B'/%3E%3Crect x='0' y='836' width='1440' height='5' fill='%23FF8C42' opacity='0.45'/%3E%3C/svg%3E");
    background-size: cover;
    background-position: center bottom;
    background-attachment: fixed;
    height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ===== APP CONTAINER ===== */
.app {
  max-width: 390px;
  width: 100%;
  min-height: 100svh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}
@media (max-width: 479px) {
  .app { max-width: 100%; }
}

@media (min-width: 480px) {
  .app {
    min-height: unset;
    height: min(860px, 92svh);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 32px 96px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.08);
  }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.9); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* ===== SCREENS ===== */
.screen {
  display: none;
  min-height: 100svh;
  padding: 0;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s cubic-bezier(0.22,1,0.36,1), transform 0.45s cubic-bezier(0.22,1,0.36,1);
}
.screen.active {
  display: flex;
  flex-direction: column;
}
.screen.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 480px) {
  .screen {
    min-height: unset;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
  }
  .screen::-webkit-scrollbar { display: none; }
}

/* ===== TOP SCREEN (2-tone) ===== */
#screen-top {
  background: #FBF6EF;
  justify-content: flex-start;
  padding: 0;
  gap: 0;
}

.top-upper {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #1A3A6B 0%, #0E2447 100%);
  padding: 68px 32px 92px;
  text-align: center;
  clip-path: polygon(0 0, 100% 0, 100% 82%, 0 100%);
}

.top-lower {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 32px 48px;
}

/* small accent ticks in the cream zone */
.top-lower::before {
  content: "✦";
  color: var(--pop);
  font-size: 14px;
  margin-bottom: 18px;
  opacity: 0.85;
}

/* Staggered entrance for top screen */
#screen-top.visible .top-eyebrow {
  animation: fadeSlideUp 0.6s cubic-bezier(0.22,1,0.36,1) 0.05s both;
}
#screen-top.visible .top-title {
  animation: fadeSlideUp 0.6s cubic-bezier(0.22,1,0.36,1) 0.15s both;
}
#screen-top.visible .top-title-sub {
  animation: fadeSlideUp 0.6s cubic-bezier(0.22,1,0.36,1) 0.22s both;
}
#screen-top.visible .top-divider {
  animation: fadeIn 0.5s ease 0.30s both;
}
#screen-top.visible .top-catch {
  animation: fadeSlideUp 0.6s cubic-bezier(0.22,1,0.36,1) 0.38s both;
}
#screen-top.visible .btn-start {
  animation: scaleIn 0.5s cubic-bezier(0.34,1.56,0.64,1) 0.50s both;
}
#screen-top.visible .top-note {
  animation: fadeIn 0.5s ease 0.65s both;
}

.top-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  margin-bottom: 24px;
}

.top-title {
  font-size: 32px;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.3;
  margin-bottom: 8px;
}

.top-title-sub {
  display: inline-block;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.78);
  margin-top: 14px;
  padding: 6px 16px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50px;
}

.top-catch {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-sub);
  line-height: 1.9;
  margin-bottom: 36px;
}

.btn-start {
  position: relative;
  display: inline-block;
  overflow: hidden;
  background: var(--pop);
  color: #FFFFFF;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 16px 64px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  letter-spacing: 0.05em;
  box-shadow: 0 6px 22px rgba(217,48,48,0.35);
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
}
.btn-start-label {
  position: relative;
  z-index: 1;
}
.btn-start-glow { display: none; }
.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(217,48,48,0.45);
}
.btn-start:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px rgba(217,48,48,0.3);
}

.top-note {
  margin-top: 20px;
  font-size: 12px;
  color: #A7AEBD;
}

/* ===== SURVEY SCREEN ===== */
#screen-survey {
  background: var(--bg);
  padding: 0;
}

.survey-head {
  padding: 52px 24px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.survey-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.survey-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.survey-sub {
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.7;
}

.survey-body {
  padding: 28px 24px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
#screen-survey.visible .survey-group {
  animation: fadeSlideUp 0.5s cubic-bezier(0.22,1,0.36,1) both;
}
#screen-survey.visible .survey-group:nth-child(1) { animation-delay: 0.08s; }
#screen-survey.visible .survey-group:nth-child(2) { animation-delay: 0.16s; }
#screen-survey.visible .survey-group:nth-child(3) { animation-delay: 0.24s; }

.survey-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.survey-label::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 14px;
  background: var(--pop);
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: -2px;
}
.survey-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.survey-opt {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: var(--surface);
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s;
}
.survey-opt:hover { border-color: rgba(26,58,107,0.4); }
.survey-opt.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

.btn-survey-next {
  margin: 16px 24px 44px;
  padding: 15px;
  border: none;
  border-radius: 50px;
  background: var(--pop);
  color: #fff;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(217,48,48,0.32);
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
}
.btn-survey-next:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(217,48,48,0.42);
}
.btn-survey-next:active:not(:disabled) { transform: scale(0.98); }
.btn-survey-next:disabled {
  background: #ccc;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.7;
}
.survey-next-wrap { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.survey-next-hint {
  font-size: 12px;
  color: var(--pop);
  font-weight: 700;
  margin: 12px 24px 4px;
  letter-spacing: 0.03em;
  transition: opacity 0.3s;
  text-align: center;
}
.survey-next-hint.hidden { opacity: 0; pointer-events: none; }
.top-provider {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 10px;
  letter-spacing: 0.03em;
}
.banner-link { display: block; margin-top: 12px; border-radius: 14px; overflow: hidden; }
.banner-img { width: 100%; display: block; }
.screen-footer {
  font-size: 10px;
  color: #C0C4CE;
  text-align: center;
  padding: 16px 0 20px;
  letter-spacing: 0.03em;
}

/* ===== QUESTION SCREEN ===== */
#screen-question {
  background: var(--bg);
  padding: 0;
}

#screen-question.visible .q-header {
  animation: fadeSlideUp 0.5s cubic-bezier(0.22,1,0.36,1) 0.05s both;
}
#screen-question.visible .q-body {
  animation: fadeSlideUp 0.5s cubic-bezier(0.22,1,0.36,1) 0.12s both;
}

/* Choice buttons animate in via JS-inserted class, using nth-child delays */
.choice-btn {
  animation: fadeSlideUp 0.45s cubic-bezier(0.22,1,0.36,1) both;
}
.choice-btn:nth-child(1) { animation-delay: 0.18s; }
.choice-btn:nth-child(2) { animation-delay: 0.25s; }
.choice-btn:nth-child(3) { animation-delay: 0.32s; }
.choice-btn:nth-child(4) { animation-delay: 0.39s; }

.q-header {
  padding: 52px 24px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-step {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
  letter-spacing: 0.05em;
}

.progress-pct {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
}

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #3B6FD4);
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.22,1,0.36,1);
}

.q-body {
  padding: 32px 24px 24px;
  flex: 1;
}

.q-number {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.q-lead {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  line-height: 1.7;
  margin-bottom: 8px;
}

.q-text {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 32px;
}

/* Per-question re-entrance (triggered via JS class toggle) */
.q-enter .q-number { animation: fadeSlideUp 0.5s cubic-bezier(0.22,1,0.36,1) 0.02s both; }
.q-enter .q-lead   { animation: fadeSlideUp 0.5s cubic-bezier(0.22,1,0.36,1) 0.08s both; }
.q-enter .q-text   { animation: fadeSlideUp 0.5s cubic-bezier(0.22,1,0.36,1) 0.14s both; }

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

.choice-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s, transform 0.18s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
  width: 100%;
  box-shadow: 0 2px 8px rgba(26,58,107,0.07);
}
.choice-btn:hover {
  border-color: rgba(26,58,107,0.35);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26,58,107,0.13);
}
.choice-btn:active {
  transform: scale(0.98);
}
.choice-btn.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: scale(1.01);
}

.choice-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  min-width: 20px;
  padding-top: 1px;
}

.choice-text {
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.6;
}

/* ===== LOADING ===== */
#screen-loading {
  background: linear-gradient(160deg, #1A3A6B 0%, #0E2447 100%);
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 36px;
  padding: 48px 32px;
}

.loading-orbit {
  position: relative;
  width: 84px;
  height: 84px;
}

.loading-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFE566 0%, #FF8C42 70%, #D93030 100%);
  box-shadow: 0 0 18px rgba(255,180,80,0.8);
  animation: pulse 1.6s ease-in-out infinite;
}

.loading-ring {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(255,255,255,0.12);
  border-top-color: var(--gold);
  border-right-color: #FF6B35;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  font-size: 15px;
  color: rgba(255,255,255,0.88);
  line-height: 1.8;
  opacity: 1;
  transition: opacity 0.26s ease;
}
.loading-text.fading {
  opacity: 0;
}

/* ===== RESULT SCREEN ===== */
#screen-result {
  background: var(--bg);
  padding-bottom: 48px;
}

#screen-result.visible .result-hero {
  animation: fadeSlideUp 0.6s cubic-bezier(0.22,1,0.36,1) 0.05s both;
}
#screen-result.visible .result-section:nth-child(2) {
  animation: fadeSlideUp 0.55s cubic-bezier(0.22,1,0.36,1) 0.22s both;
}
#screen-result.visible .result-section:nth-child(3) {
  animation: fadeSlideUp 0.55s cubic-bezier(0.22,1,0.36,1) 0.35s both;
}
#screen-result.visible .btn-retry {
  animation: fadeSlideUp 0.5s cubic-bezier(0.22,1,0.36,1) 0.45s both;
}
#screen-result.visible .sub-stock-card:nth-child(1) {
  animation: fadeSlideUp 0.45s cubic-bezier(0.22,1,0.36,1) 0.38s both;
}
#screen-result.visible .sub-stock-card:nth-child(2) {
  animation: fadeSlideUp 0.45s cubic-bezier(0.22,1,0.36,1) 0.46s both;
}
#screen-result.visible .sub-stock-card:nth-child(3) {
  animation: fadeSlideUp 0.45s cubic-bezier(0.22,1,0.36,1) 0.54s both;
}

/* 結果画面の各要素を圧縮させない（固定高さフレックスでの見切れ防止） */
#screen-result > * {
  flex-shrink: 0;
}

.result-hero {
  background: linear-gradient(145deg, #1A3A6B 0%, #0E2447 100%);
  padding: 56px 24px 40px;
  text-align: center;
}

.result-hero-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.result-type-name {
  font-size: 22px;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.4;
  margin-bottom: 16px;
  white-space: pre-line;
}

.result-type-desc {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255,255,255,0.82);
  line-height: 1.8;
}

.result-axes {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.axis-tag {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.82);
  border: 1px solid rgba(255,255,255,0.15);
}

.result-section {
  padding: 32px 20px 0;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--text-sub);
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* Main stock card */
.main-stock-card {
  background: var(--card-bg);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: box-shadow 0.3s;
}

.main-stock-header {
  background: var(--accent);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stock-badge {
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
  min-width: 56px;
}

.stock-code {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  display: block;
}

.stock-code-num {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  display: block;
}

.main-stock-name {
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
}

.main-stock-body {
  padding: 20px;
}

.vision-block {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.vision-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.vision-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
}

.desc-block {
  margin-bottom: 16px;
}

.desc-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-sub);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.desc-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
}

.oshi-block {
  background: #FFF0F0;
  border-radius: 14px;
  padding: 14px;
  border: 1px solid #F5BBBB;
}

.oshi-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--pop);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.oshi-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
}

/* Sub stocks */
.sub-stocks-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sub-stock-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 16px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.2s, transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(26,58,107,0.07);
}
.sub-stock-card:hover {
  border-color: rgba(26,58,107,0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,58,107,0.13);
}
.sub-stock-card:active {
  transform: scale(0.98);
  border-color: var(--accent);
}

.sub-badge {
  background: var(--accent-light);
  border-radius: 8px;
  padding: 6px 10px;
  text-align: center;
  min-width: 52px;
  flex-shrink: 0;
}

.sub-code {
  font-size: 10px;
  color: var(--accent);
  display: block;
}

.sub-code-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.sub-info {
  flex: 1;
}

.sub-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.sub-oshi-short {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sub-arrow {
  color: var(--border);
  font-size: 20px;
  flex-shrink: 0;
  transition: transform 0.2s, color 0.2s;
}
.sub-stock-card:hover .sub-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

/* Retry button */
.btn-retry {
  display: block;
  width: calc(100% - 40px);
  margin: 32px 20px 0;
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 14px;
  border-radius: 50px;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s, color 0.2s, transform 0.18s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
}
.btn-retry:hover {
  background: var(--accent);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,58,107,0.25);
}
.btn-retry:active {
  transform: scale(0.97);
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  max-width: 390px;
  margin: 0 auto;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: 0 0 40px;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32,0.72,0,1);
  max-height: 85svh;
  overflow-y: auto;
}
.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 20px;
}

.modal-header {
  background: var(--accent);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.modal-body {
  padding: 0 20px;
}

.modal-name {
  font-size: 18px;
  font-weight: 700;
  color: #FFFFFF;
}

.modal-vision-block {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.modal-oshi-block {
  background: #FFF0F0;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #F5BBBB;
}

/* ===== SPARKLES (atmosphere) ===== */
#screen-top, .result-hero {
  position: relative;
  overflow: hidden;
}

.sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.top-upper > :not(.sparkles),
.result-hero > :not(.sparkles) {
  position: relative;
  z-index: 1;
}

.sparkle {
  position: absolute;
  border-radius: 50%;
  background: #FFE9B0;
  box-shadow: 0 0 6px 1px rgba(255,221,150,0.8);
  opacity: 0;
  animation-name: twinkle;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0.6); }
  50%       { opacity: 0.9; transform: translateY(-8px) scale(1); }
}

/* ===== RESONANCE RING ===== */
.resonance {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.resonance-ring {
  position: relative;
  width: 132px;
  height: 132px;
}
.resonance-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}
.ring-fg {
  fill: none;
  stroke: url(#ringGrad);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.3s cubic-bezier(0.22,1,0.36,1);
}

.resonance-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.resonance-num {
  font-size: 40px;
  font-weight: 800;
  color: var(--pop);
  line-height: 1;
}
.resonance-pct {
  font-size: 18px;
  font-weight: 700;
  color: var(--pop);
}
.resonance-caption {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text-sub);
}

/* Main card dramatic reveal */
#screen-result.visible .main-stock-card {
  animation: scaleIn 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.5s both;
}

/* ============================================================
   MOCK THEME OVERRIDES（パープル夜景テイスト）
   ※ 末尾に置くことで既存ルールを上書き
   ============================================================ */

/* --- desktop: 背景写真（bg.jpg を置けば反映。なければパープルグラデ） --- */
@media (min-width: 480px) {
  body {
    background-color: #2a1f57;
    background-image: url('img/bg.png'),
      linear-gradient(165deg, #3a2a7e 0%, #34379b 50%, #4f63c8 100%);
    background-size: cover, cover;
    background-position: center center, center center;
    background-repeat: no-repeat, no-repeat;
    background-attachment: fixed, fixed;
  }
}

/* ===== TOP ===== */
#screen-top {
  background: var(--hero-grad);
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 42px 30px;
}
.top-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; width: 100%; }
#screen-top > :not(.sparkles) { position: relative; z-index: 1; }
.top-eyebrow { color: rgba(255,255,255,0.65); letter-spacing: 0.28em; }
.top-title { color: #fff; font-size: 34px; text-shadow: 0 4px 24px rgba(0,0,0,0.28); margin-bottom: 14px; }
.top-title-sub { color: rgba(255,255,255,0.82); border-color: rgba(255,255,255,0.3); margin-top: 0; }
.top-catch { color: rgba(255,255,255,0.9); margin: 20px 0 22px; }
.top-note { color: rgba(255,255,255,0.5); margin-top: 22px; }

.top-features { display: flex; gap: 8px; justify-content: center; width: 100%; margin: 6px 0 30px; }
.feat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.feat-ic {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff;
  background: linear-gradient(135deg, rgba(255,255,255,0.22), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.28);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.3);
}
.feat-t { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.86); line-height: 1.4; }

.btn-start {
  background: var(--cta-grad);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; max-width: 320px; padding: 17px 36px;
  box-shadow: 0 12px 30px rgba(229,57,47,0.45);
}
.btn-start-arrow { position: relative; z-index: 1; font-weight: 700; }

/* ===== SURVEY ===== */
.survey-opt.selected { background: #FFF1EE; border-color: var(--pop); color: var(--pop); }
.survey-label::before { content: ""; width: auto; height: auto; background: transparent; border-radius: 0; margin-right: 7px; vertical-align: baseline; font-size: 15px; }
.btn-survey-next { background: var(--cta-grad); display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 10px 28px rgba(229,57,47,0.4); }
.btn-arrow { font-weight: 700; }

/* ===== QUESTION: step indicator ===== */
.q-header { padding: 46px 28px 22px; }
.step-indicator { position: relative; display: flex; justify-content: space-between; max-width: 280px; margin: 0 auto; }
.step-indicator::before { content: ""; position: absolute; left: 16px; right: 16px; top: 50%; height: 2px; background: var(--border); transform: translateY(-50%); }
.step-dot {
  position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #B7BECD; background: #fff; border: 2px solid var(--border);
  transition: all 0.3s;
}
.step-dot.active { background: var(--cta-grad); border-color: transparent; color: #fff; box-shadow: 0 5px 14px rgba(229,57,47,0.4); transform: scale(1.08); }
.step-dot.done { background: var(--pop); border-color: transparent; color: #fff; }
.step-count { text-align: center; margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--pop); }

/* ===== LOADING ===== */
#screen-loading { position: relative; overflow: hidden; background: var(--hero-grad); }
#screen-loading > :not(.sparkles) { position: relative; z-index: 1; }

/* ===== RESULT ===== */
#screen-result { position: relative; background: var(--hero-grad); padding-bottom: 42px; }
#screen-result > :not(.sparkles) { position: relative; z-index: 1; }
.result-hero { background: transparent; padding: 44px 24px 24px; }
.result-hero-label { color: rgba(255,255,255,0.72); letter-spacing: 0.16em; }
.result-type-name { color: #fff; }
.result-type-desc { color: rgba(255,255,255,0.86); }
.result-section .section-label { color: rgba(255,255,255,0.88); }

/* main card: 白カード＋マッチ度バッジ */
.main-stock-card { position: relative; overflow: visible; border: none; margin-top: 24px; box-shadow: 0 16px 36px rgba(0,0,0,0.28); }
.match-badge {
  position: absolute; top: -20px; left: 18px; z-index: 3;
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--cta-grad); color: #fff; border: 3px solid #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(229,57,47,0.5);
}
.mb-label { font-size: 9px; font-weight: 700; opacity: 0.92; letter-spacing: 0.04em; }
.mb-num { font-size: 23px; font-weight: 800; line-height: 1; }
.mb-pct { font-size: 12px; font-weight: 700; }
.main-stock-header { background: #fff; padding: 20px 18px 6px 106px; gap: 12px; }
.stock-badge { background: #EEF1F8; min-width: 50px; padding: 6px 10px; }
.stock-code { color: var(--text-sub); }
.stock-code-num { color: var(--accent); font-size: 15px; }
.main-stock-name { color: var(--text); font-size: 20px; }
.main-stock-body { padding: 10px 18px 20px; }
.vision-block { background: #F4F6FB; border-left-color: var(--pop); }
.vision-text { color: var(--text); }

/* sub cards */
.sub-stock-card { border: none; box-shadow: 0 8px 20px rgba(0,0,0,0.18); }
.sub-match { font-size: 12px; font-weight: 700; color: var(--pop); margin-top: 3px; }

/* retry on dark */
.btn-retry { border: 1.5px solid rgba(255,255,255,0.55); color: #fff; background: rgba(255,255,255,0.08); }
.btn-retry:hover { background: #fff; color: var(--accent); border-color: #fff; }

/* ===== RESULT: メインカードを角丸＋デッキ風（背面に重なるカード） ===== */
.main-stock-card {
  border-radius: 24px;
  margin-top: 28px;
}
.main-stock-header { border-radius: 24px 24px 0 0; }
.main-stock-card::before,
.main-stock-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  z-index: -1;
  box-shadow: 0 16px 34px rgba(0,0,0,0.16);
}
.main-stock-card::before {
  background: #2E4A7E;
  transform: translate(7px, 11px) rotate(1.6deg);
}
.main-stock-card::after {
  background: #18294C;
  transform: translate(13px, 21px) rotate(3.2deg);
  z-index: -2;
}

/* ===== 背景の空：流れ星アニメ（PC表示のみ・スマホ枠の背面） ===== */
.sky-fx { display: none; }
@media (min-width: 480px) {
  .sky-fx {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
  }
}
.shooting-star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px 2px rgba(255,255,255,0.85);
  opacity: 0;
  transform: rotate(28deg);
}
.shooting-star::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 3px;
  width: 140px;
  height: 1.5px;
  background: linear-gradient(90deg, rgba(255,255,255,0.85), rgba(255,255,255,0));
  transform: translateY(-50%);
}
@keyframes shoot {
  0%   { opacity: 0; transform: translate(0, 0) rotate(28deg); }
  3%   { opacity: 1; }
  15%  { opacity: 1; transform: translate(520px, 270px) rotate(28deg); }
  17%  { opacity: 0; transform: translate(520px, 270px) rotate(28deg); }
  100% { opacity: 0; transform: translate(520px, 270px) rotate(28deg); }
}
/* 上空のあちこちから、間隔をあけて流れる */
.shooting-star.s1 { top: 8%;  left: 12%; animation: shoot 6s ease-in 1.5s infinite; }
.shooting-star.s2 { top: 14%; left: 62%; animation: shoot 7s ease-in 5s infinite; }
.shooting-star.s3 { top: 6%;  left: 80%; animation: shoot 6.5s ease-in 9s infinite; }
.shooting-star.s4, .shooting-star.s5 { display: none; }

/* 背景の星のまたたき（sky-fx内） */
.sky-twinkle .sparkle { background:#FFFFFF; box-shadow:0 0 7px 1px rgba(255,255,255,0.8); }

/* ===== トップ：ロゴ画像 ===== */
.top-title { margin-bottom: 6px; }
.top-logo {
  display: block;
  width: 288px;
  max-width: 86%;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.35));
}

/* ============================================================
   POP（トーンダウン）：質問=色付き吹き出し / 回答=白カードで差分
   ============================================================ */
#screen-question { background: linear-gradient(180deg, #FAF7FF 0%, #F1EEFF 100%); }
.q-header { background: transparent; border-bottom: none; padding: 46px 24px 14px; }

.step-indicator::before { background: #E0DAF2; height: 3px; }
.step-dot { border: 2px solid #CFC8EC; color: #8A82B8; font-weight: 800; box-shadow: none; }
.step-dot.active { background: var(--cta-grad); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(229,57,47,0.35); transform: scale(1.1); }
.step-dot.done { background: #8A7BEA; border-color: transparent; color: #fff; box-shadow: none; }
.step-count { color: var(--pop); font-weight: 800; }

.q-body { position: relative; }
.q-body::before { content: ""; position: absolute; top: 0; right: 0; width: 110px; height: 110px; background-image: radial-gradient(#D9D0F2 20%, transparent 22%); background-size: 13px 13px; opacity: 0.4; pointer-events: none; z-index: 0; }
.q-body > * { position: relative; z-index: 1; }

/* Q番号：控えめバッジ */
.q-number { display: inline-block; background: var(--cta-grad); color: #fff; font-weight: 800; padding: 4px 14px; border-radius: 50px; box-shadow: 0 4px 12px rgba(229,57,47,0.3); transform: none; margin-bottom: 16px; }

/* 質問 = 色付き吹き出し（回答と差別化） */
.q-text {
  position: relative; background: linear-gradient(135deg, #5E4BD0 0%, #3E46B8 100%);
  color: #fff; border: none; border-radius: 20px; padding: 20px;
  box-shadow: 0 10px 24px rgba(62,70,184,0.32);
  font-weight: 800; font-size: 18px; line-height: 1.6; margin-bottom: 28px;
}
.q-text::after { content: ""; position: absolute; left: 30px; bottom: -12px; border-width: 14px 12px 0 0; border-style: solid; border-color: #3E46B8 transparent transparent transparent; }
.q-text::before { content: none; }

/* 回答 = 白カード（やさしい影・傾きなし） */
.choice-btn {
  position: relative; background: #fff; border: 2px solid #ECE9F7; border-radius: 16px;
  box-shadow: 0 4px 14px rgba(44,37,80,0.10); padding: 15px 16px; gap: 14px; transform: none;
  transition: transform 0.16s cubic-bezier(.34,1.56,.64,1), box-shadow 0.18s, border-color 0.15s, background 0.15s;
}
.choice-btn:nth-child(odd), .choice-btn:nth-child(even) { transform: none; }
.choice-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(44,37,80,0.16); border-color: #D9D2F2; }
.choice-btn:active { transform: scale(0.98); }
.choice-label { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; min-width: 30px; border-radius: 50%; flex-shrink: 0; padding: 0; background: var(--accent-light); color: var(--accent); border: none; box-shadow: none; font-weight: 800; font-size: 14px; }
.choice-text { color: #1c1740; font-weight: 700; }
.choice-btn.selected { border-color: #E5392F; background: #FFF3F0; animation: comicPop 0.4s ease; }
.choice-btn.selected .choice-label { background: #E5392F; color: #fff; }
.choice-btn.selected::after { content: none; }
@keyframes comicPop { 0% { transform: scale(1); } 45% { transform: scale(1.03); } 100% { transform: scale(1); } }

/* ===== アンケート：質問画面に同調 ===== */
#screen-survey { background: linear-gradient(180deg, #FAF7FF 0%, #F1EEFF 100%); }
.survey-head { background: transparent; border-bottom: none; }
.survey-opt { box-shadow: 0 3px 10px rgba(44,37,80,0.08); transition: transform 0.16s, box-shadow 0.18s, border-color 0.15s, background 0.15s, color 0.15s; }
.survey-opt:hover { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(44,37,80,0.14); }
.survey-opt.selected { background: #FFF3F0; border-color: #E5392F; color: #E5392F; box-shadow: 0 4px 12px rgba(229,57,47,0.18); }

/* ===== 結果カード：前面は白・背面は奥行きだけ（控えめ） ===== */
.main-stock-card { background: #fff; }
.main-stock-card::before { background: #2E4A7E; transform: translate(4px, 7px) rotate(1deg); box-shadow: 0 10px 24px rgba(0,0,0,0.14); }
.main-stock-card::after  { background: #1B2E55; transform: translate(8px, 14px) rotate(2deg); box-shadow: 0 10px 24px rgba(0,0,0,0.14); }

/* ===== 結果メインカード：前面を完全に白く（本文も白背景） ===== */
.main-stock-card { background: #fff; }
.main-stock-header,
.main-stock-body { position: relative; z-index: 1; background: #fff; }
.main-stock-body { border-radius: 0 0 24px 24px; }
/* 背面の覗きは縁だけ（控えめな奥行き） */
.main-stock-card::before { transform: translate(3px, 6px) rotate(0.8deg); }
.main-stock-card::after  { transform: translate(7px, 12px) rotate(1.8deg); }

/* モーダル：会社説明ブロック */
.modal-desc-block { margin-bottom: 16px; }

/* ============================================================
   TOP 背景：オービット幾何学（ロゴモチーフ）＋ 街シルエット
   ============================================================ */
.top-deco { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

/* 傾いた楕円の軌道リング（静止・うっすら） */
.orbit-ring { position: absolute; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.13); }
.orbit-ring.r1 { width: 280px; height: 118px; left: 50%; top: 24%; margin-left: -140px; transform: rotate(-22deg); }
.orbit-ring.r2 { width: 360px; height: 150px; left: 50%; top: 30%; margin-left: -180px; transform: rotate(16deg); border-color: rgba(167,139,250,0.20); }
.orbit-ring.r3 { width: 210px; height: 210px; right: -70px; top: 6%; border-color: rgba(255,255,255,0.08); }

/* 周回する惑星（点）：円トラックを回転 */
.orbit-spin { position: absolute; border-radius: 50%; }
.orbit-spin.s1 { width: 230px; height: 230px; left: 50%; top: 20%; margin-left: -115px; animation: orbitSpin 20s linear infinite; }
.orbit-spin.s2 { width: 330px; height: 330px; left: 50%; top: 14%; margin-left: -165px; animation: orbitSpinRev 30s linear infinite; }
.orbit-spin.s3 { width: 160px; height: 160px; right: -45px; top: 12%; animation: orbitSpin 16s linear infinite; }
.planet { position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; }
.planet.p1 { background: #FF8A6B; box-shadow: 0 0 10px 2px rgba(255,138,107,0.6); }
.planet.p2 { background: #A78BFA; box-shadow: 0 0 10px 2px rgba(167,139,250,0.6); }
.planet.p3 { width: 7px; height: 7px; margin-left: -3.5px; background: #FFFFFF; box-shadow: 0 0 8px 2px rgba(255,255,255,0.55); }
@keyframes orbitSpin    { to { transform: rotate(360deg); } }
@keyframes orbitSpinRev { to { transform: rotate(-360deg); } }

/* 街のシルエット（背景画像となじませる・下部） */
.city-silhouette {
  position: absolute; left: 0; right: 0; bottom: 0; height: 96px;
  opacity: 0.55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 390 96' preserveAspectRatio='xMidYMax slice'%3E%3Cg fill='%231a1342'%3E%3Crect x='0' y='52' width='34' height='44'/%3E%3Crect x='30' y='38' width='26' height='58'/%3E%3Crect x='54' y='58' width='40' height='38'/%3E%3Crect x='92' y='44' width='30' height='52'/%3E%3Crect x='120' y='62' width='44' height='34'/%3E%3Crect x='160' y='32' width='28' height='64'/%3E%3Crect x='186' y='56' width='38' height='40'/%3E%3Crect x='222' y='46' width='30' height='50'/%3E%3Crect x='250' y='60' width='42' height='36'/%3E%3Crect x='290' y='40' width='28' height='56'/%3E%3Crect x='316' y='58' width='40' height='38'/%3E%3Crect x='352' y='48' width='40' height='48'/%3E%3C/g%3E%3Cg fill='%23FFD27A' opacity='0.55'%3E%3Crect x='40' y='48' width='3' height='4'/%3E%3Crect x='40' y='58' width='3' height='4'/%3E%3Crect x='168' y='42' width='3' height='4'/%3E%3Crect x='176' y='52' width='3' height='4'/%3E%3Crect x='232' y='56' width='3' height='4'/%3E%3Crect x='298' y='50' width='3' height='4'/%3E%3Crect x='360' y='58' width='3' height='4'/%3E%3C/g%3E%3C/svg%3E") repeat-x bottom;
  background-size: auto 100%;
}

/* 修正：top-deco を全面オーバーレイに固定（ID優先度のため強める） */
#screen-top > .top-deco { position: absolute; inset: 0; z-index: 1; }
#screen-top > .top-inner { z-index: 2; }

/* 選択肢：ラベル＆テキストを縦中央に */
.choice-btn { align-items: center; }

/* ============================================================
   アンケート：プルダウン式（アイコン廃止）
   ============================================================ */
.survey-label::before { content: none; }
.survey-label { display: block; margin-bottom: 10px; }
.survey-select-wrap { position: relative; }
.survey-select-wrap::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--text-sub); border-bottom: 2px solid var(--text-sub);
  transform: translateY(-65%) rotate(45deg); pointer-events: none;
}
.survey-select {
  -webkit-appearance: none; appearance: none;
  width: 100%; font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 15px; font-weight: 500; color: var(--text);
  padding: 14px 40px 14px 16px; border: 2px solid #E3DEF4; border-radius: 14px;
  background: #fff; box-shadow: 0 3px 10px rgba(44,37,80,0.07);
  cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
}
.survey-select:focus { outline: none; border-color: var(--pop); box-shadow: 0 4px 14px rgba(229,57,47,0.15); }
.survey-select:invalid, .survey-select option[value=""] { color: #B0B8C8; }
.survey-select option:not([value=""]) { color: var(--text); }
.survey-select:not(.filled) { color: #B0B8C8; }
.survey-select.filled { color: var(--text); }

/* ============================================================
   結果：旧ビジョンのテキストを大きく・見出しのあしらいを廃止
   ============================================================ */
.main-stock-body .vision-block {
  background: transparent; border-left: none; border-radius: 0;
  padding: 0; margin-bottom: 18px;
}
.main-stock-body .vision-text {
  font-size: 18px; font-weight: 700; line-height: 1.7; color: var(--text);
}

/* ============================================================
   TOP 演出：光のマッチング（中心へ集まる光の粒）案B
   ============================================================ */
.converge { position: absolute; left: 50%; top: 40%; width: 0; height: 0; }
.converge::before {
  content: ""; position: absolute; left: -65px; top: -65px; width: 130px; height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,224,190,0.28), rgba(255,224,190,0) 70%);
  animation: corePulse 3s ease-in-out infinite;
}
.lp {
  position: absolute; left: 0; top: 0; border-radius: 50%; opacity: 0;
  box-shadow: 0 0 8px 2px rgba(255,255,255,0.45);
  animation-name: converge; animation-timing-function: ease-in; animation-iteration-count: infinite;
}
@keyframes converge {
  0%   { opacity: 0; transform: translate(var(--x), var(--y)) scale(0.5); }
  15%  { opacity: 1; }
  78%  { opacity: 1; }
  100% { opacity: 0; transform: translate(0, 0) scale(1.1); }
}
@keyframes corePulse {
  0%, 100% { transform: scale(0.85); opacity: 0.55; }
  50%      { transform: scale(1.15); opacity: 1; }
}

/* ============================================================
   アンケート：カテゴリ＋プルダウンを横並び・余白調整
   ============================================================ */
.survey-label::before { content: none; }           /* アイコン廃止（再確認） */
.survey-group { display: flex; align-items: center; gap: 14px; }
.survey-label { margin-bottom: 0; flex: 0 0 auto; white-space: nowrap; }
.survey-select-wrap { flex: 1; min-width: 0; }
.survey-body { gap: 20px; }
.btn-survey-next { margin: 40px 24px 48px; }

/* ============================================================
   TOP 演出：コネクション・ネットワーク（案A／光のマッチング）
   ============================================================ */
.net { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }

/* 線：引かれて → つながって → 消える */
.net-lines line {
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 240; stroke-dashoffset: 240; opacity: 0;
  animation: netLine 6s ease-in-out infinite;
}
@keyframes netLine {
  0%   { opacity: 0;   stroke-dashoffset: 240; }
  16%  { opacity: 0.5; }
  46%  { opacity: 0.5; stroke-dashoffset: 0; }
  70%  { opacity: 0.5; stroke-dashoffset: 0; }
  100% { opacity: 0;   stroke-dashoffset: 0; }
}
.net-lines line:nth-child(1)  { animation-delay: 0.0s; }
.net-lines line:nth-child(2)  { animation-delay: 0.5s; }
.net-lines line:nth-child(3)  { animation-delay: 1.0s; }
.net-lines line:nth-child(4)  { animation-delay: 1.6s; }
.net-lines line:nth-child(5)  { animation-delay: 2.1s; }
.net-lines line:nth-child(6)  { animation-delay: 2.6s; }
.net-lines line:nth-child(7)  { animation-delay: 3.1s; }
.net-lines line:nth-child(8)  { animation-delay: 3.6s; }
.net-lines line:nth-child(9)  { animation-delay: 4.0s; }
.net-lines line:nth-child(10) { animation-delay: 4.4s; }
.net-lines line:nth-child(11) { animation-delay: 4.9s; }
.net-lines line:nth-child(12) { animation-delay: 5.3s; }

/* ノード：やわらかく明滅（マッチの瞬き） */
.net-nodes circle {
  transform-box: fill-box; transform-origin: center;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.7));
  animation: nodePulse 3s ease-in-out infinite;
}
@keyframes nodePulse {
  0%, 100% { transform: scale(0.7); opacity: 0.55; }
  50%      { transform: scale(1.25); opacity: 1; }
}
.net-nodes circle:nth-child(1) { animation-delay: 0.2s; }
.net-nodes circle:nth-child(2) { animation-delay: 1.1s; }
.net-nodes circle:nth-child(3) { animation-delay: 0.6s; }
.net-nodes circle:nth-child(4) { animation-delay: 1.8s; }
.net-nodes circle:nth-child(5) { animation-delay: 0.9s; }
.net-nodes circle:nth-child(6) { animation-delay: 2.2s; }
.net-nodes circle:nth-child(7) { animation-delay: 1.4s; }
.net-nodes circle:nth-child(8) { animation-delay: 2.6s; }
.net-nodes circle:nth-child(9) { animation-delay: 0.4s; }

/* ネットワークはロゴより上の帯に限定（上部のみ） */
.net { height: 18%; }

/* ============================================================
   アンケート：縦並び・セクションカード化・アイコン無し
   ============================================================ */
.survey-body { gap: 16px; padding: 24px 22px 8px; }
.survey-group {
  display: block;
  background: #fff; border: 1px solid #ECE9F7; border-radius: 16px;
  padding: 16px 18px; box-shadow: 0 2px 10px rgba(44,37,80,0.05);
}
.survey-label { display: block; margin: 0 0 10px; flex: none; white-space: normal; font-weight: 700; color: var(--text); }
.survey-label::before { content: none; }
.survey-select-wrap { width: 100%; flex: none; }
.survey-select { background: #F7F6FC; border-color: #E3DEF4; }
.survey-select:focus { background: #fff; }

/* ============================================================
   TOP 演出：左右から光が伸びて中央で星になる（マッチ成立）
   ============================================================ */
.beams { position: absolute; left: 0; top: 0; width: 100%; height: 22%; }
.beam-row { position: absolute; left: 0; width: 100%; height: 2px; }
.beam-row.r1 { top: 30%; }
.beam-row.r2 { top: 55%; }
.beam-row.r3 { top: 78%; }

.beam {
  position: absolute; top: 50%; height: 2px; width: 0;
  transform: translateY(-50%); border-radius: 2px;
  box-shadow: 0 0 6px rgba(255,255,255,0.6);
  animation: beamGrow 4.6s ease-in-out infinite;
}
.beam.left  { left: 0;  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(199,184,255,0.25) 55%, #fff); }
.beam.right { right: 0; background: linear-gradient(270deg, rgba(255,255,255,0), rgba(255,184,150,0.25) 55%, #fff); }

.beam-star {
  position: absolute; left: 50%; top: 50%; color: #fff; font-size: 18px;
  text-shadow: 0 0 10px rgba(255,224,180,0.95), 0 0 4px #fff;
  transform: translate(-50%,-50%) scale(0); opacity: 0;
  animation: starPop 4.6s ease-in-out infinite;
}

/* 行ごとに時間差 */
.beam-row.r2 .beam, .beam-row.r2 .beam-star { animation-delay: 1.5s; }
.beam-row.r3 .beam, .beam-row.r3 .beam-star { animation-delay: 3.0s; }

@keyframes beamGrow {
  0%   { width: 0;   opacity: 0; }
  8%   { opacity: 1; }
  42%  { width: 47%; opacity: 1; }
  58%  { width: 47%; opacity: 1; }
  74%  { width: 47%; opacity: 0; }
  100% { width: 0;   opacity: 0; }
}
@keyframes starPop {
  0%, 40% { opacity: 0; transform: translate(-50%,-50%) scale(0) rotate(0deg); }
  50%     { opacity: 1; transform: translate(-50%,-50%) scale(1.5) rotate(25deg); }
  60%     { opacity: 1; transform: translate(-50%,-50%) scale(1) rotate(0deg); }
  72%     { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  86%     { opacity: 0; transform: translate(-50%,-50%) scale(0.6); }
  100%    { opacity: 0; }
}

/* ============================================================
   TOP 調整：ロゴを大きく上に / 光ビームはロゴと説明の間に1本（細く）
   ============================================================ */
#screen-top { justify-content: center; padding: 48px 30px; }
.top-logo { width: 360px; max-width: 92%; }

.match-beam { position: relative; width: 100%; height: 22px; margin: 12px 0 22px; }
.match-beam .beam {
  position: absolute; top: 50%; height: 1.5px; width: 0; transform: translateY(-50%);
  border-radius: 2px; box-shadow: 0 0 5px rgba(255,255,255,0.5);
  animation: beamGrow 4.6s ease-in-out infinite;
}
.match-beam .beam.left  { left: 0;  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(199,184,255,0.25) 55%, #fff); }
.match-beam .beam.right { right: 0; background: linear-gradient(270deg, rgba(255,255,255,0), rgba(255,184,150,0.25) 55%, #fff); }
.match-beam .beam-star {
  position: absolute; left: 50%; top: 50%; color: #fff; font-size: 16px;
  text-shadow: 0 0 10px rgba(255,224,180,0.95), 0 0 4px #fff;
  transform: translate(-50%,-50%) scale(0); opacity: 0;
  animation: starPop 4.6s ease-in-out infinite;
}

/* ============================================================
   結果：マッチ度バッジを上部中央・大きく
   ============================================================ */
.main-stock-card { margin-top: 52px; }
.match-badge {
  left: 50%; top: -44px; transform: translateX(-50%);
  width: 92px; height: 92px;
}
.mb-label { font-size: 10px; }
.mb-num { font-size: 28px; }
.mb-pct { font-size: 14px; }
.main-stock-header { padding: 56px 18px 6px; }

/* ============================================================
   アンケート：プルダウンの状態表現（赤＝エラーを廃止）
   未選択＝薄いボーダー / フォーカス＝ニュートラル / 選択後＝ボーダー無しの塗り
   ============================================================ */
.survey-select {
  border: 1.5px solid #E3DEF4; background: #F7F6FC;
  box-shadow: none; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.survey-select:focus {
  outline: none; border-color: #B3A7E6; background: #fff;
  box-shadow: 0 0 0 3px rgba(124,107,232,0.14);
}
.survey-select.filled {
  border-color: #CFCFDA; background: #fff;
  box-shadow: none;
}
.survey-select.filled:focus {
  border-color: #B3A7E6; box-shadow: 0 0 0 3px rgba(124,107,232,0.14);
}

/* ============================================================
   TOP 背景：スマホ画面に素材画像を全面表示
   ============================================================ */
#screen-top {
  background-image: url('img/top-bg.png');
  background-size: 128%;
  background-position: center center;
  background-repeat: no-repeat;
}
/* 画像に街・公園があるためシルエットは非表示 */
.city-silhouette { display: none; }

/* ============================================================
   アンケート：ヘッダーを全面パネル（下だけ丸・中央揃え）＋内容をスッキリ
   ============================================================ */
.survey-head {
  background: #fff;
  text-align: center;
  border-radius: 0 0 24px 24px;
  padding: 48px 24px 28px;
  box-shadow: 0 4px 16px rgba(44,37,80,0.06);
  border-bottom: none;
}
.survey-title { margin-bottom: 10px; }
.survey-sub { margin: 0 auto; }

/* 内容：カード装飾をやめてスッキリ */
.survey-body { padding: 26px 24px 8px; gap: 18px; }
.survey-group { background: transparent; border: none; box-shadow: none; padding: 0; }
.survey-label { margin: 0 0 8px; }

/* プルダウン：影なし。未入力＝薄ボーダー / 入力後＝薄いグレーのボーダー */
.survey-select { background: #fff; border: 1.5px solid #E3DEF4; box-shadow: none; }
.survey-select:focus { outline: none; border-color: #B3A7E6; box-shadow: none; background: #fff; }
.survey-select.filled { border-color: #CFCFDA; box-shadow: none; background: #fff; }
.survey-select.filled:focus { border-color: #B3A7E6; box-shadow: none; }

/* ============================================================
   設問・アンケートを夜テイスト（トップ/結果と統一：パープル＋白カード）
   ============================================================ */
#screen-survey, #screen-question { position: relative; background: var(--hero-grad); }
#screen-survey > :not(.sparkles), #screen-question > :not(.sparkles) { position: relative; z-index: 1; }

/* --- 設問 --- */
.q-header { background: transparent; border-bottom: none; }
.q-body::before { display: none; }
.step-indicator::before { background: rgba(255,255,255,0.22); }
.step-dot { background: rgba(255,255,255,0.10); border: 2px solid rgba(255,255,255,0.35); color: rgba(255,255,255,0.85); box-shadow: none; }
.step-dot.active { background: var(--cta-grad); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(229,57,47,0.4); }
.step-dot.done { background: #8A7BEA; border-color: transparent; color: #fff; }
.step-count { color: rgba(255,255,255,0.9); }
.q-number { box-shadow: 0 4px 12px rgba(229,57,47,0.35); }
.q-text {
  background: transparent; color: #fff; box-shadow: none; padding: 0;
  font-size: 21px; line-height: 1.6;
}
.q-text::after, .q-text::before { content: none; }
.choice-btn { background: #fff; border: 2px solid transparent; box-shadow: 0 6px 18px rgba(0,0,0,0.18); }
.choice-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,0.26); border-color: transparent; }
.choice-text { color: var(--text); }
.choice-btn.selected { border-color: #E5392F; background: #FFF3F0; }
.choice-btn.selected .choice-text { color: var(--text); }

/* --- アンケート --- */
.survey-label { color: #fff; }

/* ============================================================
   設問・アンケート：上部パープル＋下部 白の角丸パネル（2セクション）
   ============================================================ */

.q-top { padding: 46px 26px 24px; }
.q-top .q-text { margin-bottom: 0; }
.survey-top { padding: 46px 26px 22px; text-align: center; }
.survey-top .survey-title { color: #fff; }
.survey-top .survey-sub { color: rgba(255,255,255,0.85); }

.q-panel, .survey-panel {
  background: #fff; border-radius: 28px 28px 0 0; flex: 1;
  padding: 28px 22px 0; box-shadow: 0 -8px 26px rgba(0,0,0,0.14);
  display: flex; flex-direction: column; justify-content: space-between;
}
.q-panel .screen-footer, .survey-panel .screen-footer {
  margin-top: auto;
  padding: 16px 0 20px;
}

/* 設問：回答カードを白パネル上で見やすく */
.q-panel .choice-btn { background: #fff; border: 1.5px solid #ECE9F7; box-shadow: 0 3px 10px rgba(44,37,80,0.07); }
.q-panel .choice-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(44,37,80,0.13); border-color: #D9D2F2; }
.q-panel .choice-btn.selected { border-color: #E5392F; background: #FFF3F0; }

/* アンケート：白パネル内 */
.survey-panel .survey-body { padding: 0; gap: 16px; }
.survey-panel .survey-label { color: var(--text); }
.btn-survey-next { margin: auto 0 6px; }

/* 設問：ステッパーの線が丸に被らないよう丸を不透明に / Q番号は非表示 */
.step-dot { background: #473C90; }
.q-number { display: none; }

/* 設問：質問文を下げて上下マージンを確保 */
.q-top { padding: 44px 26px 36px; }
.q-top .q-text { margin: 28px 0 8px; }
.q-top .step-count { margin-top: 14px; }

/* 設問：質問文サイズ */
.q-top .q-text { font-size: 24px; }

/* ============================================================
   モーダル：メインカードと同じ見た目（サブ企業の詳細）
   ============================================================ */
.modal-header:empty { display: none; }
.modal-body .modal-card {
  margin-top: 44px;
  box-shadow: none;
  border: 1px solid var(--border);
}
.modal-body .modal-card::before,
.modal-body .modal-card::after { display: none; }
.modal-body { padding-top: 4px; }

/* 結果：タイプ説明とマッチ度の円の距離を縮める */
.result-hero { padding-bottom: 10px; }
.result-section { padding-top: 12px; }
.main-stock-card { margin-top: 42px; }

/* アンケート：ボタンと最後の選択肢の間隔を確保＋下部に余白（外部ブラウザのナビ対策） */
.btn-survey-next { margin: 28px 0 0; }
.survey-panel { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
