/* 閱讀尋寶隊：叢林綠、樹皮棕、陽光黃與河水藍的尋寶地圖主題。 */
:root {
  --bg: #f4e7c8;
  --bg-2: #e7d2a4;
  --ink: #22301f;
  --muted: #6d5a3d;
  --accent: #f2c14e;
  --accent-2: #2f6b4f;
  --accent-3: #5aa9e6;
  --good: #2c8a5b;
  --bad: #bf4a35;
  --card: #fffaf0;
  --line: #3a2a1c;
  --line-soft: rgba(58, 42, 28, 0.18);
  --bark: #6b4a2f;
  --leaf: #3f7d4f;
  --river: #5aa9e6;
  --sun: #f2c14e;
  --shadow: 0 7px 0 rgba(58, 42, 28, 0.18), 0 18px 38px rgba(58, 42, 28, 0.14);
  --shadow-sm: 0 4px 0 rgba(58, 42, 28, 0.18);
  --radius: 24px;
  --radius-sm: 16px;
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 8% 4%, rgba(242, 193, 78, 0.3) 0, transparent 25%),
    radial-gradient(circle at 92% 12%, rgba(90, 169, 230, 0.18) 0, transparent 24%),
    radial-gradient(ellipse at 8% 78%, rgba(47, 107, 79, 0.12) 0, transparent 20%),
    radial-gradient(ellipse at 88% 82%, rgba(47, 107, 79, 0.1) 0, transparent 22%),
    repeating-linear-gradient(0deg, rgba(107, 74, 47, 0.045) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(90deg, rgba(107, 74, 47, 0.03) 0 1px, transparent 1px 26px),
    radial-gradient(rgba(58, 42, 28, 0.08) 1px, transparent 1px);
  background-size: auto, auto, auto, auto, auto, auto, 16px 16px;
}

h1, h2, h3, .brand-name, .btn, .level-name {
  letter-spacing: 0.03em;
}

/* ---------- 頂欄：樹皮與營地木牌 ---------- */
.topbar {
  background:
    repeating-linear-gradient(90deg, rgba(255, 250, 240, 0.06) 0 12px, transparent 12px 24px),
    linear-gradient(180deg, #1b4232, #14342b 58%, #0f2a22);
  border-bottom: 4px solid #0b211a;
  box-shadow: 0 4px 0 rgba(242, 193, 78, 0.32);
  color: #fff8e6;
}

.brand-name {
  color: #fff8e6;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
}

.brand-dot {
  border-color: #0b211a;
  background: var(--sun);
  box-shadow: 0 0 0 3px rgba(242, 193, 78, 0.2);
}

.icon-btn {
  border-color: #0b211a;
  background: #fff4d8;
  color: #22301f;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.28);
}

.icon-btn:hover {
  background: var(--sun);
}

.icon-btn svg {
  fill: #22301f;
}

.icon-btn svg.stroke,
.icon-btn svg path.stroke,
.icon-btn svg circle.hole {
  stroke: #22301f;
}

.icon-btn svg circle.hole {
  fill: #fff4d8;
}

/* ---------- 首頁：尋寶地圖 ---------- */
.hero {
  position: relative;
  margin-top: 8px;
  padding: clamp(18px, 3vw, 34px);
  border: 3px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(90deg, rgba(255, 244, 217, 0.98) 0 54%, rgba(255, 244, 217, 0.7) 76%, rgba(255, 244, 217, 0.45) 100%),
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.8), transparent 28%),
    radial-gradient(circle at 85% 80%, rgba(90, 169, 230, 0.12), transparent 32%),
    repeating-linear-gradient(0deg, rgba(107, 74, 47, 0.05) 0 1px, transparent 1px 22px),
    url("../assets/img/hero.webp") center right / cover no-repeat,
    #fff4d9;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  border: 3px dashed rgba(47, 107, 79, 0.42);
  border-radius: 50%;
  pointer-events: none;
}

.hero::before {
  left: -70px;
  bottom: -90px;
}

.hero::after {
  right: -50px;
  top: -80px;
  width: 170px;
  height: 170px;
  border-color: rgba(90, 169, 230, 0.45);
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--line-soft);
  letter-spacing: 0.12em;
}

