/* === Global Variables and Font === */
:root {
  --round: 1.25rem;
  --fg: #0f172a;
  --bg: #ffffff;
  --accent: #228be6;
}

body {
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
}

/* === Avatar === */
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f1f3f5;
  display: grid;
  place-items: center;
  font-size: 22px;
}

/* === Deck Layout === */
.deck {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 12px;
}

/* === Cards === */
.cardlet {
  appearance: none;
  border: 0;
  border-radius: var(--round);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.08);
  padding: 10px 8px;
  font-size: 28px;
  line-height: 1;
  cursor: grab;
  transition: transform 0.08s ease;
}
.cardlet:active {
  cursor: grabbing;
  transform: scale(0.96);
}
.cardlet.correct {
  outline: 2px solid #2fb344;
  background: #e6fcf5;
}
.cardlet.wrong {
  outline: 2px solid #fa5252;
  background: #fff5f5;
}

/* === Drop Zones === */
.bin {
  border: 2px dashed #ced4da;
  border-radius: var(--round);
  padding: 14px;
  min-height: 82px;
  display: grid;
  place-items: center;
  background: #fff;
  user-select: none;
  font-size: 20px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.bin.dragover {
  border-color: #228be6;
  background: #f1f8ff;
}

.bin.hearts {
  color: #e03131;
}
.bin.spades {
  color: #212529;
}
.bin.clubs {
  color: #2f9e44;
}
.bin.diamonds {
  color: #d9480f;
}

/* === Accessibility and Visual Focus === */
.cardlet:focus,
.bin:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* === Advanced Selectors === */
/* Attribute + Adjacent sibling selector */
.cardlet[draggable="true"] + .hint {
  font-size: 0.9rem;
  color: #868e96;
}

/* Pseudo-class grouping with :is() */
footer a:is(:hover, :focus) {
  text-decoration: underline;
}

/* === Reduced Motion Preference === */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* === Small Utility Text === */
.small-muted {
  color: #868e96;
  font-size: 0.875rem;
}