/* Visually hide radios but keep them keyboard-focusable */
.custom-card input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.custom-card {
  position: relative;
  display: inline-block;
  padding: 12px 24px;
  border: 2px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  width: 350px;
  height: 350px;
  vertical-align: top;
}

.custom-card:focus-within {
  outline: 3px solid #005fcc;
  outline-offset: 2px;
}

.custom-card:focus-within:not(:has(input[type="radio"]:checked)) {
  border-color: #005fcc;
  box-shadow: 0 0 0 3px rgba(0, 95, 204, 0.25);
}

.custom-card:has(input[type="radio"]:checked) {
  background-color: #007bff;
  color: white;
  border-color: #007bff;
}

.selected-badge {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.95);
  color: #007bff;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

.custom-card:has(input[type="radio"]:checked) .selected-badge {
  display: block;
}

.option-group {
  border: 0;
  margin: 0 0 2rem;
  padding: 0;
}

.option-group legend {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.option-hint {
  margin: 0 0 1rem;
  color: #555;
  font-size: 0.95rem;
}

.option-hint kbd {
  display: inline-block;
  padding: 0.1em 0.45em;
  border: 1px solid #bbb;
  border-radius: 4px;
  background-color: #f5f5f5;
  font-family: inherit;
  font-size: 0.9em;
}

.option-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

body {
  padding: 30px;
}
