* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans TC", "PingFang TC", sans-serif;
  color: #1a0a00;
  min-height: 100vh;
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 30%, #ffcc80 60%, #ffb74d 100%);
}

/* 背景裝飾光暈 */
.starfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.starfield::before,
.starfield::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}

.starfield::before {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #ff9800 0%, #ff5722 60%, transparent 100%);
  top: -120px;
  right: -100px;
  animation: blobFloat 8s ease-in-out infinite alternate;
}

.starfield::after {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #ffd740 0%, #ff9800 60%, transparent 100%);
  bottom: -100px;
  left: -80px;
  animation: blobFloat 10s ease-in-out infinite alternate-reverse;
}

@keyframes blobFloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, 20px) scale(1.08); }
}

/* 浮動彩色泡泡裝飾 */
.starfield .bubble {
  position: absolute;
  border-radius: 50%;
  opacity: 0.18;
  animation: bubbleRise linear infinite;
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  position: relative;
}

/* ===== Card ===== */
.card {
  width: min(860px, 100%);
  background: rgba(255, 255, 255, 0.72);
  border: 1.5px solid rgba(255, 153, 0, 0.25);
  border-radius: 24px;
  padding: 36px 32px;
  backdrop-filter: blur(16px);
  box-shadow:
    0 8px 32px rgba(255, 100, 0, 0.12),
    0 2px 8px rgba(255, 152, 0, 0.08);
  position: relative;
  overflow: hidden;
}

/* 卡片頂部橘色光條 */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ff6d00, #ff9800, #ffd740, #ff9800, #ff6d00);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.hidden { display: none; }
.visible { display: block; }

/* ===== Badge ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(120deg, #ff6d00, #ff9800);
  color: #fff;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  box-shadow: 0 2px 10px rgba(255, 100, 0, 0.3);
}

h1 {
  font-size: 2rem;
  margin: 14px 0 10px;
  background: linear-gradient(120deg, #e64a00, #ff9800, #e65100);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
}

h2 {
  font-size: 1.4rem;
  margin: 10px 0 14px;
  color: #bf360c;
}

h3 {
  margin: 16px 0 8px;
  color: #e64a00;
  font-size: 1rem;
  letter-spacing: 0.3px;
}

p { line-height: 1.8; color: #4a2500; }

/* ===== Buttons ===== */
.btn-primary, .btn-secondary {
  border: none;
  border-radius: 14px;
  padding: 13px 22px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: linear-gradient(120deg, #ff6d00, #ff9800 60%, #ffb300);
  color: #fff;
  box-shadow: 0 4px 18px rgba(255, 109, 0, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 28px rgba(255, 109, 0, 0.5);
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  background: #fff;
  color: #e64a00;
  border: 2px solid #ff9800;
  box-shadow: 0 2px 10px rgba(255, 152, 0, 0.15);
}

.btn-secondary:hover {
  background: #fff3e0;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.25);
}

/* ===== Landing section ===== */
#landing h1 {
  font-size: 1.9rem;
}

#landing > p {
  font-size: 1.05rem;
  color: #6d3300;
  margin-bottom: 28px;
}

/* ===== Progress / TopBar ===== */
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #bf360c;
}

.progress-wrap {
  margin: 12px 0 22px;
  background: rgba(255, 152, 0, 0.15);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff6d00, #ffb300);
  transition: width 0.3s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 8px rgba(255, 109, 0, 0.5);
}

/* ===== Question ===== */
#questionCategory {
  font-size: 1rem;
  color: #ff6d00;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.question {
  font-size: 1.35rem;
  line-height: 1.55;
  margin-bottom: 24px;
  color: #1a0a00;
  font-weight: 500;
}

/* ===== Scale Info ===== */
.scale-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 10px;
  color: #a35800;
  font-weight: 500;
}

/* ===== Options ===== */
.options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.option-btn {
  padding: 16px 8px;
  border-radius: 14px;
  border: 2px solid rgba(255, 152, 0, 0.3);
  background: rgba(255, 255, 255, 0.7);
  color: #5a2500;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}

.option-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #ff6d00, #ffb300);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.option-btn span {
  position: relative;
  z-index: 1;
}

