/* ==============================
   ChatGPTつかいみち診断 — Pop Style
   ============================== */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Pop palette */
  --purple: #7C3AED;
  --purple-light: #A78BFA;
  --pink: #EC4899;
  --pink-light: #F9A8D4;
  --orange: #F97316;
  --orange-light: #FDBA74;
  --cyan: #06B6D4;
  --cyan-light: #67E8F9;
  --yellow: #FACC15;
  --green: #22C55E;

  --bg: #F5F0FF;
  --card-bg: #FFFFFF;
  --text: #1E1B4B;
  --text-sub: #6B7280;
  --text-muted: #9CA3AF;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 4px 24px rgba(124, 58, 237, .10);
  --shadow-lg: 0 8px 40px rgba(124, 58, 237, .15);
  --font-main: 'Zen Maru Gothic', 'Noto Sans JP', sans-serif;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Screen system ---------- */
.screen {
  display: none;
  min-height: 100dvh;
  position: relative;
}
.screen.active {
  display: flex;
  animation: fadeIn .5s ease;
}
.screen-inner {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  display: flex;
  flex-direction: column;
}

/* ---------- TOP Screen ---------- */
.top-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.bubble {
  position: absolute;
  border-radius: 50%;
  opacity: .25;
  animation: float 6s ease-in-out infinite;
}
.bubble-1 { width: 200px; height: 200px; background: var(--purple-light); top: -40px; left: -60px; animation-delay: 0s; }
.bubble-2 { width: 150px; height: 150px; background: var(--pink-light); top: 20%; right: -40px; animation-delay: 1.5s; }
.bubble-3 { width: 120px; height: 120px; background: var(--cyan-light); bottom: 20%; left: 10%; animation-delay: 3s; }
.bubble-4 { width: 180px; height: 180px; background: var(--orange-light); bottom: -30px; right: -30px; animation-delay: 2s; }
.bubble-5 { width: 80px; height: 80px; background: var(--yellow); top: 45%; left: 60%; animation-delay: 4s; }

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

.top-screen {
  position: relative;
  z-index: 1;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 100dvh;
}

.hero-badge {
  font-size: 3.5rem;
  margin-bottom: 8px;
  animation: bounce 2s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

h1 {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: .02em;
  margin-bottom: 8px;
}
h1 .accent {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.top-subcopy {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 8px;
}
.top-description {
  font-size: .9rem;
  color: var(--text-sub);
  line-height: 1.7;
  margin-bottom: 28px;
}

.top-note {
  margin-top: 12px;
  font-size: .8rem;
  color: var(--text-muted);
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 16px 40px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(124, 58, 237, .3);
  transition: transform .2s, box-shadow .2s;
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 28px rgba(124, 58, 237, .4);
}
.btn-primary:active { transform: scale(.97); }

.btn-primary-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  font-size: .95rem;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(124, 58, 237, .25);
  transition: transform .2s, box-shadow .2s, opacity .2s;
}
.btn-primary-sm:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(124, 58, 237, .35);
}
.btn-primary-sm:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--card-bg);
  color: var(--purple);
  border: 2px solid var(--purple-light);
  border-radius: 999px;
  padding: 12px 24px;
  font-size: .9rem;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  transition: transform .2s, background .2s;
}
.btn-secondary:hover:not(:disabled) {
  background: #F3EEFF;
  transform: translateY(-1px);
}
.btn-secondary:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--text-sub);
  border: 2px solid #E5E7EB;
  border-radius: 999px;
  padding: 12px 24px;
  font-size: .9rem;
  font-weight: 500;
  font-family: var(--font-main);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.btn-outline:hover {
  border-color: var(--purple-light);
  color: var(--purple);
}

/* ---------- Question Screen ---------- */
.question-screen {
  justify-content: flex-start;
  padding-top: 32px;
}

