/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Sky & atmosphere */
  --sky-top: #4a7fb5;
  --sky-mid: #7db4d8;
  --sky-low: #b5d8ec;

  /* Landscape */
  --mountain: #6b7f6b;
  --mountain-shadow: #556455;
  --hill-far: #5e8a4a;
  --hill-mid: #6a9e52;
  --hill-near: #78b25c;
  --ground: #5a9444;
  --ground-shadow: #4e8038;
  --ground-dark: #3e6e2c;

  /* Farm structures */
  --barn-red: #8b3028;
  --barn-dark: #6a221c;
  --barn-trim: #f0d88a;
  --wood: #6b4226;
  --wood-light: #8c6239;
  --wood-dark: #4a2e18;
  --fence-color: #7a5a3a;
  --fence-light: #9e7e5a;
  --stable-wood: #8a6840;
  --stable-dark: #5e4428;
  --stable-roof: #6a5038;

  /* UI */
  --cream: #faf5ec;
  --text-dark: #2c1810;
  --text-muted: #6b5a4e;
  --btn-primary: #5a8e3e;
  --btn-primary-hover: #4e7e36;
  --btn-primary-shadow: #3e6a2c;
  --btn-primary-text: #f5f0e8;
  --card-bg: rgba(255, 255, 255, 0.92);
  --card-border: rgba(0, 0, 0, 0.08);
  --locked-bg: #d8d2c8;
  --locked-border: #b8b0a4;
  --locked-text: #9a9088;
  --completed-bg: #e8d8a0;
  --completed-border: #c8b478;
  --completed-check: #4a8030;
  --unlocked-border: #5a8e3e;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Georgia', 'Times New Roman', serif;
  background: var(--ground);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}

/* ===== Screen Management ===== */
.screen {
  display: none;
  position: fixed;
  inset: 0;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}

.screen.active {
  display: flex;
}

/* ===== Buttons ===== */
.btn-primary {
  font-family: 'Georgia', serif;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 14px 44px;
  border: none;
  border-radius: 8px;
  background: var(--btn-primary);
  color: var(--btn-primary-text);
  cursor: pointer;
  letter-spacing: 0.5px;
  box-shadow:
    0 3px 0 var(--btn-primary-shadow),
    0 4px 12px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255,255,255,0.15);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  position: relative;
  z-index: 10;
}

.btn-primary:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-1px);
  box-shadow:
    0 4px 0 var(--btn-primary-shadow),
    0 6px 16px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow:
    0 1px 0 var(--btn-primary-shadow),
    0 2px 4px rgba(0,0,0,0.12);
}

.btn-back {
  font-family: inherit;
  font-size: 1.3rem;
  width: 40px;
  height: 40px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: transform 0.12s ease;
}

.btn-back:hover {
  transform: scale(1.06);
}

/* ===== Screen Header ===== */
.screen-header {
  width: 100%;
  max-width: 500px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  z-index: 5;
}

.screen-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  flex: 1;
}

.btn-reset {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border: 1px solid #c4a4a4;
  border-radius: 8px;
  background: #f5e8e8;
  color: #8a4040;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.btn-reset:hover {
  background: #ecd8d8;
  transform: scale(1.04);
}

.btn-reset:active {
  transform: scale(0.96);
}

/* =========================================
   TITLE SCREEN — Farm Scene
   ========================================= */
#screen-title {
  justify-content: flex-start;
  overflow: hidden;
}

.farm-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

/* Sky */
.sky {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(
    to bottom,
    var(--sky-top) 0%,
    var(--sky-mid) 50%,
    var(--sky-low) 100%
  );
}

