/* Flag token */
.flag {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--flag-w);
  height: var(--flag-h);
  overflow: hidden;
  /* The neutral disc: what shows (with the code) until the image paints over it. */
  background: linear-gradient(160deg, var(--ink-300), var(--ink-500));
  vertical-align: middle;
}
.flag--circle {
  border-radius: 50%;
  box-shadow:
    0 0 0 1.5px rgb(255 255 255 / 0.22),
    0 2px 6px rgb(0 0 0 / 0.45);
}
.flag--rect {
  border-radius: 3px;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.16),
    0 1px 3px rgb(0 0 0 / 0.4);
}
.flag__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Soft gloss so flat flags read as tokens */
.flag--circle::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(120% 80% at 30% 10%, rgb(255 255 255 / 0.28), transparent 45%),
    radial-gradient(100% 100% at 50% 120%, rgb(0 0 0 / 0.25), transparent 60%);
  pointer-events: none;
}
.flag__initials {
  font-family: var(--font-display);
  font-weight: var(--weight-heavy);
  font-size: calc(var(--flag-h) * 0.42);
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--text-1);
}
.flag--rect .flag__initials {
  font-size: calc(var(--flag-h) * 0.5);
}
/* A three-letter code ("BRA") on a small disc: a little smaller, so it stays inside. */
.flag[data-code='3'] .flag__initials {
  font-size: calc(var(--flag-h) * 0.32);
}
.flag--rect[data-code='3'] .flag__initials {
  font-size: calc(var(--flag-h) * 0.42);
}
