.is-shell {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 12px 20px;
  color: var(--cg-ink);
  font-family: Inter, Arial, sans-serif;
}
.cg-shell-game .cg-stage-main #game-root > .is-shell { max-width: min(100%, 760px) !important; }
.is-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: min(100%, 72vh, 720px);
  margin: 0 auto 8px;
}
.is-stats { display: flex; gap: 6px; min-width: 0; }
.is-stat {
  min-width: 0;
  padding: 6px 9px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
  box-shadow: 0 4px 12px rgba(33, 43, 40, .06);
  position: relative;
  overflow: hidden;
}
.is-stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: #2a7fff; }
.is-stat:nth-child(2)::before { background: var(--cg-amber); }
.is-stat:nth-child(3)::before { background: #a35cf0; }
.is-stat span { display: block; color: var(--cg-muted); font-size: 10px; font-weight: 800; line-height: 1.1; text-transform: uppercase; }
.is-stat strong { display: block; margin-top: 2px; font-size: 17px; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.is-stat strong.is-over { color: var(--cg-red); }
.is-actions { display: flex; gap: 4px; flex: none; }
.is-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
  color: var(--cg-ink);
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 4px 12px rgba(33, 43, 40, .06);
  transition: transform 120ms ease, border-color 120ms ease;
}
.is-btn:hover:not(:disabled) { transform: translateY(-1px); border-color: #2a7fff; }
.is-btn:disabled { opacity: .45; cursor: default; }
.is-btn:focus-visible, .is-canvas:focus-visible { outline: 3px solid rgba(42, 127, 255, .45); outline-offset: 2px; }
.is-primary { border-color: transparent; background: #2a7fff; color: #fff; }
.is-icon { display: inline-grid; place-items: center; padding: 0; }
.is-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.is-stage {
  position: relative;
  width: min(100%, 72vh, 720px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--cg-line);
  border-radius: 12px;
  background: #0d2a44;
  box-shadow: var(--cg-shadow);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.is-canvas { display: block; width: 100%; height: 100%; cursor: pointer; touch-action: none; }
.is-toast {
  position: absolute;
  left: 50%;
  bottom: 10px;
  max-width: 88%;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(10, 30, 50, .82);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: nowrap;
}
.is-toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.is-result {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(10, 30, 50, .45);
  backdrop-filter: blur(3px);
}
.is-result[hidden], .is-modal[hidden] { display: none; }
.is-panel {
  display: grid;
  gap: 8px;
  width: min(92%, 340px);
  padding: 16px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .95);
  text-align: center;
  box-shadow: var(--cg-shadow);
  animation: is-pop 260ms cubic-bezier(.16, 1, .3, 1);
}
.is-panel h2 { margin: 0; font-size: 22px; }
.is-panel p { margin: 0; color: var(--cg-muted); font-size: 14px; line-height: 1.4; }
.is-stars { display: flex; justify-content: center; gap: 4px; min-height: 0; }
.is-stars b { font-size: 34px; line-height: 1; color: #c9d7de; animation: is-star 420ms cubic-bezier(.2, 1.6, .4, 1) both; }
.is-stars b.on { color: #ffb400; text-shadow: 0 2px 8px rgba(255, 180, 0, .5); }
.is-panel-actions { display: flex; gap: 6px; }
.is-panel-actions .is-btn { flex: 1 1 0; padding: 0 6px; }
.is-panel-actions .is-primary { flex: 1.6 1 0; }
@keyframes is-pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
@keyframes is-star { from { opacity: 0; transform: scale(.2) rotate(-40deg); } to { opacity: 1; transform: scale(1); } }
.is-below {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: min(100%, 72vh, 720px);
  margin: 8px auto 0;
}
.is-dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.is-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--cg-line); }
.is-dots i.is-cur { background: #2a7fff; box-shadow: 0 0 0 3px rgba(42, 127, 255, .25); }
.is-dots i.is-done { background: var(--cg-green); }
.is-dots i.s3 { background: #ffb400; }
.is-pad { display: none; }
@media (pointer: coarse) {
  .is-pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(100%, 72vh, 720px); margin: 8px auto 0; }
  .is-dir { min-height: 56px; font-size: 24px; padding: 0; }
}
.is-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(30, 37, 40, .4);
}
.is-modal-card {
  display: grid;
  gap: 10px;
  width: min(100%, 420px);
  padding: 20px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  background: var(--cg-panel);
  box-shadow: var(--cg-shadow);
}
.is-modal-card h2 { margin: 0; }
.is-modal-card p { margin: 0; color: var(--cg-muted); font-size: 14px; line-height: 1.5; }
.is-keys kbd { padding: 1px 6px; border: 1px solid var(--cg-line); border-radius: 4px; background: #f3f6f7; font-size: 12px; }
@media (max-width: 480px) {
  .is-shell { padding: 0 8px 16px; }
  .is-stat { padding: 5px 7px; }
  .is-stat strong { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .is-panel, .is-stars b { animation: none; }
}