.hero .eyebrow::before {
  content: "🌿";
}

.hero-title {
  color: #14342b;
  text-shadow: 3px 3px 0 rgba(242, 193, 78, 0.6);
}

.hero-desc {
  color: #5a452c;
}

.hero-meta {
  display: inline-block;
  padding: 6px 13px;
  border: 2px dashed rgba(58, 42, 28, 0.32);
  border-radius: 12px;
  background: rgba(255, 250, 240, 0.72);
}

.hero-blob {
  border: 3px solid var(--line);
  background:
    radial-gradient(circle at 32% 24%, #fff 0, transparent 34%),
    radial-gradient(circle at 70% 70%, rgba(90, 169, 230, 0.45), transparent 36%),
    linear-gradient(145deg, #9ed08a, #2f6b4f 72%);
  box-shadow: var(--shadow);
  transform: rotate(-4deg);
}

.hero-blob::before {
  content: "";
  position: absolute;
  inset: 14%;
  border: 3px dashed rgba(255, 248, 230, 0.7);
  border-radius: 48% 52% 44% 56% / 55% 46% 54% 45%;
}

.hero-art img {
  filter: drop-shadow(0 18px 14px rgba(58, 42, 28, 0.22));
}

.hero-sticker {
  border: 3px solid #2a1b10;
  background: #f7e4b0;
  color: #3a2611;
  font-family: var(--font-body);
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow: 5px 5px 0 rgba(58, 42, 28, 0.24);
}

.howto {
  position: relative;
  border-color: #49301c;
  background:
    linear-gradient(90deg, rgba(242, 193, 78, 0.12), transparent 24%),
    #fff8e8;
  overflow: hidden;
}

.howto::before {
  content: "🧭";
  position: absolute;
  right: 18px;
  top: 12px;
  font-size: 42px;
  opacity: 0.5;
  transform: rotate(-8deg);
}

.howto-list li {
  position: relative;
  padding-left: 30px;
  font-weight: 700;
}

.howto-list li::before {
  content: "🍃";
  position: absolute;
  left: 0;
  top: 0;
}

.howto-tip {
  padding-top: 10px;
  border-top: 2px dashed rgba(58, 42, 28, 0.22);
  font-weight: 700;
}

/* ---------- 關卡地圖 ---------- */
.screen-head .eyebrow {
  color: #2f6b4f;
}

.level-grid {
  gap: 16px;
}

.level-card {
  position: relative;
  overflow: hidden;
  border: 3px solid #3a2a1c;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.75), transparent 48%),
    #fff6de;
  box-shadow: 0 6px 0 #c7ab74, 0 14px 26px rgba(58, 42, 28, 0.16);
}

.level-card::before {
  content: "";
  position: absolute;
  right: -20px;
  top: -26px;
  width: 74px;
  height: 74px;
  border-radius: 0 0 0 100%;
  background: rgba(47, 107, 79, 0.16);
  transform: rotate(18deg);
}

.level-card:nth-child(3n + 2) {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), transparent 48%),
    #fdf0cf;
}

.level-card:nth-child(3n + 3) {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), transparent 48%),
    #f3eed4;
}

.level-card:not(:disabled):hover {
  transform: translateY(-4px) rotate(-0.6deg);
  box-shadow: 0 10px 0 #c7ab74, 0 20px 30px rgba(58, 42, 28, 0.2);
}

.level-card[data-current="true"] {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), transparent 46%),
    #ffe6a3;
  box-shadow: 0 6px 0 #d2a33c, 0 0 0 5px rgba(242, 193, 78, 0.24);
}

.level-num {
  padding: 2px 9px;
  border: 2px solid #3a2a1c;
  border-radius: 9px;
  background: #2f6b4f;
  color: #fff8e6;
  font-size: 12px;
  letter-spacing: 0.1em;
}

.level-name {
  color: #1f3d2b;
}

.level-goal {
  color: #6d5a3d;
}

.level-stars {
  color: #c7ab74;
}

.level-stars .on {
  color: #e0a21b;
  text-shadow: 0 1px 0 #6b4a2f;
}