/* Sun */
.sun {
  position: absolute;
  top: 6%;
  right: 16%;
  width: 55px;
  height: 55px;
  background: radial-gradient(circle, #fff8e0 0%, #f5dca0 40%, rgba(245,220,160,0) 70%);
  border-radius: 50%;
  z-index: 1;
}

.sun::after {
  content: '';
  position: absolute;
  inset: -25px;
  background: radial-gradient(circle, rgba(245,220,160,0.25) 0%, transparent 65%);
  border-radius: 50%;
}

/* Clouds */
.cloud {
  position: absolute;
  background: rgba(255,255,255,0.55);
  border-radius: 50px;
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.cloud-1 {
  width: 120px;
  height: 28px;
  top: 12%;
  left: 5%;
  opacity: 0.7;
  animation: cloud-drift 90s linear infinite;
}
.cloud-1::before { width: 48px; height: 38px; top: -16px; left: 18px; }
.cloud-1::after { width: 38px; height: 28px; top: -10px; left: 52px; }

.cloud-2 {
  width: 85px;
  height: 22px;
  top: 20%;
  right: 22%;
  opacity: 0.5;
  animation: cloud-drift 110s linear infinite;
  animation-delay: -35s;
}
.cloud-2::before { width: 38px; height: 30px; top: -12px; left: 14px; }
.cloud-2::after { width: 28px; height: 22px; top: -8px; left: 40px; }

.cloud-3 {
  width: 65px;
  height: 18px;
  top: 8%;
  left: 42%;
  opacity: 0.4;
  animation: cloud-drift 130s linear infinite;
  animation-delay: -70s;
}
.cloud-3::before { width: 32px; height: 26px; top: -10px; left: 10px; }

@keyframes cloud-drift {
  from { transform: translateX(-200px); }
  to { transform: translateX(calc(100vw + 200px)); }
}

/* Mountains */
.mountains {
  position: absolute;
  bottom: 48%;
  left: -5%;
  right: -5%;
  height: 18%;
  background: linear-gradient(135deg, var(--mountain) 30%, var(--mountain-shadow) 70%);
  clip-path: polygon(
    0% 100%,
    5% 55%, 12% 70%, 20% 30%, 30% 60%, 38% 20%, 48% 50%,
    55% 15%, 62% 45%, 70% 25%, 78% 55%, 85% 35%, 92% 60%, 100% 40%,
    100% 100%
  );
  opacity: 0.45;
}

/* Layered hills */
.hills-far {
  position: absolute;
  bottom: 42%;
  left: -10%;
  right: -10%;
  height: 16%;
  background: var(--hill-far);
  border-radius: 60% 50% 0 0 / 100% 100% 0 0;
  opacity: 0.8;
}

.hills-mid {
  position: absolute;
  bottom: 37%;
  left: -8%;
  right: -12%;
  height: 14%;
  background: var(--hill-mid);
  border-radius: 45% 55% 0 0 / 100% 80% 0 0;
}

.hills-near {
  position: absolute;
  bottom: 32%;
  right: -10%;
  width: 70%;
  height: 12%;
  background: var(--hill-near);
  border-radius: 50% 40% 0 0 / 100% 100% 0 0;
}

.ground {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(
    to bottom,
    var(--ground) 0%,
    var(--ground-shadow) 60%,
    var(--ground-dark) 100%
  );
}

/* Distant sheep (white dots on hills) */
.distant-sheep {
  position: absolute;
  width: 14px;
  height: 10px;
  background: #e8e4da;
  border-radius: 50%;
  opacity: 0.7;
  z-index: 1;
}

.distant-sheep::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 1px;
  width: 6px;
  height: 5px;
  background: #4a4240;
  border-radius: 50%;
}

.sheep-1 { bottom: 44%; left: 18%; }
.sheep-2 { bottom: 45%; left: 28%; transform: scale(0.8); }
.sheep-3 { bottom: 43%; left: 23%; transform: scale(0.6); opacity: 0.5; }

/* ===== Stable ===== */
.stable {
  position: absolute;
  bottom: 28%;
  left: 3%;
  z-index: 2;
}

.stable-roof {
  width: 130px;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 22px solid var(--stable-roof);
  position: relative;
}

.stable-roof::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -6px;
  width: 122px;
  height: 3px;
  background: var(--stable-dark);
}

.stable-body {
  width: 110px;
  height: 42px;
  margin-left: 5px;
  position: relative;
  background: linear-gradient(to bottom, var(--stable-wood), var(--stable-dark));
}

.stable-stall {
  position: absolute;
  top: 0;
  height: 100%;
  border-right: 2px solid var(--stable-dark);
}

.stable-stall:nth-child(1) { left: 33%; width: 1px; }
.stable-stall:nth-child(2) { left: 66%; width: 1px; }

.stable-post {
  position: absolute;
  bottom: 0;
  width: 5px;
  height: 48px;
  background: linear-gradient(to right, var(--wood-dark), var(--wood), var(--wood-dark));
}

.stable-post:nth-child(4) { left: -2px; }
.stable-post.post-2 { left: 33%; }
.stable-post.post-3 { left: 66%; }
.stable-post.post-4 { right: -2px; }

/* ===== Barn ===== */
.barn {
  position: absolute;
  bottom: 30%;
  right: 5%;
  z-index: 2;
}

.barn-roof {
  width: 0;
  height: 0;
  border-left: 65px solid transparent;
  border-right: 65px solid transparent;
  border-bottom: 40px solid var(--barn-dark);
  margin-left: -8px;
  position: relative;
}

.barn-roof-shadow {
  position: absolute;
  top: 100%;
  left: -57px;
  width: 114px;
  height: 4px;
  background: rgba(0,0,0,0.2);
}

.barn-body {
  width: 114px;
  height: 72px;
  background: linear-gradient(to bottom, var(--barn-red), #7a2820);
  position: relative;
  box-shadow: 2px 0 8px rgba(0,0,0,0.12);
}

/* X brace on barn */
.barn-x-brace {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 40px;
  height: 34px;
}

.barn-x-brace::before,
.barn-x-brace::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-top: 2px solid rgba(255,255,255,0.12);
}

