/* Harvest Season Web 99% Faithful Edition */
:root {
  --primary-font: "DFKai-SB", "BiauKai", "Kaiti TC", "STKaiti", "楷體", "KaiTi", "Microsoft JhengHei", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  font-family: var(--primary-font);
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0b2e22;
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 62.5vw; /* 16:10 wide ratio */
  max-width: 160vh;
  max-height: 100vh;
  aspect-ratio: 16 / 10;
  background: #15a373;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

/* Screen Base */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.screen.active {
  display: block;
}

/* Top Bar */
.top-bar {
  position: absolute;
  top: 18px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  pointer-events: none;
}

.top-bar * {
  pointer-events: auto;
}

.back-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 54px;
  height: 54px;
  transition: transform 0.15s ease;
}

.back-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.back-btn:hover {
  transform: scale(1.1);
}

.coin-pill {
  background: #ffcc00;
  border: 3px solid #ff9900;
  border-radius: 30px;
  padding: 4px 18px 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.coin-pill .coin-icon {
  width: 38px;
  height: 38px;
  background: #ff9800;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 24px;
  border: 2px solid #fff;
}

.breadcrumb-text {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
  margin-left: 14px;
}

/* Screen Rabbit: Exact Header Matching Original Footage */
.game-top-bar {
  position: absolute;
  top: 18px;
  left: 20px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  pointer-events: none;
}

.game-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
}

.game-breadcrumb-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.25;
}

.breadcrumb-pub {
  font-size: 25px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 2px;
  text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.55), 0 0 2px rgba(0, 0, 0, 0.4);
}

.breadcrumb-sub {
  font-size: 21px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 1.5px;
  text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.55), 0 0 2px rgba(0, 0, 0, 0.4);
}

.game-coin-display {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 32px;
  font-weight: 900;
  color: #ffeb3b;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.6), 0 0 8px rgba(255, 235, 59, 0.35);
  pointer-events: auto;
}

.game-coin-display .coin-icon {
  width: 44px;
  height: 44px;
  background: radial-gradient(circle at 35% 35%, #ffd54f 0%, #ff9800 100%);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 28px;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Yellow Pill Action Buttons */
.yellow-btn {
  background: linear-gradient(180deg, #ffea60 0%, #f7b71d 100%);
  border: 3px solid #e28e00;
  border-radius: 35px;
  color: #8c4500;
  font-size: 28px;
  font-weight: 900;
  padding: 12px 36px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0,0,0,0.25), inset 0 3px 2px rgba(255,255,255,0.7);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.8);
}

.yellow-btn:hover {
  transform: translateY(-3px) scale(1.03);
  filter: brightness(1.05);
}

.yellow-btn:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Screen 1: Title Screen */
#screen-title {
  background-image: url('../assets/images/index_bg.png');
}

.title-fox {
  position: absolute;
  right: 14%;
  bottom: 8%;
  width: 145px;
  z-index: 10;
  pointer-events: none;
  animation: floatBreathing 3.5s infinite ease-in-out;
}

.title-fox img {
  width: 100%;
}

.title-center-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
}

.btn-start-play {
  background: linear-gradient(180deg, #38c8f5 0%, #0099db 100%);
  border: 4px solid #fff;
  border-radius: 40px;
  color: #fff;
  font-size: 34px;
  font-weight: 900;
  padding: 14px 50px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35), inset 0 3px 3px rgba(255,255,255,0.7);
  text-shadow: 2px 2px 4px #005c8a;
  transition: transform 0.15s ease;
}

.btn-start-play:hover {
  transform: scale(1.08);
}

.title-bottom-icons {
  position: absolute;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 28px;
  z-index: 20;
}

.circle-icon-btn {
  width: 66px;
  height: 66px;
  background: linear-gradient(180deg, #ffb347 0%, #ff8800 100%);
  border: 3px solid #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(0,0,0,0.3);
  transition: transform 0.15s ease;
}

.circle-icon-btn:hover {
  transform: scale(1.15);
}

/* Screen 2: Farm Selection (Faithful to Unity Game Image 3) */
.farm-select-screen {
  background: url('../assets/images/index_bg.png') no-repeat center center / cover;
  position: relative;
  overflow: hidden;
}

.farm-wavy-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 94%;
  z-index: 5;
  pointer-events: none;
}

.farm-wavy-modal-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: drop-shadow(0 14px 28px rgba(0, 45, 20, 0.3));
}

