#game-root .sh-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 24px;
  color: var(--cg-ink);
  font-family: Inter, Arial, sans-serif;
}

#game-root .sh-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#game-root .sh-statline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

#game-root .sh-stat,
#game-root .sh-hud-card {
  min-width: 74px;
  padding: 8px 10px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 20px rgba(33, 43, 40, 0.08);
}

#game-root .sh-stat span,
#game-root .sh-hud-card span {
  display: block;
  color: var(--cg-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

#game-root .sh-stat strong,
#game-root .sh-hud-card strong {
  display: block;
  margin-top: 2px;
  color: var(--cg-ink);
  font-size: 19px;
  line-height: 1;
}

#game-root .sh-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#game-root .sh-btn,
#game-root .sh-close {
  min-height: 44px;
  min-width: 44px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
  color: var(--cg-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(33, 43, 40, 0.08);
  transition: transform 120ms ease, border-color 120ms ease;
}

#game-root .sh-btn {
  padding: 0 14px;
}

#game-root .sh-btn:hover,
#game-root .sh-close:hover {
  transform: translateY(-1px);
  border-color: rgba(18, 122, 137, 0.45);
}

#game-root .sh-btn:focus-visible,
#game-root .sh-close:focus-visible,
#game-root .sh-canvas:focus-visible {
  outline: 3px solid rgba(49, 95, 157, 0.35);
  outline-offset: 3px;
}

#game-root .sh-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

#game-root .sh-primary {
  border-color: transparent;
  background: var(--cg-teal);
  color: #fff;
}

#game-root .sh-icon-btn {
  display: inline-grid;
  place-items: center;
  padding: 0;
}

#game-root .sh-icon-btn svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#game-root .sh-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
  box-shadow: var(--cg-shadow);
  touch-action: none;
}

#game-root .sh-canvas {
  display: block;
  width: 100%;
  height: min(72vh, 640px);
  min-height: 460px;
  cursor: pointer;
  touch-action: none;
}

#game-root .sh-hud {
  position: absolute;
  top: 12px;
  left: 50%;
  display: flex;
  justify-content: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

#game-root .sh-hud-card {
  min-width: 78px;
  text-align: center;
  backdrop-filter: blur(8px);
}

#game-root .sh-start,
#game-root .sh-result {
  position: absolute;
  left: 50%;
  display: grid;
  gap: 6px;
  width: min(84%, 300px);
  padding: 16px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--cg-ink);
  text-align: center;
  box-shadow: var(--cg-shadow);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

#game-root .sh-start {
  bottom: 22px;
  pointer-events: none;
}

#game-root .sh-start strong,
#game-root .sh-result strong {
  font-size: 22px;
  line-height: 1.1;
}

#game-root .sh-start span,
#game-root .sh-result span,
#game-root .sh-result p {
  margin: 0;
  color: var(--cg-muted);
  font-size: 14px;
}

#game-root .sh-result {
  top: 50%;
  transform: translate(-50%, -50%);
}

#game-root .sh-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(30, 37, 40, 0.32);
}

#game-root .sh-modal-card {
  position: relative;
  width: min(100%, 430px);
  padding: 22px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
  color: var(--cg-ink);
  box-shadow: 0 24px 70px rgba(30, 37, 40, 0.22);
}

#game-root .sh-modal-card h2 {
  margin: 0 48px 12px 0;
  font-size: 24px;
  line-height: 1.1;
}

#game-root .sh-modal-card p {
  margin: 10px 0 0;
  color: var(--cg-muted);
  line-height: 1.45;
}

#game-root .sh-close {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

#game-root .sh-is-hidden {
  display: none !important;
}

@media (max-width: 560px) {
  #game-root .sh-shell {
    padding: 0 10px 18px;
  }

  #game-root .sh-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  #game-root .sh-statline,
  #game-root .sh-actions {
    justify-content: center;
  }

  #game-root .sh-stat {
    flex: 1 1 72px;
    text-align: center;
  }

  #game-root .sh-canvas {
    height: min(70vh, 560px);
    min-height: 430px;
  }

  #game-root .sh-hud {
    top: 8px;
    gap: 6px;
  }

  #game-root .sh-hud-card {
    min-width: 68px;
    padding: 7px 8px;
  }

  #game-root .sh-hud-card strong {
    font-size: 17px;
  }
}
