/* ============================================================
   Chiikawa 範文討伐記 — Style
   Claymorphism + 粉彩療癒風 · Soft 3D玩具感 · 行動裝置優先
   Design System: Claymorphism (childcare pastels, double shadows, squishy press)
   ============================================================ */

/* ---------- Font Faces ---------- */
@font-face {
  font-family: 'OpenHuninn';
  src: url('../fonts/jf-openhuninn-2.1.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Iansui';
  src: url('../fonts/Iansui-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'NotoSerifTC';
  src: url('../fonts/NotoSerifTC-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'NotoSerifTC';
  src: url('../fonts/NotoSerifTC-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- CSS Variables ---------- */
:root {
  /* Claymorphism pastel palette (childcare/daycare refined) */
  --pink: #f9a8d4;
  --pink-dark: #e88db8;
  --pink-light: #fce4f0;
  --blue: #a5d8e8;
  --blue-dark: #8cc8d8;
  --blue-light: #e0f4fa;
  --yellow: #fff3b8;
  --yellow-dark: #efe0a0;
  --yellow-light: #fffdf0;
  --mint: #b8e8b8;
  --mint-dark: #90d890;
  --mint-light: #e0fae0;
  --lavender: #e8d8f0;
  --lavender-dark: #d0bce0;
  --peach: #fdcbb8;
  --cream: #fffaf2;
  --cream-dark: #f5f0e5;
  --brown: #5a4a42;
  --brown-light: #8a7a6a;
  --brown-xlight: #b5a595;
  --white: #ffffff;
  --cork: #d4a574;
  --cork-light: #e8ccaa;
  --cork-dark: #b8855a;
  --success: #7bc67e;
  --danger: #f08080;
  --danger-dark: #d06060;
  --gold: #f0c060;

  /* Claymorphism shadows: inner glow + outer offset */
  --shadow-inner-sm: inset 1px 1px 3px rgba(255,255,255,0.7), inset -1px -1px 2px rgba(90,74,66,0.06);
  --shadow-inner-md: inset 2px 2px 6px rgba(255,255,255,0.8), inset -2px -2px 4px rgba(90,74,66,0.08);
  --shadow-clay-sm: 2px 3px 0 rgba(90,74,66,0.12), 3px 4px 8px rgba(90,74,66,0.08);
  --shadow-clay-md: 3px 5px 0 rgba(90,74,66,0.14), 5px 7px 16px rgba(90,74,66,0.10);
  --shadow-clay-lg: 4px 6px 0 rgba(90,74,66,0.16), 8px 12px 24px rgba(90,74,66,0.12);
  --shadow-clay-pressed: 1px 2px 0 rgba(90,74,66,0.10), 2px 3px 4px rgba(90,74,66,0.06);
  --shadow-sm: 0 2px 8px rgba(90,74,66,0.10);
  --shadow-md: 0 4px 16px rgba(90,74,66,0.14);
  --shadow-lg: 0 8px 32px rgba(90,74,66,0.18);

  /* Claymorphism: chunky radii (16-24px), thick borders (3-4px) */
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 26px;
  --radius-xl: 34px;
  --border: 3px solid #5a4a42;
  --border-light: 2px solid #d5cdc1;
  --border-thick: 4px solid #5a4a42;

  --font-heading: 'Baloo 2', 'OpenHuninn', cursive, sans-serif;
  --font-ui: 'OpenHuninn', 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', sans-serif;
  --font-text: 'NotoSerifTC', 'Songti TC', 'PMingLiU', serif;
  --font-kai: 'Iansui', 'DFKai-SB', 'BiauKai', 'KaiTi', '標楷體', 'NotoSerifTC', serif;
  --font-size-sm: 0.85rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.2rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-title: 2.5rem;

  /* Claymorphism easing: soft bounce */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-squish: cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}
.ic {
  display: inline-block;
  vertical-align: -0.2em;
  flex-shrink: 0;
  line-height: 0;
}
.blob {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.char-img {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
}
.title-emoji img {
  display: block;
  width: 88px;
  height: 88px;
}
button .ic { vertical-align: -0.15em; }
body {
  font-family: var(--font-ui);
  background: var(--cream);
  color: var(--brown);
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  font-size: inherit;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible {
  outline: 3px solid var(--brown);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
img { max-width: 100%; display: block; }

/* ---------- Screen Management ---------- */
#screen-container {
  max-width: 100%;
  overflow-x: hidden;
}
.screen {
  display: none;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: hidden;
  padding: 0;
  position: relative;
  animation: fadeIn 0.3s ease;
}
.screen.active {
  display: flex;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Fixed UI ---------- */
#top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: var(--border-thick);
  box-shadow: 0 3px 0 rgba(90,74,66,0.06), 0 2px 8px rgba(90,74,66,0.05);
  padding: 8px 16px;
}
.top-bar-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.coin-display {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--gold);
  font-size: var(--font-size-lg);
  background: var(--yellow-light);
  padding: 6px 16px;
  border-radius: var(--radius-xl);
  border: var(--border-thick);
  font-weight: 700;
  font-family: var(--font-heading);
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
}
.top-title-label {
  font-size: var(--font-size-md);
  color: var(--brown-light);
  font-weight: 700;
  font-family: var(--font-heading);
}
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-mute {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--brown);
  box-shadow: var(--shadow-inner-sm);
  flex-shrink: 0;
}
.btn-mute:active { transform: scale(0.9); }
.btn-mute.logged-in {
  width: auto;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.8rem;
  background: var(--yellow);
  color: var(--brown-dark);
  border-color: var(--brown-light);
}
.btn-mute.logout-confirm {
  background: var(--pink-dark);
  color: #fff;
  border-color: #b05070;
}

#btn-home {
  position: fixed;
  top: 8px;
  right: 16px;
  z-index: 101;
  font-size: 1.3rem;
  width: 44px;
  height: 44px;
  background: var(--white);
  border: var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Mascot ---------- */
.mascot {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99;
  pointer-events: none;
}
.mascot-img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  transition: transform 0.3s var(--ease-bounce);
}
.mascot-speech {
  position: absolute;
  bottom: 72px;
  right: -10px;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: var(--font-size-sm);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  animation: speechPop 2.5s ease forwards;
}
@keyframes speechPop {
  0% { opacity: 0; transform: translateY(10px); }
  15% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- Buttons ---------- */
.btn-primary, .btn-secondary, .btn-big, .btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: var(--radius-xl);
  border: var(--border-thick);
  font-weight: 700;
  font-size: var(--font-size-md);
  min-height: 44px;
  font-family: var(--font-heading);
  transition: transform 0.15s var(--ease-bounce), box-shadow 0.15s var(--ease-bounce);
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
  cursor: pointer;
}
.btn-primary {
  background: var(--pink-light);
  color: var(--brown);
}
.btn-secondary {
  background: var(--white);
  color: var(--brown);
}
.btn-big {
  font-size: var(--font-size-xl);
  padding: 18px 40px;
  border-radius: var(--radius-xl);
  min-height: 60px;
  letter-spacing: 0.03em;
  box-shadow: var(--shadow-inner-md), var(--shadow-clay-md);
}
.btn-back {
  background: var(--white);
  padding: 8px 16px;
  font-size: var(--font-size-sm);
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
}
.btn-primary:active, .btn-secondary:active, .btn-back:active {
  transform: scale(0.95);
  box-shadow: var(--shadow-inner-md), var(--shadow-clay-pressed);
}
.btn-big:active {
  transform: scale(0.94);
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-pressed);
}

/* Bounce animation for start button (claymorphism-style: toy-like float) */
.btn-bounce {
  animation: btnBounce 2.0s var(--ease-bounce) infinite;
}
@keyframes btnBounce {
  0%,100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-4px); }
}

/* ---------- Title Screen ---------- */
#screen-title {
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(205,239,253,0.82) 0%, rgba(255,250,242,0.85) 60%, rgba(216,245,208,0.82) 100%),
    url('../assets/img/首頁.webp') center/cover no-repeat;
}
.title-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.title-float {
  position: absolute;
  font-size: 2rem;
  animation: titleFloat 4s ease-in-out infinite;
}
.title-star1 { top: 10%; left: 10%; animation-delay: 0s; color: #e8b84a; }
.title-star2 { top: 20%; right: 15%; animation-delay: 0.8s; color: #e88db0; }
.title-star3 { bottom: 30%; left: 8%; animation-delay: 1.6s; color: #7fae6b; }
.title-star4 { bottom: 20%; right: 12%; animation-delay: 2.4s; color: #7fb2d8; }
.title-grass1 { bottom: 12%; left: 25%; animation-delay: 1s; color: #5d9c48; }
.title-grass2 { bottom: 8%; right: 30%; animation-delay: 2s; color: #7fae6b; }
.title-sticker-a { top: 14%; left: 22%; animation-delay: 0.5s; }
.title-sticker-b { bottom: 26%; right: 20%; animation-delay: 1.4s; }
.title-sticker-c { top: 16%; right: 28%; animation-delay: 2.2s; }
.title-float img {
  width: 92px;
  height: 92px;
  object-fit: contain;
}
@keyframes titleFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.title-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
}
.title-mascot-row {
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
}
.title-emoji {
  animation: titleFloat 3s ease-in-out infinite;
}
.title-emoji.t1 { animation-delay: 0s; }
.title-emoji.t2 { animation-delay: 0.4s; }
.title-emoji.t3 { animation-delay: 0.8s; }
.title-main {
  font-family: var(--font-heading);
  font-size: var(--font-size-title);
  color: var(--brown);
  text-shadow: 3px 3px 0 rgba(255,255,255,0.6);
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.title-sub {
  font-size: var(--font-size-lg);
  color: var(--brown-light);
  max-width: 320px;
}
.title-footer {
  font-size: var(--font-size-sm);
  color: var(--brown-light);
  opacity: 0.6;
  margin-top: 16px;
}
.btn-start-icon { font-size: 1.3em; }

/* ---------- Board Cards ---------- */
.board-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: 1160px;
  margin: 0 auto;
}
@media (min-width: 600px) {
  .board-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .board-grid { grid-template-columns: repeat(3, 1fr); }
}
.board-card {
  position: relative;
  height: 210px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: var(--border-thick);
  cursor: pointer;
  box-shadow: var(--shadow-clay-sm);
  transition: box-shadow 0.2s, filter 0.2s;
  background: var(--cream);
  display: flex;
  flex-direction: column;
}
.board-card:hover { box-shadow: var(--shadow-clay-md); filter: brightness(0.97); }
.board-card:active { transform: scale(0.96); }
.board-card-bg-img {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center;
  display: block;
}
.board-card-body {
  flex: 0 0 auto;
  background: rgba(255, 250, 242, 0.94);
  border-top: 3px solid var(--brown);
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.board-card-order {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--brown);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--brown);
  box-shadow: var(--shadow-inner-sm);
}
.board-card-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--brown);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.board-card-author { font-size: 0.8rem; color: var(--brown-light); }
.board-card-empty {
  background: var(--cream);
}

/* ---------- Selection Screens ---------- */
.select-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.select-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--brown);
  display: flex;
  align-items: center;
  gap: 8px;
}
/* ---------- Character Select ---------- */
.char-select-modal {
  max-width: 640px;
  max-height: 86vh;
  overflow-y: auto;
  text-align: left;
}
.char-select-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.char-select-modal-header .select-title { margin: 0; }
.btn-char-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: var(--border);
  background: var(--white);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown);
  flex-shrink: 0;
}
.btn-char-close:active { transform: scale(0.92); }
.char-select-modal .char-select-grid { max-width: none; }
.char-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
}
.char-select-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
  cursor: pointer;
  transition: transform 0.2s var(--ease-bounce), box-shadow 0.2s;
}
.char-select-card:hover { box-shadow: var(--shadow-inner-sm), var(--shadow-clay-md); filter: brightness(0.97); }
.char-select-card:active { transform: scale(0.94); }
.char-select-img img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-inner-sm);
}
.char-select-name {
  font-weight: 700;
  color: var(--brown);
  font-size: var(--font-size-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.char-select-skill { margin-top: 1px; }
.skill-tag {
  background: var(--pink-light);
  border: 1.5px solid var(--pink-dark);
  border-radius: var(--radius-xl);
  padding: 1px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brown);
}
.char-select-skill-desc {
  font-size: 0.68rem;
  color: var(--brown-light);
  text-align: center;
  line-height: 1.35;
}

/* ---------- Text Detail Screen ---------- */
#screen-text-detail { padding: 76px 16px 40px; }
.text-detail {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.text-detail-hero {
  position: relative;
  height: 200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: var(--border-thick);
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-clay-sm);
}
.text-detail-heading {
  text-align: center;
}
.text-detail-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--brown);
  line-height: 1.2;
}
.text-detail-author {
  color: var(--brown-light);
  font-size: var(--font-size-md);
  margin-top: 2px;
}
.text-detail-fulltext {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.text-detail-fulltext.collapsed::after {
  content: '點擊展開全文';
  display: block;
  margin: auto;
  padding: 10px 0;
  color: var(--brown-light);
  font-size: 0.85rem;
  font-family: var(--font-ui);
}
.text-detail-fulltext-title {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  font-weight: 700;
  color: var(--brown);
  padding: 10px 16px;
  background: var(--cream);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: var(--font-size-md);
  text-align: left;
}
.text-detail-fulltext-title:hover { filter: brightness(0.97); }
.fulltext-chevron {
  margin-left: auto;
  font-size: 0.9rem;
  color: var(--brown-light);
  transition: transform 0.2s ease;
}
.text-detail-fulltext:not(.collapsed) .text-detail-fulltext-title {
  border-bottom: 2px dashed var(--brown-light);
}
.text-detail-fulltext.collapsed .text-detail-fulltext-body {
  display: none;
}
.text-detail-fulltext-body {
  padding: 14px 18px;
  max-height: 360px;
  overflow-y: auto;
  font-family: var(--font-text);
  font-size: 1.05rem;
  line-height: 2.1;
  letter-spacing: 0.03em;
  color: var(--brown);
}
.fulltext-text { white-space: pre-line; }
.fulltext-empty { color: var(--brown-light); text-align: center; padding: 24px; font-family: var(--font-ui); }
.text-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.text-detail-monster {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  justify-content: center;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
}
.text-detail-monster img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-inner-sm);
}
.text-detail-monster-name { font-weight: 700; color: var(--brown); font-size: var(--font-size-md); }
.text-detail-info {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: var(--font-size-sm);
  line-height: 1.7;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.author-bg-card { border-left: 6px solid var(--blue); }
.writing-bg-card { border-left: 6px solid var(--yellow); }
.text-detail-info strong { color: var(--brown); font-size: var(--font-size-md); }
.text-detail-info-text { color: var(--brown-light); }
.text-detail-actions {
  display: flex;
  flex-direction: row;
  gap: 12px;
}
.text-detail-actions .btn-task {
  flex: 1;
}

@media (min-width: 820px) {
  .text-detail-hero { height: 280px; }
  .text-detail-grid {
    grid-template-columns: 1.5fr 1fr;
    align-items: stretch;
  }
  .text-detail-grid.grid-single { grid-template-columns: 1fr; }
  .text-detail-monster { grid-column: 2; grid-row: 1 / 3; }
  .text-detail-grid.grid-single .text-detail-monster { grid-column: 1; grid-row: 1; }
  .author-bg-card { grid-column: 1; grid-row: 1; }
  .writing-bg-card { grid-column: 1; grid-row: 2; }
  .text-detail-monster img { width: 120px; height: 120px; }
}

/* ---------- Board Screen ---------- */
#screen-board {
  padding: 76px 16px 120px;
}
.board-header {
  text-align: center;
  margin-bottom: 20px;
}
.board-title { font-size: var(--font-size-2xl); }
.board-sub { color: var(--brown-light); font-size: var(--font-size-sm); margin-top: 4px; }

