/* ===================================
   RAY 視覺設計應用課程探索 — style.css
   =================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #7C3AED;
  --primary-light: #A78BFA;
  --secondary: #06B6D4;
  --accent: #F59E0B;
  --success: #10B981;
  --danger: #F43F5E;
  --bg-dark: #0F0C24;
  --bg-card: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --font: 'Nunito', sans-serif;
  --radius: 20px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

html,
body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text);
  overflow: hidden;
}

#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

/* ============================
   SCREENS
   ============================ */
.screen {
  display: none;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.screen.slide-in {
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================
   WELCOME
   ============================ */
.welcome-bg-glow {
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.3) 0%, transparent 70%);
  pointer-events: none;
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {

  0%,
  100% {
    opacity: .6;
    transform: translateX(-50%) scale(1);
  }

  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.08);
  }
}

.welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem 3rem;
  gap: .9rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.badge-tag {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: .3rem 1rem;
  border-radius: 30px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.5);
}

.title-main {
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  font-weight: 900;
  line-height: 1.15;
  color: #fff;
}

.gradient-text {
  background: linear-gradient(135deg, #A78BFA, #06B6D4, #F59E0B);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-muted);
  font-size: .95rem;
  font-weight: 600;
}

.ray-container {
  position: relative;
}

.ray-img {
  width: 120px;
  filter: drop-shadow(0 0 20px rgba(167, 139, 250, .7));
}

.ray-speech-bubble {
  position: absolute;
  top: -24px;
  right: -65px;
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 16px 16px 16px 4px;
  padding: .6rem .9rem;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
  max-width: 155px;
  line-height: 1.45;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
  text-align: left;
  white-space: pre-line;
}

.cursor {
  animation: blink .8s step-end infinite;
  color: var(--primary-light);
}

@keyframes blink {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0
  }
}

.btn-start {
  background: linear-gradient(135deg, var(--primary), #5B21B6);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 1rem 2.5rem;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font);
  cursor: pointer;
  transition: transform .15s;
  letter-spacing: .02em;
}

.btn-start:active {
  transform: scale(.95);
}

.glow-pulse {
  animation: glow-btn 2s ease-in-out infinite;
}

@keyframes glow-btn {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(124, 58, 237, .6), 0 8px 25px rgba(124, 58, 237, .4);
  }

  50% {
    box-shadow: 0 0 0 14px rgba(124, 58, 237, 0), 0 8px 35px rgba(124, 58, 237, .6);
  }
}

.stars-decoration {
  font-size: 1.2rem;
  letter-spacing: .4rem;
  opacity: .5;
}

/* ============================
   SCREEN INNER / QUESTIONS
   ============================ */
.screen-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  gap: 1rem;
  justify-content: center;
}

.ray-guide-bar {
  display: flex;
  align-items: flex-end;
  gap: .75rem;
  width: 100%;
  padding: 0 .5rem;
}

.ray-small {
  width: 60px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(167, 139, 250, .6));
}

.guide-bubble {
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 14px 14px 14px 4px;
  padding: .65rem .9rem;
  font-size: .86rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.5;
  flex: 1;
  box-shadow: var(--shadow);
}

/* Question card */
.question-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.1rem;
  width: 100%;
  box-shadow: var(--shadow);
}

.q-number {
  font-size: .7rem;
  font-weight: 800;
  color: var(--primary-light);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .4rem;
}

.q-text {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 1rem;
  color: #fff;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
}

.option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  background: rgba(255, 255, 255, .05);
  border: 2px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  padding: .9rem .5rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s cubic-bezier(.34, 1.56, .64, 1);
  text-align: center;
  line-height: 1.3;
}

.option-btn small {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.7rem;
}

.option-btn .opt-icon {
  font-size: 1.8rem;
}

.option-btn:hover {
  border-color: var(--primary-light);
  background: rgba(124, 58, 237, .15);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 20px rgba(124, 58, 237, .3);
}