.level-lock {
  filter: grayscale(0.2);
}

/* ---------- 遊戲進行 ---------- */
.play-top {
  position: relative;
  padding: 14px 18px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.6), transparent 52%),
    #efe0b8;
  box-shadow: var(--shadow-sm);
}

.play-kicker {
  display: inline-block;
  padding: 3px 10px;
  border: 2px solid #3a2a1c;
  border-radius: 8px;
  background: #2f6b4f;
  color: #fff8e6;
  font-weight: 900;
}

.play-title {
  color: #14342b;
}

.play-objective {
  color: #6d5a3d;
}

.hud-item {
  border-color: #3a2a1c;
  background: #fff8e8;
}

.hud-item strong {
  color: #2f6b4f;
}

.timer {
  border-color: #3a2a1c;
  background: #fff4d8;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.8), 0 3px 0 rgba(58, 42, 28, 0.18);
}

.timer-fill {
  background: linear-gradient(90deg, #2c8a5b, #f2c14e 54%, #e38b2c 82%, #bf4a35);
}

.timer-text {
  color: #2a1b10;
}

.q-progress .q-dot {
  background: rgba(58, 42, 28, 0.14);
}

.q-progress .q-dot.done {
  background: #2f6b4f;
}

.q-progress .q-dot.now {
  background: #e0a21b;
  box-shadow: 0 0 0 3px rgba(242, 193, 78, 0.3);
}

.question-host {
  position: relative;
  border-color: #3a2a1c;
  background:
    radial-gradient(circle at 6% 4%, rgba(255, 255, 255, 0.8), transparent 24%),
    repeating-linear-gradient(0deg, rgba(107, 74, 47, 0.035) 0 1px, transparent 1px 24px),
    #fffaf0;
  box-shadow: var(--shadow);
}

.question-host::before,
.question-host::after {
  content: "";
  position: absolute;
  width: 72px;
  height: 22px;
  background: rgba(242, 193, 78, 0.52);
  border: 1px solid rgba(58, 42, 28, 0.12);
  transform: rotate(-4deg);
  pointer-events: none;
}

.question-host::before {
  left: 22px;
  top: -10px;
}

.question-host::after {
  right: 22px;
  bottom: -10px;
  transform: rotate(3deg);
}

.rq-question-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.rq-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border: 2px solid #2a1b10;
  border-radius: 999px;
  background: #2f6b4f;
  color: #fff8e6;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.rq-type-badge::before {
  content: "🔎";
}

.rq-goal {
  padding: 4px 10px;
  border: 2px dashed rgba(58, 42, 28, 0.3);
  border-radius: 999px;
  color: #6d5a3d;
  font-size: 12px;
  font-weight: 700;
}

.rq-passage-card {
  position: relative;
  margin-bottom: 14px;
  padding: 12px 18px 14px;
  border: 2.5px solid #b08b52;
  border-radius: 18px;
  background:
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(107, 74, 47, 0.08) 30px 31px),
    #fff8e6;
  box-shadow: 0 4px 0 rgba(176, 139, 82, 0.25);
}

.rq-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.rq-tag {
  display: inline-block;
  padding: 2px 11px;
  border: 2px solid #3a2a1c;
  border-radius: 8px;
  background: #f2c14e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.rq-leaf-dots {
  display: flex;
  gap: 5px;
}

.rq-leaf-dots i {
  width: 9px;
  height: 9px;
  display: block;
  border-radius: 50% 0 50% 50%;
  background: #7fae6f;
  transform: rotate(45deg);
}

.rq-passage {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #332615;
  font-size: clamp(17px, 2.2vw, 20px);
  line-height: 1.95;
  white-space: pre-wrap;
}

.rq-clue {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 2px dashed #c08a2c;
  border-radius: 14px;
  background:
    linear-gradient(100deg, rgba(242, 193, 78, 0.62), rgba(242, 193, 78, 0.22));
}

.rq-clue-tag {
  flex: none;
  padding: 2px 8px;
  border-radius: 6px;
  background: #6b4a2f;
  color: #fff8e6;
  font-size: 12px;
  font-weight: 900;
}

