.rhythm-section {
  padding-top: 30px;
  padding-bottom: 118px;
}

.rhythm-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.65fr);
  gap: 72px;
  align-items: end;
  margin-bottom: 42px;
}

.rhythm-heading h2 {
  margin: 0;
  font: 600 clamp(42px, 4.8vw, 66px) / 0.96 var(--serif);
  letter-spacing: -0.055em;
}

.rhythm-heading h2 em {
  color: #759d58;
  font-weight: 500;
}

.rhythm-intro p {
  margin: 0 0 16px;
  color: #496057;
  font-size: 16px;
}

.rhythm-intro a,
.rhythm-note a {
  color: #17372d;
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.rhythm-intro a span,
.rhythm-note a span {
  display: inline-block;
  margin-left: 5px;
  color: #759d58;
  text-decoration: none;
}

.rhythm-flow {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px minmax(0, 1fr) 74px minmax(0, 1fr);
  align-items: center;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(16, 37, 31, 0.12);
  border-radius: 36px;
  background:
    radial-gradient(circle at 50% 0, rgba(216, 242, 155, 0.36), transparent 33%),
    #eeefe8;
  box-shadow: 0 32px 70px rgba(16, 37, 31, 0.08);
}

.rhythm-flow::before {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 48%;
  height: 1px;
  background: rgba(23, 55, 45, 0.17);
  content: "";
}

.rhythm-step {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 17px 17px 20px;
  overflow: hidden;
  border: 1px solid rgba(16, 37, 31, 0.1);
  border-radius: 27px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 18px 40px rgba(16, 37, 31, 0.09);
  animation: rhythm-card-focus 9s ease-in-out infinite;
}

.rhythm-step-learn {
  animation-delay: 3s;
}

.rhythm-step-return {
  animation-delay: 6s;
}

.rhythm-step-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  font-family: var(--mono);
  text-transform: uppercase;
}

.rhythm-step-top > span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  background: #17372d;
  color: #d8f29b;
  font-size: 9px;
}

.rhythm-step-top strong {
  color: #28473e;
  font-size: 9px;
  letter-spacing: 0.07em;
}

.rhythm-step-top i {
  padding: 4px 7px;
  border-radius: 999px;
  background: #e5eadf;
  color: #587068;
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.04em;
}

.rhythm-step-learn .rhythm-step-top i {
  background: #fff0dc;
  color: #b45f2c;
}

.rhythm-step-return .rhythm-step-top i {
  background: #e4f2ca;
  color: #50753e;
}

.rhythm-device {
  width: min(218px, 88%);
  height: 282px;
  margin: 0 auto 18px;
  overflow: hidden;
  border: 7px solid #17372d;
  border-radius: 24px;
  background: #17372d;
  box-shadow: 0 22px 35px rgba(16, 37, 31, 0.18);
}

.rhythm-device-bar {
  display: flex;
  height: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  color: #fff;
  font: 500 7px var(--mono);
}

.rhythm-device-bar span {
  color: #90aa9f;
  font-size: 6px;
}

.rhythm-play-screen,
.rhythm-learn-screen,
.rhythm-return-screen {
  position: relative;
  height: 248px;
  overflow: hidden;
  border-radius: 16px;
}

