*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #f5f5f5;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #222;
}

.cp-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

.cp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 14px;
  color: #666;
}

.cp-header a { color: #666; }

.cp-prompt {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 8px;
}

.cp-round {
  font-size: 12px;
  color: #888;
  margin: 0 0 16px;
}

.cp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 16px;
  border: 1px solid #ddd;
  background: #fff;
  padding: 4px;
}

.cp-grid.no-mouse .cp-cell { pointer-events: none; }

.cp-cell {
  aspect-ratio: 1;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: border-color 0.15s, filter 0.3s;
  user-select: none;
}

.cp-cell:hover { border-color: #4285f4; }

.cp-cell.selected {
  border-color: #4285f4;
  background: rgba(66, 133, 244, 0.15);
}

.cp-cell.degraded { filter: blur(1px) contrast(1.4) saturate(0.3); }

.cp-cell.heavy { filter: blur(3px) contrast(2) invert(0.1); }

.cp-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.cp-actions button {
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 2px;
  cursor: pointer;
}

#cp-verify {
  background: #4285f4;
  color: #fff;
}

#cp-verify:disabled { opacity: 0.5; cursor: default; }

#cp-skip {
  background: #eee;
  color: #666;
}

.cp-timer {
  font-size: 13px;
  color: #c00;
  font-weight: 600;
}

.cp-hint {
  font-size: 12px;
  color: #666;
  margin-top: 8px;
}

.cp-cmd {
  margin-top: 16px;
  padding: 12px;
  background: #fff;
  border: 1px solid #ccc;
}

.cp-cmd label { display: block; font-size: 11px; margin-bottom: 6px; color: #888; }

.cp-cmd input {
  width: 100%;
  padding: 8px;
  font-family: monospace;
  font-size: 13px;
}

.cp-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #c00;
  color: #fff;
  text-align: center;
  padding: 14px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  z-index: 20;
  animation: cp-drop 0.4s ease-out;
}

.cp-banner[hidden] { display: none; }

@keyframes cp-drop {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.cp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 30;
  text-align: center;
  padding: 20px;
}

.cp-overlay[hidden] { display: none; }

.cp-overlay button {
  margin-top: 16px;
  padding: 10px 24px;
  cursor: pointer;
}