.rq-clue-text {
  color: #3a2611;
  font-weight: 900;
  line-height: 1.7;
}

.rq-sentence-map {
  display: grid;
  gap: 7px;
  margin: 0 0 14px;
  padding: 11px;
  border: 2px dashed rgba(47, 107, 79, 0.45);
  border-radius: 14px;
  background: rgba(127, 174, 111, 0.1);
}

.rq-sentence-head,
.rq-events-head {
  margin: 0 0 2px;
  color: #2f6b4f;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.rq-sentence {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 7px 9px;
  border: 2px solid rgba(58, 42, 28, 0.22);
  border-radius: 10px;
  background: #fffaf0;
  box-shadow: 0 2px 0 rgba(58, 42, 28, 0.1);
}

.rq-sentence-num {
  padding: 2px 5px;
  border-radius: 999px;
  background: #2f6b4f;
  color: #fff8e6;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.rq-sentence-text {
  color: #332615;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
}

.rq-events {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 10px;
  border: 2px dashed rgba(47, 107, 79, 0.45);
  border-radius: 14px;
  background: rgba(127, 174, 111, 0.11);
}

.rq-event {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 2px solid #3a2a1c;
  border-radius: 10px;
  background: #fffaf0;
  box-shadow: 0 2px 0 rgba(58, 42, 28, 0.14);
  font-size: 13px;
  font-weight: 700;
}

.rq-events-head {
  flex-basis: 100%;
}

.rq-event-icon {
  font-size: 13px;
}

.rq-event-num {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2f6b4f;
  color: #fff8e6;
  font-size: 11px;
  font-weight: 900;
}

.rq-event-arrow {
  color: #2f6b4f;
  font-weight: 900;
}

.rq-table-wrap {
  margin: 0 0 14px;
  padding: 10px 12px 12px;
  border: 2.5px solid #b08b52;
  border-radius: 16px;
  background: #fff8e6;
}

.rq-table-caption {
  margin-bottom: 6px;
  color: #6d5a3d;
  font-size: 12px;
  font-weight: 900;
}

.rq-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 10px;
  font-size: 15px;
}

.rq-table th,
.rq-table td {
  padding: 7px 10px;
  border: 1.5px solid #c7ab74;
  text-align: left;
}

.rq-table .rq-th {
  background: #2f6b4f;
  color: #fff8e6;
  font-weight: 900;
}

.rq-table .rq-td {
  background: #fffdf5;
  font-weight: 700;
}

.rq-table tr:nth-child(even) .rq-td {
  background: #fdf3d9;
}

.rq-compass {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 12px;
  padding: 8px;
  border: 2px dashed rgba(58, 42, 28, 0.3);
  border-radius: 999px;
  background: rgba(90, 169, 230, 0.08);
}

.rq-compass-label {
  padding: 2px 4px;
  border-radius: 999px;
  background: #fffaf0;
  color: #2f6b4f;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.rq-compass-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid #2a1b10;
  border-radius: 50%;
  background: #f2c14e;
  color: #2a1b10;
  font-size: 12px;
  font-weight: 900;
  transform: translate(-50%, -50%);
}

.rq-prompt {
  margin-top: 4px;
  color: #1f3d2b;
}

.rq-read-gate {
  margin: 18px auto 0;
  width: min(100%, 360px);
  font-size: 17px;
}

.rq-keyhint {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 2px dashed rgba(58, 42, 28, 0.16);
  color: #7a684e;
  font-size: 12px;
}

.rq-choices {
  margin-top: 12px;
}

.rq-choice {
  justify-content: flex-start;
  text-align: left;
  border-color: #4a3320;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.8), transparent 52%),
    #fff8e8;
  box-shadow: 0 5px 0 #c7ab74;
}

.rq-choice:hover:not(:disabled) {
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.8), transparent 52%),
    #ffedb5;
  box-shadow: 0 7px 0 #c7ab74;
}

.rq-choice .key {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid #3a2a1c;
  border-radius: 50%;
  background: #f2c14e;
  color: #2a1b10;
  font-size: 12px;
  font-weight: 900;
}