.barn-x-brace::before {
  transform: rotate(40deg);
  transform-origin: top left;
  width: 52px;
}

.barn-x-brace::after {
  transform: rotate(-40deg);
  transform-origin: top right;
  left: auto;
  right: 0;
  width: 52px;
}

.barn-window {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 18px;
  height: 18px;
  background: var(--barn-trim);
  border: 2px solid var(--barn-dark);
  opacity: 0.8;
}

.barn-window::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--barn-dark);
  transform: translateY(-50%);
}

.barn-window::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--barn-dark);
  transform: translateX(-50%);
}

.barn-window-2 {
  right: 34px;
}

.barn-door {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 48px;
  background: linear-gradient(to bottom, var(--barn-dark), #4a1610);
  border-radius: 17px 17px 0 0;
  border: 2px solid #3a1210;
  border-bottom: none;
}

.barn-door-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #3a1210;
}

/* Silo */
.silo {
  position: absolute;
  bottom: 0;
  left: -28px;
  width: 24px;
  height: 85px;
  background: linear-gradient(to right, #7a7a7a, #a8a8a8, #888);
  border-radius: 12px 12px 0 0;
}

.silo::before {
  content: '';
  position: absolute;
  top: -6px;
  left: -2px;
  width: 28px;
  height: 10px;
  background: linear-gradient(to right, #888, #b0b0b0, #999);
  border-radius: 50%;
}

/* ===== Fence ===== */
.fence {
  position: absolute;
  bottom: 22%;
  left: 15%;
  width: 55%;
  height: 40px;
  z-index: 3;
}

.fence-post {
  position: absolute;
  bottom: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(to right, var(--fence-color), var(--fence-light), var(--fence-color));
  border-radius: 2px 2px 0 0;
}

.fence-post::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -1px;
  width: 7px;
  height: 5px;
  background: var(--fence-color);
  border-radius: 2px 2px 0 0;
}

.fence-post:nth-child(1) { left: 0; }
.fence-post:nth-child(2) { left: 14%; }
.fence-post:nth-child(3) { left: 28%; }
.fence-post:nth-child(4) { left: 42%; }
.fence-post:nth-child(5) { left: 56%; }
.fence-post:nth-child(6) { left: 70%; }
.fence-post:nth-child(7) { left: 86%; }

.fence-rail {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to bottom, var(--fence-light), var(--fence-color));
  border-radius: 1px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}

.fence-rail.top { top: 10px; }
.fence-rail.bottom { top: 24px; }

/* ===== Hay Bales ===== */
.hay-bale {
  position: absolute;
  z-index: 2;
}

.bale-1 {
  bottom: 24%;
  right: 28%;
  width: 32px;
  height: 24px;
  background: linear-gradient(to bottom, #d4b468, #b89848);
  border-radius: 4px;
  box-shadow: 1px 2px 4px rgba(0,0,0,0.15);
}

.bale-1::before {
  content: '';
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 3px;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 4px,
    rgba(0,0,0,0.05) 4px,
    rgba(0,0,0,0.05) 5px
  );
}

.bale-2 {
  bottom: 27%;
  right: 25%;
  width: 28px;
  height: 28px;
  background: radial-gradient(circle, #d8ba70, #c4a050);
  border-radius: 50%;
  box-shadow: 1px 2px 4px rgba(0,0,0,0.15);
}

.bale-2::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    transparent 0deg 15deg,
    rgba(0,0,0,0.04) 15deg 30deg
  );
}

/* ===== Water Trough ===== */
.trough {
  position: absolute;
  bottom: 18%;
  right: 22%;
  width: 40px;
  height: 16px;
  background: linear-gradient(to bottom, #6a6a6a, #888);
  border-radius: 3px;
  z-index: 2;
}

.trough::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 3px;
  right: 3px;
  height: 8px;
  background: linear-gradient(to bottom, #5a8ab8, #4a7aa8);
  border-radius: 2px;
}

.trough::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 5px;
  width: 4px;
  height: 8px;
  background: #6a6a6a;
  box-shadow: 26px 0 0 #6a6a6a;
}

/* ===== Chickens ===== */
.chicken {
  position: absolute;
  z-index: 4;
}

.chicken-1 {
  width: 32px;
  height: 30px;
  bottom: 16%;
  right: 38%;
  transform: scaleX(-1);
}

.chicken-2 {
  width: 28px;
  height: 26px;
  bottom: 14%;
  right: 28%;
  animation: chicken-peck 3s ease-in-out infinite;
  animation-delay: -1s;
}

.chicken-3 {
  width: 26px;
  height: 24px;
  bottom: 15%;
  right: 32%;
  animation: chicken-peck 4s ease-in-out infinite;
}

