.ss-game {
  --ss-fg: #fff5da;
  --ss-faint: #cacca9;
  --ss-paper: #292946;
  display: flex;
  flex-direction: column;
  gap: clamp(0.4rem, 1.25vh, 0.95rem);
  min-height: 100%;
  width: 100%;
  padding: clamp(0.65rem, 1.6vw, 1.4rem);
  color: var(--ss-fg);
  background: var(--ss-paper);
  font:
    500 1rem/1.32 system-ui,
    sans-serif;
  isolation: isolate;
}
#main[data-room-status='playing'] .ss-game {
  height: 100%;
}
.ss-sprint {
  background: linear-gradient(150deg, #2b2448, #1a2137);
  --ss-faint: #d6c9ac;
}
.ss-dive {
  background: linear-gradient(140deg, #184b57, #0d3245);
  --ss-faint: #c2e0d8;
}
.ss-game > * {
  min-width: 0;
}
.ss-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex: none;
}
.ss-head h2 {
  margin: 0;
  font:
    800 clamp(1.15rem, 3.05vw, 2.35rem)/1.02 system-ui,
    sans-serif;
  letter-spacing: -0.046em;
  color: var(--ss-fg);
}
.ss-badge,
.ss-clock {
  flex: none;
  white-space: nowrap;
  border: 1px solid #d9d7ac66;
  border-radius: 5px;
  padding: 0.36rem 0.65rem;
  font:
    650 0.83rem ui-monospace,
    monospace;
  color: var(--ss-fg);
  background: #13193136;
}
.ss-game .ss-canvas {
  display: block;
  width: 100%;
  min-height: 135px;
  flex: 1 1 13rem;
  height: 0;
  max-height: none;
  object-fit: fill;
  border: 1px solid #c3bd9e77;
  border-radius: 0.75rem;
  background: #303247;
}
.ss-dive .ss-canvas {
  background: #27647a;
}
.ss-console {
  display: flex;
  align-items: center;
  gap: clamp(0.55rem, 1.5vw, 1.15rem);
  flex-wrap: wrap;
}
.ss-game .ss-call {
  flex: 1 1 13rem;
  margin: 0;
  color: var(--ss-fg);
  font-weight: 650;
  line-height: 1.3;
}
.ss-lights {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #10172b;
  border: 1px solid #837692;
  border-radius: 0.6rem;
  padding: 0.48rem 0.65rem;
  box-shadow: inset 0 3px #01061d80;
}
.ss-lights i {
  width: clamp(0.75rem, 2.2vw, 1.55rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #374250;
  box-shadow: inset 0 2px 2px #02061788;
}
.ss-sprint[data-phase='ready'] .ss-lights i:first-child,
.ss-sprint[data-phase='ready'] .ss-lights i:nth-child(2) {
  background: #ffbc61;
  box-shadow:
    0 0 8px #f3a54a88,
    inset 0 -3px #ad6739;
}
.ss-sprint[data-phase='go'] .ss-lights i {
  background: #a9eb65;
  box-shadow:
    0 0 11px #9afd8299,
    inset 0 -3px #55a463;
}
.ss-game .ss-console .ss-button {
  flex: none;
  margin: 0;
  min-width: clamp(8rem, 17vw, 17rem);
  min-height: 48px;
  border-radius: 0.55rem;
  border: 1px solid #fbce77;
  box-shadow: 0 3px 0 #a77643;
  background: #ffe093;
  color: #392c35;
  font-size: clamp(1rem, 1.7vw, 1.25rem);
  font-weight: 800;
}
.ss-game[data-phase='go'] .ss-console .ss-button {
  background: #cff49a;
  color: #233b2b;
  border-color: #d8fa9d;
  box-shadow: 0 3px 0 #699753;
}
.ss-game .ss-console .ss-button:disabled {
  color: #dbd2c1;
  background: #444055;
  border-color: #797584;
  box-shadow: none;
  opacity: 0.86;
}
.ss-scores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(8rem, 100%), 1fr));
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ss-scores li {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 0.13rem;
  padding: 0.38rem 0.55rem;
  border: 1px solid #c4c8b83b;
  border-inline-start: 4px solid var(--ss-team);
  border-radius: 0.32rem;
  background: #ffffff0d;
}
.ss-scores b,
.ss-scores span,
.ss-scores small {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.ss-scores b {
  font-weight: 750;
  font-size: clamp(0.78rem, 1.5vw, 0.95rem);
}
.ss-scores span,
.ss-scores small {
  color: var(--ss-faint);
  font-size: 0.76rem;
}
.ss-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}
.ss-options button {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  justify-content: start;
  text-align: start;
  min-height: 52px;
  margin: 0;
  padding: 0.45rem 0.6rem;
  background: #f1e8c8;
  color: #273f42;
  border: 2px solid #cbb583;
  border-radius: 0.55rem;
  box-shadow: 0 2px #7b8170;
}
.ss-options button[data-choice='reef'] {
  background: #d9edcc;
  border-color: #a6c8a8;
}
.ss-options button[data-choice='bank'] {
  background: #dce9ec;
  border-color: #a3c4cc;
}
.ss-options button[aria-pressed='true'] {
  outline: 3px solid #f4d974;
  outline-offset: -4px;
  opacity: 1;
}
.ss-options button:disabled {
  opacity: 0.8;
  cursor: default;
}
.ss-options b,
.ss-options small {
  display: block;
  color: #293a3c;
}
.ss-options small {
  font-size: 0.75rem;
  line-height: 1.2;
  font-weight: 500;
}
.ss-options .ss-order-art {
  width: clamp(2.1rem, 6vw, 4rem);
  height: auto;
  flex: none;
}
.ss-game .role-rules {
  margin: 0;
  padding: 0.32rem 0 0;
  color: var(--ss-faint);
  font-size: 0.77rem;
  border-top: 1px solid #c4c8b83b;
}
.ss-game .role-rules summary:focus-visible,
.ss-game button:focus-visible,
.ss-game:focus-visible {
  outline: none;
  filter: brightness(1.25);
}
@media (max-width: 660px) {
  .ss-console {
    gap: 0.45rem;
  }
  .ss-options {
    gap: 0.3rem;
  }
  .ss-options button {
    display: grid;
    justify-items: start;
    align-content: start;
    padding: 0.35rem;
  }
  .ss-options .ss-order-art {
    width: 2.05rem;
  }
  .ss-options b {
    font-size: 0.82rem;
  }
  .ss-options small {
    font-size: 0.66rem;
  }
  .ss-badge {
    font-size: 0.7rem;
  }
  .ss-scores {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .ss-game .ss-console .ss-button {
    min-width: 6rem;
  }
}
@media (max-height: 760px) and (min-width: 700px) {
  .ss-game {
    padding: 0.6rem 1rem;
    gap: 0.5rem;
  }
  .ss-scores li {
    padding-block: 0.25rem;
  }
}
@media (forced-colors: active) {
  .ss-canvas,
  .ss-order-art {
    forced-color-adjust: none;
  }
  .ss-options button[aria-pressed='true'] {
    outline: 3px solid Highlight;
  }
  .ss-game {
    color: CanvasText;
  }
}

@media (min-width: 661px) and (max-width: 940px) {
  .ss-scores:has(> :nth-child(5)) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
