/* Tile Hop at the Fitness Center: hop onto every tile of a board once. Boards share a 6 × 6 area, so tiles keep one
   size from board to board; --cell is one tile's width. */
.hop-card { display: flex; flex-direction: column; align-items: center; gap: 14px; min-height: 0; }
.hop-hud { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hop-hud span { padding: 6px 14px; border: 2px solid #c9dcd9; border-radius: 99px; background: #f3faf8; color: #3f6670; font-weight: 800; }
.hop-hud strong { color: #e0662e; font-size: 18px; }
.hop-stage {
  position: relative;
  width: min(100%, 440px);
  padding: 58px 16px 24px;
  overflow: hidden;
  border: 4px solid #2f6e8b;
  border-radius: 18px;
  background:
    repeating-linear-gradient(90deg, transparent 0 58px, #d7e6ea 58px 62px) 0 0 / 100% 44px no-repeat,
    linear-gradient(#e7f1f3 0 44px, #c98f5a 44px 47px, transparent 47px),
    repeating-linear-gradient(#d9a36c 0 34px, #cf9763 34px 36px);
  box-shadow: 0 5px 0 #24546a;
  touch-action: manipulation;
  user-select: none;
}
.hop-banner { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); padding: 5px 16px; border: 3px solid #24546a; border-radius: 8px; background: #ef7a3a; color: #fff; font: 900 14px Nunito, system-ui, sans-serif; letter-spacing: 2px; white-space: nowrap; }
.hop-area { display: grid; place-items: center; width: min(100%, 384px); aspect-ratio: 1; margin: 0 auto; }
.hop-board { --cols: 3; --rows: 3; position: relative; width: calc(var(--cols) * 100% / 6); container-type: inline-size; }
.hop-grid, .hop-tile, .hop-buddy { --cell: calc(100cqi / var(--cols)); }
.hop-grid { display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-template-rows: repeat(var(--rows), 1fr); aspect-ratio: var(--cols) / var(--rows); outline: none; }
.hop-tile, .hop-gap { margin: 6%; }
.hop-tile {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 20%;
  background: linear-gradient(#fff5e2, #f4d2a2);
  box-shadow: inset 0 0 0 calc(var(--cell) * .04) #ffffffa0, 0 calc(var(--cell) * .08) 0 #b97d48;
  transition: background .2s, box-shadow .2s, transform .15s;
}
.hop-tile.is-lit { background: radial-gradient(circle at 50% 42%, #fff1b8 0 9%, transparent 10%), linear-gradient(#ffb357, #eb7633); box-shadow: inset 0 0 0 calc(var(--cell) * .04) #ffd9a0, 0 calc(var(--cell) * .08) 0 #a3431d, 0 0 calc(var(--cell) * .2) #ffb35799; }
.hop-tile.is-lit::after { content: '★'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff4d2; font: 900 calc(var(--cell) * .34) / 1 Nunito, system-ui, sans-serif; text-shadow: 0 1px 0 #c35a26; }
/* The finish tile is chequered with a flag; it can only be landed on last. */
.hop-tile.is-finish { background: conic-gradient(#fff5e2 25%, #e9c493 0 50%, #fff5e2 0 75%, #e9c493 0) 0 0 / 50% 50%; }
/* The flag stands at the tile's top corner, above Buddy, so it stays in sight when Buddy is just in front of it. */
.hop-tile.is-finish::after { content: '🏁'; position: absolute; inset: -26% -10% auto auto; display: block; z-index: 3; font-size: calc(var(--cell) * .44); line-height: 1; filter: drop-shadow(0 1px 0 #fff); }
.hop-tile.is-next { cursor: pointer; background: linear-gradient(#f2fff3, #c8ebc9); box-shadow: inset 0 0 0 calc(var(--cell) * .05) #3f9a5c, 0 calc(var(--cell) * .08) 0 #6fa778; }
.hop-tile.is-next::before { content: ''; position: absolute; inset: calc(var(--cell) * -.06); border: calc(var(--cell) * .04) solid #3f9a5c; border-radius: 24%; opacity: 0; animation: hop-reach 1.2s ease-in-out infinite; }
.hop-tile.is-finish.is-lit { background: linear-gradient(#ffb357, #eb7633); }
.hop-tile.is-finish.is-next { background: conic-gradient(#f2fff3 25%, #c8ebc9 0 50%, #f2fff3 0 75%, #c8ebc9 0) 0 0 / 50% 50%; }
.hop-tile.is-next:hover { transform: translateY(calc(var(--cell) * -.04)); }
.hop-tile.is-next:focus-visible { outline: 3px solid #db8753; outline-offset: 2px; }
.hop-board.is-stuck .hop-tile:not(.is-lit) { background: linear-gradient(#fde9e4, #f3c3b7); box-shadow: inset 0 0 0 calc(var(--cell) * .04) #fff8, 0 calc(var(--cell) * .08) 0 #c9796b; }
.hop-board.is-cleared .hop-tile { animation: hop-cleared .7s ease-out; }
.hop-board.is-new .hop-grid { animation: hop-board-in .35s ease-out; }

/* Buddy stands on the current tile and hops to the next one. */
.hop-buddy.avatar {
  left: 0;
  top: 0;
  bottom: auto;
  width: calc(var(--cell) * 1.02);
  height: calc(var(--cell) * 1.79);
  z-index: 2;
  pointer-events: none;
  transform: translate(calc((var(--x, 0) + .5) * var(--cell) - 50%), calc((var(--y, 0) + .88) * var(--cell) - 100%));
  transition: transform .2s cubic-bezier(.3, .7, .4, 1);
}
.hop-buddy.no-slide { transition: none; }
.hop-buddy .avatar-art { transition: scale .15s; }
.hop-buddy.face-left .avatar-art { scale: -1 1; }
.hop-buddy.is-hopping .avatar-art { animation: hop-bounce .22s ease-out; }

.hop-feedback { position: absolute; top: 52px; left: 50%; z-index: 4; transform: translate(-50%, 6px); color: #2f8f5a; font: 900 24px Nunito, system-ui, sans-serif; text-shadow: 0 2px 0 #fff; white-space: nowrap; opacity: 0; transition: opacity .15s, transform .15s; pointer-events: none; }
.hop-feedback.show { opacity: 1; transform: translate(-50%, 0); }
.hop-feedback.bad { color: #d9493f; }
.hop-overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 18px; background: #1f3d4c88; }
.hop-overlay[hidden] { display: none; }
.hop-panel { max-width: 320px; padding: 20px 22px; border: 3px solid #2f6e8b; border-radius: 16px; background: #fffdf4; box-shadow: 0 5px 0 #24546a; text-align: center; }
.hop-panel h3 { margin: 0 0 6px; color: #24546a; font-size: 26px; }
.hop-panel p { margin: 0 0 12px; color: #5f7275; font-size: 14px; }
.hop-result { display: grid; gap: 4px; margin-bottom: 14px; color: #3f5f45; font-weight: 800; }
.hop-result strong { color: #e0662e; font-size: 30px; line-height: 1.1; }
.hop-result .hop-points { color: #3f5f45; }
.hop-result em { color: #d9493f; font-style: normal; }
.hop-result span { color: #7a6427; }
.hop-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hop-controls .text-button { display: inline-flex; align-items: center; gap: 8px; }
.hop-controls kbd { padding: 1px 6px; border: 1px solid #c9d8cc; border-radius: 6px; background: #fff; color: #577958; font: 800 11px/1.3 ui-monospace, monospace; }
@media (hover: none) { .hop-controls kbd { display: none; } }

@keyframes hop-reach { 0%, 100% { opacity: 0; } 50% { opacity: .9; } }
@keyframes hop-bounce { 0%, 100% { translate: 0 0; } 45% { translate: 0 -22%; } }
@keyframes hop-cleared { 0% { transform: none; } 40% { transform: translateY(calc(var(--cell) * -.12)) scale(1.06); } 100% { transform: none; } }
@keyframes hop-board-in { from { opacity: 0; transform: scale(.94); } }

@media (max-width: 650px) {
  .hop-stage { padding: 52px 4px 14px; }
  .hop-tile, .hop-gap { margin: 4%; }
  .hop-hud { gap: 6px; }
  .hop-hud span { padding: 5px 11px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .hop-buddy.avatar, .hop-tile { transition: none; }
  .hop-buddy.is-hopping .avatar-art, .hop-tile.is-next::before, .hop-board.is-cleared .hop-tile, .hop-board.is-new .hop-grid { animation: none; }
  .hop-tile.is-next::before { opacity: .7; }
}