.rhythm-play-screen {
  background: linear-gradient(#9fd8f2 0 47%, #8fc46d 47% 100%);
}

.rhythm-cloud {
  position: absolute;
  width: 42px;
  height: 13px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
}

.rhythm-cloud::before,
.rhythm-cloud::after {
  position: absolute;
  bottom: 0;
  border-radius: 50%;
  background: inherit;
  content: "";
}

.rhythm-cloud::before { left: 8px; width: 17px; height: 22px; }
.rhythm-cloud::after { right: 7px; width: 14px; height: 17px; }
.cloud-one { left: 20px; top: 31px; }
.cloud-two { right: 22px; top: 58px; transform: scale(0.72); }

.rhythm-game-world {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 64px;
  display: flex;
  align-items: end;
  justify-content: space-around;
  padding: 0 24px;
  color: #47734f;
  font-size: 37px;
  text-shadow: 0 4px rgba(29, 70, 47, 0.12);
}

.rhythm-game-world i:nth-child(2) { color: #f6c963; font-size: 52px; }
.rhythm-game-world i:nth-child(3) { color: #6b9d5c; font-size: 44px; }

.rhythm-game-card {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.94);
  color: #17372d;
}

.rhythm-game-card small { font-size: 8px; font-weight: 700; }
.rhythm-game-card strong { font-size: 9px; }

.rhythm-learn-screen {
  padding: 20px 14px;
  background: linear-gradient(160deg, #fff6dd, #e4f5bc);
  color: #17372d;
  text-align: center;
}

.rhythm-lock {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 2px auto 12px;
  place-items: center;
  border-radius: 15px;
  background: #f36a65;
  color: #fff;
  font-size: 27px;
  transform: rotate(-8deg);
}

.rhythm-learn-screen > small,
.rhythm-return-screen > small {
  font: 500 7px var(--mono);
  letter-spacing: 0.1em;
}

.rhythm-learn-screen h3,
.rhythm-return-screen h3 {
  margin: 13px 0;
  font: 600 24px / 1 var(--serif);
  letter-spacing: -0.04em;
}

.rhythm-answers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.rhythm-answers span {
  padding: 8px 2px;
  border: 1px solid #d5d9cd;
  border-radius: 9px;
  background: #fff;
  font-size: 9px;
  font-weight: 800;
}

.rhythm-answers .is-right {
  border-color: #759d58;
  background: #dff0bd;
}

.rhythm-progress {
  height: 5px;
  margin: 20px 5px 0;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(23, 55, 45, 0.12);
}

.rhythm-progress i {
  display: block;
  width: 68%;
  height: 100%;
  border-radius: inherit;
  background: #759d58;
}

.rhythm-return-screen {
  padding: 23px 14px;
  background: linear-gradient(160deg, #dff0bd, #c4e9ba);
  color: #17372d;
  text-align: center;
}

.rhythm-success {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 11px;
  place-items: center;
  border-radius: 50%;
  background: #759d58;
  color: #fff;
  box-shadow: 0 8px 18px rgba(75, 113, 65, 0.2);
  font-size: 23px;
}

.rhythm-return-screen h3 { margin-bottom: 12px; }

.rhythm-time {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
}

.rhythm-time strong { font: 600 21px var(--serif); }
.rhythm-time span { color: #4f6c61; font-size: 8px; }

.rhythm-return-button {
  margin-top: 14px;
  padding: 8px;
  border-radius: 999px;
  background: #17372d;
  color: #fff;
  font-size: 8px;
  font-weight: 800;
}

.rhythm-step-copy h3 {
  margin: 0 0 7px;
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.rhythm-step-copy p {
  min-height: 63px;
  margin: 0;
  color: #587068;
  font-size: 12px;
  line-height: 1.65;
}

.rhythm-connector {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 9px;
  color: #587068;
  text-align: center;
}

.rhythm-connector span {
  width: 92px;
  padding: 7px 8px;
  border: 1px solid rgba(16, 37, 31, 0.12);
  border-radius: 999px;
  background: #fffdf8;
  box-shadow: 0 8px 20px rgba(16, 37, 31, 0.08);
  font: 600 7px / 1.35 var(--mono);
  text-transform: uppercase;
}

.rhythm-connector i {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #17372d;
  color: #d8f29b;
  font-size: 16px;
  font-style: normal;
}

.rhythm-note {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding: 17px 20px;
  border-radius: 18px;
  background: #17372d;
  color: #fff;
}

.rhythm-note > span {
  padding: 6px 10px;
  border-radius: 999px;
  background: #d8f29b;
  color: #17372d;
  font: 800 9px var(--mono);
  text-transform: uppercase;
}

.rhythm-note p {
  margin: 0;
  color: #d9e4df;
  font-size: 12px;
}

.rhythm-note a { color: #fff; }
.rhythm-note a span { color: #d8f29b; }

@keyframes rhythm-card-focus {
  0%, 26%, 100% { transform: translateY(0); box-shadow: 0 18px 40px rgba(16, 37, 31, 0.09); }
  6%, 20% { transform: translateY(-7px); box-shadow: 0 28px 56px rgba(16, 37, 31, 0.17); }
}

@media (max-width: 920px) {
  .rhythm-heading { grid-template-columns: 1fr; gap: 24px; }
  .rhythm-flow { grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr) 44px minmax(0, 1fr); padding: 16px; }
  .rhythm-device { width: 88%; height: 246px; }
  .rhythm-play-screen, .rhythm-learn-screen, .rhythm-return-screen { height: 212px; }
  .rhythm-step { padding: 12px 12px 17px; }
  .rhythm-step-top i { display: none; }
  .rhythm-connector span { display: none; }
  .rhythm-step-copy p { min-height: 78px; }
}

@media (max-width: 700px) {
  .rhythm-section { padding-top: 100px; padding-bottom: 80px; }
  .rhythm-heading h2 { font-size: 43px; }
  .rhythm-flow { grid-template-columns: 1fr; gap: 0; padding: 14px; border-radius: 28px; }
  .rhythm-flow::before { top: 6%; bottom: 6%; left: 50%; right: auto; width: 1px; height: auto; }
  .rhythm-step { width: 100%; padding: 16px; }
  .rhythm-device { width: min(230px, 82%); height: 286px; }
  .rhythm-play-screen, .rhythm-learn-screen, .rhythm-return-screen { height: 252px; }
  .rhythm-step-copy { text-align: center; }
  .rhythm-step-copy p { min-height: 0; }
  .rhythm-connector { min-height: 74px; align-content: center; }
  .rhythm-connector span { display: block; width: auto; }
  .rhythm-connector i { transform: rotate(90deg); }
  .rhythm-note { grid-template-columns: 1fr; justify-items: start; }
}

@media (max-width: 560px) {
  .rhythm-section { padding-top: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  .rhythm-step { animation: none; }
}
