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

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

.cz-statline,
.cz-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cz-stat {
  min-width: 76px;
  padding: 8px 10px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
  box-shadow: 0 8px 20px rgba(33, 43, 40, 0.08);
}

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

.cz-stat strong {
  display: block;
  margin-top: 2px;
  font-size: 19px;
  line-height: 1;
  white-space: nowrap;
}

.cz-btn,
.cz-close {
  min-width: 44px;
  min-height: 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, background 120ms ease;
}

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

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

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

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

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

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

.cz-stage {
  position: relative;
  min-height: 560px;
  height: min(72vh, 640px);
  overflow: hidden;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: #eaf5f4;
  box-shadow: var(--cg-shadow);
  touch-action: none;
}

.cz-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.cz-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 8px auto 1fr auto;
  gap: 10px;
  padding: 0 14px 14px;
  pointer-events: none;
}

.cz-timer {
  margin: 0 -14px;
  background: rgba(255, 255, 255, 0.34);
}

.cz-timer div {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--cg-green), var(--cg-amber));
  transition: width 80ms linear;
}

.cz-hud {
  justify-self: end;
  display: flex;
  gap: 8px;
  padding-top: 10px;
}

.cz-hud div {
  min-width: 72px;
  padding: 7px 9px;
  border: 1px solid rgba(216, 222, 216, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 18px rgba(33, 43, 40, 0.08);
  text-align: center;
  backdrop-filter: blur(8px);
}

.cz-hud strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cz-card {
  align-self: center;
  justify-self: center;
  width: min(92%, 520px);
  min-height: 136px;
  padding: 16px 18px;
  border: 1px solid rgba(216, 222, 216, 0.96);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 34px rgba(33, 43, 40, 0.15);
  color: var(--cg-ink);
  text-align: center;
  transform: translate(var(--cz-dx, 0), var(--cz-dy, 0));
  transition: transform 160ms ease, border-color 160ms ease;
  pointer-events: auto;
  cursor: grab;
  user-select: none;
  backdrop-filter: blur(10px);
}

.cz-card.cz-drag {
  transition: none;
  cursor: grabbing;
  border-color: var(--cg-teal);
}

.cz-card span {
  display: inline-block;
  margin-bottom: 7px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(18, 122, 137, 0.1);
  color: var(--cg-teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.cz-card strong {
  display: block;
  font-size: 25px;
  line-height: 1.18;
}

.cz-card em {
  display: block;
  margin-top: 8px;
  color: var(--cg-muted);
  font-size: 14px;
  font-style: normal;
  line-height: 1.35;
}

.cz-zones {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  justify-self: center;
  width: min(100%, 650px);
  pointer-events: auto;
}

.cz-zone {
  min-height: 54px;
  min-width: 44px;
  padding: 7px 8px;
  border: 1px solid rgba(216, 222, 216, 0.96);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--cg-ink);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(33, 43, 40, 0.08);
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.cz-zone span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 4px;
  border-radius: 999px;
  background: var(--cg-bg);
  color: var(--cg-muted);
  font-size: 12px;
  font-weight: 900;
}

.cz-zone strong {
  font-size: 14px;
  line-height: 1.1;
}

.cz-focus {
  border-color: var(--cg-blue);
  background: rgba(238, 244, 250, 0.96);
}

.cz-mastered {
  border-color: rgba(29, 127, 98, 0.45);
  background: rgba(237, 248, 243, 0.96);
}

.cz-start,
.cz-result {
  position: absolute;
  left: 50%;
  z-index: 3;
  display: grid;
  gap: 8px;
  width: min(88%, 350px);
  padding: 16px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--cg-ink);
  text-align: center;
  box-shadow: var(--cg-shadow);
  transform: translateX(-50%);
  pointer-events: auto;
  backdrop-filter: blur(10px);
}

.cz-start {
  top: 50%;
  transform: translate(-50%, -50%);
}

.cz-result {
  top: 50%;
  transform: translate(-50%, -50%);
  animation: cz-pop 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.cz-start strong,
.cz-result strong {
  font-size: 23px;
  line-height: 1.1;
}

.cz-start span,
.cz-result span,
.cz-result p {
  margin: 0;
  color: var(--cg-muted);
  font-size: 14px;
  line-height: 1.35;
}

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

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

.cz-final-cell strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}

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

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

.cz-below {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

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

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

.cz-seg-btn[aria-pressed="true"] {
  background: var(--cg-teal);
  color: #fff;
}

.cz-note {
  flex: 1 1 240px;
  margin: 0;
  color: var(--cg-muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.cz-modal-card {
  position: relative;
  width: min(100%, 440px);
  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);
}

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

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

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

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

@media (max-width: 560px) {
  .cz-shell {
    padding: 0 10px 18px;
  }

  .cz-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .cz-statline,
  .cz-actions {
    justify-content: center;
  }

  .cz-stat {
    flex: 1 1 72px;
    text-align: center;
  }

  .cz-stage {
    min-height: 610px;
    height: min(72vh, 660px);
  }

  .cz-overlay {
    gap: 8px;
    padding: 0 10px 12px;
  }

  .cz-hud {
    justify-self: stretch;
    gap: 6px;
  }

  .cz-hud div {
    flex: 1 1 0;
    min-width: 0;
    padding: 7px 4px;
  }

  .cz-hud span {
    font-size: 9px;
  }

  .cz-hud strong {
    font-size: 15px;
  }

  .cz-card {
    width: 100%;
    min-height: 128px;
    padding: 14px 13px;
  }

  .cz-card strong {
    font-size: 20px;
  }

  .cz-card em {
    font-size: 13px;
  }

  .cz-zones {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .cz-zone {
    min-height: 48px;
    padding: 6px;
  }

  .cz-zone strong {
    font-size: 13px;
  }

  .cz-seg {
    flex: 1 1 100%;
  }

  .cz-seg-btn {
    flex: 1 1 0;
  }
}
