* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Yu Gothic", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 153, 102, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(38, 198, 218, 0.18), transparent 30%),
    linear-gradient(180deg, #09111f 0%, #142236 58%, #203550 100%);
  color: #f5f1eb;
  position: relative;
  overflow-x: hidden;
}

.container {
  width: min(760px, 92%);
  margin: 0 auto;
}

header {
  padding: 32px 0 20px;
}

.legal-shell {
  padding: 32px 0 24px;
}

h1 {
  margin: 0;
  font-size: 2.2rem;
  letter-spacing: 0;
}

.subtitle {
  margin-top: 8px;
  color: #ffb88c;
}

.tiny {
  margin-top: 6px;
  color: #b8c2d4;
  font-size: 0.92rem;
}

.hero-kawaii {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  font-size: 1.3rem;
}

.hero-kawaii span {
  display: inline-block;
  animation: floaty 2.6s ease-in-out infinite;
}

.hero-kawaii span:nth-child(2) {
  animation-delay: 0.2s;
}

.hero-kawaii span:nth-child(3) {
  animation-delay: 0.4s;
}

.hero-kawaii span:nth-child(4) {
  animation-delay: 0.6s;
}

.top-links,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.top-links {
  margin-top: 14px;
}

.top-links a,
.footer-links a,
.text-link {
  color: #ffd9bb;
  text-decoration: none;
}

.top-links a:hover,
.footer-links a:hover,
.text-link:hover {
  text-decoration: underline;
}

.card {
  background: rgba(10, 19, 33, 0.72);
  border: 1px solid rgba(255, 184, 140, 0.2);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
}

.legal-card h2 {
  margin-top: 0;
}

label,
button {
  display: block;
  width: 100%;
}

button {
  margin-top: 8px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 184, 140, 0.35);
  background: linear-gradient(90deg, #ff8a65 0%, #ffb74d 100%);
  cursor: pointer;
  font-weight: 600;
  color: #09111f;
}

button:hover {
  filter: brightness(1.08);
}

#quizRoot {
  margin-top: 10px;
}

.progress-wrap {
  margin-top: 10px;
}

.progress-label {
  font-size: 0.88rem;
  color: #ffbe98;
  margin-bottom: 6px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #ff8a65 0%, #26c6da 100%);
  transition: width 0.2s ease;
}

.quiz-single {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.option-chip {
  display: block;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 10px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.option-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 184, 140, 0.65);
  background: rgba(255, 184, 140, 0.12);
}

.option-chip input {
  margin-right: 6px;
}

.share-row,
.nav-row {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.ghost-btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffe0c7;
  border: 1px solid rgba(255, 184, 140, 0.28);
  border-radius: 10px;
}

.ghost-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#shareLink {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, #26c6da 0%, #4dd0e1 100%);
  color: #09111f;
  text-decoration: none;
  font-weight: 700;
}

.hidden {
  display: none;
}

.footer {
  padding: 14px 0 24px;
  color: #9db0c6;
  font-size: 0.9rem;
}

.footer-links {
  margin-top: 12px;
}

.image-card {
  margin-bottom: 24px;
}

.image-row {
  display: flex;
  gap: 8px;
}

.mini-card {
  flex: 1;
  background: linear-gradient(180deg, rgba(255, 138, 101, 0.2) 0%, rgba(38, 198, 218, 0.18) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  text-align: center;
  padding: 12px 8px;
  font-weight: 600;
  color: #fff4e8;
}

.bg-blob {
  position: fixed;
  border-radius: 999px;
  z-index: -1;
  filter: blur(2px);
  opacity: 0.45;
  animation: drift 8s ease-in-out infinite;
}

.blob-1 {
  width: 180px;
  height: 180px;
  background: #ff8a65;
  top: 80px;
  left: -40px;
}

.blob-2 {
  width: 220px;
  height: 220px;
  background: #26c6da;
  top: 260px;
  right: -60px;
  animation-delay: 0.9s;
}

.blob-3 {
  width: 160px;
  height: 160px;
  background: #ffd54f;
  bottom: 40px;
  left: 40%;
  animation-delay: 1.5s;
}

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

@keyframes drift {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.04); }
}

.result-box {
  text-align: center;
}

.type-code {
  font-size: 2rem;
  font-weight: 800;
  color: #ffbe98;
}

.insta-canvas {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  margin-top: 8px;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 138, 101, 0.28) 0%, rgba(20, 34, 54, 0.92) 55%, rgba(38, 198, 218, 0.24) 100%);
}

.type-tag {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 184, 140, 0.28);
  color: #ffd9bb;
  font-weight: 700;
  font-size: 0.82rem;
}

.sparkles {
  margin-top: 6px;
  font-size: 1.2rem;
  animation: floaty 2.2s ease-in-out infinite;
}

.meter-grid {
  display: grid;
  gap: 10px;
}

.meter-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px;
}

.meter-title {
  font-size: 0.9rem;
  color: #ffd1b1;
  font-weight: 700;
}

.meter-track {
  margin-top: 6px;
  height: 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff8a65 0%, #26c6da 100%);
}

.meter-num {
  margin-top: 4px;
  text-align: right;
  color: #b7c7da;
  font-size: 0.85rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.style-chip {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 138, 101, 0.18) 0%, rgba(38, 198, 218, 0.16) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff0e0;
  font-weight: 700;
  font-size: 0.85rem;
}

ul {
  padding-left: 18px;
}

.portal-shell {
  padding: 36px 0 40px;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.portal-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: rgba(10, 19, 33, 0.72);
  border: 1px solid rgba(255, 184, 140, 0.2);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.portal-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 184, 140, 0.48);
}

.portal-card h2 {
  margin: 10px 0 6px;
  font-size: 1.15rem;
}

.portal-card p {
  margin: 0;
  color: #b8c2d4;
  font-size: 0.94rem;
}

.portal-emoji {
  font-size: 1.8rem;
}

@media (max-width: 640px) {
  .quiz-single,
  .image-row,
  .share-row,
  .nav-row {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .quiz-single {
    display: grid;
  }

  .top-links,
  .footer-links {
    flex-direction: column;
  }
}