.round-green-back-btn {
  position: absolute;
  top: 20px;
  left: 24px;
  width: 54px;
  height: 54px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 35;
  padding: 0;
  transition: transform 0.15s ease;
  touch-action: manipulation;
}

.round-green-back-btn:hover {
  transform: scale(1.1);
}

.round-green-back-btn:active {
  transform: scale(0.95);
}

.round-green-back-btn img {
  width: 100%;
  height: 100%;
  display: block;
}

.farm-select-title {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  pointer-events: none;
}

.farm-select-title .zy-char {
  font-size: 32px;
  color: #147954;
  font-weight: 900;
  font-family: "DFKai-SB", "BiauKai", "PingFang TC", "Microsoft JhengHei", sans-serif;
  margin-right: 8px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.85);
}

.farm-select-title .zy-symbols,
.farm-select-title .zy-tone {
  color: #147954;
}

.farm-button-row {
  position: absolute;
  top: 44%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 24px;
  z-index: 30;
  width: 95%;
  max-width: 920px;
}

.farm-pill-btn {
  background: url('../assets/images/login_btn.png') no-repeat center center / contain;
  width: 245px;
  height: 76px;
  border: none;
  background-color: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px 6px 10px;
  transition: transform 0.15s ease, filter 0.15s ease;
  touch-action: manipulation;
}

.farm-pill-btn:hover {
  transform: translateY(-2px) scale(1.05);
  filter: brightness(1.05);
}

.farm-pill-btn:active {
  transform: translateY(1px) scale(0.97);
}

.farm-pill-btn .zy-char {
  font-size: 21px;
  color: #147954;
  font-weight: 900;
  font-family: "DFKai-SB", "BiauKai", "PingFang TC", "Microsoft JhengHei", sans-serif;
  margin-right: 4px;
}

.farm-pill-btn .zy-symbols,
.farm-pill-btn .zy-tone {
  color: #147954;
}

.farm-bunny-corner {
  position: absolute;
  left: 12px;
  bottom: -6px;
  width: 175px;
  z-index: 30;
  pointer-events: none;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.22));
}

.farm-bunny-corner img {
  width: 100%;
  display: block;
}

/* Menu Screens (Grade, Speed) */
.menu-screen {
  background: #d8f1e5;
  background-image: radial-gradient(#c2e5d3 20%, transparent 20%), radial-gradient(#c2e5d3 20%, transparent 20%);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
}

.menu-title-banner {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 38px;
  font-weight: 900;
  color: #217a55;
  text-shadow: 2px 2px 0 #fff;
  white-space: nowrap;
  text-align: center;
}

.menu-sub-banner {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 26px;
  font-weight: 900;
  color: #8c4500;
  white-space: nowrap;
}

.menu-button-row {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 28px;
  z-index: 20;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 90%;
}

.speed-card-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.speed-subtext {
  font-size: 18px;
  color: #2e6b52;
  font-weight: bold;
}

.menu-bunny-corner {
  position: absolute;
  left: 4%;
  bottom: 0;
  width: 170px;
  z-index: 10;
  pointer-events: none;
}

.menu-bunny-corner img {
  width: 100%;
}

/* Gameplay Screen (Whack-a-Mole) */
#screen-rabbit {
  background-image: url('../assets/images/rabbit_bg.png');
}

.cloud-target-banner {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 105px;
  background: #ffffff;
  border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15), inset 0 -3px 5px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  padding-top: 14px;
}

.cloud-target-char {
  font-size: 58px;
  font-weight: 900;
  color: #005b41;
  text-shadow: 1px 2px 3px rgba(0,0,0,0.12);
}

.holes-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.hole-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 230px;
  height: 160px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}

.cloud-target-char,
.bubble-char,
.bookmark-radical .big-char,
.ruby-char-unit,
.word-tile-box,
.zhuyin-hanzi {
  font-family: "DFKai-SB", "BiauKai", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

/* Authentic Depth Hole Cavity Mask */
/* Positioned in the left half of the hole so rabbit emerges on the left, clear of the word bubble */
.hole-cavity-mask {
  position: absolute;
  top: -155px;
  left: 10px;
  width: 135px;
  bottom: 45px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  pointer-events: none;
  z-index: 10;
}

.popping-bunny-wrapper {
  position: absolute;
  bottom: 0;
  width: 135px;
  height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  transform: translateY(115%);
  pointer-events: auto;
  transition: transform 0.22s cubic-bezier(0.4, 0, 1, 1);
}

/* When Rising: Smooth Ease-out with ears poking out first */
.hole-slot.up .popping-bunny-wrapper {
  transform: translateY(0);
  transition: transform 0.36s cubic-bezier(0.18, 0.89, 0.32, 1.25);
}

/* When Ducking: Fast smooth drop down */
.hole-slot:not(.up) .popping-bunny-wrapper {
  transform: translateY(115%);
  transition: transform 0.2s cubic-bezier(0.4, 0, 1, 1);
}

/* Bunny Sprite */
.bunny-sprite {
  width: 125px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.18));
  transition: transform 0.15s ease;
}