@keyframes chicken-peck {
  0%, 80%, 100% { transform: rotate(0deg); }
  85% { transform: rotate(15deg); }
  90% { transform: rotate(0deg); }
  95% { transform: rotate(12deg); }
}

/* ===== Foreground Sheep ===== */
.sheep-fg {
  position: absolute;
  width: 55px;
  height: 42px;
  bottom: 16%;
  right: 12%;
  z-index: 3;
}

/* ===== Grass Tufts ===== */
.tuft {
  position: absolute;
  bottom: 0;
}

.tuft::before,
.tuft::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 3px;
  background: #6aaa4a;
  border-radius: 2px 2px 0 0;
}

.tuft-1 { left: 12%; bottom: 32%; }
.tuft-1::before { height: 12px; transform: rotate(-10deg); }
.tuft-1::after { height: 10px; left: 5px; transform: rotate(8deg); }

.tuft-2 { left: 25%; bottom: 30%; }
.tuft-2::before { height: 9px; transform: rotate(-6deg); }
.tuft-2::after { height: 11px; left: 5px; transform: rotate(12deg); }

.tuft-3 { right: 30%; bottom: 28%; }
.tuft-3::before { height: 10px; transform: rotate(-12deg); }
.tuft-3::after { height: 8px; left: 5px; transform: rotate(5deg); }

.tuft-4 { right: 12%; bottom: 26%; }
.tuft-4::before { height: 9px; transform: rotate(-8deg); }
.tuft-4::after { height: 12px; left: 5px; transform: rotate(10deg); }

.tuft-5 { left: 55%; bottom: 25%; }
.tuft-5::before { height: 8px; transform: rotate(-5deg); }
.tuft-5::after { height: 10px; left: 4px; transform: rotate(10deg); }

.tuft-6 { left: 70%; bottom: 27%; }
.tuft-6::before { height: 11px; transform: rotate(-10deg); }
.tuft-6::after { height: 9px; left: 5px; transform: rotate(7deg); }

/* ===== Title Content (top overlay) ===== */
.title-top {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 6vh;
  padding-bottom: 10px;
}

.game-title {
  font-family: 'Georgia', serif;
  font-size: 1.9rem;
  text-align: center;
  color: #faf5ec;
  line-height: 1.35;
  text-shadow:
    0 2px 4px rgba(0,0,0,0.35),
    0 0 20px rgba(0,0,0,0.15);
  letter-spacing: 0.3px;
}

/* ===== Cow Grounded on Field (left side) ===== */
.cow-ground {
  position: absolute;
  bottom: 10%;
  left: 3%;
  z-index: 5;
}

.cow-shadow {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 12px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.2) 0%, transparent 70%);
  border-radius: 50%;
}

.cow-character {
  width: 180px;
  height: 220px;
  animation: cow-idle 4s ease-in-out infinite;
}

.cow-svg {
  width: 100%;
  height: 100%;
}

.cow-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes cow-idle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ===== Level Select Screen ===== */
#screen-levels {
  background: linear-gradient(
    to bottom,
    var(--sky-low) 0%,
    #d4e8d0 30%,
    var(--cream) 100%
  );
  justify-content: flex-start;
  padding-top: env(safe-area-inset-top, 0);
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: min-content;
  gap: 10px;
  padding: 8px 20px 30px;
  max-width: 380px;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.level-btn {
  font-family: 'Georgia', serif;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.level-btn:hover:not(.locked) {
  transform: scale(1.06);
}

.level-btn:active:not(.locked) {
  transform: scale(0.96);
}

/* Unlocked */
.level-btn.unlocked {
  background: white;
  color: var(--text-dark);
  border-color: var(--unlocked-border);
  box-shadow:
    0 2px 0 var(--btn-primary-shadow),
    0 3px 8px rgba(0,0,0,0.1);
}

.level-btn.unlocked:hover {
  box-shadow:
    0 3px 0 var(--btn-primary-shadow),
    0 5px 12px rgba(0,0,0,0.14);
}

/* Locked */
.level-btn.locked {
  background: var(--locked-bg);
  color: var(--locked-text);
  border-color: var(--locked-border);
  cursor: not-allowed;
  box-shadow: 0 1px 0 #a8a098;
}

.level-btn.locked .level-icon::before {
  content: '\1F512';
  font-size: 0.85rem;
}

/* Completed */
.level-btn.completed {
  background: var(--completed-bg);
  color: var(--text-dark);
  border-color: var(--completed-border);
  box-shadow:
    0 2px 0 #b0a068,
    0 3px 8px rgba(0,0,0,0.1);
}

.level-btn.completed .level-icon::before {
  content: '\2714';
  font-size: 0.85rem;
  color: var(--completed-check);
}

.level-num {
  font-size: 1.2rem;
  line-height: 1;
}

.level-icon {
  font-size: 0.8rem;
  height: 1rem;
}

/* ===== Puzzle Screen ===== */
#screen-puzzle {
  background: var(--cream);
  justify-content: flex-start;
  padding-top: env(safe-area-inset-top, 0);
}

