:root {
  --bg: #0f0f13;
  --surface: #1a1a22;
  --surface-hover: #22222e;
  --accent: #ff4757;
  --accent2: #ffa502;
  --text: #e8e8f0;
  --text-muted: #888899;
  --border: #2a2a3a;
  --radius: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang TC', 'Microsoft JhengHei', system-ui, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
  margin-bottom: 40px;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent);
}

/* Topics Grid */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding-bottom: 60px;
}

.topic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: all 0.2s ease;
}

.topic-card:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 71, 87, 0.15);
}

.topic-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 10px 0 8px;
  line-height: 1.4;
}

.topic-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Category Badge */
.category-badge {
  display: inline-block;
  background: rgba(255, 71, 87, 0.12);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid rgba(255, 71, 87, 0.3);
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 99px;
}

/* Topic Article */
.topic-article {
  padding: 20px 0 20px;
}

.topic-article h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 12px 0 8px;
  line-height: 1.3;
}

.topic-article .subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 30px;
}

.opinion-box {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px;
  margin: 24px 0;
  font-size: 1.05rem;
  line-height: 1.9;
}

/* Comments */
.comments-section {
  margin: 40px 0 60px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.comments-section h3 {
  font-size: 1.1rem;
  margin-bottom: 24px;
  color: var(--text-muted);
}

.comments-placeholder {
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  font-size: 0.95rem;
}

/* ===== Quiz ===== */
.quiz-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: 60px;
}

.quiz-screen {
  text-align: center;
  animation: fadeIn 0.35s ease;
}

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

.quiz-emoji {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 16px;
}

.result-flag {
  width: 110px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ===== 首頁分區與分類篩選 ===== */
.section-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 8px 0 18px;
}

.plays-section {
  margin-bottom: 48px;
}

.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 8px 20px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.filter-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
}

.plays-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.play-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
}

.play-card:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 71, 87, 0.15);
}

.play-card.featured {
  background: linear-gradient(135deg, rgba(0, 200, 120, 0.12), rgba(255, 215, 0, 0.1));
  border-color: rgba(0, 200, 120, 0.4);
}

.play-emoji {
  font-size: 2.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.play-body {
  flex: 1;
  min-width: 0;
}

.play-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 8px 0 4px;
  line-height: 1.4;
}

.play-body p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.play-card .arrow {
  color: var(--accent);
  font-size: 1.3rem;
  flex-shrink: 0;
}

/* ===== 猜國旗遊戲 ===== */
.flag-display {
  display: flex;
  justify-content: center;
  margin: 12px 0 8px;
}

.game-flag {
  width: 240px;
  max-width: 80%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.option-btn.correct {
  border-color: #00c878;
  background: rgba(0, 200, 120, 0.18);
  color: #fff;
}

.option-btn.wrong {
  border-color: var(--accent);
  background: rgba(255, 71, 87, 0.18);
  color: #fff;
}

#result-score {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.6rem;
}

/* ===== 猜比分養怪獸 ===== */
.game-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: 60px;
}

.game-heading {
  font-size: 1.8rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
}

.game-intro {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.7;
}

.monster-panel {
  background: linear-gradient(135deg, rgba(0, 200, 120, 0.1), rgba(255, 165, 2, 0.08));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  margin-bottom: 40px;
}

.monster-emoji {
  font-size: 4.5rem;
  line-height: 1;
  margin-bottom: 8px;
  transition: transform 0.3s ease;
}

.monster-panel:hover .monster-emoji {
  transform: scale(1.08);
}

.monster-stage {
  font-size: 1.4rem;
  font-weight: 800;
}

.monster-food {
  color: var(--accent2);
  font-weight: 700;
  margin: 4px 0 14px;
}

/* 達標解鎖獎勵 */
.reward-box {
  margin-bottom: 40px;
}

.reward-locked {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.reward-unlocked {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(255, 71, 87, 0.14), rgba(255, 165, 2, 0.14));
  border: 1px solid rgba(255, 165, 2, 0.45);
  border-radius: var(--radius);
  padding: 18px 20px;
  flex-wrap: wrap;
}

