/* Rainy Bloom: the game's sage street, cream paper and rose accent, rain over the first screen,
   the opening story as a reel, and one day at the flower cart. Loaded after app-page.css; scoped to .app-rainy-bloom. */
.app-rainy-bloom {
  --rb-sage: #dbe6c9; --rb-sage-deep: #b9c9a4; --rb-street: #a9ad9f; --rb-street-line: #9a9e90;
  --rb-cream: #f8f3e8; --rb-rose: #b8325e; --rb-rose-deep: #8f2246; --rb-gold: #f2b52f; --rb-ink: #3a2622;
}
.app-rainy-bloom .ap-back, .app-rainy-bloom .ap-lang { background: rgba(248, 243, 232, 0.72); }
.app-rainy-bloom :focus-visible { outline: 3px solid var(--rb-rose); outline-offset: 3px; }
.app-rainy-bloom .ap-hero h1 { font-weight: 600; letter-spacing: -0.03em; }
html:not([lang="en"]) .app-rainy-bloom .ap-hero h1 { font-family: "Zen Maru Gothic", var(--font); font-weight: 900; letter-spacing: 0; }
.app-rainy-bloom .ap-icon { box-shadow: 0 14px 30px rgba(58, 38, 34, 0.18); }
.app-rainy-bloom .store { border-radius: 99px; padding-right: 28px; box-shadow: 0 10px 24px rgba(58, 38, 34, 0.22); }