.puzzle-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 20px;
  text-align: center;
  width: 100%;
  max-width: 500px;
}

.puzzle-placeholder {
  font-size: 1.1rem;
  color: var(--text-muted);
  padding: 36px;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ===== Complete Screen ===== */
#screen-complete {
  background: linear-gradient(
    to bottom,
    #f5e8c0 0%,
    #faf2da 40%,
    #d4e8c8 100%
  );
  justify-content: center;
}

.complete-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 20px;
}

.cow-celebrate {
  width: 180px;
  height: 220px;
  animation: cow-bounce 0.7s ease-in-out infinite;
}

@keyframes cow-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  30% { transform: translateY(-8px) rotate(-1.5deg); }
  70% { transform: translateY(-8px) rotate(1.5deg); }
}

.speech-bubble {
  background: white;
  border-radius: 16px;
  padding: 18px 24px;
  position: relative;
  border: 1px solid var(--card-border);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  text-align: center;
  max-width: 280px;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 13px solid white;
  filter: drop-shadow(0 -1px 0 rgba(0,0,0,0.06));
}

.congrats-text {
  font-family: 'Georgia', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--btn-primary);
  margin-bottom: 4px;
}

#complete-message {
  font-size: 1rem;
  color: var(--text-muted);
}

/* ===== Farm Task Screen ===== */
#screen-farm-task {
  background: linear-gradient(
    to bottom,
    var(--sky-low),
    #c8deb8 50%,
    var(--ground) 100%
  );
  justify-content: center;
}

.farm-task-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px;
  text-align: center;
  max-width: 460px;
  width: 100%;
}

.farm-task-content h2 {
  font-family: 'Georgia', serif;
  font-size: 1.8rem;
  color: var(--text-dark);
}

.farm-task-content p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 320px;
}

.farm-task-progress {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.8);
  padding: 4px 14px;
  border-radius: 999px;
  min-height: 1.4em;
}

.farm-task-progress.farm-task-done {
  color: var(--btn-primary);
  animation: cow-bounce 0.6s ease;
}

/* Play area */
.farm-task-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: 100%;
  padding: 10px 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.farm-targets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 16px;
  min-height: 96px;
}

.farm-sources {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

/* Targets (animals / messes / incubator) */
.farm-animal {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.farm-cow-img {
  width: 76px;
  height: auto;
  display: block;
}

.farm-chicken-svg {
  width: 70px;
  height: 64px;
}

.farm-sheep-svg {
  width: 92px;
  height: 70px;
}

.farm-sheep .sheep-skin {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.farm-sheep.done .sheep-wool {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.farm-sheep.done .sheep-skin {
  opacity: 1;
}

.farm-mess {
  font-size: 2.4rem;
  line-height: 1;
  padding: 8px;
  border-radius: 12px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.farm-mess.done {
  opacity: 0;
  transform: scale(0.4) rotate(20deg);
  pointer-events: none;
}

/* Badge shown on completed animal targets */
.farm-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 1.3rem;
  opacity: 0;
  transform: scale(0.3);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.farm-animal.done .farm-badge {
  opacity: 1;
  transform: scale(1);
}

.farm-animal.done {
  animation: farm-munch 0.5s ease;
}

@keyframes farm-munch {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-6px) rotate(-3deg); }
  60% { transform: translateY(-6px) rotate(3deg); }
}

/* Dropzone feedback */
.farm-dropzone.over {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 3px var(--btn-primary);
  transform: scale(1.06);
}

/* Incubator */
.farm-incubator {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.farm-incubator-box {
  font-size: 3rem;
  line-height: 1;
}

.farm-incubator-eggs {
  display: flex;
  gap: 2px;
  min-height: 1.2em;
  font-size: 1.1rem;
}

.farm-incubator-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* Draggable tools / items */
.farm-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.farm-tool-icon {
  font-size: 2.6rem;
  line-height: 1;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 2px solid var(--card-border);
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.farm-tool-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}

.farm-egg {
  width: 48px;
  height: 48px;
  font-size: 2rem;
}

.farm-draggable {
  cursor: grab;
  touch-action: none;
  transition: transform 0.1s ease;
}

.farm-draggable:active {
  cursor: grabbing;
}

.farm-source-hidden {
  opacity: 0.25;
  pointer-events: none;
}

.farm-drag-clone {
  position: fixed;
  left: 0;
  top: 0;
  margin: 0;
  pointer-events: none;
  z-index: 1000;
  transform: scale(1.1);
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.25));
}

#btn-farm-continue.ready {
  animation: cow-bounce 0.6s ease;
}

/* ===== Responsive ===== */
@media (max-height: 600px) {
  .cow-character {
    width: 130px;
    height: 160px;
  }

  .cow-celebrate {
    width: 140px;
    height: 170px;
  }

  .cow-ground {
    bottom: 6%;
  }

  .title-top {
    padding-top: 3vh;
  }

  .game-title {
    font-size: 1.4rem;
  }

  .btn-primary {
    padding: 10px 32px;
    font-size: 1rem;
  }
}

@media (min-width: 500px) {
  .level-grid {
    gap: 12px;
  }

  .game-title {
    font-size: 2.2rem;
  }

  .cow-character {
    width: 220px;
    height: 268px;
  }

  .cow-celebrate {
    width: 220px;
    height: 268px;
  }

  .cow-shadow {
    width: 200px;
  }
}

/* ===== Sudoku Puzzle ===== */
.sudoku-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 400px;
  width: 100%;
}