.reward-emoji {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.reward-text {
  flex: 1;
  min-width: 0;
}

.reward-text h3 {
  font-size: 1.05rem;
  font-weight: 800;
}

.reward-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.reward-unlocked .btn-primary {
  margin-top: 0;
  padding: 10px 22px;
  font-size: 0.9rem;
}

.reward-soon {
  color: var(--accent2);
  font-weight: 700;
  font-size: 0.9rem;
}

.matches-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.match-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.match-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.match-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.team {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.95rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.team:last-child {
  justify-content: flex-end;
}

.team-flag {
  width: 28px;
  height: auto;
  border-radius: 3px;
  flex-shrink: 0;
}

.score-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.score-input {
  width: 48px;
  padding: 8px;
  font-size: 1.1rem;
  font-family: inherit;
  text-align: center;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.score-input:focus {
  outline: none;
  border-color: var(--accent);
}

.colon {
  font-weight: 700;
  color: var(--text-muted);
}

.final-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.score-final {
  font-size: 1.3rem;
  font-weight: 800;
  flex-shrink: 0;
}

.match-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.match-action .btn-primary {
  margin-top: 0;
  padding: 8px 18px;
  font-size: 0.85rem;
}

.pred-note {
  font-size: 0.82rem;
  color: var(--accent2);
}

.pred-note.muted {
  color: var(--text-muted);
}

.result-badge {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
}

.result-badge.exact {
  color: #00e08a;
  background: rgba(0, 200, 120, 0.15);
}

.result-badge.outcome {
  color: var(--accent2);
  background: rgba(255, 165, 2, 0.15);
}

.result-badge.miss {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
}

.quiz-screen h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 10px;
  line-height: 1.3;
}

/* Buttons */
.btn-primary,
.btn-secondary {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 99px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  margin-top: 24px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 71, 87, 0.35);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

/* Progress */
.progress-bar {
  height: 8px;
  background: var(--surface);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  transition: width 0.3s ease;
}

.progress-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 28px;
}

.question-text {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 32px;
  line-height: 1.5;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.option-btn {
  font-family: inherit;
  font-size: 1.05rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 24px;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
}

.option-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateX(4px);
}

/* Result */
.result-label {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

#result-title {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.2rem;
}

.result-desc {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.9;
  margin: 20px auto 8px;
  max-width: 520px;
  background: var(--surface);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.result-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}

.result-actions .btn-primary,
.result-actions .btn-secondary {
  margin-top: 0;
}

/* Quiz entry card on homepage */
.quiz-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(255,71,87,0.12), rgba(255,165,2,0.12));
  border: 1px solid rgba(255,71,87,0.3);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-decoration: none;
  color: var(--text);
  margin-bottom: 32px;
  transition: all 0.2s ease;
}

.quiz-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 71, 87, 0.18);
}

.quiz-banner .quiz-banner-emoji {
  font-size: 2.4rem;
  line-height: 1;
}

.quiz-banner h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.quiz-banner p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.quiz-banner .arrow {
  margin-left: auto;
  color: var(--accent);
  font-size: 1.4rem;
}

/* 世界盃特輯：較搶眼的金綠漸層邊框 */
.quiz-banner-hot {
  background: linear-gradient(135deg, rgba(0, 200, 120, 0.15), rgba(255, 215, 0, 0.12));
  border-color: rgba(0, 200, 120, 0.45);
}

.quiz-banner-hot:hover {
  box-shadow: 0 8px 24px rgba(0, 200, 120, 0.22);
}

.hot-tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
  padding: 2px 8px;
  border-radius: 99px;
  color: #fff;
  background: linear-gradient(135deg, #00c878, #ffd700);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 600px) {
  .topic-article h1 {
    font-size: 1.4rem;
  }

  .topics-grid {
    grid-template-columns: 1fr;
  }
}
