  :root {
    --card-bg: rgba(0,0,0,0.55);
    --accent: #e3c26b;
    --accent-dark: #9c7a2f;
    --good: #39d353;
    --bad: #ff4d4f;
    --ink: #f3efe2;
  }

  html, body {
    height: 100%;
    margin: 0;
  }
  body {
    font-family: "Sofia", system-ui, serif;
    background: url('old_background.jpg') center/cover fixed no-repeat, #1a1410;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .wrap {
    flex: 1;
    display: grid;
    grid-template-rows: auto 1fr auto;
  }

  header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(8px, 2vw, 16px);
    position: sticky;
    top: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0));
    z-index: 5;
  }
  .title {
    font-size: clamp(28px, 5vw, 48px);
    letter-spacing: 1px;
    text-shadow: 0 2px 4px #000;
  }
  .hud {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
  }
  .lives {
    font-size: clamp(18px, 3vw, 28px);
    padding: 4px 10px;
    border: 2px solid var(--accent);
    border-radius: 8px;
    background: var(--card-bg);
  }
  .farmburn {
    position: relative;
    width: 134;
    height: 64px;
    background: rgba(0,0,0,0.35);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.15);
  }
  .farmburn img {
    width: 100%; height: 100%; object-fit: cover;
    filter: drop-shadow(0 0 6px rgba(255,110,10,0.7));
  }

	.newgame-btn {
	  font-size: clamp(18px, 3vw, 28px);
	  padding: 4px 10px;
	  border: 2px solid var(--accent);
	  border-radius: 8px;

	  /* Be explicit */
	  background-color: var(--card-bg);
	  color: var(--btn-fg);
	  -webkit-text-fill-color: var(--btn-fg); /* resists some auto-dark modes */

	  appearance: none;        /* ditch UA button styling */
	  color-scheme: light;     /* hint: don't auto-darken this control */
	  transition: background-color 120ms, transform 120ms;
	}

	/* Only add hover on devices that actually hover */
	@media (hover: hover) and (pointer: fine) {
	  .newgame-btn:hover {
		/* darken slightly relative to base instead of forcing black */
		background-color: color-mix(in srgb, var(--card-bg) 80%, black);
		transform: translateY(-1px);
	  }
	}

	.newgame-btn:active { transform: translateY(1px) scale(0.98); }


  .prompt {
    background: var(--card-bg);
    border: 2px solid var(--accent-dark);
    padding: clamp(10px, 3vw, 20px);
    border-radius: 12px;
    font-size: clamp(18px, 2.3vw, 28px);
    line-height: 1.25;
  }
  .prompt h2 {
    margin: 0 0 .4em 0;
    font-size: 1.35em;
    color: var(--accent);
  }
  .prompt p { margin: .3em 0; }

  .grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: clamp(8px, 2vw, 16px);
  }
  @media (max-width: 1100px) {
    .grid { grid-template-columns: repeat(3, 1fr); }
  }
  @media (max-width: 700px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
  }

  .card {
    position: relative;
    aspect-ratio: 1 / 1;
    background: rgba(0,0,0,0.45);
    border: 2px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .08s ease-in-out, box-shadow .15s ease-in-out;
  }
  .card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.35); }
  .card img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
    pointer-events: none;
  }
  .overlay {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    font-size: clamp(28px, 5vw, 50px);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
    opacity: 0; transition: opacity .2s ease-in-out;
  }
  .flash-correct { box-shadow: 0 0 0 4px var(--good) inset, 0 0 18px rgba(57,211,83,0.6); }
  .flash-wrong   { box-shadow: 0 0 0 4px var(--bad) inset, 0 0 18px rgba(255,77,79,0.6); }
  .overlay.show  { opacity: 1; }
  

  .scorebar {
    margin-top: -6px;
    display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
    font-size: clamp(16px, 2vw, 22px);
    text-shadow: 0 2px 3px rgba(0,0,0,0.6);
  }
  .scorechip {
    background: var(--card-bg);
    border: 2px solid var(--accent);
    padding: 6px 10px;
    border-radius: 10px;
  }

  .gameover {
    text-align: center;
    padding: 28px;
    background: var(--card-bg);
    border: 2px solid var(--accent-dark);
    border-radius: 14px;
    margin: 20px auto;
    max-width: 800px;
  }
  .gameover h1 {
    font-size: clamp(36px, 6vw, 62px);
    margin: 0 0 10px 0;
    color: var(--bad);
  }
  .gameover p { margin: .5em 0; font-size: clamp(18px, 2.2vw, 24px); }

  footer {
    padding: 12px;
    text-align: center;
    font-size: clamp(14px, 1.8vw, 18px);
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0));
  }
  footer a { color: var(--accent); text-decoration: none; }
  footer a:hover { text-decoration: underline; }
  

/* ----- Sound toggle button ----- */
.sound-btn {
  font-size: 1.8rem;
  line-height: 1;
  border: 2px solid var(--accent, #e3c26b);
  background: var(--card-bg, rgba(0, 0, 0, 0.55));
  color: var(--ink, #f3efe2);
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 2px 3px rgba(0,0,0,0.6);
}

/* hover/active feedback */
.sound-btn:hover {
  background: rgba(0,0,0,0.7);
  transform: translateY(-1px);
}

.sound-btn:active {
  transform: scale(0.95);
  background: rgba(0,0,0,0.8);
}

/* optional “off” state if you want visual difference (add class="muted") */
.sound-btn.muted {
  color: #999;
  border-color: #777;
  text-shadow: none;
}


/* Links — gold theme */
a,
a:link {
  color: var(--accent, #e3c26b);
  text-decoration: none;
  transition: color 0.2s ease-in-out, text-shadow 0.2s ease-in-out;
}

a:visited {
  color: var(--accent, #e3c26b);
}

a:hover {
  color: var(--accent-dark, #9c7a2f);
  text-decoration: underline;
  text-shadow: 0 0 6px rgba(227, 194, 107, 0.6);
}

a:active {
  color: var(--ink, #f3efe2);
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.4);
}



/* Gallery for farm images */
.gallery {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  margin-top: 20px;
}

.info-image {
  text-align: center;
  max-width: 150px;
}

.info-image img {
  width: 220px;
  height: auto;
  border: 2px solid var(--accent, #e3c26b);
  border-radius: 10px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease-in-out;
}

.info-image img:hover {
  transform: scale(1.05);
}

.info-image figcaption {
  margin-top: 5px;
  font-size: 0.6em;
  opacity: 0.6;
}