.board-cork {
  background:
    repeating-linear-gradient(0deg, transparent, transparent 8px, rgba(0,0,0,0.03) 8px, rgba(0,0,0,0.03) 9px),
    linear-gradient(135deg, #d4a574 0%, #e0bb90 30%, #d4a574 60%, #c89568 100%);
  border: 8px solid #b8855a;
  border-radius: var(--radius-lg);
  padding: 20px;
  max-width: 960px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg), inset 0 2px 4px rgba(255,255,255,0.2);
}
.flyer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.flyer-card {
  background: var(--white);
  border: var(--border-thick);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.18s var(--ease-bounce), box-shadow 0.18s var(--ease-bounce);
  position: relative;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
  min-height: 44px;
}
.flyer-card:hover {
  transform: translateY(-4px) rotate(-0.5deg);
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-md);
}
.flyer-card:active { transform: scale(0.94); box-shadow: var(--shadow-inner-md), var(--shadow-clay-pressed); }
.flyer-emoji { font-size: 1.8rem; display: block; margin-bottom: 4px; }
.flyer-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  margin-bottom: 2px;
  line-height: 1.3;
}
.flyer-author { font-size: 0.72rem; color: var(--brown-light); }
.flyer-stamps {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 6px;
  font-size: 0.8rem;
}
.flyer-stamp { opacity: 0.35; }
.flyer-stamp.earned { opacity: 1; }
.flyer-tape {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(2deg);
  width: 28px; height: 14px;
  background: rgba(200,220,255,0.6);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Ramen entry button on board */
.board-ramen-area {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 24px;
}
.btn-ramen-entry {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--pink-light);
  border: var(--border-thick);
  border-radius: var(--radius-xl);
  padding: 16px 32px;
  font-size: var(--font-size-md);
  font-weight: 700;
  min-height: 56px;
  font-family: var(--font-heading);
  transition: transform 0.18s var(--ease-bounce), box-shadow 0.18s var(--ease-bounce);
  cursor: pointer;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
}
.btn-ramen-entry:active { transform: scale(0.94); box-shadow: var(--shadow-inner-md), var(--shadow-clay-pressed); }
.ramen-btn-icon { font-size: 1.4em; }
.ramen-btn-badge {
  background: var(--danger);
  color: var(--white);
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ---------- Text Detail Screen ---------- */
#screen-text { padding: 76px 16px 40px; }
.text-header { margin-bottom: 16px; }
.text-detail {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.text-card {
  background: var(--white);
  border: var(--border-thick);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-inner-md), var(--shadow-clay-sm);
}
.text-card-emoji {
  font-size: 4rem;
  text-align: center;
  margin-bottom: 8px;
}
.text-card-title {
  font-size: var(--font-size-2xl);
  text-align: center;
  font-weight: 700;
}
.text-card-author {
  text-align: center;
  color: var(--brown-light);
  font-size: var(--font-size-md);
  margin-bottom: 12px;
}
.text-card-divider {
  border: none;
  border-top: 2px dashed var(--brown-light);
  opacity: 0.4;
  margin: 12px 0;
}
.text-scenario {
  background: var(--yellow-light);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  font-size: var(--font-size-sm);
  line-height: 1.7;
  border: 3px solid var(--yellow-dark);
  box-shadow: var(--shadow-inner-sm);
}
.text-scenario strong { font-size: var(--font-size-md); }
.text-focus {
  font-size: var(--font-size-sm);
  color: var(--brown-light);
  text-align: center;
  padding: 8px;
}
.text-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.btn-task {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px;
  border: var(--border-thick);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: var(--font-size-lg);
  min-height: 64px;
  transition: transform 0.18s var(--ease-bounce), box-shadow 0.18s var(--ease-bounce);
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
  font-family: var(--font-heading);
}
.btn-task::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-position: center;
  background-size: cover;
  opacity: 0.28;
}
.btn-task:active { transform: scale(0.94); box-shadow: var(--shadow-inner-md), var(--shadow-clay-pressed); }
.btn-task-weed {
  background: var(--mint);
}
.btn-task-weed::before { background-image: url('../assets/img/除草.webp'); }
.btn-task-battle {
  background: var(--pink);
}
.btn-task-battle::before { background-image: url('../assets/img/討伐.webp'); }
.btn-task > * { position: relative; z-index: 1; }
.btn-task-emoji { font-size: 2rem; }
.btn-task-label { font-weight: 700; line-height: 1.2; text-shadow: 1px 1px 0 rgba(255,255,255,0.9); }
.btn-task-sub {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--brown-light);
  text-shadow: 1px 1px 0 rgba(255,255,255,0.9);
}

