/* Game feel: touch response, round entry and a phone layout that keeps the
   choices within reach. Presentation only; no score or state depends on it. */

/* Press response. Every control gives way slightly under a finger. */
.ottrillion-page :is(.button,.choice,.icon-button,.sound-button,.help-button,.mode-switch a,.mode-nav a,.habitat-motion-button) {
  transition: transform .12s cubic-bezier(.2,.8,.2,1), box-shadow .12s ease, background-color .15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.ottrillion-page :is(.button,.icon-button,.sound-button,.help-button,.habitat-motion-button):not(:disabled):active { transform: translateY(1px) scale(.97); }
.ottrillion-page .choice:not(:disabled):active { transform: scale(.965); }
.ottrillion-page :is(.bank-button.ready,.next-button):not(:disabled):active { transform: translateY(2px) scale(.95); }

/* The ready Keep button breathes once a pick makes it meaningful. */
@keyframes feel-ready { 0%,100% { box-shadow: 0 0 0 0 rgba(214,232,140,.0); } 50% { box-shadow: 0 0 0 7px rgba(214,232,140,.35); } }
.ottrillion-page .bank-button.ready:not(:disabled) { animation: feel-ready 2.4s ease-in-out 1.2s infinite; }
.ottrillion-page .next-button:not(:disabled) { animation: feel-ready 2s ease-in-out .6s infinite; }

/* A new round arrives rather than appearing. */
@keyframes feel-stage-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes feel-card-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.ottrillion-page .round-enter .stage { animation: feel-stage-in .42s cubic-bezier(.2,.9,.25,1) both; }
.ottrillion-page .round-enter .choice { animation: feel-card-in .38s cubic-bezier(.2,.9,.25,1) both; }
.ottrillion-page .round-enter .choice:nth-child(1) { animation-delay: .10s; }
.ottrillion-page .round-enter .choice:nth-child(2) { animation-delay: .15s; }
.ottrillion-page .round-enter .choice:nth-child(3) { animation-delay: .20s; }
.ottrillion-page .round-enter .choice:nth-child(4) { animation-delay: .25s; }
.ottrillion-page .round-enter .choice:nth-child(5) { animation-delay: .30s; }
.ottrillion-page .round-enter .choice:nth-child(6) { animation-delay: .35s; }

/* The final total lands with a little weight. */
@keyframes feel-total-land { 0% { transform: scale(.7); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
.ottrillion-page .big-score { display: inline-block; animation: feel-total-land .7s cubic-bezier(.2,.9,.25,1) both; transform-origin: left center; }

/* Phones: one compact row for mode controls so the first choices sit on screen. */
@media (max-width: 560px) {
  .ottrillion-page .mode-strip { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; padding-bottom: 10px; }
  .ottrillion-page .mode-strip .mode-caption { display: none; }
  .ottrillion-page .mode-strip .mode-switch { flex: 0 1 auto; }
  .ottrillion-page .mode-strip .all-games-link { margin-left: auto; padding: 8px 6px; }
  .ottrillion-page .mode-strip > .habitat-motion-button,
  .ottrillion-page .mode-caption-tools .habitat-motion-button {
    position: relative; flex: none; width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .ottrillion-page .habitat-motion-button [data-habitat-motion-label] {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .ottrillion-page .habitat-motion-button::before { content: ""; width: 12px; height: 12px; background: currentColor;
    clip-path: polygon(0 0,35% 0,35% 100%,0 100%,0 0,65% 0,100% 0,100% 100%,65% 100%,65% 0); }
  .ottrillion-page .habitat-motion-button[aria-pressed="false"]::before { clip-path: polygon(10% 0,100% 50%,10% 100%); }
  .ottrillion-page .habitat-motion-button:disabled::before { opacity: .45; }

  .unlimited-page.ottrillion-page .mode-bar, .unlimited-page .mode-bar { flex-wrap: nowrap; align-items: center; gap: 8px; padding-bottom: 10px; }
  .unlimited-page .mode-bar .mode-nav { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.25fr) minmax(0,1fr); flex: 1 1 auto; width: auto; min-width: 0; }
  .unlimited-page .mode-bar .mode-nav a { white-space: nowrap; min-width: 0; padding: 8px 4px; }
  .unlimited-page .mode-bar .mode-caption-tools { margin-left: auto; display: flex; align-items: center; flex: none; width: auto; min-width: 0; }
  .unlimited-page .mode-bar .mode-caption-tools p { display: none; }
  .unlimited-page .ul-local-progress { display: none; }

  .ottrillion-page .main .topline { margin-bottom: 10px; gap: 8px; }
  .ottrillion-page .round-intro .game-hook { display: none; }
  .ottrillion-page .round-title { font-size: 30px; line-height: 1.05; margin: 2px 0 0; }
  .ottrillion-page .stage.armful-stage .scene-area { height: 150px; min-height: 150px; flex-basis: 150px; }
  .ottrillion-page .stage.armful-stage .scene-area svg { height: 150px; }
}

@media (max-width: 370px) {
  .ottrillion-page .mode-strip .mode-switch a { min-width: 0; padding: 7px 11px; }
  .ottrillion-page .mode-strip .all-games-link { padding: 8px 2px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .ottrillion-page .round-enter :is(.stage,.choice),
  .ottrillion-page .big-score,
  .ottrillion-page :is(.bank-button.ready,.next-button) { animation: none !important; }
  .ottrillion-page :is(.button,.choice,.icon-button,.sound-button,.help-button,.habitat-motion-button) { transition: none; }
  .ottrillion-page :is(.button,.choice,.icon-button,.sound-button,.help-button,.habitat-motion-button):active { transform: none; }
}
