.ld-shell {
  --ld-asphalt: #272c3d;
  --ld-asphalt-2: #222738;
  --ld-neon: #4de0ff;
  --ld-orb: #ffd166;
  --ld-rail: #ff5a78;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 12px 22px;
  color: var(--cg-ink);
  font-family: Inter, Arial, sans-serif;
}

.cg-shell-game .cg-stage-main #game-root > .ld-shell {
  max-width: min(100%, 780px) !important;
}

.ld-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.ld-hudrow {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.ld-hudrow span {
  display: block;
  color: var(--cg-muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ld-hudrow strong {
  display: block;
  color: var(--cg-ink);
  font-size: 20px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ld-big strong {
  font-size: 26px;
}

.ld-big em {
  margin-left: 2px;
  color: var(--cg-muted);
  font-size: 13px;
  font-style: normal;
}

.ld-chip {
  padding: 5px 10px;
  border-radius: 999px;
  background: #e9eef5;
  color: var(--cg-muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ld-chip.ld-on {
  background: #ffd166;
  color: #3a2600;
}

.ld-chip.ld-hot {
  background: #7dffb0;
  color: #06331a;
}

.ld-statline {
  display: flex;
  gap: 12px;
  color: var(--cg-muted);
  font-size: 12px;
}

.ld-statline b {
  color: var(--cg-ink);
  font-variant-numeric: tabular-nums;
}

.ld-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.ld-btn,
.ld-close,
.ld-padbtn,
.ld-segbtn {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--cg-line);
  border-radius: 9px;
  background: var(--cg-panel);
  color: var(--cg-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(33, 43, 40, 0.06);
  transition: transform 120ms ease, border-color 120ms ease;
}

.ld-btn {
  padding: 0 13px;
  font-size: 14px;
}

.ld-btn:hover,
.ld-close:hover,
.ld-padbtn:hover,
.ld-segbtn:hover {
  transform: translateY(-1px);
  border-color: var(--cg-teal);
}

.ld-btn:focus-visible,
.ld-close:focus-visible,
.ld-padbtn:focus-visible,
.ld-segbtn:focus-visible,
.ld-canvas:focus-visible {
  outline: 3px solid rgba(49, 95, 157, 0.38);
  outline-offset: 3px;
}

.ld-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.ld-icon {
  display: inline-grid;
  padding: 0;
  place-items: center;
  font-size: 19px;
  line-height: 1;
}

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

.ld-big {
  min-height: 48px;
  width: 100%;
  font-size: 16px;
}

.ld-stage {
  position: relative;
  width: min(100%, 720px);
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #2a2f45;
  border-radius: 14px;
  background: #0a0d1a;
  box-shadow: var(--cg-shadow);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.ld-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.ld-pills {
  position: absolute;
  z-index: 4;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
  pointer-events: none;
}

.ld-pill {
  display: none;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #08111c;
}

.ld-pill.ld-on {
  display: block;
  animation: ld-pop 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ld-pill-shield {
  background: #7fe9ff;
}

.ld-pill-turbo {
  background: #7dffb0;
}

.ld-pill-magnet {
  background: #c79bff;
}

.ld-banner {
  position: absolute;
  z-index: 6;
  top: 16px;
  left: 50%;
  padding: 8px 20px;
  border: 2px solid var(--ld-orb);
  border-radius: 999px;
  background: rgba(10, 13, 26, 0.82);
  color: var(--ld-orb);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px) scale(0.86);
}

.ld-banner.ld-on {
  animation: ld-banner 1300ms ease forwards;
}

.ld-overlay {
  position: absolute;
  z-index: 12;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 9px;
  width: min(88%, 400px);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(9, 12, 24, 0.9);
  color: #f2f6ff;
  text-align: center;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(8px);
}

.ld-overlay strong {
  color: #fff;
  font-size: 26px;
  line-height: 1.1;
}

.ld-overlay span {
  color: #8fa6c4;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ld-overlay p,
.ld-overlay li {
  margin: 0;
  color: #b9c8dd;
  font-size: 13px;
  line-height: 1.45;
}

.ld-overlay .ld-btn {
  color: var(--cg-ink);
}

.ld-overlay .ld-btn.ld-primary {
  color: #fff;
}


.ld-keys {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.ld-result-row .ld-btn {
  flex: 1 1 0;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #f2f6ff;
}

.ld-result-row .ld-btn.ld-primary {
  border-color: transparent;
  background: var(--cg-teal);
  color: #fff;
}

.ld-pad {
  display: none;
  width: min(100%, 720px);
  margin: 8px auto 0;
  gap: 7px;
}

.ld-padbtn {
  flex: 1 1 0;
  min-height: 58px;
  font-size: 20px;
  background: linear-gradient(180deg, #ffffff, #eef2f7);
  touch-action: manipulation;
}

.ld-pad-up {
  border-color: #a9dcc0;
  color: var(--cg-green);
}

.ld-pad-down {
  border-color: #f0c79a;
  color: var(--cg-amber);
}

.ld-pad-left,
.ld-pad-right {
  border-color: #bcd0e6;
  color: var(--cg-blue);
}

.ld-below {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 720px);
  margin: 10px auto 0;
  flex-wrap: wrap;
}

.ld-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  background: var(--cg-panel);
  box-shadow: 0 8px 20px rgba(33, 43, 40, 0.08);
}

.ld-segbtn {
  padding: 0 13px;
  font-size: 13px;
}

.ld-segbtn[aria-pressed="true"] {
  border-color: transparent;
  background: var(--cg-ink);
  color: #fff;
}

.ld-note {
  margin: 0;
  color: var(--cg-muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.ld-modal {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 16, 28, 0.55);
}

.ld-modal-card {
  position: relative;
  width: min(100%, 520px);
  max-height: 84vh;
  overflow-y: auto;
  padding: 22px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(12, 16, 28, 0.35);
}

.ld-modal-card h2 {
  margin: 0 48px 12px 0;
}

.ld-modal-card p {
  color: var(--cg-muted);
  font-size: 14px;
  line-height: 1.55;
}

.ld-modal-card b {
  color: var(--cg-ink);
}

.ld-close {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 0;
  font-size: 24px;
}

.ld-hidden {
  display: none !important;
}

@keyframes ld-banner {
  0% { opacity: 0; transform: translate(-50%, -16px) scale(0.8); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1.05); }
  72% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, 8px) scale(0.96); }
}

@keyframes ld-pop {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

@media (pointer: coarse) {
  .ld-pad {
    display: flex;
  }
}

@media (max-width: 620px) {
  .ld-shell {
    padding: 0 6px 14px;
  }

  .ld-topbar {
    gap: 5px;
    margin-bottom: 6px;
  }

  .ld-hudrow {
    flex: 1 1 auto;
    gap: 9px;
  }

  .ld-big strong {
    font-size: 22px;
  }

  .ld-hudrow strong {
    font-size: 17px;
  }

  .ld-actions {
    gap: 3px;
  }

  .ld-actions .ld-btn {
    min-width: 44px;
    padding: 0 7px;
    font-size: 12px;
  }

  #ld-share {
    display: none;
  }

  .ld-statline {
    flex: 1 1 100%;
    justify-content: center;
  }

  .ld-stage {
    aspect-ratio: 5 / 7;
    max-height: calc(100dvh - 250px);
    min-height: 360px;
    border-radius: 12px;
  }

  .ld-overlay {
    width: min(92%, 340px);
    gap: 7px;
    padding: 15px;
  }

  .ld-overlay strong {
    font-size: 22px;
  }

  .ld-overlay p,
  .ld-overlay li {
    font-size: 12px;
  }

  .ld-below {
    gap: 6px;
    margin-top: 8px;
  }

  .ld-note {
    flex: 1 1 100%;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ld-banner.ld-on,
  .ld-pill.ld-on {
    animation-duration: 1ms;
  }

  .ld-btn,
  .ld-padbtn,
  .ld-segbtn {
    transition-duration: 1ms;
  }
}