/* Challenge button */
.btn-challenge {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px;
  border: var(--border-thick);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: var(--font-size-lg);
  min-height: 64px;
  transition: transform 0.18s var(--ease-bounce), box-shadow 0.18s var(--ease-bounce);
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
  font-family: var(--font-heading);
  width: 100%;
}
.btn-challenge::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-position: center;
  background-size: cover;
  background-image: url('../assets/img/挑戰.webp');
  opacity: 0.28;
}
.btn-challenge.unlocked { background: #ffe0b2; }
.btn-challenge.locked {
  background: #e8e0d8;
  cursor: not-allowed;
}
.btn-challenge.locked::before {
  filter: grayscale(1) brightness(1.25);
  opacity: 0.14;
}
.btn-challenge > * { position: relative; z-index: 1; }
.btn-challenge .btn-task-label,
.btn-challenge .btn-task-sub { text-shadow: 1px 1px 0 rgba(255,255,255,0.9); }
.btn-challenge.unlocked:active { transform: scale(0.94); }
.btn-challenge.locked .btn-task-label,
.btn-challenge.locked .btn-task-sub { color: var(--brown-light); }
.text-progress {
  display: flex;
  gap: 12px;
  justify-content: center;
  font-size: var(--font-size-sm);
}
.text-progress-item {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-xl);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.text-progress-item.done { background: var(--mint); }

/* ---------- Weed Screen ---------- */
#screen-weed { padding: 76px 16px 40px; background: linear-gradient(180deg, rgba(216,245,208,0.86) 0%, rgba(255,250,242,0.9) 40%, rgba(255,250,242,0.94) 100%), url('../assets/img/除草.webp') center/cover no-repeat fixed; }
.weed-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.weed-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--font-size-sm);
  font-weight: 700;
}
.weed-progress-bar {
  flex: 1;
  height: 12px;
  background: var(--white);
  border-radius: 6px;
  border: 1.5px solid var(--brown);
  overflow: hidden;
}
.weed-progress-fill {
  height: 100%;
  background: var(--mint-dark);
  border-radius: 5px;
  transition: width 0.3s ease;
  width: 0%;
}
.weed-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.weed-player {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto 16px;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
}
.weed-player .fighter-img { width: 76px; height: 76px; }
.weed-player-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.weed-player-skill {
  font-size: 0.8rem;
  color: var(--brown-light);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.weed-skill-desc { font-size: 0.75rem; }
.weed-player-coins {
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  font-weight: 800;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.sentence-card {
  background: var(--white);
  border: var(--border-thick);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  font-family: var(--font-kai);
  text-align: center;
  box-shadow: var(--shadow-inner-md), var(--shadow-clay-md);
  font-family: var(--font-text);
  font-size: var(--font-size-xl);
  line-height: 2.2;
  letter-spacing: 0.05em;
}
.sentence-target {
  display: inline-block;
  background: #8fcc7a;
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  min-width: 48px;
  border: 2px solid #6ba85a;
  position: relative;
  cursor: default;
  font-family: var(--font-ui);
  font-size: var(--font-size-md);
  color: #3a6a2a;
}
.sentence-target::after {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='20' height='20' fill='%235d9c48' stroke='%233a6a2a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z'/%3E%3Cpath d='M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12'/%3E%3C/svg%3E");
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
}
.sentence-target.shake {
  animation: shake 0.5s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.sentence-target.pulled {
  background: var(--success);
  color: var(--white);
  transition: all 0.3s ease;
}
.sentence-target.pulled::after {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='20' height='20' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  top: -18px;
}
.weed-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.weed-option {
  background: var(--white);
  border: var(--border-thick);
  border-radius: var(--radius-xl);
  padding: 16px;
  font-family: var(--font-kai);
  text-align: center;
  font-size: var(--font-size-md);
  font-weight: 700;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s var(--ease-bounce);
  cursor: pointer;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
}
.weed-option:hover {
  background: var(--yellow-light);
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-md);
}
.weed-option:active {
  transform: scale(0.94);
  box-shadow: var(--shadow-inner-md), var(--shadow-clay-pressed);
}
.weed-option.correct {
  background: var(--mint) !important;
  animation: popCorrect 0.4s ease;
}
.weed-option.wrong {
  background: #f0e0e0 !important;
  color: #a08080;
}
@keyframes popCorrect {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Weed result */
.weed-result {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  background: var(--white);
  border: var(--border-thick);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-inner-md), var(--shadow-clay-lg);
}
.weed-result-stamp {
  font-size: 3rem;
  margin-bottom: 12px;
}
.weed-result-text {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: 8px;
}
.weed-result-coins {
  font-size: var(--font-size-xl);
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 20px;
}

/* ---------- Battle Screen ---------- */
#screen-battle {
  padding: 76px 16px 40px;
  background: linear-gradient(180deg, rgba(255,243,184,0.86) 0%, rgba(255,250,242,0.9) 50%, rgba(255,250,242,0.94) 100%), url('../assets/img/討伐.webp') center/cover no-repeat fixed;
}

/* ---------- Challenge Screen ---------- */
#screen-challenge {
  padding: 76px 16px 40px;
  background: linear-gradient(180deg, rgba(255,224,208,0.86) 0%, rgba(255,250,242,0.9) 50%, rgba(255,250,242,0.94) 100%), url('../assets/img/挑戰.webp') center/cover no-repeat fixed;
}
.challenge-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.challenge-progress { flex: 1; text-align: right; font-weight: 700; font-size: var(--font-size-sm); color: var(--brown-light); }
.challenge-top {
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: 900px;
  width: 100%;
  margin: 0 auto 12px;
}
.challenge-player {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.challenge-player .fighter-img { width: 80px; height: 80px; }
.challenge-timer {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--brown);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
  flex-shrink: 0;
}
.challenge-timer-text {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--brown);
}
.challenge-timer-text.warning { color: #e8b000; }
.challenge-timer-text.danger { color: var(--danger); }
.challenge-score-box { flex: 1; text-align: center; }
.challenge-score-label { font-size: 0.75rem; color: var(--brown-light); font-weight: 700; }
.challenge-score-value { font-family: var(--font-heading); font-size: 2rem; font-weight: 900; color: var(--gold); line-height: 1.1; }
.challenge-result-score {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1.1;
  margin-bottom: 4px;
}
.challenge-result-score-label { font-size: 1.2rem; color: var(--brown-light); }
.challenge-sentence {
  font-family: var(--font-kai);
  font-size: var(--font-size-lg);
  line-height: 2;
  letter-spacing: 0.05em;
  color: var(--brown);
  margin-bottom: 14px;
  padding: 8px 4px;
}
.battle-top {
  display: flex;
  gap: 12px;
  margin: 0 auto 12px;
  align-items: center;
  max-width: 900px;
  width: 100%;
}
.battle-fighter {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.battle-vs {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--brown);
  background: var(--white);
  border: 3px solid var(--brown);
  border-radius: 50%;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
  flex-shrink: 0;
}
.fighter-display {
  line-height: 1;
  margin-bottom: 4px;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fighter-img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
  display: inline-block;
}
.monster-display {
  animation: monsterFloat 3s ease-in-out infinite;
}
@keyframes monsterFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.monster-display.hit {
  animation: monsterHit 0.3s ease;
}
@keyframes monsterHit {
  0% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}
.monster-name, .fighter-name {
  font-size: var(--font-size-sm);
  font-weight: 700;
  margin-bottom: 6px;
}
.hp-bar {
  width: 100%;
  height: 14px;
  background: #e8e0d8;
  border-radius: 7px;
  border: 2px solid var(--brown);
  overflow: hidden;
  margin-bottom: 4px;
}
.hp-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s ease;
  width: 100%;
}
.hp-enemy { background: linear-gradient(90deg, #f08080, #e05050); }
.hp-player { background: linear-gradient(90deg, #7bc67e, #5aaa5a); }
.combo-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: #e07020;
  animation: comboPulse 0.6s ease;
}
@keyframes comboPulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* Timer bar */
.battle-timer-bar {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 16px;
  height: 10px;
  background: #e8e0d8;
  border-radius: 5px;
  border: 1.5px solid var(--brown);
  overflow: hidden;
  position: relative;
}
.timer-fill {
  height: 100%;
  background: var(--success);
  border-radius: 4px;
  transition: width 0.3s linear;
  width: 100%;
}
.timer-fill.warning { background: var(--gold); }
.timer-fill.danger { background: var(--danger); }
.timer-text {
  position: absolute;
  right: 6px;
  top: -14px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--brown-light);
}

/* Battle question */
.battle-question-area {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.battle-q-card {
  background: var(--white);
  border: var(--border-thick);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-inner-md), var(--shadow-clay-md);
}
.battle-q-tag {
  display: inline-block;
  background: var(--pink);
  border-radius: var(--radius-xl);
  padding: 2px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 10px;
  border: 1.5px solid var(--pink-dark);
}
.battle-q-text {
  font-family: var(--font-kai);
  font-size: var(--font-size-lg);
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 8px;
}
.battle-q-src {
  font-size: var(--font-size-sm);
  color: var(--brown-light);
  font-family: var(--font-text);
  font-style: italic;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: #f8f5f0;
  border-radius: var(--radius-sm);
}
.battle-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.battle-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: var(--font-kai);
  padding: 14px 18px;
  border: var(--border-thick);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: pointer;
  transition: all 0.18s var(--ease-bounce);
  text-align: left;
  font-size: var(--font-size-sm);
  line-height: 1.5;
  min-height: 44px;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
  font-family: var(--font-ui);
}
.battle-option:hover {
  background: var(--yellow-light);
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-md);
}
.battle-option:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-inner-md), var(--shadow-clay-pressed);
}
.battle-option .opt-label {
  font-weight: 700;
  flex-shrink: 0;
  width: 24px; height: 24px;
  background: #f0e8d8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}
.battle-option.correct {
  background: var(--mint) !important;
  border-color: var(--mint-dark);
}
.battle-option.wrong {
  background: #fce4e4 !important;
  border-color: var(--danger);
}
.battle-option.dim {
  opacity: 0.5;
  pointer-events: none;
}

/* Skills bar */
.battle-skills {
  max-width: 900px;
  margin: 16px auto 0;
  display: flex;
  gap: 8px;
  justify-content: center;
}
.btn-skill {
  padding: 10px 18px;
  border: var(--border-thick);
  border-radius: var(--radius-xl);
  font-size: var(--font-size-sm);
  font-weight: 700;
  min-height: 44px;
  transition: all 0.18s var(--ease-bounce);
  background: var(--white);
  cursor: pointer;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
}
.btn-skill:active { transform: scale(0.93); box-shadow: var(--shadow-inner-md), var(--shadow-clay-pressed); }
.btn-skill.used {
  opacity: 0.4;
  pointer-events: none;
  text-decoration: line-through;
}

/* Battle result */
.battle-result {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  background: var(--white);
  border: var(--border-thick);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-inner-md), var(--shadow-clay-lg);
}
.battle-rank {
  font-size: 4rem;
  font-weight: 900;
  margin-bottom: 8px;
}
.battle-rank.S { color: #ffd700; }
.battle-rank.A { color: #f08080; }
.battle-rank.B { color: var(--brown); }
.battle-rank.C { color: var(--brown-light); }
.battle-result-text { font-size: var(--font-size-lg); font-weight: 700; margin-bottom: 8px; }
.battle-result-detail { font-size: var(--font-size-sm); color: var(--brown-light); margin-bottom: 8px; }
.battle-result-coins { font-size: var(--font-size-xl); color: var(--gold); font-weight: 700; margin-bottom: 20px; }

/* ---------- Ramen Screen ---------- */
#screen-ramen { padding: 76px 16px 40px; }
.ramen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.ramen-title { font-size: var(--font-size-xl); }
.ramen-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  justify-content: center;
}
.ramen-tab {
  padding: 10px 20px;
  border: var(--border-thick);
  border-radius: var(--radius-xl);
  font-size: var(--font-size-sm);
  font-weight: 700;
  background: var(--white);
  min-height: 44px;
  transition: all 0.18s var(--ease-bounce);
  cursor: pointer;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
}
.ramen-tab.active {
  background: var(--pink-light);
  box-shadow: var(--shadow-inner-md), var(--shadow-clay-pressed);
}
.ramen-content {
  max-width: 900px;
  margin: 0 auto;
}
.wrong-list-empty {
  text-align: center;
  padding: 40px 20px;
  font-size: var(--font-size-lg);
  color: var(--brown-light);
}
.wrong-group {
  margin-bottom: 16px;
}
.wrong-group-title {
  font-size: var(--font-size-md);
  font-weight: 700;
  padding: 8px 12px;
  background: #f8f5f0;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.wrong-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--white);
  margin-bottom: 6px;
  font-size: var(--font-size-sm);
}
.wrong-item.reviewed { background: #f0f8f0; }
.wrong-item-type {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--brown);
  font-weight: 700;
  white-space: nowrap;
}
.wrong-item-type.weed { background: var(--mint); }
.wrong-item-type.battle { background: var(--pink); }
.wrong-item-q {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wrong-item-answer {
  color: var(--success);
  font-weight: 700;
  font-size: 0.9rem;
}
.wrong-item-stamp {
  font-size: 0.8rem;
  opacity: 0.4;
}
.wrong-item-stamp.reviewed { opacity: 1; }

/* Ramen buy tab */
.ramen-buy-area {
  text-align: center;
}
.ramen-shop-bowl {
  font-size: 6rem;
  margin-bottom: 12px;
}
.btn-buy-ramen {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  background: var(--pink-light);
  border: var(--border-thick);
  border-radius: var(--radius-xl);
  font-size: var(--font-size-lg);
  font-weight: 700;
  min-height: 56px;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: transform 0.18s var(--ease-bounce), box-shadow 0.18s var(--ease-bounce);
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
}
.btn-buy-ramen:active { transform: scale(0.94); box-shadow: var(--shadow-inner-md), var(--shadow-clay-pressed); }

/* Ramen eat overlay */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.overlay-inner {
  background: var(--cream);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.ramen-eat { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.ramen-bowl { font-size: 5rem; }
.ramen-steam {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.steam {
  width: 8px; height: 24px;
  background: rgba(200,200,200,0.5);
  border-radius: 4px;
  animation: steamRise 1.5s ease-in-out infinite;
}
.steam.s1 { animation-delay: 0s; }
.steam.s2 { animation-delay: 0.5s; }
.steam.s3 { animation-delay: 1s; }
@keyframes steamRise {
  0% { transform: translateY(0); opacity: 0.6; }
  50% { opacity: 1; }
  100% { transform: translateY(-20px); opacity: 0; }
}
.ramen-review-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  width: 100%;
  text-align: left;
  font-size: var(--font-size-sm);
  line-height: 1.6;
}
.ramen-review-card .rr-q {
  font-weight: 700;
  margin-bottom: 8px;
}
.ramen-review-card .rr-answer {
  color: var(--success);
  font-weight: 700;
  margin-bottom: 6px;
}
.ramen-review-card .rr-explain {
  color: var(--brown-light);
  font-size: 0.85rem;
  padding: 8px;
  background: #f8f5f0;
  border-radius: var(--radius-sm);
}

/* ---------- Records Screen ---------- */
#screen-records { padding: 76px 16px 120px; }
.records-score-card {
  text-align: center;
  background: var(--white);
  border: var(--border-thick);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-inner-md), var(--shadow-clay-md);
  margin-bottom: 16px;
}
.records-score-label { font-size: var(--font-size-sm); color: var(--brown-light); font-weight: 700; }
.records-score-value {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1.1;
}
.records-score-sub { font-size: var(--font-size-sm); color: var(--brown-light); }
.records-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.records-stat {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
}
.records-stat-icon { color: var(--brown); }
.records-stat-num { font-family: var(--font-heading); font-size: var(--font-size-xl); font-weight: 800; color: var(--brown); }
.records-stat-label { font-size: 0.75rem; color: var(--brown-light); }
.records-rank-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
  margin-bottom: 16px;
}
.records-rank-title { font-weight: 700; color: var(--brown); margin-bottom: 10px; }
.records-rank-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.rank-badge {
  padding: 4px 12px;
  border-radius: var(--radius-xl);
  border: 2px solid var(--brown);
  font-weight: 800;
  font-size: 0.85rem;
}
.rank-S { background: #fff3b8; color: #c9a000; }
.rank-A { background: #fce4e4; color: #c05050; }
.rank-B { background: #e0f4fa; color: #3a7a8a; }
.rank-C { background: #f0e8d8; color: var(--brown-light); }
.records-achv-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
  margin-bottom: 16px;
}
.achv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.achv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: var(--border-light);
  background: var(--cream);
}
.achv-item.unlocked {
  background: var(--yellow-light);
  border: 2px solid var(--yellow-dark);
}
.achv-item.locked { opacity: 0.5; }
.achv-icon {
  color: var(--brown);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.achv-item.locked .achv-icon { color: var(--brown-xlight); }
.achv-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.achv-name { font-weight: 700; font-size: var(--font-size-sm); color: var(--brown); }
.achv-desc { font-size: 0.72rem; color: var(--brown-light); }
.records-deco { text-align: center; }
.records-deco img { width: 140px; height: 140px; display: inline-block; }

.lb-profile-card {
  background: var(--white);
  border: var(--border-thick);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-inner-md), var(--shadow-clay-md);
  margin-bottom: 16px;
  text-align: center;
}
.lb-field-label { font-weight: 700; color: var(--brown); margin-bottom: 6px; }
.lb-name-input {
  width: 100%;
  max-width: 260px;
  padding: 10px 14px;
  border: var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-md);
  font-family: inherit;
  text-align: center;
  margin-bottom: 10px;
  background: var(--cream);
}
.lb-name-input:focus { outline: 3px solid var(--brown); outline-offset: 2px; }
.lb-my-score { font-size: var(--font-size-sm); color: var(--brown-light); margin-bottom: 12px; }
.lb-msg { font-size: var(--font-size-sm); color: var(--brown-light); margin-top: 10px; min-height: 1.2em; }
.lb-list {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: var(--shadow-inner-sm), var(--shadow-clay-sm);
}
.lb-loading { text-align: center; padding: 24px; color: var(--brown-light); font-size: var(--font-size-sm); }
.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
}
.lb-row:nth-child(odd) { background: var(--cream); }
.lb-rank {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  background: #f0e8d8;
  border: 1.5px solid var(--brown-light);
  flex-shrink: 0;
}
.lb-rank.top1 { background: #ffd700; color: #7a5a00; }
.lb-rank.top2 { background: #d8d8d8; color: #555; }
.lb-rank.top3 { background: #e8a060; color: #6a3a10; }
.lb-name { flex: 1; font-weight: 700; color: var(--brown); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-family: var(--font-heading); font-weight: 800; color: var(--gold); }
.lb-row.lb-me { background: var(--yellow); border-radius: var(--radius-sm); }

/* Toast */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: var(--brown);
  color: var(--white);
  padding: 10px 24px;
  border-radius: var(--radius-xl);
  font-size: var(--font-size-sm);
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.2s forwards;
  pointer-events: none;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-50%) translateY(-10px); } }

/* ---------- Accessibility & Feedback ---------- */
.board-card:focus-visible, .char-select-card:focus-visible {
  outline: 3px solid var(--brown);
  outline-offset: 3px;
}
@keyframes coinPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); }
  100% { transform: scale(1); }
}
.coin-pop { animation: coinPop 0.35s ease; }
.text-detail-monster img {
  animation: monsterFloat 3.4s ease-in-out infinite;
}
.title-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 14px;
  border-radius: var(--radius-xl);
  border: 2px solid var(--brown);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brown);
  margin: 4px 3px 0;
  box-shadow: var(--shadow-inner-sm);
}
.title-mode-badge.badge-weed { background: var(--mint); }
.title-mode-badge.badge-battle { background: var(--pink); }