.sudoku-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-auto-rows: 1fr;
  aspect-ratio: 1;
  width: 100%;
  gap: 1px;
  background: #8a7a6a;
  border: 2px solid #4a3a2a;
  border-radius: 4px;
  overflow: hidden;
}

.sudoku-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: white;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.12s ease;
  line-height: 1;
}

/* Box borders — applied per-cell by JS so they adapt to grid size */
.sudoku-cell.box-right {
  border-right: 2px solid #4a3a2a;
}

.sudoku-cell.box-bottom {
  border-bottom: 2px solid #4a3a2a;
}

.sudoku-cell.given {
  background: #f5f0e4;
  cursor: default;
  font-size: 1.5rem;
}

.sudoku-cell.selected {
  background: #d0e4f5;
  box-shadow: inset 0 0 0 2px #5a9ac8;
}

.sudoku-cell.filled {
  color: #2a6a2a;
}

.sudoku-cell.error {
  background: #f8d8d4;
  animation: cell-shake 0.35s ease;
}

.sudoku-cell.correct-flash {
  background: #b8e8a0;
  transition: background-color 0.3s ease;
}

@keyframes cell-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

.sudoku-palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 320px;
}

.palette-btn {
  font-family: inherit;
  font-size: 1.5rem;
  padding: 8px 4px;
  border: 2px solid #d4cabe;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  box-shadow: 0 2px 0 #c4bab0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.palette-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 3px 0 #c4bab0;
}

.palette-btn:active {
  transform: scale(0.95) translateY(1px);
  box-shadow: 0 1px 0 #c4bab0;
}

.palette-eraser {
  font-size: 1.2rem;
  font-weight: 700;
  color: #8a6a5a;
}

/* Sudoku responsive */
@media (max-width: 360px) {
  .sudoku-cell {
    font-size: 1.1rem;
  }
  .sudoku-cell.given {
    font-size: 1.2rem;
  }
  .palette-btn {
    font-size: 1.2rem;
    padding: 6px 2px;
  }
}

@media (max-height: 600px) {
  .sudoku-wrapper {
    gap: 8px;
  }
  .sudoku-grid {
    max-width: 280px;
  }
  .sudoku-palette {
    max-width: 240px;
    gap: 4px;
  }
  .palette-btn {
    font-size: 1.2rem;
    padding: 5px 2px;
  }
  .puzzle-container {
    gap: 8px;
    padding: 8px 16px;
  }
}

/* ===== Word Search ===== */
.ws-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 420px;
  width: 100%;
}

.ws-grid {
  display: grid;
  grid-auto-rows: 1fr;
  aspect-ratio: 1;
  width: 100%;
  gap: 1px;
  background: #8a7a6a;
  border: 2px solid #4a3a2a;
  border-radius: 4px;
  overflow: hidden;
  touch-action: none;
}

.ws-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  background: white;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  text-transform: uppercase;
  line-height: 1;
}

.ws-cell.ws-selecting {
  background: #d0e4f5;
}

.ws-cell.found {
  background: #cfe8c0;
  color: #2a6a2a;
}

.ws-cell.correct-flash {
  background: #b8e8a0;
  transition: background-color 0.3s ease;
}

.ws-word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: center;
}

.ws-word {
  font-weight: 600;
  color: #4a3a2a;
}

.ws-word.found {
  text-decoration: line-through;
  color: #9a8a7a;
}

/* ===== Queens / Star Battle ===== */
.queens-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 400px;
  width: 100%;
}

.queens-hint {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

.queens-grid {
  display: grid;
  grid-auto-rows: 1fr;
  aspect-ratio: 1;
  width: 100%;
  gap: 0;
  border: 3px solid #4a3a2a;
  border-radius: 4px;
  overflow: hidden;
}

.queens-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  line-height: 1;
}

.queens-cell.region-top {
  border-top: 3px solid #4a3a2a;
}

.queens-cell.region-right {
  border-right: 3px solid #4a3a2a;
}

