/* Rainbow Rally: a little town, an editable cargo tray, and one clear request. */
.stage:has(.rr-game) { height: auto; padding: 0; overflow: hidden; background: #fff9ec; }
.stage-inner:has(.rr-game) { height: auto; min-height: 0; }
.rr-game { --rr-friend-color: #ef7772; --rr-columns: 5; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-width: 0; color: #274d4b; background: #fff9ec; }
.rr-game [hidden] { display: none !important; }
.rr-game button, .rr-game a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.rr-scene { position: relative; isolation: isolate; min-height: 510px; overflow: hidden; background: linear-gradient(#a6dbe2 0 30%, #c9e5a5 30% 62%, #a8ce83 100%); }
.rr-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 65%; pointer-events: none; opacity: .92; }
.rr-roads { position: absolute; inset: 26% 0 -2%; display: block; filter: drop-shadow(0 3px 0 #637f4c25); }
.rr-roads svg { width: 100%; height: 100%; }
.rr-place { position: absolute; top: 14%; width: 32%; transform: translateX(-50%); z-index: 2; }
.rr-home-art { display: block; filter: drop-shadow(0 7px 3px #405c4f24); }
.rr-home-art svg, .rr-resident svg, .rr-reward-art svg, .rr-truck-art svg, .rr-mini-cargo svg, .rr-request-face svg, .rr-item-art svg, .rr-arrival-art svg, .rr-received-item svg { display: block; width: 100%; height: auto; }
.rr-place::before { content: ""; position: absolute; inset: -8% -3% 10%; border-radius: 50%; background: #fff9bc; opacity: 0; filter: blur(7px); z-index: -1; }
.rr-place.rr-current::before { opacity: .8; }
.rr-resident { position: absolute; width: 40%; left: 29%; bottom: 3%; filter: drop-shadow(0 3px 1px #37544930); }
.rr-place-name { display: block; position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%); padding: 3px 10px; border: 2px solid #fff9ea; border-radius: 20px; color: #385954; background: #fff9eae8; font-size: 13px; font-weight: 900; line-height: 1.2; white-space: nowrap; box-shadow: 0 2px 2px #35534815; }
.rr-current .rr-place-name { background: #fff3ac; border-color: #fffdf1; }
.rr-reward { position: absolute; top: 46%; width: 26%; transform: translateX(-50%); z-index: 3; filter: drop-shadow(0 4px 2px #48603d20); }
.rr-reward-art { display: block; }
.rr-new-reward { animation: rr-reward-grow .6s cubic-bezier(.21,.82,.32,1.18) both; }
.rr-truck { position: absolute; left: 50%; top: 79%; width: 80px; transform: translate(-50%,-50%) rotate(var(--rr-truck-turn, 0deg)) scale(var(--rr-truck-scale, 1)); transform-origin: 50% 50%; z-index: 4; filter: drop-shadow(0 7px 2px #34554b35); }
.rr-truck-art { display: block; }
.rr-truck-cargo { display: flex; align-items: center; justify-content: center; position: absolute; width: 73%; left: 14%; top: 61%; gap: 0; }
.rr-mini-cargo { display: block; width: 28px; flex: 0 0 28px; margin: 0 -5px; }
.rr-trip-label, .rr-world-note { position: absolute; left: 50%; transform: translateX(-50%); z-index: 5; padding: 8px 15px; border-radius: 22px; text-align: center; white-space: nowrap; font-weight: 900; }
.rr-trip-label { top: 15px; color: #426453; background: #fffcf0e8; font-size: 13px; border: 2px solid #fffdf6; box-shadow: 0 3px 0 #577b5330; }
.rr-world-note { bottom: 15px; max-width: 93%; color: #34584a; background: #f7ffdfed; font-size: 12px; white-space: normal; }
.rr-panel { position: relative; min-width: 0; padding: 22px; border-left: 3px solid #fffdf2; background: radial-gradient(ellipse at 100% 0, #fff3ce 0, transparent 60%), #fffbf0; }
.rr-request { display: flex; align-items: center; gap: 12px; min-height: 78px; margin-bottom: 17px; }
.rr-request-face { display: block; width: 69px; flex: 0 0 69px; padding: 5px; border-radius: 24px; background: #fff; box-shadow: 0 4px 0 #e6ddc4; }
.rr-request-label { display: block; margin-bottom: 4px; color: #776b52; font-size: 11px; font-weight: 900; letter-spacing: .075em; text-transform: uppercase; }
.rr-request-title { margin: 0; max-width: 22ch; color: #284f4e; font-size: clamp(21px, 2.15vw, 28px); line-height: 1.14; font-weight: 950; }
.rr-area-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; font-weight: 900; color: #5a6554; }
.rr-items { display: grid; grid-template-columns: repeat(var(--rr-columns), minmax(0, 1fr)); gap: 7px; min-width: 0; align-content: start; }
.rr-pool { min-height: 57px; margin-bottom: 16px; }
.rr-item { position: relative; display: grid; place-items: center; min-width: 0; min-height: 53px; aspect-ratio: 1; padding: 3px; border: 2px solid #d4ded3; border-bottom-width: 4px; border-radius: 15px; color: inherit; background: #fff; box-shadow: 0 2px 0 #e5e7d9; cursor: pointer; }
.rr-item-art { display: block; width: 100%; max-width: 62px; pointer-events: none; }
.rr-cargo-wrap { position: relative; min-height: 114px; padding: 12px; border: 2px solid #d7bd83; border-bottom: 6px solid #c5a469; border-radius: 18px; background: linear-gradient(#fff1c8, #fff7e2); box-shadow: inset 0 2px 0 #fffcf0, 0 3px 0 #eae1c8; }
.rr-cargo-wrap .rr-area-heading { margin-bottom: 9px; color: #735b35; }
.rr-cargo { gap: 6px; }
.rr-cargo-item { min-height: 48px; padding: 1px; border-color: #d7bd83; border-bottom-width: 3px; border-radius: 13px; background: #fffefa; box-shadow: 0 2px 0 #e9d7aa; }
.rr-empty { display: grid; min-height: 43px; place-items: center; text-align: center; font-size: 12px; font-weight: 700; color: #826d47; }
.rr-cargo-note { display: block; margin-top: 8px; font-size: 11px; text-align: center; font-weight: 750; color: #856d46; }
.rr-count-note:not(:empty) { display: grid; min-width: 26px; height: 26px; place-items: center; border-radius: 9px; background: #fff; color: #6a562e; font-size: 17px; }
.rr-pack-actions { display: flex; gap: 10px; align-items: stretch; margin-top: 16px; }
.rr-count-help, .rr-hear, .rr-town-link { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 15px; border: 2px solid #d7e1d3; border-bottom-width: 4px; border-radius: 15px; color: #426352; background: #fffefa; font: inherit; font-size: 13px; font-weight: 900; text-align: center; text-decoration: none; cursor: pointer; }
.rr-count-help { flex: 1; }
.rr-go, .rr-next { display: inline-flex; align-items: center; justify-content: center; gap: 15px; min-height: 55px; padding: 10px 20px; border: 2px solid #398866; border-bottom: 5px solid #287454; border-radius: 17px; color: #fff; background: #32815b; box-shadow: inset 0 2px 0 #8dcfa077, 0 3px 0 #deead8; font: inherit; font-weight: 950; text-shadow: 0 1px 0 #28684c60; cursor: pointer; }
.rr-go { min-width: 126px; font-size: 25px; }
.rr-go span:last-child { font-size: 29px; line-height: .6; }
.rr-arrival { padding: 0 3px; text-align: center; }
.rr-arrival-art { display: block; width: 144px; margin: -4px auto 3px; }
.rr-arrival-title { margin: 0 0 6px; color: #315b4d; font-size: 24px; line-height: 1.12; font-weight: 950; }
.rr-arrival-text { margin: 0; color: #64715b; font-size: 13px; line-height: 1.35; font-weight: 750; }
.rr-received { margin: 12px auto; padding: 8px 10px; border: 1px solid #e2d8b5; border-radius: 15px; background: #fff7dd; }
.rr-received-label { display: block; color: #79633b; font-size: 12px; font-weight: 850; }
.rr-received-items { display: flex; max-width: 290px; flex-wrap: wrap; justify-content: center; gap: 3px; margin: 4px auto 0; }
.rr-received-item { display: block; flex: 0 0 42px; width: 42px; }
.rr-word-model { margin: 12px 0; color: #5d6384; font-size: 16px; line-height: 1.35; font-weight: 850; }
.rr-word-model:not(:empty)::before { content: "Try a little phrase"; display: block; margin-bottom: 4px; color: #6d6a84; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.rr-arrival-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.rr-next { width: 100%; order: -1; min-height: 50px; font-size: 16px; }
.rr-hear, .rr-town-link { min-height: 44px; flex: 1; }
.rr-receipt { margin: 10px 0 0; color: #6b725f; font-size: 11px; line-height: 1.3; }
.rr-game[data-phase="driving"] .rr-arrival-art { width: 160px; margin-top: 40px; }
.rr-game[data-phase="driving"] .rr-panel { display: flex; flex-direction: column; }
.rr-game[data-phase="driving"] .rr-arrival { flex: 1; }
.rr-item.is-speaking, .rr-item.is-narrating { border-color: #9882d3; outline: 4px solid #d6c8fc; box-shadow: 0 3px 0 #b4a1df; }
.rr-game button:focus-visible, .rr-game a:focus-visible { outline: 4px solid #9682d6; outline-offset: 3px; }
.rr-paused * { animation-play-state: paused !important; }
@keyframes rr-reward-grow { from { opacity: 0; transform: translateX(-50%) scale(.45); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
@media (hover: hover) and (pointer: fine) { .rr-item:hover { background: #fff9e9; border-color: #aaa985; } .rr-go:hover, .rr-next:hover { background: #2c7853; } }
@media (max-width: 760px) {
  .rr-game { grid-template-columns: minmax(0, 1fr); }
  .rr-scene { height: 240px; min-height: 0; }
  .rr-panel { padding: 17px; border-left: 0; border-top: 3px solid #fffdf2; }
  .rr-place { top: 7%; width: 27%; max-width: 138px; }
  .rr-place-name { font-size: 11px; bottom: -9px; padding: 2px 9px; }
  .rr-reward { top: 45%; width: 22%; max-width: 95px; }
  .rr-trip-label { top: 8px; padding: 5px 12px; font-size: 10px; }
  .rr-world-note { bottom: 8px; padding: 5px 12px; font-size: 10px; }
  .rr-truck { width: 55px; }
  .rr-mini-cargo { width: 21px; flex-basis: 21px; margin: 0 -4px; }
  .rr-request { min-height: 62px; margin-bottom: 13px; gap: 11px; }
  .rr-request-face { width: 58px; flex-basis: 58px; padding: 3px; border-radius: 18px; }
  .rr-request-title { font-size: 24px; }
  .rr-request-label { font-size: 10px; }
  .rr-items { gap: 6px; }
  .rr-pool { margin-bottom: 13px; }
  .rr-cargo-wrap { padding: 10px; }
  .rr-item { min-height: 48px; border-radius: 13px; }
  .rr-cargo-item { min-height: 44px; border-radius: 11px; }
  .rr-arrival-art { width: 130px; }
  .rr-game[data-phase="driving"] .rr-arrival-art { margin-top: 0; width: 125px; }
  .rr-arrival-actions { max-width: 450px; margin: auto; }
}
@media (min-width: 480px) and (max-width: 760px) { .rr-scene { height: 275px; } .rr-panel { padding: 19px 26px; } }
@media (max-width: 390px) {
  .rr-scene { height: 215px; }
  .rr-panel { padding: 13px; }
  .rr-game[data-level="3"] .rr-items { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .rr-request-title { font-size: 22px; }
  .rr-items { gap: 5px; }
  .rr-cargo { gap: 4px; }
  .rr-count-help { padding-inline: 8px; font-size: 12px; }
  .rr-go { min-width: 114px; }
}
@media (prefers-reduced-motion: reduce) { .rr-game *, .rr-game *::before, .rr-game *::after { animation: none !important; transition: none !important; } }
.rr-game[data-quiet="true"] *, .rr-game[data-quiet="true"] *::before, .rr-game[data-quiet="true"] *::after { animation: none !important; transition: none !important; }
/* Keep the request, editable set and Go together on a phone while packing. */
@media (max-width: 600px) {
  .rr-game[data-phase="packing"] .rr-scene { height: 112px; }
  .rr-game[data-phase="packing"] .rr-place { top: 0; width: 21%; max-width: 82px; }
  .rr-game[data-phase="packing"] .rr-place-name { font-size: 9px; bottom: -4px; }
  .rr-game[data-phase="packing"] .rr-truck { width: 33px; }
  .rr-game[data-phase="packing"] .rr-mini-cargo { width: 13px; flex-basis: 13px; margin: 0 -3px; }
  .rr-game[data-phase="packing"] .rr-trip-label, .rr-game[data-phase="packing"] .rr-world-note { display: none; }
  .rr-game[data-phase="packing"] .rr-reward { max-width: 45px; top: 58%; }
  .rr-game[data-phase="packing"] .rr-request { min-height: 44px; margin-bottom: 10px; }
  .rr-game[data-phase="packing"] .rr-request-face { width: 44px; flex-basis: 44px; border-radius: 14px; }
  .rr-game[data-phase="packing"] .rr-request-label { font-size: 12px; }
  .rr-game[data-phase="packing"] .rr-request-title { display: none; }
}
@media (min-width: 390px) and (max-width: 760px) {
  .rr-game[data-level="3"] .rr-items { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
