/* Rutefall: the well in the middle, the next pieces and the motif on the left, the cloth and a fact on the right. */
.rf { display: grid; grid-template-columns: 210px auto 230px; justify-content: center; gap: 18px; align-items: start; padding-top: 14px }
.rf-left, .rf-right { display: grid; gap: 12px }
.rf-centre { display: grid; gap: 26px; justify-items: center }
.rf-stats { grid-template-columns: repeat(4, auto); gap: 4px 22px; justify-content: center }
.rf-stats dd { font-size: 22px }
.rf-well { position: relative; border-radius: 4px; box-shadow: 0 0 0 6px #8a6b45, 0 0 0 8px #5d4630, 0 14px 30px rgba(42, 35, 31, .3); background: var(--linen) }
.rf-well::before, .rf-well::after { /* the loom's beams */ content: ""; position: absolute; left: -14px; right: -14px; height: 10px; border-radius: 5px; background: linear-gradient(#a7845a, #6f5235); box-shadow: 0 2px 4px rgba(0, 0, 0, .25) }
.rf-well::before { top: -16px } .rf-well::after { bottom: -16px }
#well { display: block; image-rendering: pixelated; touch-action: none; outline: none; cursor: pointer }
.rf-overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; background: rgba(239, 232, 216, .86); backdrop-filter: blur(1px) }
.rf-overlay[hidden] { display: none }
.rf-overlay h2 { margin: 0; font: 700 34px/1 Barlow, sans-serif }
.rf-overlay p { margin: 0; max-width: 260px; font-size: 16px; color: var(--ink-2) }
.rf-best { font-size: 14px }
#next { width: 100%; max-width: 120px; margin: 0 auto; image-rendering: pixelated }
.rf-now-body { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: start }
#now-motif { width: 64px; height: 64px; image-rendering: pixelated; border-radius: 3px }
#now-name { font-size: 17px }
#now-om { margin: 2px 0 0; font-size: 14px; line-height: 1.4; color: var(--ink-2) }
.rf-cloth h2 { display: flex; justify-content: space-between; gap: 6px }
.rf-cloth h2 .muted { font: 500 13px Barlow, sans-serif; letter-spacing: 0; text-transform: none }
.rf-cloth-box { height: 300px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; background: repeating-linear-gradient(90deg, transparent 0 5px, rgba(207, 194, 162, .5) 5px 6px); border-radius: 4px }
#cloth { width: 100%; image-rendering: pixelated }
.rf-pad { display: none }
.rf-over .stats { grid-template-columns: repeat(4, 1fr); margin: 14px 0 }
.rf-final { margin: 6px 0 4px; max-height: 46vh; overflow: auto; border-radius: 6px; background: var(--linen); padding: 12px }
#final { width: 100%; image-rendering: pixelated }
.rf-final-labels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; font: 700 12px 'Barlow Condensed', sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); text-align: center }

@media (max-width: 900px) {
  .rf { grid-template-columns: auto 180px; }
  .rf-left { grid-column: 2; grid-row: 1 } .rf-right { grid-column: 2; grid-row: 2 } .rf-centre { grid-column: 1; grid-row: 1 / span 2 }
  .rf-right .panel:last-child { display: none }
}
/* Phones: the well and the buttons, nothing else while playing. */
@media (max-width: 640px) {
  .is-game .foot { display: none }
  .stage.rf { padding: 8px 8px 0; gap: 8px; grid-template-columns: 1fr auto }
  .rf-left { grid-column: 2; grid-row: 1; align-self: start } .rf-centre { grid-column: 1; grid-row: 1 } .rf-right { display: none }
  .rf-left .panel { padding: 8px }
  .rf-now { display: none }
  .rf-next h2 { margin-bottom: 4px }
  #next { width: 54px }
  .rf-stats { grid-template-columns: repeat(4, auto); gap: 0 12px }
  .rf-stats dd { font-size: 18px }
  .rf-well { box-shadow: 0 0 0 4px #8a6b45, 0 8px 18px rgba(42, 35, 31, .3) }
  .rf-well::before, .rf-well::after { display: none }
  .rf-pad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; width: 100%; padding-bottom: env(safe-area-inset-bottom) }
  .rf-pad button { min-height: 54px; border-radius: 12px; border: 1px solid var(--pill-border); background: var(--card); font-size: 24px; color: var(--ink); touch-action: none; user-select: none; -webkit-user-select: none }
  .rf-pad button.down, .rf-pad button:active { background: var(--linen-2) }
  .rf-pad .rf-drop { background: var(--w-raud); border-color: var(--w-raud); color: #fff }
}
@media (hover: none) and (min-width: 641px) { .rf-pad { display: grid; grid-template-columns: repeat(6, 64px); gap: 8px } .rf-pad button { min-height: 56px; border-radius: 12px; border: 1px solid var(--pill-border); background: var(--card); font-size: 24px } }