/* Subtle Idle Breathing/Bobbing while waiting */
.hole-slot.up:not(.hit-correct):not(.hit-wrong) .bunny-sprite {
  animation: bunnyIdleBreath 2.0s infinite ease-in-out alternate;
}

@keyframes bunnyIdleBreath {
  0% { transform: translateY(0) scale(1, 1); }
  50% { transform: translateY(-4px) scale(1.02, 0.99); }
  100% { transform: translateY(0) scale(1, 1); }
}

/* Dizzy Wobble on Hit */
.hole-slot.hit-correct .bunny-sprite,
.hole-slot.hit-wrong .bunny-sprite {
  animation: bunnyDizzyWobble 0.5s ease-in-out forwards;
}

@keyframes bunnyDizzyWobble {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg) translateY(3px); }
  50% { transform: rotate(8deg) translateY(-2px); }
  75% { transform: rotate(-4deg) translateY(1px); }
  100% { transform: rotate(0deg); }
}

/* Independent Speech Word Bubble Positioned at Bottom-Right of Hole (never obscuring rabbit face) */
.bunny-word-bubble {
  position: absolute;
  right: 2px;
  bottom: -4px;
  width: 96px;
  height: 96px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
}

.bunny-word-bubble::before {
  content: '';
  position: absolute;
  top: 24px;
  left: -5px;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 2px;
  transform: rotate(45deg);
  z-index: -1;
  box-shadow: -2px 2px 3px rgba(0, 0, 0, 0.08);
}

.bubble-char {
  font-size: 50px;
  font-weight: 900;
  color: #005b41;
  line-height: 1;
}

/* Word Bubble Spring Open Animation */
.hole-slot.up .bunny-word-bubble {
  animation: bubbleSpringOpen 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards;
  pointer-events: auto;
}

.hole-slot:not(.up) .bunny-word-bubble {
  animation: bubbleSpringClose 0.15s ease-in forwards;
}

@keyframes bubbleSpringOpen {
  0% { opacity: 0; transform: scale(0.2); }
  65% { opacity: 1; transform: scale(1.12); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes bubbleSpringClose {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.2); }
}

/* Toy Hammer Strike Effect */
.toy-hammer-fx {
  position: absolute;
  top: -45px;
  right: 15px;
  width: 95px;
  height: 95px;
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transform-origin: bottom right;
}

.hole-slot.whack-strike .toy-hammer-fx {
  animation: hammerStrikeAnim 0.4s ease-out forwards;
}

@keyframes hammerStrikeAnim {
  0% {
    opacity: 0;
    transform: translate(35px, -45px) rotate(45deg) scale(0.9);
  }
  30% {
    opacity: 1;
    transform: translate(-15px, 18px) rotate(-22deg) scale(1.1);
  }
  65% {
    opacity: 1;
    transform: translate(-15px, 18px) rotate(-18deg) scale(1.05);
  }
  100% {
    opacity: 0;
    transform: translate(20px, -25px) rotate(25deg) scale(0.9);
  }
}

/* Hit Correct Badge (Blue Circle O) */
.hit-correct-badge {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 85px;
  height: 85px;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
}

.hole-slot.hit-correct .hit-correct-badge {
  animation: badgePopAnim 0.5s ease-out forwards;
}

@keyframes badgePopAnim {
  0% { opacity: 0; transform: translateX(-50%) scale(0.2); }
  40% { opacity: 1; transform: translateX(-50%) scale(1.15); }
  70% { opacity: 1; transform: translateX(-50%) scale(1.0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-25px) scale(0.9); }
}

.hole-mound-img {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 90px;
  object-fit: contain;
  z-index: 15;
  pointer-events: none;
}

.wrong-cross-overlay {
  position: absolute;
  top: 35%;
  font-size: 64px;
  font-weight: 900;
  color: #e53935;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.4);
  display: none;
  z-index: 25;
}

