.tc-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 24px;
  color: var(--cg-ink);
  font-family: Inter, Arial, sans-serif;
  --tc-water: #10415a;
  --tc-bank: #b99a68;
  --tc-ink: #f4f1e2;
}

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

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

.tc-statline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.tc-stat,
.tc-hud-card {
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
  box-shadow: 0 4px 12px rgba(33, 43, 40, 0.06);
}

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

.tc-stat strong,
.tc-hud-card strong {
  display: block;
  margin-top: 2px;
  color: var(--cg-ink);
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
}

.tc-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tc-btn,
.tc-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 4px 12px rgba(33, 43, 40, 0.06);
  transition: transform 120ms ease, border-color 120ms ease;
}

.tc-btn {
  padding: 0 14px;
}

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

.tc-btn:focus-visible,
.tc-close:focus-visible,
.tc-canvas:focus-visible,
.tc-hop:focus-visible,
.tc-seg-btn:focus-visible {
  outline: 3px solid rgba(49, 95, 157, 0.35);
  outline-offset: 3px;
}

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

.tc-icon-btn {
  display: inline-grid;
  place-items: center;
  padding: 0;
}

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

#tc-pause svg path {
  fill: currentColor;
}

.tc-hud {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  width: min(100%, 720px);
  margin: 0 auto 8px;
}

.tc-hud-card {
  position: relative;
  overflow: hidden;
  text-align: left;
}

.tc-hud-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--cg-teal);
  content: "";
}

.tc-hud-card:nth-child(1) strong,
.tc-hud-card:nth-child(5) strong {
  font-size: 21px;
}

.tc-hud-card:nth-child(3) strong {
  font-size: 17px;
}

.tc-hud-card:nth-child(4) {
  text-align: center;
}

.tc-hud-card:nth-child(4)::before {
  background: #bd3c37;
}

.tc-hud-card:nth-child(4) strong {
  color: #bd3c37;
  letter-spacing: 2px;
}

.tc-hud-card:nth-child(5)::before {
  background: var(--cg-amber);
}

.tc-hud-card strong {
  font-variant-numeric: tabular-nums;
}

.tc-stage {
  position: relative;
  width: min(100%, 720px, 72vh);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--cg-line);
  border-radius: 12px;
  background: #0d2a38;
  box-shadow: var(--cg-shadow);
  touch-action: none;
}

.tc-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 13 / 12;
  cursor: pointer;
}

.tc-timebar {
  height: 7px;
  background: rgba(255, 255, 255, 0.14);
}

.tc-timefill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #d98f2b, #f2c94c);
  transition: width 120ms linear;
}

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

.tc-start {
  bottom: 16px;
  pointer-events: none;
}

.tc-start strong,
.tc-paused strong,
.tc-result strong {
  font-size: 22px;
  line-height: 1.1;
}

.tc-start span,
.tc-paused span,
.tc-result span,
.tc-result p {
  margin: 0;
  color: var(--cg-muted);
  font-size: 14px;
}