/* Decorative animated stickers */
.weed-result-deco, .battle-result-deco { text-align: center; margin-bottom: 4px; }
.weed-result-deco img, .battle-result-deco img { width: 150px; height: 150px; object-fit: contain; display: inline-block; }
.ramen-deco { text-align: center; margin-bottom: 6px; }
.ramen-deco img { width: 128px; height: 128px; object-fit: contain; display: inline-block; }

/* Floating decorative stickers (screens) */
.float-deco {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  animation: floatY 4s ease-in-out infinite;
}
.float-deco img {
  width: 92px;
  height: 92px;
  object-fit: contain;
}
.float-deco.tl { top: 74px; left: 18px; animation-delay: 0s; }
.float-deco.tr { top: 74px; right: 18px; animation-delay: 1.2s; }
.float-deco.bl { bottom: 90px; left: 18px; animation-delay: 0.6s; }
.float-deco.br { bottom: 90px; right: 18px; animation-delay: 1.8s; }
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
@media (max-width: 720px) {
  .float-deco img { width: 64px; height: 64px; }
  .float-deco.tl { top: 70px; left: 8px; }
  .float-deco.tr { top: 70px; right: 8px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .flyer-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .flyer-card { padding: 10px 8px; }
  .flyer-title { font-size: 0.75rem; }
  .flyer-author { font-size: 0.65rem; }
  .battle-top { flex-wrap: wrap; }
  .battle-player-area { width: 100%; order: 2; }
  .title-main { font-size: 2rem; }
}
@media (max-width: 600px) {
  :root {
    --font-size-title: 1.8rem;
    --font-size-2xl: 1.4rem;
    --font-size-xl: 1.15rem;
    --font-size-lg: 1.05rem;
  }
  .flyer-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .weed-options { grid-template-columns: 1fr; }
  .battle-options { gap: 8px; }
  .battle-option { padding: 10px 12px; }
  .battle-skills { flex-wrap: wrap; }
  .btn-skill { flex: 1; min-width: 80px; }
  .title-mascot-row { gap: 8px; }
  .mascot { bottom: 12px; right: 12px; }
  .mascot-img { width: 76px; height: 76px; }
  .btn-big { padding: 14px 28px; font-size: var(--font-size-md); }
  .board-cork { padding: 12px; border-width: 5px; }
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
@media (hover: hover) and (pointer: fine) {
  .flyer-card:hover {
    transform: translateY(-2px) rotate(-0.5deg);
    box-shadow: 3px 4px 12px rgba(0,0,0,0.15);
  }
  .weed-option:hover { background: var(--yellow); transform: scale(1.02); }
  .battle-option:hover { background: var(--yellow); }
  .btn-primary:hover, .btn-buy-ramen:hover { filter: brightness(0.95); }
}

/* ===== 答題文字特效 ===== */
.answer-effect {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 400;
  pointer-events: none;
  font-family: 'OpenHuninn', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-weight: 700;
  font-size: 3rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-align: center;
  animation: answer-pop 1.2s ease forwards;
}
.answer-effect.anchored {
  transform: translateX(-50%);
  animation-name: answer-pop-anchored;
}
.answer-effect.correct { color: #2f9e44; }
.answer-effect.wrong { color: #e03131; }
@keyframes answer-pop {
  0%   { opacity: 0; transform: translate(-50%, -50%) translateY(14px) scale(0.4) rotate(-4deg); }
  18%  { opacity: 1; transform: translate(-50%, -50%) translateY(-8px) scale(1.12) rotate(2deg); }
  34%  { opacity: 1; transform: translate(-50%, -50%) translateY(-14px) scale(1) rotate(0deg); }
  72%  { opacity: 1; transform: translate(-50%, -50%) translateY(-30px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) translateY(-48px) scale(0.94); }
}
@keyframes answer-pop-anchored {
  0%   { opacity: 0; transform: translateX(-50%) translateY(14px) scale(0.4) rotate(-4deg); }
  18%  { opacity: 1; transform: translateX(-50%) translateY(-8px) scale(1.12) rotate(2deg); }
  34%  { opacity: 1; transform: translateX(-50%) translateY(-14px) scale(1) rotate(0deg); }
  72%  { opacity: 1; transform: translateX(-50%) translateY(-30px) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-48px) scale(0.94); }
}
@media (max-width: 640px) {
  .answer-effect { font-size: 2.4rem; }
}

/* ============================================================
   詩歌選單（唐詩三首 / 宋詞三首）— 詩卡介面
   ============================================================ */
.poem-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 14px 0;
}
@media (min-width: 720px) {
  .poem-list { grid-template-columns: repeat(3, 1fr); }
}
.poem-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: var(--white);
  border: 2px solid var(--pcd, #e0d8c8);
  box-shadow: 0 8px 16px rgba(90,74,66,0.08), inset 0 2px 4px rgba(255,255,255,0.9);
}
.poem-card-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 14px;
  min-height: 110px;
  background-color: var(--pc, #fff);
  background-size: cover;
  background-position: center;
}
.poem-card-head::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,250,242,0.85) 0%, rgba(255,250,242,0.93) 60%, rgba(255,250,242,0.96) 100%);
  background: linear-gradient(180deg, rgb(from var(--pc, #fff) r g b / 0.5) 0%, rgba(255,250,242,0.86) 55%, rgba(255,250,242,0.9) 100%);
}
.poem-card-head-text { flex: 1 1 auto; min-width: 0; position: relative; z-index: 1; }
.poem-card-title {
  font-family: 'NotoSerifTC', serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--brown);
  line-height: 1.3;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.75);
}
.poem-card-author {
  font-size: 0.8rem;
  color: var(--brown-light);
  margin-top: 2px;
}
.poem-card-foot {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.poem-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.poem-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--brown-light);
  background: rgba(90,74,66,0.06);
  border: 1px solid rgba(90,74,66,0.12);
}
.poem-badge.done {
  color: #4a8f5c;
  background: #e4f4e8;
  border-color: #b8e0c0;
}
.poem-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-poem-task {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brown);
  padding: 8px 10px;
  border-radius: 16px;
  border: 2px solid rgba(90,74,66,0.16);
  background: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 3px 6px rgba(90,74,66,0.08);
}
.btn-poem-task::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-position: center;
  background-size: cover;
  opacity: 0.28;
}
.btn-poem-task > * { position: relative; z-index: 1; }
.btn-poem-task:hover { transform: translateY(-1px); }
.btn-poem-task:active { transform: scale(0.94); box-shadow: inset 0 2px 4px rgba(90,74,66,0.12); }
.btn-poem-weed { background: #eaf7e8; border-color: #b8e0b8; }
.btn-poem-weed::before { background-image: url('../assets/img/除草.webp'); }
.btn-poem-battle { background: #fff4e0; border-color: #f0d8a8; }
.btn-poem-battle::before { background-image: url('../assets/img/討伐.webp'); }
.btn-poem-emoji { line-height: 1; }
.btn-poem-label { font-weight: 700; line-height: 1.25; text-shadow: 1px 1px 0 rgba(255,255,255,0.9); }
.btn-poem-sub {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--brown-light);
  text-shadow: 1px 1px 0 rgba(255,255,255,0.9);
}

/* ============================================================
   登入閘門（強制學校 Google 帳號）
   ============================================================ */
#screen-login {
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(205,239,253,0.82) 0%, rgba(255,250,242,0.88) 55%, rgba(255,214,224,0.78) 100%),
    url('../assets/img/首頁.webp') center/cover no-repeat;
}
.login-bg { position: absolute; inset: 0; pointer-events: none; }
.login-deco { position: absolute; color: var(--brown-light); opacity: 0.5; }
.login-deco-a { top: 12%; left: 12%; animation: floatY 4s ease-in-out infinite; }
.login-deco-b { top: 20%; right: 14%; animation: floatY 5s ease-in-out infinite 0.6s; }
.login-deco-c { bottom: 18%; left: 16%; animation: floatY 4.6s ease-in-out infinite 1.2s; }
.login-deco-d { bottom: 12%; right: 12%; animation: floatY 5.4s ease-in-out infinite 0.3s; }
.login-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 380px);
  margin: 0 auto;
  padding: 32px 24px 28px;
  background: rgba(255,255,255,0.92);
  border: 2px solid var(--yellow-dark);
  border-radius: 28px;
  box-shadow: 0 12px 28px rgba(90,74,66,0.14), inset 0 2px 6px rgba(255,255,255,0.9);
}
.login-mascot { margin-bottom: 4px; }
.login-mascot img {
  width: 72px; height: 72px; object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(90,74,66,0.15));
}
.login-title {
  font-family: 'NotoSerifTC', serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--brown);
}
.login-tagline {
  font-size: 0.85rem;
  color: var(--brown-light);
  margin-bottom: 6px;
}
.login-divider { width: 72%; height: 2px; background: var(--yellow); border-radius: 2px; margin: 6px 0 14px; }
.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--brown);
  background: #fff;
  border: 2px solid rgba(90,74,66,0.18);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(90,74,66,0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-google:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(90,74,66,0.16); }