.queens-cell.region-bottom {
  border-bottom: 3px solid #4a3a2a;
}

.queens-cell.region-left {
  border-left: 3px solid #4a3a2a;
}

.queens-cell.marked {
  opacity: 0.5;
}

.queens-cell.error {
  animation: cell-shake 0.35s ease;
  box-shadow: inset 0 0 0 3px #d04040;
}

.queens-cell.correct-flash {
  filter: brightness(1.15) saturate(1.3);
  transition: filter 0.3s ease;
}

@media (max-width: 360px) {
  .ws-cell {
    font-size: 0.95rem;
  }
  .queens-cell {
    font-size: 1.2rem;
  }
}

@media (max-height: 600px) {
  .ws-wrapper,
  .queens-wrapper {
    gap: 8px;
  }
  .ws-grid,
  .queens-grid {
    max-width: 280px;
  }
}

/* ===== Pens (barnyard logic) puzzle ===== */
.pens-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 440px;
  width: 100%;
}

.pens-hint {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

.pens-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.pen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.pen-slot {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  line-height: 1;
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      to bottom,
      var(--stable-wood) 0,
      var(--stable-wood) 9px,
      var(--stable-dark) 9px,
      var(--stable-dark) 11px
    );
  border: 3px solid var(--wood-dark);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
  user-select: none;
  -webkit-user-select: none;
}

.pen-slot.filled {
  background: var(--cream);
  border-color: var(--wood);
}

.pen.open .pen-slot {
  border-color: var(--btn-primary);
  box-shadow: 0 0 0 3px rgba(90, 142, 62, 0.35);
}