.option-btn:active {
  transform: scale(.95);
}

.option-btn.selected {
  border-color: var(--primary-light);
  background: linear-gradient(135deg, rgba(124, 58, 237, .3), rgba(6, 182, 212, .2));
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .3), 0 8px 24px rgba(124, 58, 237, .3);
}

/* Back button */
.back-row {
  width: 100%;
  display: flex;
  justify-content: center;
}

.btn-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  padding: .4rem .8rem;
  border-radius: 20px;
  transition: all .2s;
  border: 1px solid transparent;
}

.btn-back:hover {
  color: var(--primary-light);
  border-color: rgba(167, 139, 250, .3);
  background: rgba(167, 139, 250, .08);
}

/* Progress bar */
.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, .1);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 100px;
  transition: width .5s cubic-bezier(.34, 1.56, .64, 1);
  box-shadow: 0 0 8px var(--primary-light);
}

/* Name form */
.card-form {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.1rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  box-shadow: var(--shadow);
}

.form-label {
  font-size: .78rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.form-input {
  background: rgba(255, 255, 255, .08);
  border: 2px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  padding: .85rem .95rem;
  color: #fff;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  outline: none;
  transition: border-color .2s;
  width: 100%;
}

.form-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .2);
}

.form-input::placeholder {
  color: rgba(255, 255, 255, .25);
}

.btn-next {
  background: linear-gradient(135deg, var(--primary), #5B21B6);
  color: white;
  border: none;
  border-radius: 12px;
  padding: .9rem;
  font-size: 1rem;
  font-weight: 800;
  font-family: var(--font);
  cursor: pointer;
  transition: transform .15s;
  letter-spacing: .02em;
}

.btn-next:active {
  transform: scale(.96);
}

/* ============================
   RESULT SCREEN
   ============================ */
.result-screen {
  justify-content: flex-start;
  padding-top: 1.5rem;
}

.result-ray-wrap {
  display: flex;
  align-items: flex-end;
  gap: .75rem;
  width: 100%;
  padding: 0 .5rem;
}

.ray-result {
  width: 75px;
  filter: drop-shadow(0 0 14px rgba(167, 139, 250, .8));
}

.result-speech {
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 14px 14px 14px 4px;
  padding: .7rem 1rem;
  font-size: .88rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.55;
  flex: 1;
  box-shadow: var(--shadow);
}

.result-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.2rem;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}

.result-badge {
  font-size: 2.8rem;
  margin-bottom: .4rem;
}

.result-desc {
  font-size: .92rem;
  color: var(--text);
  font-weight: 700;
  line-height: 1.65;
}

.bridge-card {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  align-items: center;
}

.bridge-text {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.65;
  text-align: center;
}

.btn-reviews {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #000;
  border: none;
  border-radius: 50px;
  padding: .85rem 2rem;
  font-size: .95rem;
  font-weight: 800;
  font-family: var(--font);
  cursor: pointer;
  transition: transform .15s;
  box-shadow: 0 6px 20px rgba(245, 158, 11, .4);
  letter-spacing: .02em;
}

.btn-reviews:active {
  transform: scale(.96);
}

/* ============================
   REVIEWS SCREEN
   ============================ */
#screen-reviews {
  display: none;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
}

#screen-reviews.active {
  display: flex;
}

.reviews-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 12, 36, .85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1rem;
  flex-shrink: 0;
}

.btn-back-top {
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: .82rem;
  font-weight: 700;
  border-radius: 20px;
  padding: .35rem .9rem;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}

.btn-back-top:hover {
  background: rgba(255, 255, 255, .15);
  color: #fff;
}

.reviews-title-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.ray-tiny {
  width: 32px;
  filter: drop-shadow(0 0 6px rgba(167, 139, 250, .7));
}

.reviews-title {
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
}

