.play-page #game-root.sand-shift-panel {
  padding: clamp(12px, 2.5vw, 26px);
  border-color: #9d76545e;
  background: #160c0a;
}
.sand-shift-shell {
  color: #f0e5c9;
  text-align: center;
}
.sand-shift-progress, .sand-shift-toolbar, .sand-shift-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.sand-shift-progress { margin: 2px 0 16px; gap: 5px; }
.sand-shift-progress span { width: min(7%, 32px); height: 4px; background: #62453c; border-radius: 5px; }
.sand-shift-progress .done { background: #a78355; }
.sand-shift-progress .current { background: #f1ca86; }
.sand-shift-toolbar button, .sand-shift-win button {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #84674f;
  border-radius: 999px;
  background: #2b1915;
  color: #f1e2c5;
  font-weight: 700;
}
.sand-shift-toolbar button:disabled { opacity: .48; }
.sand-shift-toolbar button.primary, .sand-shift-win button { background: #f1ca86; color: #2b1915; }
.sand-shift-stats { margin: 13px auto; color: #dbc09d; font-size: .88rem; }
.sand-shift-stats span + span::before { content: '·'; margin-right: 8px; color: #ae8a65; }

.sand-shift-board {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: end;
  gap: 27px clamp(9px, 2vw, 19px);
  padding: 19px 8px 32px;
  border: 1px solid #b8835338;
  border-radius: 18px;
  background: radial-gradient(ellipse at 50% 94%, #5d2b1b 0%, #241310 50%, #130b09 87%);
  box-shadow: inset 0 1px #d9a36d1a, inset 0 -8px 29px #0e07062e;
}
.sand-shift-tube {
  --unit: 25%;
  position: relative;
  width: clamp(48px, 8vw, 74px);
  height: clamp(134px, 24vw, 210px);
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 8px 8px 23% 23%;
  flex: none;
  isolation: isolate;
  touch-action: manipulation;
}
.sand-shift-board .sand-shift-tube:disabled { opacity: 1; }
.sand-shift-tube::before {
  content: '';
  position: absolute;
  inset: 3px 1px 0;
  z-index: 2;
  pointer-events: none;
  border: 1px solid #f0d5b47d;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffe0b442, transparent 12%, #fff6d91a 16%, transparent 23% 72%, #f9dbac23 87%, #fff4d741 96%, #1b111d66);
  box-shadow: inset 1px 0 1px #fff4d8b0, inset -2px 0 4px #1a1118c9, inset 0 -5px 4px #f8e4c23d, 0 8px 12px #100806b0;
}
.sand-shift-tube::after {
  content: '';
  position: absolute;
  inset: 0 -2px auto;
  height: 13px;
  z-index: 3;
  pointer-events: none;
  border: 2px solid #e3c8a0;
  border-bottom-color: #a78b75;
  border-radius: 50%;
  background: radial-gradient(ellipse, #271e21bd 45%, #b5a29099 60%, #fff2d8bd 80%);
}
.sand-shift-fill {
  position: absolute;
  inset: 18px 4px 6px;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  border-radius: 2px 2px 22% 22%;
}
.sand-shift-layer {
  height: var(--unit);
  flex: none;
  background-color: var(--sand);
  background-image: linear-gradient(98deg, #30203070, #ffffff2b 22%, transparent 44%, #29192263), var(--grain-texture, none);
  background-size: 100% 100%, 96px 96px;
  box-shadow: inset 0 2px 1px #fff2d54f, inset 0 -2px 3px #3d242e44;
}
.sand-shift-incoming { clip-path: inset(100% 0 0); }
.sand-shift-number {
  position: absolute;
  inset: auto 0 -21px;
  color: #ddbc95;
  font-size: .73rem;
  font-variant-numeric: tabular-nums;
}
.sand-shift-tube.selected::before, .sand-shift-tube:focus-visible::before {
  border-color: #f5cd83;
  box-shadow: 0 0 0 2px #f5cd8399, 0 0 19px #c27f4d91;
}
.sand-shift-tube.full::after { border-color: #a8cb92; }
.sand-shift-tube.is-pouring { opacity: .16; }
.sand-shift-stream, .sand-shift-moving { position: fixed; pointer-events: none; }
.sand-shift-stream { inset: 0 auto auto 0; z-index: 10000; }
.sand-shift-moving { transform-origin: 50% 6px; z-index: 10001; }
.sand-shift-status { min-height: 2.6em; margin: 14px auto 0; line-height: 1.4; color: #e4cbb0; }
.sand-shift-status.won { color: #c7e69e; }
.sand-shift-win { margin: 12px auto; padding: 16px; border: 1px solid #aa8e58; border-radius: 14px; }
.sand-shift-win strong { display: block; font-size: 1.2rem; }
.sand-shift-win p { margin: 8px 0; }
@media (max-width: 480px) {
  .sand-shift-board { padding-inline: 6px; column-gap: 9px; }
  .sand-shift-tube { height: clamp(109px, 32vw, 144px); }
  .sand-shift-toolbar button { padding-inline: 10px; font-size: .83rem; }
}

.sand-shift-tube[data-destination="true"] { outline:2px solid #ffd38f; outline-offset:4px; }
.sand-shift-tube[data-destination="true"]:focus-visible { outline:3px solid #fff5d9; }