.btn-google:active { transform: scale(0.97); box-shadow: inset 0 2px 4px rgba(90,74,66,0.14); }
.btn-google:disabled { opacity: 0.65; cursor: default; }
.login-hint { font-size: 0.78rem; color: var(--brown-light); margin-top: 2px; }
.login-loading {
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brown-light);
}
.login-loading::before {
  content: '';
  display: inline-block;
  width: 12px; height: 12px;
  margin-right: 8px;
  border: 2.5px solid var(--yellow-dark);
  border-top-color: var(--brown);
  border-radius: 50%;
  vertical-align: -2px;
  animation: loginSpin 0.8s linear infinite;
}
@keyframes loginSpin { to { transform: rotate(360deg); } }
.login-error {
  margin-top: 8px;
  width: 100%;
  padding: 10px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.5;
  color: #a14a4a;
  background: var(--pink-light);
  border: 1.5px solid var(--pink-dark);
  border-radius: 14px;
}

/* ============================================================
   詩卡：作者與寫作背景摺疊區
   ============================================================ */
.poem-card-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brown-light);
  background: rgba(90,74,66,0.05);
  border: 1px dashed rgba(90,74,66,0.22);
  border-radius: 12px;
  padding: 6px 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.poem-card-more:hover { background: rgba(90,74,66,0.09); }
