/* Acorn Dash — all selectors are scoped under .acorn-dash so themes can't leak in */
.acorn-dash {
  display: block; width: 100%; margin: 1em auto; padding: 0;
  font-family: "Trebuchet MS", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.3; color: #3b2a1a; -webkit-tap-highlight-color: transparent;
}
.acorn-dash *, .acorn-dash *::before, .acorn-dash *::after { box-sizing: border-box; }
.acorn-dash .ad-wrap {
  position: relative; margin: 0 auto; overflow: hidden; border-radius: 14px;
  background: #2a5a2d; box-shadow: 0 6px 24px rgba(30, 50, 20, .35), inset 0 0 0 2px rgba(60, 35, 15, .5);
  -webkit-user-select: none; user-select: none; font-size: 14px;
  min-height: min(700px, 100vh); min-height: min(700px, 100dvh);
}
.acorn-dash .ad-canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; max-width: none; margin: 0; }
.acorn-dash .ad-wrap.ad-playing .ad-canvas { touch-action: none; }

/* HUD */
.acorn-dash .ad-hud {
  position: absolute; top: .5em; left: .5em; right: .5em; display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: flex-start; gap: .4em; pointer-events: none;
}
.acorn-dash .ad-hl, .acorn-dash .ad-hr { display: flex; align-items: center; gap: .35em; flex-wrap: wrap; }
.acorn-dash .ad-pill {
  background: rgba(40, 25, 10, .62); color: #fff6d8; padding: .22em .65em; border-radius: 999px;
  font-weight: 700; font-size: .9em; white-space: nowrap; backdrop-filter: blur(2px);
}
.acorn-dash .ad-pill b { font-weight: 800; }
.acorn-dash .ad-combo { font-style: normal; color: #ffd23f; font-weight: 800; }
.acorn-dash .ad-hearts { background: rgba(40, 25, 10, .62); padding: .12em .55em; border-radius: 999px; font-size: 1em; letter-spacing: .1em; white-space: nowrap; }
.acorn-dash .ad-hearts span { color: rgba(255, 255, 255, .25); }
.acorn-dash .ad-hearts span.on { color: #ff5a4d; }
.acorn-dash .ad-timer { position: absolute; top: 0; left: 0; right: 0; height: .35em; background: rgba(0, 0, 0, .25); pointer-events: none; }
.acorn-dash .ad-timer-fill { height: 100%; width: 0; background: linear-gradient(90deg, #ffd23f, #ff9d2e); transition: width .15s linear; }
.acorn-dash .ad-risk {
  position: absolute; left: .5em; bottom: .5em; background: rgba(120, 50, 20, .78); color: #ffe9c7;
  padding: .2em .7em; border-radius: 999px; font-weight: 700; font-size: .82em; pointer-events: none;
}
.acorn-dash .ad-mood {
  position: absolute; right: .5em; bottom: .5em; background: rgba(40, 25, 10, .7); color: #fff6d8;
  padding: .2em .7em; border-radius: 999px; font-weight: 700; font-size: .82em; pointer-events: none;
}
.acorn-dash .ad-gain { font-style: normal; color: #b9e68a; margin-left: .3em; font-weight: 700; font-size: .85em; }
.acorn-dash .ad-risk[hidden], .acorn-dash .ad-mood[hidden], .acorn-dash .ad-overlay[hidden] { display: none; }

/* Buttons — hardened against theme styles */
.acorn-dash button.ad-ibtn, .acorn-dash button.ad-btn {
  appearance: none; -webkit-appearance: none; cursor: pointer; font-family: inherit; text-transform: none;
  letter-spacing: normal; text-shadow: none; margin: 0; text-decoration: none;
}
.acorn-dash button.ad-ibtn {
  pointer-events: auto; width: 2.1em; height: 2.1em; padding: 0; border: 0; border-radius: 50%;
  background: rgba(40, 25, 10, .62); color: #fff6d8; font-size: .9em; line-height: 1; box-shadow: none;
}
.acorn-dash button.ad-ibtn:hover, .acorn-dash button.ad-ibtn:focus-visible { background: rgba(40, 25, 10, .85); color: #fff; }
.acorn-dash button.ad-btn {
  display: inline-block; padding: .7em 1.5em; border-radius: .8em; font-size: 1.1em; font-weight: 800; line-height: 1.1;
  border: 0; border-bottom: .2em solid rgba(0, 0, 0, .25); color: #fff; transition: transform .1s, filter .15s;
  min-height: 2.9em; box-shadow: none;
}
.acorn-dash button.ad-btn:hover { filter: brightness(1.08); color: #fff; }
.acorn-dash button.ad-btn:active { transform: translateY(.12em); }
.acorn-dash button.ad-btn:focus-visible, .acorn-dash button.ad-ibtn:focus-visible { outline: 3px solid #ffd23f; outline-offset: 2px; }
.acorn-dash .ad-primary { background: linear-gradient(#58b24a, #2f8a35); }
.acorn-dash .ad-secondary { background: linear-gradient(#a8743c, #7a4c22); }

/* Overlay + cards */
.acorn-dash .ad-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 3%;
  background: rgba(20, 40, 20, .55); backdrop-filter: blur(2px); overflow: auto;
}
.acorn-dash .ad-card {
  width: min(100%, 27em); max-height: 100%; overflow: auto; margin: auto; text-align: center;
  background: linear-gradient(#fff9e8, #f7e9c6); border: .22em solid #6e4524; border-radius: 1.1em;
  padding: 1.1em 1.2em 1.2em; box-shadow: 0 .5em 1.6em rgba(0, 0, 0, .4);
  animation: ad-pop .28s ease-out; color: #3b2a1a;
}
@keyframes ad-pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.acorn-dash .ad-title { font-size: 1.9em; font-weight: 900; color: #5b3513; line-height: 1.1; margin: 0 0 .15em; }
.acorn-dash .ad-sub { margin: 0 0 .8em; font-size: 1em; color: #6b4a2b; }
.acorn-dash .ad-how { list-style: none; margin: 0 0 1em; padding: 0; text-align: left; }
.acorn-dash .ad-how li { display: flex; gap: .6em; align-items: center; margin: .35em 0; font-size: .95em; }
.acorn-dash .ad-how li span { font-size: 1.5em; width: 1.5em; text-align: center; flex: none; }
.acorn-dash .ad-how li em { font-style: normal; }
.acorn-dash .ad-best { margin-top: .8em; font-weight: 700; color: #6b4a2b; font-size: .9em; }
.acorn-dash .ad-chiprow { display: flex; align-items: center; gap: .6em; text-align: left; }
.acorn-dash .ad-chip { width: 6em; height: 6em; flex: none; animation: ad-bob 1.1s ease-in-out infinite; }
@keyframes ad-bob { 50% { transform: translateY(-.35em) rotate(-3deg); } }
.acorn-dash .ad-bubble {
  position: relative; background: #fff; border: .15em solid #6e4524; border-radius: .9em; padding: .6em .8em;
  font-weight: 700; font-size: .95em;
}
.acorn-dash .ad-bubble::before {
  content: ""; position: absolute; left: -.55em; top: 50%; width: .9em; height: .9em; background: #fff;
  border-left: .15em solid #6e4524; border-bottom: .15em solid #6e4524; transform: translateY(-50%) rotate(45deg);
}
.acorn-dash .ad-stats { margin: .8em 0 .4em; font-size: 1em; }
.acorn-dash .ad-stats b, .acorn-dash .ad-ask b { color: #b83c16; }
.acorn-dash .ad-tally { margin: 0 0 .5em; font-size: .85em; color: #6b4a2b; line-height: 1.5; }
.acorn-dash .ad-ask { margin: .2em 0 .8em; font-size: 1.05em; font-weight: 700; }
.acorn-dash .ad-note { margin: .6em 0 0; padding: .35em .6em; border-radius: .6em; background: #e5f3d6; color: #2c6a2a; font-weight: 700; font-size: .9em; }
.acorn-dash .ad-btns { display: flex; gap: .6em; justify-content: center; flex-wrap: wrap; }
.acorn-dash .ad-btns .ad-btn { flex: 1 1 8em; padding-left: .8em; padding-right: .8em; }
.acorn-dash .ad-hint { margin: .9em 0 0; font-size: .78em; color: #7a5a38; text-align: left; line-height: 1.4; }

@media (prefers-reduced-motion: reduce) {
  .acorn-dash .ad-card, .acorn-dash .ad-chip { animation: none; }
}

/* Placeholder / error states (visible before JS runs, or if it fails) */
.acorn-dash .ad-loading, .acorn-dash .ad-error {
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 1.2em;
  min-height: min(320px, 100vh); border-radius: 14px; background: #2a5a2d; color: #fff6d8; font-weight: 700; font-size: 16px;
}
.acorn-dash .ad-error { background: #7a3b1d; }
.acorn-dash .ad-angry .ad-chip { animation: ad-rage .35s linear infinite; filter: saturate(1.4) hue-rotate(-12deg); }
.acorn-dash .ad-angry .ad-bubble { background: #ffe3d8; border-color: #b83c16; }
.acorn-dash .ad-angry .ad-bubble::before { background: #ffe3d8; border-color: #b83c16; }
@keyframes ad-rage { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-.2em) rotate(-4deg); } 75% { transform: translateX(.2em) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .acorn-dash .ad-angry .ad-chip { animation: none; } }

.acorn-dash .ad-note.ad-warn { background: #fde3d2; color: #9a3412; margin: .6em 0 .9em; }