.hole-slot.hit-wrong .wrong-cross-overlay {
  display: block;
  animation: popIn 0.3s ease;
}

.floating-money {
  position: absolute;
  font-size: 34px;
  font-weight: 900;
  z-index: 60;
  pointer-events: none;
  animation: floatUpFade 0.8s forwards cubic-bezier(0.2, 0.8, 0.2, 1);
}

.floating-money.plus {
  color: #ffeb3b;
  text-shadow: 2px 2px 4px #000;
}

.floating-money.minus {
  color: #ff3d00;
  text-shadow: 2px 2px 4px #000;
}

/* Settlement Screen Faithful to Image 2 (Authentic Original) */
#screen-result {
  background: url('../assets/images/settlement_bg.png') no-repeat center center;
  background-size: cover;
  overflow: hidden;
  position: relative;
}

.settlement-card {
  position: absolute;
  inset: 0;
  padding: 24px 36px 16px 36px;
  display: flex;
  flex-direction: column;
}

.settlement-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  height: 115px;
}

.bookmark-radical {
  position: absolute;
  top: -24px;
  left: 48px;
  width: 124px;
  height: 140px;
  background: url('../assets/images/settle_bookmark.svg?v=20260914c') no-repeat center top / contain;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.25));
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 22px;
  z-index: 20;
}

