html,
body {
  touch-action: manipulation;
}

html.cat-play,
html.cat-play body {
  overflow: hidden;
  touch-action: none;
}

.cat-shell.app {
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 10px 12px 8px;
  box-sizing: border-box;
}

.cat-shell .site-header {
  margin-bottom: 8px;
}

.cat-shell [hidden] {
  display: none !important;
}

.cat-shell .stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 8px;
}

.cat-shell .stat-card {
  padding: 6px 8px 8px;
  border-radius: var(--radius-lg);
  border: 2.5px solid var(--border);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
}

.cat-shell .stat-card--level { background: var(--amber-soft); }
.cat-shell .stat-card--time { background: var(--indigo-soft); }
.cat-shell .stat-card--best { background: var(--coral-soft); }

.cat-shell .stat-label {
  font-size: 0.74rem;
  font-weight: 900;
  color: var(--ink);
}

.cat-shell .stat-value {
  font-size: clamp(1.02rem, 3.4vw, 1.35rem);
  font-weight: 900;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.cat-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 180px;
  border-radius: var(--radius-xl);
  border: 2.5px solid var(--border);
  background: #e0f2fe;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.cat-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.cat-card {
  margin-top: 8px;
  padding: 12px 14px 14px;
  border-radius: var(--radius-lg);
  border: 2.5px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.cat-card h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.cat-card p {
  margin: 0 0 8px;
}

.cat-kicker {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--indigo);
}

.cat-best {
  font-weight: 800;
  color: var(--ink-secondary);
}

.cat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.cat-wide {
  flex: 1 1 140px;
  justify-content: center;
  min-height: 48px;
  text-align: center;
  text-decoration: none;
}

.cat-card--results {
  background: var(--mint-soft);
}

.cat-res-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0;
}

.cat-res-grid div {
  padding: 8px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: #ffffff;
  text-align: center;
}

.cat-res-grid span {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--ink-secondary);
}

.cat-res-grid strong {
  font-size: 1.15rem;
}

.cat-new {
  display: inline-block;
  margin: 0 0 6px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--border);
  background: var(--amber);
  font-size: 0.75rem;
  font-weight: 900;
}

.cat-live {
  min-height: 1.2em;
  margin: 6px 0 0;
  text-align: center;
  font-weight: 900;
  color: var(--coral-hover);
}

.cat-shell .arcade-hint {
  margin-top: 8px;
  padding: 8px 12px;
}

.cat-shell:has(#intro:not([hidden])) .arcade-hint,
.cat-shell:has(#results:not([hidden])) .arcade-hint,
.cat-shell:has(#intro:not([hidden])) .cat-live,
.cat-shell:has(#results:not([hidden])) .cat-live {
  display: none;
}

.cat-shell .privacy-note {
  margin-top: 6px;
}

@media (max-width: 420px) {
  .cat-shell .subpage-sub {
    display: none;
  }
}