.pm-chev { font-size: 0.7rem; }
.poem-card-more-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.7);
  border-radius: 12px;
}
.pm-info {
  font-size: 0.74rem;
  line-height: 1.65;
  color: var(--brown-light);
}
.pm-info strong { color: var(--brown); font-size: 0.78rem; display: block; margin-bottom: 1px; }

/* ============================================================
   討伐標題列（放棄討伐按鈕）
   ============================================================ */
.battle-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}
.battle-header-title {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--brown-light);
}

/* ============================================================
   挑戰分類選擇（歷屆試題）
   ============================================================ */
.challenge-cat-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 0 10px;
}
.challenge-cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  padding: 14px 12px;
  font-family: inherit;
  border-radius: 18px;
  border: 2px solid rgba(90,74,66,0.18);
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(90,74,66,0.10);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.challenge-cat-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(90,74,66,0.14); }
.challenge-cat-btn:active { transform: scale(0.97); }
.challenge-cat-btn .btn-poem-label {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--brown);
}
.challenge-cat-btn .btn-poem-sub {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--brown-light);
}
.cat-yi { background: #eaf7e8; border-color: #b8e0b8; }
.cat-shoufa { background: #fff4e0; border-color: #f0d8a8; }
.cat-neirong { background: #e8f0fa; border-color: #b8d0e8; }