.bookmark-radical .big-char {
  font-size: 68px;
  font-weight: 900;
  color: #007953;
  line-height: 1;
  font-family: "DFKai-SB", "BiauKai", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

.settle-score-bar-center {
  position: absolute;
  left: 50%;
  top: 40px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 15;
}

.score-line-flank {
  width: 140px;
  height: 3px;
  background: #ffc107;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.score-coin-badge {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

.score-multiplier-text {
  font-size: 46px;
  font-weight: 900;
  color: #ffeb3b;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
  letter-spacing: 2px;
  font-family: Arial, "DFKai-SB", sans-serif;
}

.result-exit-circle-btn {
  position: absolute;
  top: 20px;
  right: 28px;
  width: 52px;
  height: 52px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
  z-index: 30;
}

.result-exit-circle-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.result-exit-circle-btn:hover {
  transform: scale(1.1);
}

.result-exit-circle-btn:active {
  transform: scale(0.95);
}

.settlement-body {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  margin-top: 45px;
  padding: 0 20px;
  flex: 1;
}

.verdict-col {
  display: flex;
  flex-direction: column;
}

.verdict-label-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  font-size: 24px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
  margin-bottom: 8px;
  font-family: "DFKai-SB", "BiauKai", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

.label-row-cyan {
  color: #ffffff !important;
}

/* Authentic Taiwan Primary School Vertical Zhuyin on Right */
.zy-char {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  position: relative;
  line-height: 1;
  margin-right: 8px;
  font-family: "DFKai-SB", "BiauKai", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

.zy-hz {
  font-size: inherit;
  font-weight: 900;
  line-height: 1;
  font-family: inherit;
}

.zy-col {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  position: relative;
  margin-left: 2px;
  vertical-align: middle;
}

.zy-symbols {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 0.92;
  font-size: 0.44em;
  font-family: "DFKai-SB", "BiauKai", "Microsoft JhengHei", Arial, sans-serif;
  font-weight: 900;
}

.zy-symbols span {
  display: block;
  line-height: 0.92;
}

.zy-tone {
  position: absolute;
  left: 100%;
  top: 10%;
  font-size: 0.40em;
  font-weight: 900;
  line-height: 1;
  margin-left: 1px;
  font-family: inherit;
}

.zy-tone.tone-5 {
  top: -0.42em;
  left: 50%;
  transform: translateX(-50%);
  margin-left: 0;
  font-size: 0.35em;
}

.verdict-label-row .zy-char {
  font-size: 26px;
  color: #ffffff;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

.verdict-label-row .zy-symbols,
.verdict-label-row .zy-tone {
  color: #ffffff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.label-row-cyan .zy-char,
.label-row-cyan .zy-symbols,
.label-row-cyan .zy-tone {
  color: #e0f7fa;
}

.verdict-row-with-ribbon {
  display: flex;
  align-items: center;
  gap: 12px;
}

.verdict-ribbon-img {
  width: 44px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
}

.verdict-tiles-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  min-height: 56px;
}

.word-tile-box {
  width: 56px;
  height: 56px;
  background: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 900;
  color: #00acc1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-family: "DFKai-SB", "BiauKai", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

.word-tile-box:hover {
  transform: scale(1.12) translateY(-3px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.word-tile-box:active {
  transform: scale(0.95);
}

.word-tile-box.wrong-tile {
  color: #d32f2f;
}

/* Settlement Footer matching Image 2 */
.settlement-footer {
  position: relative;
  height: 160px;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.settle-vocab-actor-group {
  position: absolute;
  right: 28px;
  bottom: 68px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  z-index: 20;
}

.emerald-vocab-card {
  background: #008955;
  border: 3px solid #48ca98;
  border-radius: 24px;
  padding: 12px 26px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 85px;
}

/* Accurate Zhuyin Layout for Vocabulary in Settlement */
.zhuyin-word-display {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

.zhuyin-unit {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.zhuyin-hanzi {
  font-size: 52px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
  line-height: 1;
  font-family: "DFKai-SB", "BiauKai", "PingFang TC", sans-serif;
}

.zhuyin-side {
  display: inline-flex;
  position: relative;
  margin-left: 5px;
  align-items: center;
}

.zhuyin-chars {
  display: flex;
  flex-direction: column;
  font-size: 18px;
  line-height: 1.05;
  font-weight: 900;
  color: #fff59d;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  font-family: Arial, "DFKai-SB", sans-serif;
}

.zhuyin-tone {
  position: absolute;
  top: 0;
  left: 100%;
  font-size: 16px;
  font-weight: 900;
  color: #ffe082;
  margin-left: 2px;
}

.zhuyin-tone.tone-5 {
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  margin-left: 0;
  font-size: 14px;
}

.settlement-bunny-actor {
  width: 145px;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.25));
  margin-left: -15px;
  margin-bottom: -6px;
}

.settlement-bunny-actor img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.settlement-action-btns {
  position: absolute;
  right: 28px;
  bottom: 12px;
  display: flex;
  gap: 20px;
  z-index: 25;
}

.yellow-btn-zhuyin {
  background: linear-gradient(180deg, #ffe082 0%, #ffb300 100%);
  border: 2.5px solid #ffffff;
  border-radius: 32px;
  padding: 7px 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.yellow-btn-zhuyin:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.yellow-btn-zhuyin:active {
  transform: translateY(1px) scale(0.98);
}

.yellow-btn-zhuyin .zy-char {
  font-size: 20px;
  color: #4e342e;
  margin-right: 6px;
}

.yellow-btn-zhuyin .zy-symbols,
.yellow-btn-zhuyin .zy-tone {
  color: #5d4037;
}

/* Animations */
@keyframes floatBreathing {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes popIn {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes floatUpFade {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-50px); opacity: 0; }
}

.screen-shake {
  animation: shake 0.35s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px) rotate(-1deg); }
  40% { transform: translateX(8px) rotate(1deg); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* Modals Overlay (Matching Unity 1.0.0 UI) */
.game-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.2s ease;
}

.game-modal-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog-box {
  background: #fdfbf7;
  border-radius: 28px;
  border: 4px solid #ffb74d;
  box-shadow: 0 12px 36px rgba(0,0,0,0.5);
  padding: 24px 30px;
  width: 460px;
  max-width: 90%;
  position: relative;
  animation: popIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-title {
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  color: #3e2723;
  margin-bottom: 18px;
  border-bottom: 2px dashed #ffe082;
  padding-bottom: 8px;
}

.modal-content-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 20px;
  color: #4e342e;
  font-weight: bold;
}

.toggle-btn {
  border: none;
  border-radius: 20px;
  padding: 6px 18px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn.on {
  background: #4caf50;
  color: #fff;
}

.toggle-btn.off {
  background: #9e9e9e;
  color: #fff;
}

.rank-table-box {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rank-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  background: #fff8e1;
  border-radius: 12px;
  font-size: 20px;
  font-weight: bold;
  color: #5d4037;
}

/* Settlement Fox Dialog (Video 2 Style) */
.settle-fox-dialog-container {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 60%;
  position: relative;
}

.fox-speech-bubble {
  background: #ffffff;
  border: 3px solid #ffb74d;
  border-radius: 20px;
  padding: 12px 18px;
  font-size: 20px;
  font-weight: 900;
  color: #37474f;
  line-height: 1.4;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  position: relative;
}

.fox-speech-bubble::after {
  content: "";
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 8px 0 8px 14px;
  border-style: solid;
  border-color: transparent transparent transparent #ffffff;
}

.fox-dialog-avatar {
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.fox-dialog-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.word-tile-box {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.word-tile-box:hover {
  transform: scale(1.15) translateY(-3px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.3);
}

.word-tile-box:active {
  transform: scale(0.95);
}

/* ==========================================================================
   Plan B: Mobile & Tablet Orientation Prompt, 90deg Force Landscape & Touch UX
   ========================================================================== */

/* Orientation Overlay */
.rotate-device-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 46, 34, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.rotate-device-overlay.active {
  display: flex;
}

.rotate-prompt-card {
  background: linear-gradient(180deg, #ffffff 0%, #f3fdf8 100%);
  border: 4px solid #43a047;
  border-radius: 28px;
  padding: 34px 28px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  animation: popIn 0.3s ease-out;
}

.rotate-device-icon {
  font-size: 58px;
  display: inline-block;
  animation: phoneRotateAnim 2.2s infinite ease-in-out;
  margin-bottom: 12px;
}

@keyframes phoneRotateAnim {
  0%, 20% { transform: rotate(0deg); }
  50%, 70% { transform: rotate(90deg); }
  90%, 100% { transform: rotate(0deg); }
}

.rotate-prompt-title {
  font-size: 24px;
  font-weight: 900;
  color: #1b5e20;
  margin-bottom: 12px;
}

.rotate-prompt-desc {
  font-size: 16px;
  color: #455a64;
  line-height: 1.55;
  margin-bottom: 24px;
}

.rotate-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.btn-force-rotate {
  font-size: 20px !important;
  padding: 10px 24px !important;
  width: 100%;
}

.text-link-btn {
  background: none;
  border: none;
  color: #2e7d32;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: underline;
  padding: 8px;
  touch-action: manipulation;
}

/* Floating Orient Toggle Button in Bottom Corner */
.floating-orient-btn {
  position: fixed;
  bottom: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #2e7d32;
  border-radius: 50%;
  font-size: 22px;
  color: #1b5e20;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s;
  touch-action: manipulation;
}

.floating-orient-btn:hover {
  transform: scale(1.1);
  background: #ffffff;
}

/* Floating Controls Group (Bottom Right) */
.floating-controls-group {
  position: fixed;
  bottom: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
}

.floating-ctrl-btn {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.94);
  border: 2px solid #2e7d32;
  border-radius: 50%;
  font-size: 22px;
  color: #1b5e20;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s;
  touch-action: manipulation;
}

.floating-ctrl-btn:hover {
  transform: scale(1.1);
  background: #ffffff;
}

.floating-ctrl-btn:active {
  transform: scale(0.95);
}

/* Header Fullscreen Button */
.fullscreen-header-btn {
  background: rgba(255, 255, 255, 0.88);
  border: 2px solid #2e7d32;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 17px;
  font-weight: 900;
  color: #1b5e20;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  touch-action: manipulation;
}

.fullscreen-header-btn:hover {
  background: #ffffff;
  transform: scale(1.05);
}

/* Fullscreen Mode on #game-container */
#game-container.fullscreen-mode {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  z-index: 99990 !important;
}

/* Force 90-degree Landscape Mode on Portrait Displays */
body.force-landscape {
  overflow: hidden !important;
  width: 100vw !important;
  height: 100vh !important;
}

body.force-landscape #game-container {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  width: 100vh !important;
  height: 75vh !important;
  max-width: none !important;
  max-height: 100vw !important;
  transform: translate(-50%, -50%) rotate(90deg) !important;
  transform-origin: center center !important;
  box-shadow: none !important;
}

/* Mobile & Touch General Tweaks */
@media (max-width: 768px) {
  .breadcrumb-pub {
    font-size: 20px;
  }
  .breadcrumb-sub {
    font-size: 17px;
  }
  .game-coin-display {
    font-size: 26px;
  }
  .game-coin-display .coin-icon {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }
  .cloud-target-banner {
    width: 180px;
    height: 85px;
    padding-top: 10px;
  }
  .cloud-target-char {
    font-size: 44px;
  }
  .hole-slot {
    width: 160px;
    height: 120px;
  }
  .hole-mound-img {
    height: 75px;
  }
  .popping-bunny-wrapper {
    width: 130px;
    height: 155px;
  }
  .bunny-sprite {
    width: 105px;
  }
  .bunny-word-bubble {
    width: 76px;
    height: 76px;
  }
  .bubble-char {
    font-size: 38px;
  }
}

