﻿:root {
  --primary: #6366f1;
  --secondary: #ec4899;
  --bg-color: #0f172a;
  --card-bg: rgba(255, 255, 255, 0.05);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

body {
  margin: 0;
  font-family: 'Pretendard', -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.15), transparent 25%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start; /* changed from center for long content */
  padding: 3rem 1rem;
  box-sizing: border-box;
}

#app {
  width: 100%;
  max-width: 1000px; /* narrowed slightly */
  margin: 0 auto;
}

/* Glassmorphism Card Utils */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.badge {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 99px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}
.btn:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5);
}

/* Typography */
h1 {
  font-size: 3rem;
  background: linear-gradient(to right, #a8a2ff, #ffb1df);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  margin-top: 0;
  letter-spacing: -1px;
}
h2 {
  font-size: 1.8rem;
  margin: 0;
  color: #fff;
}
p {
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1.6;
}

/* Views Layouts */
.view {
  animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.menu-card {
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  position: relative;
  overflow: hidden;
}

.menu-card:hover { transform: translateY(-8px); }
.menu-card img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 15px 25px rgba(0,0,0,0.4));
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.menu-card:hover img { transform: scale(1.15) rotate(4deg); }

.header { text-align: center; margin-bottom: 2rem; }

/* Test View UI */
.step-indicator {
  text-align: center;
  color: var(--primary);
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: 1px;
}

.question-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.q-title {
  margin: 2rem 0;
  font-size: 1.8rem;
  line-height: 1.4;
  color: #fff;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 99px;
  margin-bottom: 2rem;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 99px;
}

/* Scale Buttons for Basic Test */
.scale-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  transition: opacity 0.25s ease;
  background: rgba(0,0,0,0.2);
  padding: 1.5rem;
  border-radius: 20px;
}
.scale-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
  width: 80px;
}
.scale-buttons {
  display: flex;
  gap: 0.8rem;
  flex: 1;
  justify-content: center;
}
.scale-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  background: transparent;
  color: white;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}
.scale-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Options Grid for RPG Test */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  transition: opacity 0.25s ease;
}
.option-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  padding: 1.5rem;
  border-radius: 16px;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  line-height: 1.4;
}
.option-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2);
}
.game-btn:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

/* Result Screens */
.result-screen { text-align: center; }
.result-container {
  max-width: 850px;
  margin: 0 auto;
  position: relative;
}

.result-image {
  width: 220px;
  height: 220px;
  margin: 1.5rem auto;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,0.5));
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
  text-align: left;
}

.roadmap-box {
  padding: 1.5rem;
  background: rgba(0,0,0,0.25);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.05);
}
.roadmap-box h3 {
  color: #a8a2ff;
  margin-top: 0;
  margin-bottom: 1.2rem;
  font-size: 1.2rem;
}

/* Stat bar for values */
.stat-bar { margin-bottom: 1rem; }
.stat-bar .label {
  display: block;
  font-size: 0.9rem;
  color: #cbd5e1;
  margin-bottom: 0.3rem;
  font-weight: 600;
}
.bar-bg {
  width: 100%;
  height: 12px;
  background: rgba(255,255,255,0.1);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ec4899, #8b5cf6);
  border-radius: 99px;
  min-width: 5%;
}

