:root {
  color-scheme: dark;
  --bg: #101313;
  --panel: #1b2020;
  --line: #303737;
  --muted: #9da9a6;
  --accent: #b9e986;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: #edf0ec;
  font: 15px/1.6 system-ui, sans-serif;
}
header,
main,
footer {
  max-width: 1440px;
  margin: auto;
  padding: 28px 48px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 24px;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}
.brand span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 3px;
  margin-left: 30px;
}
button,
input,
select {
  font: inherit;
}
button,
select {
  background: var(--panel);
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 16px;
  cursor: pointer;
}
button:hover,
select:hover {
  border-color: var(--accent);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.intro {
  padding: 44px 0 38px;
}
.eyebrow {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 3px;
}
h1 {
  font-size: clamp(40px, 5vw, 68px);
  line-height: 1.12;
  letter-spacing: -3px;
  margin: 20px 0;
}
em {
  color: var(--accent);
  font-style: normal;
}
.intro p {
  color: var(--muted);
}
.stats {
  display: flex;
  gap: 36px;
  margin-top: 25px;
  color: var(--muted);
}
.stats strong {
  color: #fff;
  font-size: 24px;
  margin-right: 8px;
}
.toolbar {
  display: flex;
  gap: 12px;
}
.search {
  flex: 1;
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 24px;
  color: var(--muted);
}
input {
  width: 100%;
  border: 0;
  background: transparent;
  color: white;
  outline: none;
}
.search:focus-within {
  border-color: var(--accent);
}
#count {
  margin: 24px 0;
  color: var(--muted);
  font-size: 13px;
}
[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
  transition: transform 0.2s, border-color 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: #657263;
}
.open {
  display: block;
  text-align: left;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.flag {
  display: block;
  width: 100%;
  height: 148px;
  object-fit: cover;
  background: #262d2c;
}
.info {
  padding: 20px;
}
.info h2 {
  font-size: 19px;
  margin: 0 30px 12px 0;
}
.info p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
}
.info b {
  color: #e0e6df;
  font-weight: 400;
}
.heart {
  position: absolute;
  right: 12px;
  top: 160px;
  padding: 4px 10px;
  color: var(--accent);
}
footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-top: 45px;
  border-top: 1px solid var(--line);
}
#notice {
  color: var(--accent);
  margin-bottom: 16px;
}
.empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px;
  color: var(--muted);
}
.skeleton {
  height: 310px;
  background: linear-gradient(100deg, #1b2020, #303737, #1b2020);
  background-size: 200%;
  animation: pulse 1.5s infinite;
  border-radius: 14px;
}
@keyframes pulse {
  to {
    background-position: -200%;
  }
}
dialog {
  background: var(--panel);
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 18px;
  width: min(620px, 92vw);
  max-height: 90vh;
  padding: 30px;
}
dialog::backdrop {
  background: #000b;
  backdrop-filter: blur(5px);
}
#close {
  float: right;
}
dialog img {
  width: 160px;
  max-height: 110px;
  object-fit: contain;
}
dl {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 12px;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}
@media (min-width: 1700px) {
  .flag {
    height: 180px;
  }
}
@media (max-width: 1000px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
  header,
  main,
  footer {
    padding: 24px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .search {
    flex-basis: 100%;
  }
}
@media (max-width: 700px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .flag {
    height: 120px;
  }
  .info {
    padding: 14px;
  }
  .heart {
    top: 130px;
  }
  .stats {
    gap: 15px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 20px;
  }
  header button {
    font-size: 12px;
    padding: 10px;
  }
  select {
    width: calc(50% - 6px);
    font-size: 12px;
  }
  footer {
    display: block;
  }
  footer span {
    display: block;
  }
}
@media (max-width: 420px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .flag {
    height: 180px;
  }
  .heart {
    top: 190px;
  }
  h1 {
    letter-spacing: -2px;
  }
  .intro {
    padding-top: 28px;
  }
}

.icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  vertical-align: middle;
  flex-shrink: 0;
}
.brand > .icon {
  width: 26px;
  height: 26px;
  margin-right: 6px;
}
.heart {
  min-width: 38px;
  min-height: 38px;
}
.heart[aria-pressed="true"] .icon {
  fill: currentColor;
}
.search > .icon {
  width: 22px;
  height: 22px;
}