/* Masonry / waterfall for desktop */
.reviews-container {
  width: 100%;
  padding: 1.2rem 1rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  /* Mobile: single column */
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

/* Card */
.review-card {
  border-radius: 16px;
  padding: 1.1rem 1.1rem .9rem;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  border: 1px solid rgba(255, 255, 255, .12);
  position: relative;
  overflow: hidden;
}

.review-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}

/* Color variants */
.card-c0 {
  background: linear-gradient(135deg, rgba(124, 58, 237, .18), rgba(124, 58, 237, .06));
}

.card-c1 {
  background: linear-gradient(135deg, rgba(6, 182, 212, .18), rgba(6, 182, 212, .06));
}

.card-c2 {
  background: linear-gradient(135deg, rgba(245, 158, 11, .18), rgba(245, 158, 11, .06));
}

.card-c3 {
  background: linear-gradient(135deg, rgba(16, 185, 129, .18), rgba(16, 185, 129, .06));
}

.card-c4 {
  background: linear-gradient(135deg, rgba(244, 63, 94, .18), rgba(244, 63, 94, .06));
}

.card-c5 {
  background: linear-gradient(135deg, rgba(167, 139, 250, .18), rgba(167, 139, 250, .06));
}

.card-color-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
}

.bar-c0 {
  background: var(--primary);
}

.bar-c1 {
  background: var(--secondary);
}

.bar-c2 {
  background: var(--accent);
}

.bar-c3 {
  background: var(--success);
}

.bar-c4 {
  background: var(--danger);
}

.bar-c5 {
  background: var(--primary-light);
}

.review-quote-mark {
  font-size: 2rem;
  line-height: 1;
  color: rgba(255, 255, 255, .15);
  font-family: Georgia, serif;
}

.review-preview {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.75;
  margin: .2rem 0 .5rem;
}

.review-full {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.75;
  margin: .2rem 0 .5rem;
  display: none;
}

.review-expand-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--primary-light);
  cursor: pointer;
  padding: .65rem 0;
  min-height: 44px;
  letter-spacing: .03em;
  transition: color .2s;
  text-align: left;
}

.review-expand-btn:hover {
  color: #fff;
}

.review-card.expanded .review-preview {
  display: none;
}

.review-card.expanded .review-full {
  display: block;
}

.review-label {
  display: inline-block;
  font-size: .65rem;
  font-weight: 800;
  color: rgba(255, 255, 255, .4);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .35rem;
}

/* All-read card */
.reviews-footer {
  padding: 0 1rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.all-read-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, .2), rgba(16, 185, 129, .15));
  border: 1px solid rgba(245, 158, 11, .3);
  border-radius: var(--radius);
  padding: 1.4rem 1.2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
}

.all-read-icon {
  font-size: 2.5rem;
}

.all-read-card p {
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.65;
}

/* ============================
   DESKTOP MASONRY
   ============================ */
@media (min-width: 640px) {
  .reviews-container {
    display: block;
    columns: 2;
    column-gap: 1rem;
  }

  .review-card {
    break-inside: avoid;
    margin-bottom: 1rem;
    display: inline-block;
    width: 100%;
  }
}

@media (min-width: 960px) {
  .reviews-container {
    columns: 3;
  }
}

/* ============================
   MISC ANIMATIONS
   ============================ */
.bounce {
  animation: bounce 2s infinite;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-10px)
  }
}

.bounce-small {
  animation: bounce-s 2.5s infinite;
}

@keyframes bounce-s {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-6px)
  }
}

.tada {
  animation: tadaAnim 1s both;
}

@keyframes tadaAnim {
  0% {
    transform: scale(1)
  }

  10%,
  20% {
    transform: scale(.9) rotate(-3deg)
  }

  30%,
  50%,
  70%,
  90% {
    transform: scale(1.1) rotate(3deg)
  }

  40%,
  60%,
  80% {
    transform: scale(1.1) rotate(-3deg)
  }

  100% {
    transform: scale(1) rotate(0)
  }
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .15);
  border-radius: 99px;
}