.rq-choice-label {
  flex: 1;
}

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

.sixw-tile {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 112px;
  padding: 12px 8px;
  border-radius: 20px;
  text-align: center;
}

.sixw-tile .key {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 21px;
  height: 21px;
  font-size: 11px;
}

.sixw-icon {
  font-size: 28px;
  line-height: 1;
}

.sixw-label {
  color: #1f3d2b;
  font-size: clamp(18px, 2.6vw, 24px);
  font-weight: 900;
}

.sixw-hint {
  color: #7a684e;
  font-size: 12px;
  font-weight: 700;
}

.sixw-tile:hover:not(:disabled) {
  transform: translateY(-3px) rotate(-1deg);
}

.rq-choice.correct {
  background: #dff1df;
  border-color: #2c8a5b;
  box-shadow: 0 5px 0 #2c8a5b;
}

.rq-choice.wrong {
  background: #f8ded6;
  border-color: #bf4a35;
  box-shadow: 0 5px 0 #bf4a35;
}

/* ---------- 結果與回饋 ---------- */
.result-card {
  border-color: #3a2a1c;
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.85), transparent 28%),
    #fff6de;
}

.result-title {
  color: #14342b;
}

.stars .star {
  color: #d8c49a;
}

.stars .star.on {
  color: #e0a21b;
  text-shadow: 0 2px 0 #6b4a2f;
}

.result-stats div {
  border-color: rgba(58, 42, 28, 0.16);
  background: rgba(255, 250, 240, 0.76);
}

.result-stats strong {
  color: #2f6b4f;
}

.feedback-burst {
  border-color: #2a1b10;
  background:
    radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.8), transparent 34%),
    #fff6de;
  box-shadow: 0 8px 0 rgba(58, 42, 28, 0.2), 0 24px 50px rgba(58, 42, 28, 0.24);
}

.feedback-burst.bad {
  background:
    radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.8), transparent 34%),
    #f8ded6;
}

.feedback-text {
  color: #1f3d2b;
}

.feedback-explain {
  color: #6d5a3d;
}

body.flash-good::after,
body.flash-bad::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  animation: rq-flash 420ms ease-out both;
}

body.flash-good::after {
  background: radial-gradient(circle, rgba(44, 138, 91, 0.2), transparent 62%);
}

body.flash-bad::after {
  background: radial-gradient(circle, rgba(191, 74, 53, 0.16), transparent 62%);
}

@keyframes rq-flash {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* ---------- 頁尾與小元件 ---------- */
.site-footer {
  background: #14342b;
  color: #e8dcc2;
  border-top: 4px solid #0b211a;
}

.site-footer a {
  color: #f2c14e;
}

.toast {
  border-color: #2a1b10;
  background: #fff4d8;
  color: #22301f;
}

.dialog-panel {
  border-color: #3a2a1c;
  background:
    repeating-linear-gradient(0deg, rgba(107, 74, 47, 0.04) 0 1px, transparent 1px 22px),
    #fff8e8;
}

.dialog-head h2 {
  color: #14342b;
}

.switch:checked {
  background: #2f6b4f;
}

/* ---------- 響應式 ---------- */
@media (max-width: 860px) {
  .hero {
    padding: 18px;
  }

  .hero::before,
  .hero::after {
    opacity: 0.55;
  }

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

@media (max-width: 620px) {
  .hero {
    border-radius: 22px;
  }

  .hero-title {
    text-shadow: 2px 2px 0 rgba(242, 193, 78, 0.6);
  }

  .rq-sixw-choices {
    grid-template-columns: 1fr;
  }

  .sixw-tile {
    flex-direction: row;
    justify-content: flex-start;
    min-height: 66px;
    gap: 9px;
    text-align: left;
  }

  .sixw-tile .key {
    position: static;
  }

  .sixw-icon {
    font-size: 24px;
  }

  .rq-compass {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-radius: 18px;
    padding: 7px;
  }

  .rq-compass-core {
    display: none;
  }

  .rq-event {
    font-size: 12px;
  }

  .rq-table {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-blob,
  .hero-art img,
  .level-card {
    animation: none !important;
  }
}
