* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: #f9f9f9;
  min-height: 100vh;
  color: #202124;
}

#csh-app {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.csh-brand {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5f6368;
  margin-bottom: 6px;
}

.csh-header h1 {
  font-size: clamp(1.1rem, 4vw, 1.35rem);
  margin-bottom: 6px;
}

.csh-sub {
  font-size: 0.85rem;
  color: #5f6368;
  margin-bottom: 20px;
}

.csh-robot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #e8f0fe;
  border-radius: 10px;
  margin-bottom: 20px;
  border: 1px solid #d2e3fc;
}

.csh-bot-face { font-size: 2rem; }

#csh-bot-line {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #1967d2;
  font-style: italic;
}

.csh-challenge {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.csh-check {
  font-size: 0.95rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.csh-prompt {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.4;
}

.csh-round {
  font-size: 0.75rem;
  color: #5f6368;
  margin-bottom: 14px;
}

.csh-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 16px;
  min-height: 280px;
}

.csh-grid--loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.csh-loading {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.85rem;
  color: #5f6368;
  line-height: 1.6;
  padding: 24px 12px;
}

.csh-verify:disabled {
  opacity: 0.65;
  cursor: wait;
}

.csh-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: #f1f3f4;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.1s, background 0.1s;
}

.csh-cell:hover { background: #e8eaed; }
.csh-cell.selected { border-color: #1a73e8; background: #e8f0fe; }
.csh-cell.wrong { animation: csh-wrong 0.4s; }

@keyframes csh-wrong {
  0%, 100% { background: #fce8e6; }
  50% { background: #f28b82; }
}

.csh-verify {
  width: 100%;
  padding: 12px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.csh-verify:hover { background: #1765cc; }

.csh-feedback {
  margin-top: 12px;
  font-size: 0.85rem;
  min-height: 1.2em;
  color: #c5221f;
}

.csh-feedback.ok { color: #137333; }

.csh-screen {
  position: fixed;
  inset: 0;
  background: rgba(249, 249, 249, 0.97);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  z-index: 10;
}

.csh-screen.active { display: flex; }

.csh-screen h2 { margin-bottom: 12px; }
.csh-screen p { max-width: 360px; line-height: 1.6; margin-bottom: 12px; }

.csh-screen button {
  margin-top: 16px;
  padding: 12px 28px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
}

.csh-exit {
  display: block;
  text-align: center;
  margin-top: 24px;
  font-size: 0.8rem;
  color: #5f6368;
  text-decoration: none;
}

.csh-challenge[hidden] { display: none !important; }

/* ── Shared UI polish ── */
body {
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(66,133,244,0.08) 0%, transparent 40%) !important;
}
button, .btn, [role="button"] {
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease !important;
}
button:hover:not(:disabled), .btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
