/* The playfield stays readable against the moving diorama. */
.word-vine-game {
  --vine-forest: #153c36;
  --vine-text: #203e34;
  --vine-mint: #deefe5;
  --vine-gold: #ffd277;
  --vine-paper: #fffdf1;
  background: #e8f1df;
}
.word-vine-game #main { max-width: 1240px; }
.word-vine-game .lobby {
  padding: clamp(.95rem, 2.2vw, 1.8rem);
  border-radius: 25px;
  border-color: #b3c99c;
  background: #fffdf1;
  box-shadow: 0 16px 42px #244c3220;
}
.word-vine-game .lobby-copy { align-self: center; }
.word-vine-game .lobby-copy .eyebrow,
.word-vine-game #level-label { color: #326449; }
.word-vine-game #game-title { margin: .17em 0 .33em; color: #153c36; letter-spacing: -.045em; }
.word-vine-game .lobby-art {
  position: relative;
  min-height: 290px;
  overflow: hidden;
  background: #143f39;
}
.word-vine-game .lobby-art #scene {
  height: 100%;
  width: 100%;
  min-height: 285px;
  object-fit: cover;
}
.word-vine-game .lobby-art .art-badge {
  background: #123c35;
  color: #fff3b6;
  border: 1px solid #cbd68b;
}
.word-vine-game .lobby-monkey {
  filter: drop-shadow(0 12px 8px #112e3688);
}
.word-vine-game .lobby-note { margin-bottom: .35rem; }
.vine-lobby-settings {
  display: grid;
  gap: .65rem;
  margin: 1rem 0 .85rem;
  padding: .65rem .8rem;
  border: 1px solid #bfd1b4;
  border-radius: 14px;
  background: #eef4e7;
}
.vine-lobby-settings p { margin: 0; font-size: .93rem; }
.vine-assist {
  display: flex;
  align-items: flex-start;
  gap: .58rem;
  min-height: 44px;
  padding: .25rem 0;
  cursor: pointer;
}
.vine-assist input {
  accent-color: #2d6952;
  margin: .25rem 0 0;
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
}
.vine-assist small { display: block; margin-top: .1rem; color: #365b49; }
.vine-lobby-kit { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .75rem; }
.vine-lobby-kit button, .vine-shop-card { min-height: 44px; }
.word-vine-game .game-layout { grid-template-columns: minmax(0, 1fr) minmax(200px, 242px); gap: 15px; }
.word-vine-game #stage {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 1px solid #9aaf85;
  border-radius: 21px;
  overflow: hidden;
  background: var(--vine-paper);
}
.word-vine-game .helper-panel {
  align-self: start;
  border-color: #a9c1a1;
  background: #f5f8eb;
}
.word-vine-game .score-strip { color: #1f493f; }
.vine-course { position: relative; }
.vine-course [hidden] { display: none !important; }
.vine-course-view { position: relative; }
.vine-viewport {
  position: relative;
  aspect-ratio: 2.34;
  min-height: 160px;
  overflow: hidden;
  isolation: isolate;
  background: #8cbd9e;
}
.vine-flat, .vine-flat-art, .vine-webgl, .vine-webgl canvas, .vine-shade, .vine-burst {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.vine-flat-rope path {
  fill: none;
  stroke: #4d6532;
  stroke-width: 11px;
  stroke-linecap: round;
}
.vine-flat-rope path + path { stroke: #c7be77; stroke-width: 4px; stroke-dasharray: 7 5; }
.vine-flat-rope circle { fill: #fff6a5; }
[data-vine="glow"] .vine-flat-rope path { stroke: #45e3c4; filter: drop-shadow(0 0 7px #87ffd0); }
[data-vine="glow"] .vine-flat-rope path + path { stroke: #f0ffff; }
[data-vine="blossom"] .vine-flat-rope path { stroke: #8b645c; }
[data-vine="blossom"] .vine-flat-rope path + path { stroke: #ffafcb; stroke-width: 9px; stroke-dasharray: 1 27; }
.vine-flat-monkey, .vine-flat-companion {
  position: absolute;
  transform: translate(-50%, -68%);
  width: clamp(40px, 11%, 107px);
  filter: drop-shadow(0 4px 4px #16392d7a);
}
.vine-flat-companion { width: auto; font-size: clamp(16px, 3vw, 34px); }
.vine-webgl { opacity: 0; }
.vine-webgl-ready { opacity: 1; }
.vine-shade { pointer-events: none; box-shadow: inset 0 0 45px #193a3752; }
.vine-course-tags {
  position: absolute;
  inset: .6rem .65rem auto;
  display: flex;
  justify-content: space-between;
  gap: .35rem;
  pointer-events: none;
}
.vine-course-tags span {
  border: 1px solid #d3f1ba80;
  border-radius: 999px;
  padding: .28rem .54rem;
  background: #153b35ed;
  color: #fff6d3;
  font-size: clamp(.71rem, 1.7vw, .88rem);
  font-weight: 750;
  line-height: 1.25;
}
.vine-workbench {
  display: grid;
  gap: .65rem;
  padding: clamp(.7rem, 2.2vw, 1.15rem);
  color: var(--vine-text);
}
.vine-spelling-board {
  position: absolute;
  z-index: 1;
  inset: auto 0 .65rem;
  width: min(21.75rem, calc(100% - 1.3rem));
  margin-inline: auto;
  padding: .6rem .75rem;
  border: 1px solid #b7c7a0;
  border-radius: 16px;
  background: #fffdf2f5;
  color: #203e34;
  box-shadow: 0 .45rem 1.3rem #143d3b59;
}
.vine-prompt { display: flex; align-items: center; gap: .75rem; }
.vine-picture {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: clamp(56px, 8.6vw, 78px);
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid #9fb885;
  border-radius: 15px;
  background: linear-gradient(148deg, #f9f6d8, #e3efce);
}
.vine-picture:hover { border-color: #326449; background: #e3efce; }
.vine-picture-art { display: grid; place-items: center; width: 94%; height: 94%; }
.vine-picture-art img, .vine-picture-art svg { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }
.vine-picture-audio {
  position: absolute;
  inset: auto 3px 3px auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #205340;
  color: #fffdf1;
}
.vine-picture-audio svg { width: 15px; height: 15px; }
.vine-task-tag {
  margin: 0 0 .2rem;
  color: #2d6854;
  font-size: .77rem;
  font-weight: 800;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.vine-prompt h2 { margin: 0; color: #183e33; line-height: 1.11; font-size: clamp(1.15rem, 2.6vw, 1.55rem); }
.vine-rule { margin: .26rem 0 0; font-size: .93rem; line-height: 1.27; }
.vine-options {
  display: grid;
  grid-template-columns: repeat(var(--vine-choices, 3), minmax(0, 1fr));
  gap: clamp(.25rem, 1vw, .55rem);
}
.vine-options button {
  position: relative;
  min-height: 51px;
  min-width: 0;
  padding: .22rem .26rem;
  border: 1px solid #3c725a;
  border-bottom-width: 3px;
  border-radius: 12px;
  color: #fffdf0;
  background: linear-gradient(160deg, #367963, #215646);
  font-size: clamp(.98rem, 3.7vw, 1.48rem);
  line-height: 1.1;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}
.vine-options button:hover { background: #1d473d; transform: translateY(-1px); }
.vine-options button small {
  position: absolute;
  inset: .15rem auto auto .28rem;
  color: #d8efca;
  font-size: .61rem;
  font-weight: 700;
}
.vine-options button:focus-visible, .vine-timing button:focus-visible, .vine-shop-card:focus-visible {
  outline: 3px solid #257d75;
  outline-offset: 3px;
}
.vine-word-model {
  margin: .32rem 0 .14rem;
  color: #365947;
  text-align: center;
  font-size: .83rem;
}
.vine-word-model strong {
  margin-inline-start: .36rem;
  color: #244b3a;
  font-size: 1.11rem;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.vine-word-slots {
  display: flex;
  justify-content: center;
  gap: clamp(.2rem, .7vw, .4rem);
  margin-top: .42rem;
}
.vine-spelling-part {
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid #bac49d;
  border-radius: 9px;
  background: #ece9d3;
}
.vine-spelling-letter {
  display: grid;
  place-items: center;
  width: clamp(1.36rem, 6vw, 2.24rem);
  height: clamp(1.68rem, 7vw, 2.3rem);
  border-radius: 7px;
  background: #fffdf3;
  color: #143e34;
  font-size: clamp(1.02rem, 4vw, 1.4rem);
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}
.vine-spelling-letter:empty::after {
  width: .65em;
  height: 2px;
  margin-top: .85em;
  border-radius: 2px;
  background: #758065;
  content: "";
}
.vine-spelling-part.next-letter {
  border-color: #785e27;
  background: #f3c75c;
  box-shadow: 0 0 0 1px #fff3bd;
}
.vine-spelling-part.found { border-color: #7e9d7a; background: #a8cda5; }
.vine-spelling-part.found .vine-spelling-letter { background: #e3f1d4; }
.vine-spelling-progress {
  margin: .24rem 0 0;
  color: #345d4c;
  font-size: .8rem;
  font-weight: 750;
  text-align: center;
}
.vine-spelling-board.word-ready { width: fit-content; max-width: calc(100% - 1.3rem); }
.vine-spelling-board.word-ready .vine-prompt { display: none; }
.vine-spelling-board.word-ready .vine-word-slots { margin-top: 0; }
.vine-confetti {
  position: absolute;
  z-index: 3;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}
.vine-confetti i {
  position: absolute;
  top: 72%;
  left: var(--origin);
  width: .38rem;
  height: .59rem;
  border-radius: 2px;
  background: var(--color);
  opacity: 0;
  animation: vine-confetti-toss 1.05s var(--delay) ease-out both;
}
.vine-confetti i:nth-child(3n) {
  height: .38rem;
  border-radius: 50%;
}
.vine-confetti-round i {
  top: 54%;
  width: .52rem;
  height: .78rem;
  animation-duration: 2.65s;
}
.vine-confetti-round i:nth-child(3n) { height: .52rem; }
@keyframes vine-confetti-toss {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(0); }
  12% { opacity: 1; }
  43% { opacity: 1; transform: translate(var(--spread), var(--rise)) rotate(var(--turn)); }
  100% { opacity: 0; transform: translate(var(--spread), var(--drop)) rotate(calc(var(--turn) + 160deg)); }
}
.word-vine-game #results.vine-round-complete {
  position: relative;
  isolation: isolate;
  border-color: #a6bd84;
  background: radial-gradient(ellipse at top, #fff4ca, #fffdf0 64%);
}
.word-vine-game #results.vine-round-complete > .eyebrow {
  display: inline-block;
  margin: .6rem 0 .25rem;
  padding: .32rem .68rem;
  border: 1px solid #bacb94;
  border-radius: 999px;
  background: #e7efcb;
  color: #234d3d;
  font-weight: 850;
}
.reduce-motion .vine-confetti { display: none; }
@media (prefers-reduced-motion: reduce) {
  .vine-confetti { display: none; }
}
.vine-prompt-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.vine-prompt-actions button { min-height: 44px; padding: .2rem .65rem; font-size: .87rem; }
.vine-inline-feedback { margin: 0; padding: .35rem .55rem; border-radius: 8px; }
.vine-inline-feedback:empty { display: none; }
.vine-timing {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .45rem .9rem;
  padding: .6rem;
  border: 1px solid #c4d4b5;
  border-radius: 13px;
  background: #eaf3e3;
}
.vine-timing .primary {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 52px;
  min-width: 8.4rem;
  border: 2px solid #1f5243;
  background: #1c5946;
  color: white;
  white-space: nowrap;
}
.vine-timing .primary.vine-now {
  background: #ffdf7e;
  color: #2f3727;
  border-color: #765329;
  box-shadow: 0 0 0 2px #fff4be;
}
.vine-timing .primary[aria-disabled="true"] { opacity: .83; }
.vine-cue { margin: 0; color: #203e34; font-size: .86rem; font-weight: 800; }
.vine-meter {
  position: relative;
  height: 13px;
  border: 1px solid #657f5d;
  border-radius: 20px;
  background: #386a58;
}
.vine-meter i {
  position: absolute;
  inset: 0 auto 0 var(--zone-start, 0%);
  width: var(--zone-width, 19%);
  border-inline: 2px solid #fff7d9;
  background: repeating-linear-gradient(135deg, #ffd77b, #ffd77b 5px, #f2bc50 5px, #f2bc50 8px);
}
.vine-meter b {
  position: absolute;
  top: -3px;
  left: var(--cursor, 0%);
  width: 9px;
  height: 17px;
  border: 2px solid #1d3d36;
  border-radius: 4px;
  background: #fffbe0;
  transform: translateX(-50%);
}
.vine-burst { pointer-events: none; }
.vine-burst i {
  position: absolute;
  top: 66%;
  left: 71%;
  width: 22px;
  height: 13px;
  opacity: 0;
  animation: vine-butterfly 1.12s var(--delay) ease-out both;
}
.vine-burst i::before, .vine-burst i::after {
  content: "";
  position: absolute;
  inset: 0 50% 0 0;
  border: 1px solid #fff5c9;
  border-radius: 92% 45% 75% 55%;
  background: var(--color);
  transform-origin: right center;
  animation: vine-wings 105ms ease-in-out infinite alternate;
}
.vine-burst i::after { inset: 0 0 0 50%; transform-origin: left center; border-radius: 45% 92% 55% 75%; }
@keyframes vine-butterfly {
  15%, 60% { opacity: 1; }
  100% { transform: translate(var(--x), var(--y)) rotate(28deg); opacity: 0; }
}
@keyframes vine-wings { from { transform: scaleX(.28); } to { transform: scaleX(1); } }
#vine-shop {
  box-sizing: border-box;
  width: min(720px, calc(100vw - 24px));
  max-width: none;
  max-height: min(88dvh, 760px);
  padding: clamp(.8rem, 3vw, 1.4rem);
  overflow: auto;
  border: 1px solid #a4b78d;
  border-radius: 19px;
  background: var(--vine-paper);
  color: #244838;
}
#vine-shop::backdrop { background: #122f2bba; }
.vine-shop-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; }
.vine-shop-head h2 { margin: 0 0 .2rem; color: #1f4c3b; }
.vine-shop-head p, #vine-shop-status { margin: .25rem 0 .45rem; }
#vine-shop h3 { margin: 1rem 0 .32rem; color: #235445; }
.vine-shop-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
.vine-shop-card {
  display: grid;
  align-content: start;
  gap: .25rem;
  text-align: left;
  color: #214737;
  background: #f0f6e4;
  border: 1px solid #b4c49d;
  border-radius: 12px;
  padding: .55rem;
}
.vine-shop-card small { font-weight: 500; line-height: 1.23; }
.vine-shop-card b { color: #285942; font-size: .85rem; }
.vine-shop-card[aria-pressed="true"] { background: #d8edd7; border-color: #4a825e; }
.vine-shop-card.vine-guided { outline: 2px solid #a06d27; outline-offset: -2px; }
.vine-item-icon { font-size: 1.35rem; line-height: 1; }
#vine-shop-status { min-height: 1.4rem; font-weight: 700; }
@media (max-width: 760px) {
  .word-vine-game .game-layout { grid-template-columns: minmax(0, 1fr); }
  .word-vine-game .helper-panel { display: none; }
  .word-vine-game .lobby-art, .word-vine-game .lobby-art #scene { min-height: 200px; }
  .word-vine-game #plh-help-button {
    position: static !important;
    min-height: 41px;
    padding: .28rem .7rem;
    border-width: 1px;
    box-shadow: none;
    font-size: .83rem;
  }
  .word-vine-game .game-top { align-items: center; gap: .35rem; }
  .word-vine-game .game-top h1 { font-size: clamp(1.4rem, 6vw, 2rem); }
  .word-vine-game #level-label { font-size: .72rem; letter-spacing: .05em; }
  .word-vine-game .game-buttons { gap: .3rem; }
  .word-vine-game .game-buttons button { min-height: 44px; padding: .22rem .46rem; font-size: .83rem; }
  .word-vine-game #hear { display: none; }
  .word-vine-game .score-strip { padding: .42rem .55rem; gap: .4rem; }
  .word-vine-game .score-comparison { display: flex; flex-wrap: wrap; gap: .25rem; }
  .word-vine-game .score-summary { flex: 1 1 285px; flex-wrap: wrap; gap: .35rem .55rem; }
  .word-vine-game .score-comparison .score-details { position: static; margin: 0; }
  .vine-viewport { aspect-ratio: 1.9; }
}
@media (max-width: 445px) {
  .vine-shop-list { grid-template-columns: 1fr; }
  .vine-shop-card { grid-template-columns: 1.5rem minmax(0, 1fr); }
  .vine-shop-card small, .vine-shop-card b { grid-column: 2; }
  .vine-timing { gap: .4rem .5rem; }
  .vine-timing .primary { min-width: 6.3rem; padding-inline: .32rem; font-size: .91rem; }
  .vine-options button small { inset: .15rem auto auto .15rem; }
  .word-vine-game #reward-label { display: none; }
}
@media (max-width: 580px) {
  .vine-spelling-board {
    position: relative;
    inset: auto;
    margin-top: -.7rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .vine-burst { display: none; }
  .vine-options button:hover { transform: none; }
}
