/* Rhyme Swim: a pool seen from the side of the deck, four lanes, the word on his starting block below
   and three big rhymes to tap. Words to read use the rd-word class (Andika). */
.rhymeswim button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.rhymeswim .rs-stage {
  flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 10px 12px 12px;
  background: #e7f3f7 repeating-linear-gradient(90deg, transparent 0 46px, rgba(120, 170, 190, .25) 46px 48px), #e7f3f7;
  background-image: repeating-linear-gradient(90deg, transparent 0 46px, rgba(120, 170, 190, .25) 46px 48px), repeating-linear-gradient(0deg, transparent 0 46px, rgba(120, 170, 190, .25) 46px 48px);
}

/* ---------- the pool ---------- */
.rhymeswim .rs-pool {
  --sw: 100px; flex: 1 1 0; min-height: 180px; max-height: min(560px, 90vw); position: relative; overflow: hidden;
  border: 4px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow); background: #1d9fd0;
}
.rhymeswim .rs-lanes { position: absolute; inset: 0; display: flex; flex-direction: column; }
.rhymeswim .rs-lane {
  flex: 1; min-height: 0; position: relative; display: flex;
  background: repeating-linear-gradient(100deg, transparent 0 60px, rgba(255, 255, 255, .08) 60px 64px, transparent 64px 130px), linear-gradient(#45c8ec, #23a4d6);
}
.rhymeswim .rs-lane.me { background: repeating-linear-gradient(100deg, transparent 0 60px, rgba(255, 255, 255, .1) 60px 64px, transparent 64px 130px), linear-gradient(#5cd5f3, #2fb3e2); }
/* the dark line on the pool floor, with a T at each end */
.rhymeswim .rs-lane::after { content: ''; position: absolute; left: 70px; right: 56px; top: 50%; height: 8px; margin-top: -4px; border-radius: 4px; background: rgba(12, 70, 120, .3); }
.rhymeswim .rs-lane::before { content: ''; position: absolute; left: 66px; right: 52px; top: 30%; bottom: 30%; border-left: 8px solid rgba(12, 70, 120, .3); border-right: 8px solid rgba(12, 70, 120, .3); }
/* lane ropes: red and white floats */
.rhymeswim .rs-lane + .rs-lane { box-shadow: inset 0 0 0 0 transparent; }
.rhymeswim .rs-lane + .rs-lane .rs-blk::before {
  content: ''; position: absolute; left: 0; width: 100vw; top: -6px; height: 12px; z-index: 4; pointer-events: none;
  background: radial-gradient(circle, #ff5a5f 0 4.5px, var(--ink) 5px 6px, transparent 6.5px) 0 0 / 26px 12px repeat-x,
    radial-gradient(circle, #fff 0 4.5px, var(--ink) 5px 6px, transparent 6.5px) 13px 0 / 26px 12px repeat-x;
}
.rhymeswim .rs-blk {
  flex: none; width: 36px; position: relative; z-index: 3; display: grid; place-items: center; font-weight: 800; font-size: 20px; color: var(--ink);
  background: linear-gradient(90deg, #f4f7f9, #d5dfe6); border-right: 4px solid var(--ink);
}
.rhymeswim .rs-lane.me .rs-blk { background: linear-gradient(90deg, #fff3b0, var(--sun)); }
.rhymeswim .rs-pad { flex: none; width: 16px; position: relative; z-index: 3; border-left: 4px solid var(--ink); background: repeating-linear-gradient(0deg, #ffd23f 0 10px, #ff9f1c 10px 20px); }
.rhymeswim .rs-lane.done .rs-pad { background: var(--good); }
.rhymeswim .rs-track { flex: 1; position: relative; min-width: 0; }

/* ---------- swimmers ---------- */
.rhymeswim .rs-swimmer { position: absolute; left: 0; top: 50%; width: var(--sw); height: calc(var(--sw) * .83); margin-top: calc(var(--sw) * -.45); z-index: 2; will-change: transform; }
.rhymeswim .rs-swimmer.me { transition: transform .62s cubic-bezier(.2, .9, .3, 1); z-index: 3; }
.rhymeswim .rs-in { position: absolute; inset: 0; }
.rhymeswim .rs-swimmer.back .rs-in { transform: scaleX(-1); animation: rs-flip .5s ease-out; }
@keyframes rs-flip { 0% { transform: scaleX(1); } 45% { transform: scaleX(.05) translateY(18%) rotate(30deg); } 100% { transform: scaleX(-1); } }
.rhymeswim .rs-body { position: absolute; inset: 0; z-index: 1; }
.rhymeswim .rs-me-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.rhymeswim .rs-arm { transform-box: view-box; transform-origin: 87px 70px; transform: rotate(-60deg); }
.rhymeswim .swim .rs-arm { animation: rs-arm 1.15s linear infinite; }
@keyframes rs-arm { from { transform: rotate(-150deg); } to { transform: rotate(210deg); } }
.rhymeswim .rs-critter { position: absolute; left: -4%; right: -4%; top: 2%; bottom: 4%; }
.rhymeswim .rs-critter svg { display: block; width: 100%; height: 100%; }
/* the water in front of the part that's under */
.rhymeswim .rs-in::after { content: ''; position: absolute; left: -12%; right: -12%; top: 80%; bottom: -14%; z-index: 1; background: linear-gradient(rgba(70, 200, 236, .8), rgba(40, 170, 220, .92)); border-radius: 40% 40% 0 0 / 20% 20% 0 0; pointer-events: none; }
.rhymeswim .swim .rs-critter { animation: rs-bob .9s ease-in-out infinite; }
.rhymeswim .rs-swimmer:nth-child(odd) .rs-critter { animation-delay: -.4s; }
@keyframes rs-bob { 50% { transform: translateY(5%) rotate(-3deg); } }
/* the water line over the chin, and the kick behind */
.rhymeswim .rs-ripple {
  position: absolute; left: -10%; right: -10%; top: 74%; height: 18%; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse at 50% 0, rgba(255, 255, 255, .95) 0 42%, transparent 46%) 0 0 / 25% 100% repeat-x;
}
.rhymeswim .swim .rs-ripple { animation: rs-ripple .6s linear infinite; }
@keyframes rs-ripple { to { background-position: -25% 0; } }
.rhymeswim .rs-wash { position: absolute; right: 82%; top: 50%; width: 80%; height: 40%; z-index: 0; opacity: 0; border-radius: 50%;
  background: radial-gradient(circle at 20% 50%, #fff 0 18%, transparent 20%), radial-gradient(circle at 55% 30%, rgba(255, 255, 255, .9) 0 15%, transparent 17%), radial-gradient(circle at 80% 65%, rgba(255, 255, 255, .85) 0 16%, transparent 18%); }
.rhymeswim .swim .rs-wash { opacity: .9; animation: rs-wash .45s linear infinite; }
@keyframes rs-wash { 50% { transform: translateX(-8%) scale(1.12); opacity: .6; } }
.rhymeswim .rs-splash { position: absolute; left: 50%; top: 55%; width: 120%; height: 90%; z-index: 3; transform: translate(-50%, -50%) scale(.2); opacity: 0; pointer-events: none;
  background: radial-gradient(circle at 20% 60%, #fff 0 10%, transparent 11%), radial-gradient(circle at 40% 20%, #fff 0 9%, transparent 10%), radial-gradient(circle at 62% 30%, #fff 0 11%, transparent 12%),
    radial-gradient(circle at 82% 58%, #fff 0 10%, transparent 11%), radial-gradient(circle at 50% 70%, rgba(255, 255, 255, .9) 0 16%, transparent 17%); }
.rhymeswim .stroke .rs-splash { animation: rs-splash .45s ease-out; left: 85%; }
.rhymeswim .stall .rs-splash { animation: rs-splash .8s ease-out; }
@keyframes rs-splash { 30% { opacity: 1; } to { transform: translate(-50%, -70%) scale(1.25); opacity: 0; } }
.rhymeswim .stall .rs-body { animation: rs-stall .8s ease-in-out; }
@keyframes rs-stall { 20% { transform: translateY(14%) rotate(-8deg); } 45% { transform: translateY(-6%) rotate(6deg); } 70% { transform: translateY(8%) rotate(-4deg); } }
.rhymeswim .rs-you { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, 2px); z-index: 5; padding: 0 7px; font-size: 13px; font-weight: 800; line-height: 1.35; color: var(--ink); background: var(--sun); border: 2px solid var(--ink); border-radius: 8px; white-space: nowrap; }

.rhymeswim .rs-banner { position: absolute; left: 50%; top: 50%; z-index: 6; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none; white-space: nowrap;
  font-size: clamp(34px, 6vw, 60px); font-weight: 800; color: #fff; text-shadow: 0 4px 0 var(--ink), 0 0 18px rgba(0, 0, 0, .25); transition: opacity .2s, transform .25s cubic-bezier(.2, 1.6, .4, 1); }
.rhymeswim .rs-banner.show { opacity: 1; transform: translate(-50%, -50%); }

/* ---------- the word on the block, and the three rhymes ---------- */
.rhymeswim .rs-panel { flex: none; display: flex; align-items: center; justify-content: center; gap: 14px; }
.rhymeswim .rs-block {
  flex: none; min-width: 210px; min-height: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 18px 8px; overflow: hidden;
  background: #fff; border: 4px solid var(--ink); border-radius: 18px; box-shadow: 0 8px 0 #9fb3c2, 0 8px 0 2px var(--ink);
}
.rhymeswim .rs-block.pop { animation: rs-pop .3s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes rs-pop { from { transform: scale(.85); } }
.rhymeswim .rs-lbl { align-self: stretch; margin: 0 -18px 2px; padding: 1px 8px; font-size: 15px; font-weight: 800; color: #fff; background: var(--sea); text-align: center; letter-spacing: .5px; }
.rhymeswim .rs-target { font-size: clamp(46px, 6vw, 66px); font-weight: 700; line-height: 1.15; color: var(--ink); min-height: 1.15em; white-space: nowrap; }
.rhymeswim .rs-hear { display: none; width: 76px; height: 76px; margin: 4px 0 0; border-radius: 50%; border: 4px solid var(--ink); background: #fff8d6; font-size: 38px; box-shadow: 0 4px 0 rgba(58, 42, 74, .25); cursor: pointer; place-items: center; padding: 0; }
.rhymeswim .rs-block.hear .rs-hear { display: grid; animation: rs-ring 1.2s ease-in-out infinite; }
.rhymeswim .rs-block.hear .rs-target { display: none; }
@keyframes rs-ring { 50% { transform: scale(1.08); } }
.rhymeswim .rs-target u, .rhymeswim .rs-choice u { text-decoration: none; background: linear-gradient(transparent 16%, #ffe27a 16% 94%, transparent 94%); border-radius: 8px; padding: 0 2px; }
.rhymeswim .rs-choices { display: flex; gap: 12px; }
.rhymeswim .rs-choice {
  font-family: 'Andika', var(--font); font-size: clamp(36px, 4.6vw, 54px); font-weight: 700; line-height: 1.2; min-width: 160px; min-height: 104px; padding: 4px 18px;
  color: var(--ink); background: #fff; border: 4px solid var(--ink); border-radius: 22px; box-shadow: var(--shadow); cursor: pointer; white-space: nowrap; transition: transform .08s;
}
.rhymeswim .rs-choice:empty { visibility: hidden; }
.rhymeswim .rs-choice:disabled { cursor: default; color: var(--ink); opacity: 1; }
.rhymeswim .rs-choice:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 rgba(58, 42, 74, .25); }
.rhymeswim .rs-choice.ok { background: #dcf8e3; box-shadow: 0 0 0 5px var(--good), var(--shadow); }
.rhymeswim .rs-choice.bad { background: #ffe1e3; color: #b33; text-decoration: line-through 4px rgba(179, 51, 51, .6); animation: rs-shake .3s; }
.rhymeswim .rs-choice.hint { background: #fff8d6; box-shadow: 0 0 0 5px var(--sun), var(--shadow); animation: rs-ring .7s ease-in-out infinite; }
@keyframes rs-shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* ---------- start card and podium ---------- */
.rhymeswim .rs-start, .rhymeswim .rs-podium { position: absolute; inset: 0; z-index: 12; display: none; place-items: center; padding: 16px; background: rgba(10, 50, 80, .4); }
.rhymeswim .rs-start.show, .rhymeswim .rs-podium.show { display: grid; }
.rhymeswim .rs-card, .rhymeswim .rs-pod-card { background: #fff; border: 4px solid var(--ink); border-radius: 26px; padding: 16px 24px; box-shadow: var(--shadow); text-align: center; max-width: 560px; }
.rhymeswim .rs-big { font-size: 76px; line-height: 1; }
.rhymeswim .rs-how { margin: 8px 0 4px; font-size: 30px; }
.rhymeswim .rs-how .rd-word { display: inline-block; font-size: 38px; font-weight: 700; color: var(--ink); background: #fff8d6; border: 3px solid var(--ink); border-radius: 12px; padding: 0 12px; }
.rhymeswim .rs-off { font-weight: 700; color: var(--coral-dark); }
.rhymeswim .rs-go { font-size: 32px; min-height: 80px; padding: 8px 44px; margin-top: 8px; }
.rhymeswim .rs-best { margin: 10px 0 0; font-weight: 800; color: var(--ink-soft); font-size: 20px; }
.rhymeswim .rs-pod-card { animation: rs-pop .4s cubic-bezier(.2, 1.6, .4, 1); padding-bottom: 12px; }
.rhymeswim .rs-pod-card h3 { margin: 0 0 8px; font-size: 32px; color: var(--grape); }
.rhymeswim .rs-steps { display: flex; align-items: flex-end; justify-content: center; gap: 6px; }
.rhymeswim .rs-step { width: 112px; }
.rhymeswim .rs-who { position: relative; width: 86px; height: 86px; margin: 0 auto 2px; }
.rhymeswim .rs-who > svg { width: 100%; height: 100%; display: block; }
.rhymeswim .rs-medal { position: absolute; right: -10px; bottom: -6px; font-size: 34px; line-height: 1; }
.rhymeswim .rs-box { display: grid; place-items: center; font-size: 36px; font-weight: 800; color: var(--ink); background: linear-gradient(#fff, #d5dfe6); border: 4px solid var(--ink); border-bottom: 0; border-radius: 12px 12px 0 0; }
.rhymeswim .s1 .rs-box { height: 108px; } .rhymeswim .s2 .rs-box { height: 78px; } .rhymeswim .s3 .rs-box { height: 56px; }
.rhymeswim .rs-step.me .rs-box { background: linear-gradient(#fff3b0, var(--sun)); }
.rhymeswim .rs-step.me .rs-who { animation: rs-ring 1s ease-in-out infinite; }
.rhymeswim .rs-steps + p, .rhymeswim .rs-fourth { border-top: 4px solid var(--ink); }
.rhymeswim .rs-fourth { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding-top: 6px; font-size: 26px; font-weight: 800; color: var(--ink); }
.rhymeswim .rs-fourth svg { width: 54px; height: 54px; }
.rhymeswim .rs-fourth + p { border-top: 0; }
.rhymeswim .rs-time { margin: 0; padding-top: 8px; font-size: 24px; font-weight: 800; color: var(--ink); }
.rhymeswim .rs-time b { color: var(--good); }

/* ---------- phones (and narrow windows) ---------- */
@media (max-width: 760px) {
  .rhymeswim .rs-stage { padding: 8px 8px 10px; gap: 8px; }
  .rhymeswim .rs-panel { flex-direction: column; gap: 10px; }
  .rhymeswim .rs-block { min-width: 170px; min-height: 96px; }
  .rhymeswim .rs-target { font-size: 46px; }
  .rhymeswim .rs-choices { align-self: stretch; gap: 8px; }
  .rhymeswim .rs-choice { flex: 1 1 0; min-width: 0; min-height: 92px; padding: 4px 6px; font-size: clamp(28px, 8.4vw, 40px); border-radius: 18px; }
  .rhymeswim .rs-blk { width: 26px; font-size: 16px; }
  .rhymeswim .rs-pad { width: 10px; }
  .rhymeswim .rs-lane::after { left: 44px; right: 34px; }
  .rhymeswim .rs-lane::before { left: 40px; right: 30px; }
  .rhymeswim .rs-step { width: 92px; }
  .rhymeswim .rs-who { width: 70px; height: 70px; }
}
@media (max-width: 560px) {
  .rhymeswim .game-top { grid-template-columns: auto 1fr; gap: 8px; }
  .rhymeswim .game-top h2 { display: none; }
  .rhymeswim .hud { gap: 6px; font-size: 18px; }
  .rhymeswim .hud span { padding: 0 9px; white-space: nowrap; }
  .rhymeswim .rs-pod-card { padding: 12px 12px 10px; }
  .rhymeswim .rs-pod-card h3 { font-size: 26px; }
}