/* ── First screen: rain over the sage street, the shop seen from above ── */
.rb-hero { background: radial-gradient(120% 90% at 80% 10%, #e6eedb, var(--rb-sage) 60%, #cfdcba); }
.rb-rain { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
@media (min-width: 901px) { .rb-hero .ap-hero-inner { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.rb-window {
  position: relative; justify-self: center; width: min(100%, 420px); aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: 32px; border: 10px solid var(--rb-cream); background: var(--rb-street);
  box-shadow: 0 30px 60px rgba(58, 38, 34, 0.22); rotate: 2deg; pointer-events: auto;
}
.rb-window img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; display: block; }
.rb-ripple { position: absolute; width: 18%; aspect-ratio: 2 / 1; border: 2px solid rgba(255, 255, 255, 0.7); border-radius: 50%; opacity: 0; }
.rb-ripple.r1 { left: 14%; top: 86%; } .rb-ripple.r2 { left: 62%; top: 90%; } .rb-ripple.r3 { left: 40%; top: 80%; }
@media (prefers-reduced-motion: no-preference) {
  .rb-ripple { animation: rb-ripple 2.6s ease-out infinite; }
  .rb-ripple.r2 { animation-delay: -0.9s; } .rb-ripple.r3 { animation-delay: -1.7s; }
}
@keyframes rb-ripple { 0% { opacity: 0.9; scale: 0.2; } 100% { opacity: 0; scale: 1.3; } }

/* ── The opening story ── */
.rb-story { background: var(--rb-cream); padding-bottom: clamp(56px, 7vw, 96px); }
.rb-reel {
  list-style: none; padding: 0 var(--pad); margin: clamp(32px, 4vw, 52px) auto 0; max-width: var(--wrap);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 22px);
}
.rb-reel li { display: grid; align-content: start; gap: 14px; }
.rb-reel img { width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 22px; box-shadow: 0 14px 30px rgba(58, 38, 34, 0.14); }
.rb-reel p { font-size: var(--t-small); line-height: 1.6; color: var(--ink); }
.rb-reel li:nth-child(even) { margin-top: clamp(0px, 3vw, 40px); }
@media (max-width: 900px) {
  .rb-reel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 8px; }
  .rb-reel::-webkit-scrollbar { display: none; }
  .rb-reel li { flex: 0 0 min(62vw, 240px); scroll-snap-align: start; }
  .rb-reel li:nth-child(even) { margin-top: 0; }
}

/* ── One day at the cart ── */
.rb-sig { background: var(--paper-2); }
.rb-day {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-areas: "controls street" "controls result";
  gap: clamp(16px, 2vw, 24px); margin-top: clamp(32px, 4vw, 52px); align-items: start;
}
.rb-controls { grid-area: controls; display: grid; gap: 22px; padding: clamp(20px, 2.6vw, 32px); border-radius: 28px; background: var(--rb-cream); }
.rb-controls fieldset { border: 0; padding: 0; min-width: 0; }
.rb-controls legend, .rb-field > span:first-child { font-weight: 800; margin-bottom: 10px; display: block; }
.rb-bouquets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rb-bq { position: relative; display: grid; justify-items: center; gap: 4px; padding: 12px 6px 10px; border-radius: 20px; border: 2px solid transparent; background: #fff; cursor: pointer; text-align: center; transition: border-color 160ms ease, transform 200ms var(--ease-spring); }
.rb-bq input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.rb-bq > img { width: 64px; height: 64px; }
.rb-bq-name { font-weight: 800; font-size: var(--t-small); line-height: 1.3; }
.rb-bq-mix { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; font-size: 0.75rem; color: var(--muted); }
.rb-bq-mix span { display: inline-flex; align-items: center; }
.rb-bq-mix img { width: 18px; height: 18px; }
.rb-bq:has(input:checked) { border-color: var(--rb-rose); background: #fff3f5; }
.rb-bq:has(input:focus-visible) { outline: 3px solid var(--rb-rose); outline-offset: 2px; }
@media (hover: hover) { .rb-bq:hover { transform: translateY(-2px); } }
.rb-seg { display: inline-flex; padding: 4px; border-radius: 99px; background: #fff; }
.rb-seg label { position: relative; }
.rb-seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.rb-seg span { display: block; padding: 8px 20px; border-radius: 99px; font-weight: 800; }
.rb-seg input:checked + span { background: var(--rb-ink); color: var(--rb-cream); }
.rb-seg input:focus-visible + span { outline: 3px solid var(--rb-rose); outline-offset: 2px; }
.rb-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: end; }
.rb-stepper { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 99px; background: #fff; }
.rb-stepper button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--paper-2); color: var(--ink); font: 800 1.25rem/1 var(--font); cursor: pointer; }
.rb-stepper output { min-width: 2.2em; text-align: center; font: 600 1.25rem/1 "Fredoka", var(--font); }
.rb-price-row { display: flex; align-items: center; gap: 14px; min-height: 48px; }
.rb-price-row input { flex: 1; min-width: 0; accent-color: var(--rb-rose); }
.rb-price-row output { min-width: 4.4em; font: 600 1.25rem/1 "Fredoka", var(--font); }
.rb-coin { display: inline-flex; align-items: center; gap: 5px; font-family: "Fredoka", var(--font); font-weight: 600; white-space: nowrap; }
.rb-coin::before { content: ""; width: 1.05em; height: 1.05em; background: url("../assets/rainy-bloom/art/coin.webp") center / contain no-repeat; flex: none; }
.rb-cost { color: var(--muted); font-size: var(--t-small); }
.rb-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.rb-open, .rb-again { min-height: 52px; padding: 0 26px; border-radius: 99px; border: 0; font: 800 1.0625rem/1 var(--font); cursor: pointer; transition: transform 200ms var(--ease-spring); }
.rb-open { background: var(--rb-rose); color: #fff; box-shadow: 0 10px 22px rgba(184, 50, 94, 0.3); }
.rb-again { background: #fff; color: var(--ink); }
.rb-open:disabled, .rb-again:disabled { opacity: 0.5; cursor: default; }
@media (hover: hover) { .rb-open:not(:disabled):hover, .rb-again:not(:disabled):hover { transform: translateY(-2px); } }

/* The street: pavement tiles, the cart in the middle, passers-by walking left to right */
.rb-street {
  grid-area: street; position: relative; height: clamp(220px, 24vw, 280px); overflow: hidden; border-radius: 28px;
  background:
    linear-gradient(var(--rb-street-line) 1px, transparent 1px) 0 0 / 100% 46px,
    linear-gradient(90deg, var(--rb-street-line) 1px, transparent 1px) 0 0 / 92px 100%,
    var(--rb-street);
}
.rb-street::before { content: ""; position: absolute; inset: 0 0 auto; height: 22%; background: var(--rb-sage-deep); border-bottom: 6px solid #c9d6b4; }
.rb-cart { position: absolute; left: 50%; top: 14%; width: clamp(120px, 15vw, 168px); height: auto; translate: -50% 0; filter: drop-shadow(0 8px 8px rgba(40, 30, 20, 0.2)); }
.rb-walkers { position: absolute; inset: 0; }
.rb-walker { position: absolute; left: -10%; bottom: calc(10% + var(--lane) * 9%); width: clamp(44px, 5vw, 56px); translate: -50% 0; }
.rb-walker > img { width: 100%; height: auto; display: block; rotate: 90deg; }
.rb-bubble {
  position: absolute; left: 50%; bottom: 105%; transform: translate(-50%, 0); opacity: 0;
  padding: 6px 12px; border-radius: 14px; background: #fff; color: var(--ink); white-space: nowrap;
  font-size: 0.8125rem; font-weight: 800; box-shadow: 0 6px 14px rgba(40, 30, 20, 0.18);
}
.rb-bubble::after { content: ""; position: absolute; left: 50%; top: 100%; translate: -50% 0; border: 6px solid transparent; border-top-color: #fff; }
.rb-bubble.is-buy { padding: 4px; border-radius: 50%; }
.rb-bubble.is-buy img { width: 34px; height: 34px; display: block; }

.rb-result { grid-area: result; padding: clamp(20px, 2.6vw, 30px); border-radius: 28px; background: var(--rb-cream); }
.rb-result[hidden] { display: none; }
.rb-sold { font: 600 var(--t-h3)/1.3 "Fredoka", var(--font); }
.rb-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.rb-sum div { padding: 12px 14px; border-radius: 18px; background: #fff; }
.rb-sum dt { font-size: var(--t-small); color: var(--muted); }
.rb-sum dd { margin-top: 4px; font-size: 1.25rem; }
.rb-profit dd { color: #2f7a44; }
.rb-profit.is-loss dd { color: var(--rb-rose); }
.rb-left { margin-top: 12px; color: var(--muted); font-size: var(--t-small); }
.rb-result h3 { margin-top: 18px; font-size: 1rem; }
.rb-why { list-style: none; padding: 0; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.rb-why li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border-radius: 99px; background: #fff; font-size: var(--t-small); font-weight: 800; }
.rb-why b { min-width: 1.8em; padding: 2px 8px; border-radius: 99px; background: var(--paper-2); text-align: center; }
.rb-tip { margin-top: 16px; font-weight: 800; color: var(--accent-ink); }

@media (max-width: 900px) {
  .rb-day { grid-template-columns: 1fr; grid-template-areas: "controls" "street" "result"; }
}
@media (max-width: 520px) {
  .rb-row { grid-template-columns: 1fr; }
  .rb-sum { gap: 8px; }
  .rb-sum div { padding: 10px; }
  .rb-sum dd { font-size: 1rem; }
  .rb-bq-mix { display: none; }
}

/* ── Screens, facts and download ── */
.app-rainy-bloom .ap-screens { --flow-fg: var(--rb-cream); }
.rb-facts { background: var(--rb-sage); }
.rb-facts .facts-card { border-radius: 28px; background: var(--rb-cream); box-shadow: 0 20px 44px rgba(58, 38, 34, 0.12); outline: 2px dashed rgba(58, 38, 34, 0.18); outline-offset: -12px; }
.rb-facts .facts-stub { border-right: 2px dashed rgba(58, 38, 34, 0.16); }
@media (max-width: 900px) { .rb-facts .facts-stub { border-right: 0; border-bottom: 2px dashed rgba(58, 38, 34, 0.16); } }
.app-rainy-bloom .ap-download { background: var(--rb-sage); }
.app-rainy-bloom .ap-download-inner { z-index: 1; }
.rb-end-umbrella { position: absolute; z-index: 0; right: -70px; bottom: -130px; width: clamp(180px, 22vw, 300px); height: auto; opacity: 0.85; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) { .rb-end-umbrella { animation: rb-spin 40s linear infinite; } }
@keyframes rb-spin { to { rotate: 360deg; } }

/* Trailer (landscape): rose play button and a dark-earth label to match the shop */
.rb-film .film img, .rb-film .film iframe { box-shadow: 0 30px 70px rgba(58, 38, 34, 0.28); }
.rb-film .film iframe { background: #2a1c19; }
.rb-film .play-icon { top: 76%; }
.rb-film .play-icon::after { border-color: transparent transparent transparent var(--accent-ink); }
.rb-film .trailer-label { background: rgba(58, 38, 34, 0.72); }
.rb-film .film a:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 4px; }