.pen-label {
  font-family: 'Georgia', serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.pens-tray {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 52px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border-radius: 10px;
  background: rgba(122, 90, 58, 0.12);
  border: 2px dashed var(--fence-color);
}

.animal-token {
  width: 48px;
  height: 48px;
  font-size: 1.7rem;
  line-height: 1;
  border-radius: 50%;
  border: 3px solid var(--fence-light);
  background: var(--cream);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.animal-token:hover {
  transform: scale(1.08);
}

.animal-token.selected {
  border-color: var(--btn-primary);
  box-shadow: 0 0 0 3px rgba(90, 142, 62, 0.4);
  transform: scale(1.12) translateY(-2px);
}

.pens-tray-empty {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.pens-notes-title {
  font-family: 'Georgia', serif;
  font-size: 1rem;
  color: var(--text-dark);
  margin: 4px 0 0;
}

.pens-notes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
}

.clue {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--text-dark);
  line-height: 1.3;
}

.clue-mark {
  flex: none;
  width: 1.2em;
  text-align: center;
  font-weight: 700;
  color: var(--text-muted);
}

.clue.sat .clue-mark { color: var(--completed-check); }
.clue.sat .clue-text { color: var(--text-muted); }
.clue.bad .clue-mark { color: #c0392b; }
.clue.bad .clue-text { color: #c0392b; }

.pens-reset {
  font-family: 'Georgia', serif;
  font-size: 0.9rem;
  padding: 8px 18px;
  border-radius: 8px;
  border: 2px solid var(--fence-color);
  background: var(--cream);
  color: var(--text-dark);
  cursor: pointer;
}

.pens-reset:hover {
  background: #f0e8d8;
}

.pen.correct-flash .pen-slot {
  filter: brightness(1.12) saturate(1.3);
  border-color: var(--btn-primary);
  transition: filter 0.3s ease, border-color 0.3s ease;
}

@media (max-width: 360px) {
  .pen-slot { width: 46px; height: 46px; font-size: 1.5rem; }
  .animal-token { width: 42px; height: 42px; font-size: 1.4rem; }
}

/* ===== Milk store puzzle ===== */
.milk-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 440px;
  width: 100%;
}

.milk-progress {
  font-family: 'Georgia', serif;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.milk-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

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

.milk-customer {
  width: 72px;
  height: 72px;
  flex: none;
  border-radius: 50%;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.milk-customer.served {
  transform: scale(1.1);
  box-shadow: 0 0 0 4px rgba(90, 142, 62, 0.4);
}

.milk-face {
  font-size: 2.6rem;
  line-height: 1;
}

.milk-bubble-tail { display: none; }

.milk-order {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 160px;
}

.milk-order-title {
  font-family: 'Georgia', serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.milk-order-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  padding: 2px 0;
  color: var(--text-dark);
}

.milk-order-name { flex: 1; }

.milk-order-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.milk-order-row.met,
.milk-order-row.met .milk-order-count { color: var(--completed-check); }
.milk-order-row.over .milk-order-count { color: #c0392b; }

.milk-chip {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: none;
  border: 1px solid rgba(0, 0, 0, 0.15);
}
.milk-chip.milk-regular { background: #f2efe2; }
.milk-chip.milk-chocolate { background: #6a3f24; }
.milk-chip.milk-strawberry { background: #f49ab8; }

.milk-bag {
  width: 100%;
  min-height: 92px;
  border: 3px dashed var(--fence-color);
  border-radius: 12px;
  padding: 10px;
  background: rgba(122, 90, 58, 0.08);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.milk-bag.over {
  border-color: var(--btn-primary);
  background: rgba(90, 142, 62, 0.12);
}

.milk-bag-done {
  border-color: var(--btn-primary);
  background: rgba(90, 142, 62, 0.2);
}

.milk-bag-label {
  font-family: 'Georgia', serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.milk-bag-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  min-height: 64px;
}

.milk-bag-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
  align-self: center;
}

.milk-bag-item { cursor: pointer; transition: transform 0.12s ease; }
.milk-bag-item:hover { transform: translateY(-3px); }

.milk-shelf {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.milk-source-stand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.milk-source { cursor: grab; }
.milk-source:active { cursor: grabbing; }

.milk-source-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Bottle */
.milk-bottle {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 44px;
  height: 64px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.milk-cap {
  width: 16px;
  height: 10px;
  border-radius: 3px 3px 0 0;
  background: #cfc9b8;
}

.milk-body {
  width: 40px;
  height: 52px;
  border-radius: 8px 8px 12px 12px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  box-shadow: inset 0 -6px 8px rgba(0, 0, 0, 0.1), inset 0 4px 6px rgba(255, 255, 255, 0.4);
}

.milk-badge {
  position: absolute;
  bottom: 12px;
  font-size: 1rem;
  line-height: 1;
}

.milk-regular .milk-body { background: linear-gradient(#ffffff, #f2efe2); }
.milk-regular .milk-cap { background: #e2dcc8; }
.milk-chocolate .milk-body { background: linear-gradient(#8a5a39, #6a3f24); }
.milk-chocolate .milk-cap { background: #5a3520; }
.milk-strawberry .milk-body { background: linear-gradient(#ffc0d4, #f49ab8); }
.milk-strawberry .milk-cap { background: #e88aa8; }

.milk-drag-clone {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  margin: 0;
}

@media (max-width: 360px) {
  .milk-bottle { width: 38px; height: 56px; }
  .milk-body { width: 34px; height: 46px; }
  .milk-face { font-size: 2.2rem; }
}

/* ===== Crops (grazing fields) puzzle ===== */
.crops-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 460px;
  width: 100%;
}

.crops-progress {
  font-family: 'Georgia', serif;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.crops-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

.crops-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

.crop-field {
  background: rgba(120, 178, 92, 0.16);
  border: 2px solid var(--hill-near);
  border-radius: 10px;
  padding: 6px;
  min-height: 96px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.crop-field.drop-over {
  border-color: var(--btn-primary);
  background: rgba(90, 142, 62, 0.28);
}

.crop-field-head {
  font-family: 'Georgia', serif;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 6px;
  line-height: 1.2;
}

.crop-field-emoji { font-size: 1.1rem; }

.crop-field-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  align-content: flex-start;
}

.crops-basket-label {
  font-family: 'Georgia', serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  align-self: flex-start;
}

.crops-basket {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(122, 90, 58, 0.1);
  border: 2px dashed var(--fence-color);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.crops-basket.drop-over {
  border-color: var(--btn-primary);
  background: rgba(90, 142, 62, 0.16);
}

.crops-basket-empty {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.crop-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 4px 6px;
  background: var(--cream);
  border: 2px solid var(--fence-light);
  border-radius: 16px;
  font-size: 0.8rem;
  color: var(--text-dark);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  white-space: nowrap;
}

.crop-chip:active { cursor: grabbing; }
.crop-emoji { font-size: 1.1rem; line-height: 1; }

.crop-drag-clone {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  margin: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.crops-notes-title {
  font-family: 'Georgia', serif;
  font-size: 1rem;
  color: var(--text-dark);
  margin: 4px 0 0;
}

.crops-notes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
}

.crops-notes .clue {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-dark);
  line-height: 1.3;
}

.crops-notes .clue-mark {
  flex: none;
  width: 1.2em;
  text-align: center;
  font-weight: 700;
  color: var(--text-muted);
}

.crops-notes .clue.sat .clue-mark { color: var(--completed-check); }
.crops-notes .clue.sat .clue-text { color: var(--text-muted); }
.crops-notes .clue.bad .clue-mark { color: #c0392b; }

.crop-field.correct-flash {
  filter: brightness(1.12) saturate(1.3);
  border-color: var(--btn-primary);
  transition: filter 0.3s ease, border-color 0.3s ease;
}

@media (max-width: 360px) {
  .crop-chip { font-size: 0.72rem; padding: 3px 6px; }
  .crop-field-head { font-size: 0.7rem; }
}