.tc-paused {
  top: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.tc-paused .tc-btn {
  pointer-events: auto;
  justify-self: center;
}

.tc-result {
  top: 50%;
  width: min(90%, 330px);
  transform: translate(-50%, -50%);
  animation: tc-pop 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tc-pop {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.tc-result strong {
  color: #17734f;
  font-size: 25px;
}

.tc-final-score {
  color: var(--cg-ink);
  font-size: 19px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.tc-final-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.tc-final-cell {
  padding: 6px 2px;
  border: 1px solid var(--cg-line);
  border-radius: 7px;
  background: rgba(246, 247, 242, 0.92);
}

.tc-final-cell span {
  display: block;
  color: var(--cg-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tc-final-cell strong {
  display: block;
  color: var(--cg-ink);
  font-size: 15px;
  line-height: 1.2;
}

.tc-result-actions {
  display: flex;
  gap: 8px;
}

.tc-result-actions .tc-btn {
  flex: 1 1 0;
}

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

.tc-hop {
  min-height: 48px;
  min-width: 118px;
  padding: 0 18px;
  border: 2px solid #1d4a15;
  border-radius: 10px;
  background: linear-gradient(180deg, #6cb93c, #46922a);
  color: #f6ffe8;
  font: inherit;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 0 #2f6b1f, 0 10px 18px rgba(33, 43, 40, 0.18);
  touch-action: manipulation;
  transition: transform 90ms ease, box-shadow 90ms ease;
}

.tc-hop:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #2f6b1f, 0 6px 12px rgba(33, 43, 40, 0.18);
}

.tc-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);
}

.tc-seg-btn {
  min-height: 44px;
  min-width: 62px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--cg-muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.tc-seg-btn:hover {
  color: var(--cg-ink);
}

.tc-seg-btn[aria-pressed="true"] {
  border-color: var(--cg-line);
  background: #fff;
  color: var(--cg-ink);
  box-shadow: 0 3px 8px rgba(33, 43, 40, 0.1);
}

.tc-note {
  width: min(100%, 720px);
  margin: 8px auto 0;
  color: var(--cg-muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.tc-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 24, 28, 0.62);
}

.tc-modal-card {
  position: relative;
  width: min(100%, 460px);
  max-height: 86vh;
  overflow: auto;
  padding: 22px 22px 18px;
  border: 1px solid var(--cg-line);
  border-radius: 12px;
  background: var(--cg-panel);
  box-shadow: var(--cg-shadow);
}

.tc-modal-card h2 {
  margin: 0 0 10px;
  font-size: 21px;
}

.tc-modal-card p {
  margin: 0 0 10px;
  color: var(--cg-muted);
  font-size: 14px;
  line-height: 1.5;
}

.tc-close {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 0 12px;
  font-size: 20px;
  line-height: 1;
}

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

@media (max-width: 620px) {
  .tc-shell {
    padding: 0 12px 20px;
  }

  .tc-hud {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tc-hud-card:nth-child(4),
  .tc-hud-card:nth-child(5) {
    grid-column: span 1;
  }

  .tc-stage {
    width: min(100%, 60vh);
  }

  .tc-stat {
    padding: 6px 8px;
  }

  .tc-stat strong {
    font-size: 16px;
  }

  .tc-below {
    gap: 8px;
  }

  .tc-hop {
    flex: 1 1 100%;
  }
}

@media (pointer: coarse) {
  .tc-hop {
    min-height: 56px;
  }
}

.tc-stage { width: min(100%, 780px, 76vh); }
.tc-below, .tc-hud { width: min(100%, 780px, 76vh); }
.tc-topbar { flex-wrap: nowrap; margin-bottom: 6px; }
.tc-hud-card { padding: 5px 9px; }
.tc-hud-card strong { line-height: 1.1; }

@media (max-width: 620px) {
  .tc-shell { padding: 0 6px 14px; }
  .tc-statline .tc-stat:nth-child(1), .tc-statline .tc-stat:nth-child(3) { display: none; }
  .tc-topbar { gap: 6px; }
  .tc-actions { gap: 5px; }
  .tc-btn { padding: 0 10px; }
  .tc-hud { grid-template-columns: 1.3fr 1fr 1fr 1.1fr 0.9fr; gap: 4px; }
  .tc-hud-card { padding: 4px 6px; }
  .tc-hud-card span { font-size: 9px; }
  .tc-hud-card:nth-child(n) strong { font-size: 15px; letter-spacing: 0; }
  .tc-hud-card:nth-child(4) strong { font-size: 12px; }
  .tc-stage { width: 100%; border-radius: 10px; }
  .tc-below { flex-wrap: nowrap; margin-top: 8px; }
  .tc-hop { flex: 1 1 auto; min-width: 0; }
  .tc-seg { flex: none; }
  .tc-seg-btn { padding: 0 8px; min-width: 44px; }
  .tc-note { display: none; }
}
.tc-actions { flex: none; }
.tc-actions .tc-btn { flex: none; }
