.page-game .game-shell.theme-grip:has(.grip-room) {
  --grip-ink: #172f47;
  --grip-muted: #465a6c;
  --grip-accent: #205184;
  --grip-paper: #edf5fa;
  --grip-line: #adc2d1;
  background:var(--grip-paper);
  color:var(--grip-ink);
}
.page-game .game-shell.theme-grip:has(.grip-room) .game-toolbar {
  color:var(--grip-ink);
  background:var(--grip-paper);
  border-color:var(--grip-line);
}
.page-game .game-shell.theme-grip:has(.grip-room) .game-toolbar .button {
  background:#f8fcff;
  color:var(--grip-ink);
  border-color:#829cae;
}
.page-game .game-shell.theme-grip.wide .play:has(.grip-room) {
  width: min(100%,84rem);
  min-height: 0;
  justify-content: flex-start;
  margin-block: 0;
  padding: clamp(1rem,4dvh,2.6rem) clamp(1rem,3vw,2.55rem);
}
.grip-room {
  width: 100%;
  max-width: 79rem;
  min-width: 0;
  margin-inline: auto;
}
.game-shell .play .grip-room { text-align: start; }
.game-shell .play .grip-room p { color: var(--grip-muted); margin-inline: 0; max-width: none; }
.game-shell .play .grip-head p { margin: 0 0 .19rem; color: var(--grip-accent); font-weight: 730; }
.game-shell .play .grip-head h2 {
  color: var(--grip-ink);
  margin: 0 0 clamp(.7rem,2dvh,1.28rem);
  line-height: 1.1;
  outline: none;
  font-size: clamp(1.5rem,min(3.9vw,6.4dvh),3.55rem);
}
.grip-desk {
  display: grid;
  grid-template-columns: minmax(0,1.27fr) minmax(0,1fr);
  gap: clamp(.85rem,3.5vw,3.3rem);
  align-items: center;
}
.grip-route-art {
  position: relative;
  width: 100%;
  max-height: 28rem;
  aspect-ratio: 1.61;
  isolation: isolate;
  border-radius: .72rem;
  background:
    repeating-linear-gradient(0deg,#88562465 0 1px,transparent 1px 13%),
    repeating-linear-gradient(2deg,#fff0b92a 0 2px,transparent 3px 8px,#a36c3a24 9px 10px,transparent 11px 15px),
    radial-gradient(ellipse at 32% 28%,#f5d6a4,#d9a66e);
  border:1px solid #b78c60;
  box-shadow:0 .35rem .85rem #48362419;
  overflow: hidden;
}
.grip-start-line, .grip-finish-line {
  position: absolute;
  inset-block: 9%;
  width: clamp(.25rem,1.05vw,.75rem);
  left: 13%;
  background: #1e5586;
  border-radius:.12rem;
}
.grip-finish-line {
  left: auto;
  right: 13%;
  background:repeating-linear-gradient(#864221 0 11%,#f8db9f 11% 21%);
}
.grip-tray {
  position: absolute;
  inset: 26% 19% 21%;
  transform: rotate(-6deg);
  border-radius: 46%;
  background:
    radial-gradient(ellipse at 50% 48%,#fffaf0 0 43%,#e5cdaa 45% 54%,#fff4db 56%,#eccea5 69%);
  border:clamp(1px,.2vw,3px) solid #b78d60;
  box-shadow:.42rem .72rem .7rem #54351262,inset 0 .25rem 1rem #fff3d8;
}
.grip-tray > span {
  position: absolute;
  aspect-ratio: 1;
  width: 19%;
  border-radius: 46% 55% 45% 52%;
  top: 34%;
  left: 19%;
  background:
    repeating-conic-gradient(from 21deg at 42% 44%,#a93a2145 0 1.8%,transparent 2.7% 12%),
    radial-gradient(circle at 31% 26%,#fff0db 0 8%,#f6a27e 31%,#cb5939 75%,#913e24 100%);
  box-shadow:inset .09rem .16rem .2rem #ffc8a9,.24rem .42rem .41rem #79502b76;
}
.grip-tray > span:nth-child(2) { left: 42%; top: 51%; transform: rotate(31deg); }
.grip-tray > span:nth-child(3) { left: 60%; top: 22%; transform: rotate(-20deg); }
.grip-tray.grip-one-down > span:nth-child(3) { left: 90%; top: 102%; transform: rotate(40deg); }
.grip-clock {
  padding:clamp(.55rem,1.5vw,1.2rem) clamp(.8rem,2.2vw,1.6rem);
  border-radius:.6rem;
  background:#1a3852;
  color:#f5fbff;
}
.grip-clock > span { display: block; font-weight: 720; }
.grip-clock > strong {
  display: block;
  font-variant-numeric: tabular-nums;
  color:inherit;
  font-size:clamp(2.35rem,6vw,5.6rem);
  letter-spacing: -.035em;
  line-height: 1.14;
}
.grip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .46rem .58rem;
  align-items: center;
  margin: .65rem 0 .28rem;
}
.game-shell .play .grip-room button { min-height: 44px; }
.grip-room button:focus-visible { outline:3px solid #205184;outline-offset:2px }
.page-game .game-shell.theme-grip .play .grip-room .button.cta {
  background:#ff9a53;border-color:#b45a29;color:#242e36;font-weight:800;
}
.page-game .game-shell.theme-grip .play .grip-room .button.cta:enabled:hover { background:#ffb075 }
.page-game .game-shell.theme-grip .play .grip-room .button.secondary {
  background:#f8fcff;border-color:#829cae;color:var(--grip-ink);
}
.page-game .game-shell.theme-grip .play .grip-room .button[data-grip-drop] {
  background:#fff2e7;border-color:#b97659;color:#7c3524;
}
.page-game .game-shell.theme-grip .play .grip-room .button:disabled {
  background:#e2eaf0;border-color:#9bb0bf;color:#445768;opacity:1;
}
.game-shell .play .grip-room [data-grip-error] { color:#a12f29 }
.grip-record {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1.15fr);
  gap: .45rem 1.5rem;
  padding: .7rem 0 .8rem;
  border-block-start: 1px solid var(--grip-line);
  min-width: 0;
}
.game-shell .play .grip-record h3 { margin: 0; color: var(--grip-ink); }
.grip-times { display: grid; gap: .45rem; margin: .42rem 0 0; }
.grip-times dt { color: var(--grip-muted); font-size: .95rem; }
.grip-times dd { margin: 0; color: var(--grip-accent); font-weight: 740; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.grip-events { list-style:none; margin:0; padding:0; }
.grip-events li {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .7rem;
  justify-content: space-between;
  border-inline-start: 2px solid #6287a5;
  margin: 0;
  padding: .23rem .48rem;
  color: var(--grip-ink);
  font-variant-numeric: tabular-nums;
}
.grip-events [data-grip-event="drop"] { border-color: #ac675d; }
.grip-events [data-grip-event="finish"] { border-color: #639077; }
.grip-events li span { color: var(--grip-muted); }
.grip-results { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .82rem 1.66rem; }
.grip-results .grip-record { grid-template-columns: minmax(0,1fr); }
.grip-times>div:first-child {
  border-inline-start:3px solid #6c8dab;
  background:#f8fcff;
  padding:.45rem .7rem;
}
.grip-times>div:first-child dd { font-size:clamp(1.55rem,3.6vw,2.85rem);line-height:1.14;color:var(--grip-ink) }
.grip-results[data-grip-winner="0"] [data-grip-record="0"] .grip-times>div:first-child,
.grip-results[data-grip-winner="1"] [data-grip-record="1"] .grip-times>div:first-child {
  background:#ffefd6;
  border-color:#b65b2d;
}
@media (max-width: 725px) {
  .grip-desk { grid-template-columns: minmax(0,1fr); }
  .grip-route-art { max-height: min(29dvh,18rem);aspect-ratio:1.85 }
  .grip-desk>div:last-child { grid-row:1 }
}
@media (max-width: 570px) {
  .grip-record,.grip-results { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .grip-actions .button { transition:background-color .15s ease,transform .15s ease }
  .grip-actions .button:enabled:active { transform:translateY(1px) }
  .grip-tray.grip-one-down > span:nth-child(3) { animation: grip-drop .48s cubic-bezier(.32,.61,.67,1) both; }
  @keyframes grip-drop {
    from { left: 60%; top: 22%; transform: rotate(-20deg); }
    to { left: 90%; top: 102%; transform: rotate(40deg); }
  }
}
