:root {
  --yellow: #facc15;
  --yellow-soft: #fff1a8;
  --red: #ef1f2f;
  --muted: #a9adb7;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Nunito Sans', sans-serif; color: #fff; }
.portal-body {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 38px 20px;
  overflow-x: hidden;
  background: #050506;
}
.portal-body::before {
  content: '';
  position: fixed;
  inset: -35%;
  z-index: -2;
  background:
    radial-gradient(circle at 20% 25%, rgba(239, 31, 47, 0.2), transparent 25%),
    radial-gradient(circle at 80% 20%, rgba(250, 204, 21, 0.18), transparent 22%),
    radial-gradient(circle at 70% 80%, rgba(239, 31, 47, 0.13), transparent 25%),
    radial-gradient(circle at 25% 85%, rgba(250, 204, 21, 0.11), transparent 22%),
    linear-gradient(145deg, #030303, #110b08 52%, #050505);
  animation: portalGlow 16s ease-in-out infinite alternate;
}
.portal-body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle, rgba(250, 204, 21, 0.4) 0 1px, transparent 1.8px);
  background-size: 72px 72px, 72px 72px, 110px 110px;
  animation: portalGrid 22s linear infinite;
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 85%, transparent);
}
.country-portal {
  position: relative;
  width: min(1120px, 100%);
  text-align: center;
}
.country-portal::before {
  content: '';
  position: absolute;
  width: 540px;
  height: 220px;
  left: 50%;
  top: -70px;
  translate: -50% 0;
  z-index: -1;
  border-radius: 50%;
  background: rgba(239, 31, 47, 0.12);
  filter: blur(75px);
  animation: portalPulse 5s ease-in-out infinite;
}
.portal-logo {
  width: min(340px, 74vw);
  height: auto;
  margin: 0 auto 24px;
  filter: drop-shadow(0 16px 28px rgba(239, 31, 47, 0.27));
  animation: logoFloat 5s ease-in-out infinite;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--yellow);
  font: 700 0.78rem 'Exo 2', sans-serif;
  letter-spacing: 0.22em;
}
.country-portal h1 {
  margin: 0;
  color: transparent;
  font: 900 clamp(2.5rem, 7vw, 5.3rem)/1 'Exo 2', sans-serif;
  background: linear-gradient(95deg, #fff, var(--yellow-soft) 54%, #fff);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  animation: titleShine 7s linear infinite;
}
.portal-intro { margin: 17px 0 36px; color: #d1d3d9; font-size: 1.04rem; }
.country-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px; }
.country-card {
  min-height: 210px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.country-card img { width: 88px; height: 59px; object-fit: cover; border-radius: 8px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55); }
.country-card strong { font: 700 1.08rem 'Exo 2', sans-serif; }
.country-card span { color: var(--muted); font-size: 0.84rem; }
.country-card.available {
  border-color: rgba(250, 204, 21, 0.5);
  background: linear-gradient(145deg, rgba(239, 31, 47, 0.13), rgba(250, 204, 21, 0.08));
  animation: activeCardGlow 3.6s ease-in-out infinite;
}
.country-card.available:hover,
.country-card.available:focus-visible {
  transform: translateY(-7px) scale(1.015);
  border-color: var(--yellow);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 34px rgba(239, 31, 47, 0.2);
  outline: none;
}
.country-card.available span { color: var(--yellow-soft); }
.country-card.paused { opacity: 0.58; filter: saturate(0.45); }
.country-card.paused img { filter: grayscale(0.28); }

@keyframes portalGlow { from { transform: translate3d(-2%, -1%, 0) rotate(-2deg) scale(1); } to { transform: translate3d(3%, 2%, 0) rotate(3deg) scale(1.08); } }
@keyframes portalGrid { to { background-position: 72px 72px, 72px 72px, -110px 110px; } }
@keyframes portalPulse { 50% { opacity: 0.55; transform: scale(1.15); } }
@keyframes logoFloat { 50% { transform: translateY(-7px); } }
@keyframes titleShine { to { background-position: 220% center; } }
@keyframes activeCardGlow { 50% { box-shadow: 0 20px 55px rgba(0, 0, 0, 0.55), 0 0 26px rgba(250, 204, 21, 0.1); } }

@media (max-width: 850px) {
  .country-grid { grid-template-columns: repeat(2, 1fr); }
  .country-card:last-child { grid-column: 1 / -1; width: calc(50% - 8px); justify-self: center; }
}
@media (max-width: 520px) {
  .portal-body { padding: 25px 15px; }
  .portal-logo { width: min(290px, 78vw); margin-bottom: 20px; }
  .portal-intro { margin-bottom: 25px; font-size: 0.92rem; }
  .country-grid { grid-template-columns: 1fr; gap: 10px; }
  .country-card,
  .country-card:last-child { width: 100%; min-height: 128px; grid-column: auto; flex-direction: row; justify-content: flex-start; padding: 16px 20px; }
  .country-card img { width: 70px; height: 47px; flex: 0 0 auto; }
  .country-card strong { margin-left: 4px; }
  .country-card span { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-body::before,
  .portal-body::after,
  .country-portal::before,
  .portal-logo,
  .country-portal h1,
  .country-card.available { animation: none; }
}