.option-btn:hover {
  border-color: #ff9800;
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 6px 18px rgba(255, 109, 0, 0.25);
}

.option-btn:hover::before {
  opacity: 1;
}

.option-btn:hover {
  color: #fff;
}

.option-btn:active {
  transform: scale(0.97);
}

/* ===== Energy Burst ===== */
.energy-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.spark {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffb300 50%, #ff6d0000 100%);
  animation: spark 700ms ease-out forwards;
}

@keyframes spark {
  from { transform: translate(0,0) scale(1); opacity: 0.9; }
  to   { transform: translate(var(--tx), var(--ty)) scale(0.2); opacity: 0; }
}

/* ===== Report Card ===== */
.report-card {
  background: linear-gradient(160deg, #fff8f0, #fff3e0 55%, #ffe0b2);
  border-radius: 18px;
  padding: 24px;
  border: 1.5px solid rgba(255, 152, 0, 0.35);
  box-shadow: 0 4px 20px rgba(255, 100, 0, 0.1);
}

.report-card h3 {
  display: flex;
  align-items: center;
  gap: 6px;
}

.report-card ul {
  padding-left: 20px;
  color: #4a2500;
  line-height: 2;
}

.score {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 6px 0 14px;
  background: linear-gradient(120deg, #e64a00, #ff9800);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 243, 224, 0.88);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  text-align: center;
}

.loading-overlay.hidden {
  display: none;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeIn 0.3s ease;
}

.loader-rocket {
  font-size: 64px;
  animation: rocketFly 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(255, 150, 0, 1));
}

.loader-content p {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: 2px;
  background: linear-gradient(120deg, #e64a00, #ff9800);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.loader-content .small {
  font-size: 0.9rem;
  opacity: 0.7;
  font-weight: 400;
  -webkit-text-fill-color: #a35800;
}

/* 載入動畫進度條 */
.loader-bar-wrap {
  width: 200px;
  height: 6px;
  background: rgba(255, 152, 0, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

.loader-bar {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #ff6d00, #ffb300);
  border-radius: 999px;
  animation: loaderSlide 1.2s ease-in-out infinite alternate;
}

@keyframes loaderSlide {
  from { transform: translateX(-60%); }
  to   { transform: translateX(250%); }
}

@keyframes rocketFly {
  0%   { transform: translateY(8px) rotate(45deg) scale(1); }
  50%  { transform: translateY(-28px) rotate(45deg) scale(1.08); }
  100% { transform: translateY(8px) rotate(45deg) scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* ===== 趣味標籤 ===== */
.fun-tag {
  display: inline-block;
  background: linear-gradient(120deg, #ff9800, #ffb300);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}

/* ===== RWD ===== */
@media (max-width: 640px) {
  .card { padding: 24px 16px; }
  h1 { font-size: 1.5rem; }
  .question { font-size: 1.1rem; }
  .options { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .option-btn { padding: 12px 4px; font-size: 15px; }
}

/* ===== Page chrome styles (formerly inline in game.php) ===== */
.game-header {
  max-width: 860px;
  margin: 40px auto 0 auto;
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
}

.game-breadcrumb {
  font-size: 0.95rem;
  color: #5d4037;
  /* Muted brown to match the orange theme */
  margin-bottom: 8px;
}

.game-breadcrumb a {
  color: #5d4037;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.game-breadcrumb a:hover {
  color: #ff6d00;
}

.game-title {
  font-size: 2.2rem;
  color: #000000;
  font-family: 'Noto Serif TC', serif;
  font-weight: 800;
  margin: 0;
  text-align: center;
  background: none !important;
  -webkit-text-fill-color: initial !important;
  background-clip: initial !important;
}

.app {
  min-height: auto !important;
  padding-top: 20px !important;
}

@media (max-width: 768px) {
  .game-header {
    margin: 20px auto 0 auto;
  }
}
