:root {
  --primary: #ffd166;
  --text-light: #eeeeee;
  --bg: #000;
  --bg-light: #111;
}

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

body {
  color: var(--text-light);
  font-family: "Open Sans", sans-serif;
  padding: 1.5rem;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
}

#cardContainer {
  display: grid;
  grid-template-columns: repeat(10, 56px);
  grid-auto-rows: 56px;
  gap: 4px;
  width: 596px;
}

footer {
  text-align: center;
  padding: 10px;
  font-size: 0.9rem;
  color: var(--text-light);
  background: var(--bg-light);
  border-radius: 8px;
  margin-top: 1.5rem;
  max-width: 960px;
  user-select: text;
}

footer a {
  color: var(--primary);
  text-decoration: underline;
}

footer a:hover {
  opacity: 1;
}

.card {
  position: relative;
  color: white;
  text-decoration: none;
  width: 56px;
  height: 56px;
  background: var(--bg-light);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
  cursor: pointer;
  user-select: none;
  outline: none;
  transition: all .1s;
}

.card:hover,
.card:focus {
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.03); /* gentler scale */
}

.card__icon {
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  pointer-events: none;
}

/* IMPROVED: Font icons - crisp rendering */
i.card__icon {
  font-size: 38px; /* reduced from 42px for better fit */
  width: 42px;
  height: 42px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Auto-generated PNG/SVG favicons */
img.card__icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  image-rendering: auto;
}

.card__name {
  font-size: 0.8rem; /* explicit size for consistency */
  font-weight: 400;
  display: none;
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.7); /* slightly more opaque */
  color: var(--text-light);
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  transition: opacity .3s ease;
  opacity: 0;
  user-select: none;
}

.card:hover .card__name,
.card:focus .card__name {
  display: block;
  opacity: 1;
}

@media (max-width: 650px) {
  body { padding: .5rem; }
}