/* Job Accordion Styles */
.job-accordion {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  margin-bottom: 2.5rem;
  border-left: 6px solid #6366f1;
  overflow: hidden;
  transition: all 0.3s ease;
}
.job-accordion[open] {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.job-accordion summary {
  padding: 2.5rem;
  font-size: 1.8rem;
  font-weight: 800;
  color: #a8a2ff;
  cursor: pointer;
  list-style: none; /* Hide default marker */
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background 0.2s;
}
.job-accordion summary::-webkit-details-marker {
  display: none;
}
.job-accordion summary:hover {
  background: rgba(255, 255, 255, 0.03);
}
.accordion-icon {
  font-size: 1.2rem;
  color: #818cf8;
  font-weight: 800;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: rgba(99, 102, 241, 0.2);
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.job-accordion[open] .accordion-icon {
  transform: rotate(180deg);
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
}
.job-details-content {
  padding: 0 2.5rem 2.5rem 2.5rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 1rem;
  padding-top: 2rem;
  animation: slideDown 0.4s ease-out;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Quest Specific Classes */
.allocation-form label {
  font-weight: 600;
}
.allocation-form input {
  font-size: 1.1rem;
  font-weight: bold;
}
.match-scenario img {
  border: 4px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}
.interactive-prompt {
  font-family: 'Pretendard', sans-serif;
  letter-spacing: 0.3px;
}

.back-btn {
  background: transparent;
  border: 1.5px solid var(--text-muted);
  color: var(--text-muted);
  margin-top: 3rem;
  box-shadow: none;
}
.back-btn:hover {
  background: rgba(255,255,255,0.08);
  color: white;
  border-color: white;
  box-shadow: none;
}

/* Particles */
.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.6;
  pointer-events: none;
  z-index: -1;
}
@keyframes float {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  20% { opacity: 0.6; }
  80% { opacity: 0.6; }
  100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* Illustrated gateway redesign */
body.gateway-theme {
  --gateway-ink: #172033;
  --gateway-muted: #596579;
  --gateway-paper: #fff8ea;
  --gateway-mint: #9edfc5;
  --gateway-teal: #0f7d83;
  --gateway-coral: #ef7466;
  --gateway-yellow: #f8f45b;
  --gateway-blue: #8fc6ff;
  --gateway-lavender: #c9b7ff;
  background: #f5fbf5;
  background-image:
    linear-gradient(90deg, rgba(15, 125, 131, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(15, 125, 131, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, #f8fff7 0%, #fff8ea 52%, #eef9ff 100%);
  background-size: 44px 44px, 44px 44px, 100% 100%;
  color: var(--gateway-ink);
  align-items: flex-start;
  padding: 1.25rem;
}

body.gateway-theme #app {
  width: min(1180px, calc(100vw - 2.5rem));
  max-width: 1180px;
}

.gateway-view {
  color: var(--gateway-ink);
  width: 100%;
  padding-bottom: 4rem;
}

.gateway-view, .gateway-view * {
  box-sizing: border-box;
}

.gateway-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 0 auto 1.4rem;
  padding: 0.75rem 0;
}

.gateway-brand,
.gateway-nav a,
.primary-action,
.secondary-action,
.gateway-card {
  font-family: inherit;
}

.gateway-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  border: 0;
  background: transparent;
  color: var(--gateway-ink);
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 3px solid var(--gateway-ink);
  border-radius: 16px;
  background: var(--gateway-yellow);
  box-shadow: 4px 4px 0 var(--gateway-ink);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.gateway-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.gateway-nav a {
  color: var(--gateway-ink);
  text-decoration: none;
  font-weight: 850;
  font-size: 0.93rem;
  background: rgba(255,255,255,0.7);
  border: 2px solid rgba(23,32,51,0.18);
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
}

.gateway-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
  align-items: center;
  gap: 2rem;
  min-height: 560px;
  border: 4px solid var(--gateway-ink);
  border-radius: 8px;
  background: var(--gateway-paper);
  overflow: hidden;
  box-shadow: 10px 10px 0 rgba(23,32,51,0.14);
  padding: clamp(2rem, 4vw, 4.5rem);
}

.gateway-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 86px;
  background: var(--gateway-yellow);
  border-top: 4px solid var(--gateway-ink);
}

.hero-copy,
.hero-art {
  position: relative;
  min-width: 0;
  z-index: 1;
}

.gateway-chip,
.section-kicker,
.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  width: fit-content;
  font-weight: 950;
  letter-spacing: 0;
}

.gateway-chip {
  background: #ffffff;
  border: 3px solid var(--gateway-ink);
  border-radius: 999px;
  padding: 0.58rem 0.95rem;
  color: var(--gateway-teal);
  box-shadow: 4px 4px 0 var(--gateway-ink);
  margin-bottom: 1.35rem;
}

.gateway-chip svg {
  width: 18px;
  height: 18px;
}

.gateway-hero h1 {
  margin: 0;
  color: var(--gateway-ink);
  background: none;
  -webkit-text-fill-color: currentColor;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.9;
  letter-spacing: 0;
  font-weight: 950;
}

.gateway-hero p {
  max-width: 560px;
  color: var(--gateway-ink);
  font-size: 1.16rem;
  line-height: 1.65;
  font-weight: 650;
  margin: 1.4rem 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.8rem;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  border: 3px solid var(--gateway-ink);
  border-radius: 999px;
  padding: 0.8rem 1.15rem;
  color: var(--gateway-ink);
  font-size: 1rem;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--gateway-ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.primary-action { background: var(--gateway-mint); }
.secondary-action { background: #ffffff; }
.primary-action:hover,
.secondary-action:hover,
.gateway-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--gateway-ink);
}

.primary-action svg,
.secondary-action svg {
  width: 19px;
  height: 19px;
}

.hero-art {
  min-height: 420px;
  display: grid;
  place-items: center;
}

.hero-art img {
  width: min(100%, 520px);
  border: 4px solid var(--gateway-ink);
  background: #fff6e6;
  box-shadow: 8px 8px 0 var(--gateway-ink);
  transform: rotate(1.5deg);
}

.hero-sticker {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 76px;
  min-height: 48px;
  padding: 0 0.65rem;
  border: 3px solid var(--gateway-ink);
  border-radius: 999px;
  color: var(--gateway-ink);
  font-weight: 950;
  box-shadow: 4px 4px 0 var(--gateway-ink);
}

.sticker-yellow { right: 3%; top: 12%; background: var(--gateway-yellow); transform: rotate(8deg); }
.sticker-mint { left: 0; top: 30%; background: var(--gateway-mint); transform: rotate(-9deg); }
.sticker-coral { right: 8%; bottom: 18%; background: #ff9b91; transform: rotate(-6deg); }

.gateway-band {
  margin-top: 2rem;
  border: 3px solid var(--gateway-ink);
  border-radius: 8px;
  background: rgba(255,255,255,0.82);
  box-shadow: 8px 8px 0 rgba(23,32,51,0.12);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.compact-band {
  background: #fffdf8;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
}

.section-heading.with-note {
  flex-direction: row;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading h2 {
  color: var(--gateway-ink);
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 950;
}

.section-heading p {
  margin: 0;
  color: var(--gateway-muted);
  font-size: 1rem;
  font-weight: 750;
}

.section-kicker {
  color: var(--gateway-teal);
  text-transform: uppercase;
  font-size: 0.78rem;
}

.gateway-feature-grid,
.gateway-grid {
  display: grid;
  gap: 1rem;
}

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

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

.gateway-card {
  position: relative;
  min-height: 238px;
  text-align: left;
  border: 3px solid var(--gateway-ink);
  border-radius: 8px;
  background: #ffffff;
  color: var(--gateway-ink);
  padding: 1.1rem;
  cursor: pointer;
  box-shadow: 5px 5px 0 var(--gateway-ink);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
}

.gateway-card::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -28px;
  width: 124px;
  height: 96px;
  border: 3px solid var(--gateway-ink);
  background: #f2fbff;
  transform: rotate(-8deg);
  z-index: 0;
}

.gateway-card > * {
  position: relative;
  z-index: 1;
}

.feature-card {
  min-height: 190px;
  background: #fffaf0;
}

.game-card.highlight { background: #fffde3; }
.game-card.law { background: #fff3f0; }

.card-badge {
  border: 2px solid var(--gateway-ink);
  border-radius: 999px;
  color: var(--gateway-ink);
  padding: 0.3rem 0.58rem;
  font-size: 0.74rem;
  margin-bottom: 0.85rem;
}

.card-badge.yellow { background: var(--gateway-yellow); }
.card-badge.mint { background: var(--gateway-mint); }
.card-badge.violet, .card-badge.purple { background: var(--gateway-lavender); }
.card-badge.coral, .card-badge.red { background: #ff9b91; }
.card-badge.honey { background: #ffd980; }
.card-badge.blue { background: var(--gateway-blue); }
.card-badge.green { background: #a8e8a0; }
.card-badge.teal { background: #9ee7dd; }
.card-badge.navy { background: #b7c8ff; }
.card-badge.indigo { background: #c8ccff; }

.card-icon,
.mini-illust {
  display: grid;
  place-items: center;
  border: 3px solid var(--gateway-ink);
  color: var(--gateway-ink);
}

.card-icon {
  width: 60px;
  height: 60px;
  border-radius: 22px;
  background: var(--gateway-yellow);
  margin-bottom: 1rem;
  box-shadow: 4px 4px 0 var(--gateway-ink);
}

.card-icon svg,
.mini-illust svg {
  width: 30px;
  height: 30px;
  stroke-width: 2.6;
}

.mini-illust {
  width: 88px;
  height: 76px;
  border-radius: 28px 28px 18px 18px;
  box-shadow: 4px 4px 0 var(--gateway-ink);
  margin: 0.15rem 0 1.05rem;
}

.mini-illust.finance { background: #a8e8d1; }
.mini-illust.court { background: #ffb0a8; }
.mini-illust.history { background: #ffe08a; }
.mini-illust.society { background: #d5c2ff; }
.mini-illust.market { background: #b6eab0; }
.mini-illust.business { background: #b8c9ff; }
.mini-illust.study { background: #a9d7ff; }

.gateway-card strong {
  color: var(--gateway-ink);
  font-size: 1.22rem;
  line-height: 1.24;
  font-weight: 950;
  margin-bottom: 0.6rem;
}

.gateway-card span:last-child {
  color: var(--gateway-muted);
  font-size: 0.94rem;
  line-height: 1.48;
  font-weight: 700;
}

@media (max-width: 920px) {
  body.gateway-theme { padding: 0.85rem; }
  .gateway-view, .gateway-view * {
  box-sizing: border-box;
}

.gateway-topbar { align-items: flex-start; flex-direction: column; }
  .gateway-nav { justify-content: flex-start; }
  .gateway-hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-art { min-height: 300px; }
  .hero-art img { max-width: 420px; }
  .gateway-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .gateway-hero { width: 100%; padding: 1.15rem 1rem 2rem; overflow: hidden; }
  .gateway-hero::after { height: 48px; }
  .gateway-hero h1 { font-size: clamp(2.45rem, 12vw, 3rem); line-height: 0.98; }
  .gateway-hero p { font-size: 1rem; line-height: 1.55; }
  .hero-art { min-height: 250px; }
  .hero-art img { width: min(100%, 320px); }
  .hero-sticker { min-width: 58px; min-height: 38px; font-size: 0.82rem; }
  .hero-actions { flex-direction: column; }
  .primary-action, .secondary-action { width: 100%; }
  .two-col, .gateway-grid { grid-template-columns: 1fr; }
  .section-heading.with-note { align-items: flex-start; flex-direction: column; }
  .gateway-card { min-height: 210px; }
}


@media (max-width: 640px) {
  body.gateway-theme {
    overflow-x: hidden;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  body.gateway-theme #app {
    width: calc(100vw - 1.5rem);
    max-width: calc(100vw - 1.5rem);
    overflow-x: hidden;
  }

  .gateway-hero {
    max-width: 100%;
  }

  .gateway-hero h1 {
    font-size: clamp(2.1rem, 10.2vw, 2.55rem);
    overflow-wrap: break-word;
  }

  .hero-art img {
    width: min(88%, 286px);
    transform: rotate(0deg);
    margin-inline: auto;
  }

  .sticker-yellow { right: 2%; top: 10%; }
  .sticker-mint { left: 2%; top: 34%; }
  .sticker-coral { right: 4%; bottom: 16%; }
}


@media (max-width: 640px) {
  .hero-copy,
  .gateway-hero h1,
  .gateway-hero p {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .gateway-hero p {
    font-size: 0.94rem;
  }
}