.progress-area {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.progress-bar {
  flex: 1;
  height: 10px;
  background: #E9E0F8;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--pink), var(--orange));
  border-radius: 999px;
  transition: width .4s ease;
  background-size: 200% 100%;
  animation: shimmer 3s ease infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.step-counter {
  font-size: .85rem;
  font-weight: 700;
  color: var(--purple);
  white-space: nowrap;
}

.question-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  flex: 1;
}

.q-label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.q-text {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 8px;
}
.q-hint {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Chips */
.chips-area {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 2px solid #E9E0F8;
  border-radius: 999px;
  background: #FDFBFF;
  font-size: .9rem;
  font-weight: 500;
  font-family: var(--font-main);
  color: var(--text);
  cursor: pointer;
  transition: all .2s;
  user-select: none;
}
.chip:hover {
  border-color: var(--purple-light);
  background: #F3EEFF;
  transform: translateY(-1px);
}
.chip.selected {
  border-color: var(--purple);
  background: linear-gradient(135deg, #F3EEFF, #FCE7F3);
  color: var(--purple);
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(124, 58, 237, .15);
}
.chip-emoji {
  font-size: 1.15rem;
}

/* Multi-select hint */
.multi-hint {
  font-size: .75rem;
  color: var(--pink);
  font-weight: 500;
  margin-bottom: 12px;
}

/* Step nav */
.step-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

/* ---------- Loading Screen ---------- */
.loading-screen {
  justify-content: center;
  align-items: center;
  min-height: 100dvh;
  text-align: center;
}
.loading-anim {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
}
.pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--purple-light);
  opacity: .4;
  animation: pulse 2s ease-out infinite;
}
.ring-2 { animation-delay: .6s; }
@keyframes pulse {
  0% { transform: scale(.8); opacity: .5; }
  100% { transform: scale(1.6); opacity: 0; }
}
.pulse-core {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  animation: bounce 1.5s ease infinite;
}
.loading-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-sub);
  line-height: 1.7;
}

/* ---------- Result Screen ---------- */
.result-screen {
  padding-top: 32px;
}
.result-header {
  text-align: center;
  margin-bottom: 28px;
  position: relative;
}
.result-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-sub);
  margin-bottom: 4px;
}
.result-title {
  font-size: 1.6rem;
  font-weight: 900;
}
.result-title .accent {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.result-sub {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Recommendation cards */
.result-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 28px;
}
.rec-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--purple);
  position: relative;
  overflow: hidden;
  animation: slideUp .5s ease both;
}
.rec-card:nth-child(1) { border-left-color: var(--purple); animation-delay: .1s; }
.rec-card:nth-child(2) { border-left-color: var(--pink); animation-delay: .25s; }
.rec-card:nth-child(3) { border-left-color: var(--orange); animation-delay: .4s; }

.rec-card .rank {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: .75rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  padding: 4px 12px;
  border-radius: 999px;
}
.rec-card:nth-child(2) .rank {
  background: linear-gradient(135deg, var(--pink), var(--orange));
}
.rec-card:nth-child(3) .rank {
  background: linear-gradient(135deg, var(--orange), var(--yellow));
  color: var(--text);
}

.rec-card .rec-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}
.rec-card .rec-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.rec-card .rec-desc {
  font-size: .85rem;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 14px;
}

/* Prompt example box */
.prompt-box {
  background: linear-gradient(135deg, #F5F0FF, #FDF2F8);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 4px;
}
.prompt-box-label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--pink);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.prompt-box-text {
  font-size: .85rem;
  color: var(--text);
  line-height: 1.6;
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  border: 1px dashed var(--purple-light);
  position: relative;
}
.btn-copy-prompt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  background: none;
  border: none;
  font-size: .75rem;
  font-weight: 700;
  color: var(--purple);
  cursor: pointer;
  font-family: var(--font-main);
  transition: color .2s;
}
.btn-copy-prompt:hover { color: var(--pink); }

/* Tip box */
.result-tip-box {
  background: linear-gradient(135deg, #ECFDF5, #F0FDFA);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  border: 2px solid #A7F3D0;
}
.tip-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 6px;
}
.tip-text {
  font-size: .8rem;
  color: var(--text-sub);
  line-height: 1.7;
}

/* Result actions */
.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.result-footer {
  text-align: center;
  font-size: .75rem;
  color: var(--text-muted);
  padding-bottom: 20px;
}

/* ---------- Confetti ---------- */
.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confettiFall 3s ease forwards;
  z-index: 10;
}
@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translateY(120px) rotate(720deg) scale(.3); opacity: 0; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #fff;
  padding: 12px 28px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 500;
  opacity: 0;
  transition: all .3s ease;
  z-index: 1000;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */
@media (min-width: 600px) {
  .screen-inner { max-width: 540px; padding: 32px 24px 48px; }
  h1 { font-size: 2.6rem; }
  .q-text { font-size: 1.4rem; }
  .rec-card { padding: 28px; }
}
