:root {
  --surface: #f4faff;
  --surface-soft: #e6eff5;
  --surface-card: rgba(255, 255, 255, 0.42);
  --navy: #141d21;
  --navy-soft: #293236;
  --text-muted: #3c494e;
  --primary: #00677f;
  --primary-bright: #00d2ff;
  --primary-light: #47d6ff;
  --gold: #e9c349;
  --gold-light: #ffe088;
  --gold-dark: #735c00;
  --border-light: rgba(255, 255, 255, 0.55);
  --shadow-soft: 0 10px 30px rgba(34, 50, 102, 0.1);
  --container: 1280px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--navy);
  font-family: "Manrope", Arial, sans-serif;
  background:
    radial-gradient(
      circle at 75% 31%,
      rgba(255, 255, 255, 0.34) 0 10%,
      transparent 30%
    ),
    linear-gradient(135deg, #e8f8ff 0%, #b6ebff 48%, #e4f3fb 100%);
  overflow-x: hidden;
}

body.is-loading {
  overflow: hidden;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.sparkle-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.sparkle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: #fff;
  opacity: 0;
  animation: sparkle 3.8s infinite;
}

.loader-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  background:
    radial-gradient(
      circle at 50% 47%,
      rgba(255, 255, 255, 0.44),
      transparent 29%
    ),
    linear-gradient(135deg, #e8f8ff 0%, #b6ebff 54%, #e4f3fb 100%);
  display: grid;
  place-items: center;
  pointer-events: none;
  transition:
    opacity 420ms ease,
    visibility 420ms ease;
}

.loader-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-logo {
  width: clamp(190px, 25vw, 310px);
  height: auto;
  filter: drop-shadow(0 18px 28px rgba(34, 50, 102, 0.18));
  transform-origin: top left;
  will-change: transform, width;
}

.loader-logo-pulse {
  animation: loaderPulse 1.15s ease-in-out infinite;
}

body.is-loading .site-header,
body.is-loading main,
body.is-loading .site-footer,
body.is-loading .mobile-nav {
  opacity: 0;
}

body.intro-ready .site-header,
body.intro-ready main,
body.intro-ready .site-footer,
body.intro-ready .mobile-nav {
  opacity: 1;
}

body.intro-ready .brand,
body.intro-ready .header-actions,
body.intro-ready .hero-copy,
body.intro-ready .hero-art,
body.intro-ready .gateway-card,
body.intro-ready .hero-action,
body.intro-ready .results-section {
  animation: introRise 700ms ease both;
}

body.intro-ready .header-actions {
  animation-delay: 120ms;
}

body.intro-ready .hero-copy {
  animation-delay: 210ms;
}

body.intro-ready .hero-art {
  animation-delay: 300ms;
}

body.intro-ready .gateway-card {
  animation-delay: calc(390ms + (var(--card-index, 0) * 65ms));
}

body.intro-ready .hero-action {
  animation-delay: 760ms;
}

body.intro-ready .results-section {
  animation-delay: 860ms;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  width: min(100%, var(--container));
  height: 90px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand img {
  display: block;
  width: clamp(126px, 12vw, 160px);
  height: auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.icon-button {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  color: var(--primary);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 700;
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

main {
  width: min(100%, var(--container));
  margin: 0 auto;
  padding: 18px 40px 84px;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(440px, 0.95fr);
  gap: 10px 44px;
  align-items: center;
  min-height: 650px;
}

.hero-copy {
  max-width: 615px;
}

h1,
h2,
h3 {
  font-family: "Plus Jakarta Sans", Arial, sans-serif;
  margin: 0;
}

.hero-copy h1 {
  max-width: 590px;
  color: var(--primary);
  font-size: clamp(2.45rem, 5vw, 4.1rem);
  line-height: 1.05;
  font-weight: 800;
}

.hero-copy h1 .brand-highlight {
  color: transparent;
  display: inline-block;
  padding-right: 0.1em;
  margin-right: -0.04em;
  font-style: italic;
  background: linear-gradient(180deg, #fff4b1 0%, #ffd84d 44%, #d99d00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 1px rgba(255, 238, 151, 0.5);
  filter: drop-shadow(0 3px 0 rgba(255, 255, 255, 0.3))
    drop-shadow(0 8px 12px rgba(115, 92, 0, 0.32));
}

.hero-copy p {
  max-width: 560px;
  margin: 24px 0 32px;
  color: var(--navy);
  font-size: 1.08rem;
  line-height: 1.65;
}

.gold-button {
  min-height: 64px;
  padding: 0 120px;
  margin-top: -20px;
  border: 0;
  border-radius: 0;
  color: #241a00;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 100%);
  box-shadow:
    0 5px 0 var(--gold-dark),
    0 13px 22px rgba(115, 92, 0, 0.19);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-family: "Plus Jakarta Sans", Arial, sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.gold-button:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow:
    0 7px 0 var(--gold-dark),
    0 17px 28px rgba(115, 92, 0, 0.26);
}

.gold-button.testing .material-symbols-outlined {
  animation: spin 900ms linear infinite;
}

.gateway-grid {
  grid-column: 1 / -1;
  order: 4;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.hero-action {
  grid-column: 1 / -1;
  order: 3;
  justify-self: center;
  margin-top: -80px;
  margin-bottom: 20px;
}

.gateway-card {
  position: relative;
  min-height: 150px;
  padding: 18px 18px 16px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: var(--surface-card);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px);
}

.gateway-card.recommended {
  border-color: rgba(115, 92, 0, 0.34);
}

.recommended-ribbon {
  position: absolute;
  top: 0;
  right: 0;
  padding: 7px 16px 8px;
  border-radius: 0 0 0 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  box-shadow: 0 8px 18px rgba(115, 92, 0, 0.24);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.gateway-card header {
  color: var(--text-muted);
  font-size: 1.02rem;
}

.latency {
  margin: 18px 0 16px;
  color: var(--navy);
  font-family: "Plus Jakarta Sans", Arial, sans-serif;
  font-size: clamp(1.75rem, 2.6vw, 2.35rem);
  font-weight: 800;
  text-align: center;
}

.recommended .latency {
  color: var(--primary);
}

.gateway-card.slow .latency {
  color: rgba(60, 73, 78, 0.66);
}

.gateway-card a {
  min-height: 43px;
  width: 100%;
  color: var(--primary);
  background: rgba(219, 228, 234, 0.86);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.gateway-card.recommended a {
  color: #fff;
  background: var(--primary);
}

.gateway-card a:hover {
  color: #fff;
  background: #004e60;
  transform: translateY(-1px);
}

.hero-art {
  min-height: 520px;
  display: grid;
  place-items: center;
}

.hero-orbit {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 1;
  border-radius: 999px;
  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(255, 255, 255, 0.2),
      rgba(255, 255, 255, 0.04) 66%
    ),
    radial-gradient(circle, rgba(0, 210, 255, 0.18), transparent 72%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 85px rgba(0, 103, 127, 0.13);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-orbit img {
  width: 92%;
  height: auto;
  transform: translateX(2%);
  filter: drop-shadow(0 28px 44px rgba(20, 29, 33, 0.22));
  transition: transform 700ms ease;
}

.hero-orbit:hover img {
  transform: translateX(2%) scale(1.035);
}

.coin {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 3px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  display: grid;
  place-items: center;
  font-weight: 800;
  animation: floatCoin 4.5s ease-in-out infinite;
}

.coin-one {
  top: 12%;
  right: 5%;
}

.coin-two {
  left: 5%;
  bottom: 23%;
  animation-delay: 1.1s;
}

.coin-three {
  right: 12%;
  bottom: 16%;
  animation-delay: 2s;
}

.results-section {
  margin-top: 60px;
}

.section-title {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin-bottom: 42px;
}

.section-title > span {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(108, 121, 127, 0.45));
}

.section-title > span:last-child {
  background: linear-gradient(90deg, rgba(108, 121, 127, 0.45), transparent);
}

.section-title h2 {
  min-height: 54px;
  padding: 0 44px;
  border-radius: 999px;
  color: #241a00;
  background: linear-gradient(
    90deg,
    var(--gold-light),
    #fed65b,
    var(--gold-light)
  );
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 12px 26px rgba(115, 92, 0, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 1.12rem;
  font-weight: 700;
  text-transform: uppercase;
}

.results-grid {
  width: min(100%, 1040px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.draw-card {
  padding: 24px;
  color: #fff;
  background: rgba(20, 29, 33, 0.86);
  border: 1.5px solid rgba(233, 195, 73, 0.31);
  box-shadow:
    0 16px 36px rgba(20, 29, 33, 0.24),
    inset 0 0 24px rgba(233, 195, 73, 0.08);
  backdrop-filter: blur(16px);
  transition: transform 220ms ease;
}

.draw-card:hover {
  transform: translateY(-5px);
}

.draw-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.game-name {
  display: flex;
  align-items: center;
  gap: 16px;
}

.game-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 0 22px rgba(0, 210, 255, 0.28);
}

.game-icon img {
  width: 82%;
  height: 82%;
  display: block;
  object-fit: contain;
}

.draw-card:nth-child(odd) .game-icon {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.draw-card:nth-child(even) .game-icon {
  color: #241a00;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-light));
}

.game-name h3 {
  font-size: 1.35rem;
  line-height: 1.1;
}

.status-badge {
  width: fit-content;
  margin-top: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.status-badge.live {
  background: linear-gradient(90deg, #ff4b2b, #ff416c);
  box-shadow: 0 0 12px rgba(255, 75, 43, 0.75);
  animation: pulse 2s infinite;
}

.status-badge.new {
  background: rgba(0, 103, 127, 0.76);
  border: 1px solid rgba(71, 214, 255, 0.36);
}

.number-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lotto-ball {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  color: #004e60;
  background: radial-gradient(
    circle at 30% 28%,
    #fff 0%,
    #aef2ff 28%,
    var(--primary-light) 62%,
    var(--primary) 100%
  );
  box-shadow:
    inset -5px -5px 9px rgba(0, 0, 0, 0.24),
    0 7px 12px rgba(0, 0, 0, 0.28);
  display: grid;
  place-items: center;
  font-family: "Plus Jakarta Sans", Arial, sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
}

.draw-meta {
  padding: 18px 20px;
  border-radius: 36px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.draw-schedule {
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.label {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.schedule-value {
  color: var(--primary-bright);
  font-weight: 800;
}

.timer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.timer {
  color: var(--gold-light);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: "Share Tech Mono", monospace;
  font-size: 1.45rem;
  letter-spacing: 0;
  white-space: nowrap;
}

.timer .material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  animation: spin 8s linear infinite;
}

.next-draw {
  text-align: right;
}

.next-draw strong {
  display: block;
  margin-top: 3px;
  color: #fff;
}

.drawing-note {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  line-height: 1.45;
}

.history-button {
  width: 100%;
  min-height: 50px;
  margin-top: 26px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 180ms ease;
}

.history-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.site-footer {
  padding: 50px 40px;
  background: rgba(230, 239, 245, 0.72);
  border-top: 1px solid rgba(108, 121, 127, 0.16);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
}

.footer-brand img {
  width: 86px;
  height: auto;
  display: block;
  margin-bottom: 18px;
}

.footer-brand p {
  margin: 0;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 28px;
}

.footer-links a {
  color: var(--navy);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary);
}

.mobile-nav {
  display: none;
}

@keyframes sparkle {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  45% {
    opacity: 0.86;
  }
  100% {
    opacity: 0;
    transform: scale(1.7);
  }
}

@keyframes floatCoin {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-18px) rotate(16deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.06);
    opacity: 0.86;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes loaderPulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 18px 28px rgba(34, 50, 102, 0.18));
  }
  50% {
    transform: scale(1.055);
    filter: drop-shadow(0 22px 34px rgba(34, 50, 102, 0.26));
  }
}

@keyframes introRise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  body.is-loading {
    overflow: auto;
  }

  .loader-screen {
    display: none;
  }
}

@media (max-width: 1060px) {
  .hero-section {
    grid-template-columns: 1fr;
    min-height: auto;
    text-align: center;
  }

  .hero-copy {
    max-width: 760px;
    margin: 0 auto;
    margin-top: -80px;
    order: 2;
    z-index: 1;
  }

  .hero-copy p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-art {
    min-height: 420px;
    order: 1;
  }

  .hero-orbit {
    width: min(100%, 520px);
  }

  .gateway-grid {
    grid-column: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 680px);
    margin: 18px auto 0;
    order: 4;
  }

  .gateway-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - 14px) / 2);
  }

  .hero-action {
    order: 3;
    margin-top: 10px;
  }
}

@media (max-width: 760px) {
  .site-header {
    height: 76px;
    padding: 0 16px;
  }

  .language-button span:last-child {
    display: none;
  }

  main {
    padding: 10px 16px 98px;
  }

  .hero-section {
    gap: 18px;
  }

  .hero-action {
    margin-bottom: 0px;
  }

  .hero-art {
    min-height: 290px;
  }

  .hero-orbit {
    width: min(100%, 350px);
  }

  .coin {
    width: 25px;
    height: 25px;
    font-size: 0.78rem;
    border-width: 2px;
  }

  .hero-copy h1 {
    font-size: clamp(1.5rem, 10.4vw, 2.5rem);
  }

  .hero-copy p {
    margin-top: 18px;
    margin-bottom: 24px;
    font-size: 0.8rem;
    line-height: 1.55;
  }

  .gold-button {
    width: 100%;
    min-height: 58px;
    padding: 0 20px;
  }

  .gateway-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .gateway-grid {
    margin-top: 28px;
  }

  .gateway-card:last-child:nth-child(odd) {
    grid-column: auto;
    width: 100%;
  }

  .section-title {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
  }

  .section-title > span {
    display: none;
  }

  .section-title h2 {
    width: fit-content;
    max-width: 100%;
    min-height: 52px;
    padding: 0 18px;
    font-size: 0.93rem;
    gap: 8px;
  }

  .results-section {
    margin-top: 42px;
  }

  .draw-card {
    padding: 20px;
  }

  .draw-top {
    align-items: center;
  }

  .game-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
  }

  .game-name h3 {
    font-size: 1.18rem;
  }

  .lotto-ball {
    width: 44px;
    height: 44px;
  }

  .draw-meta {
    border-radius: 24px;
    padding: 16px;
  }

  .draw-schedule,
  .timer-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .next-draw {
    text-align: left;
  }

  .site-footer {
    padding: 42px 16px 110px;
    align-items: center;
    text-align: center;
    flex-direction: column;
  }

  .footer-brand img {
    margin-left: auto;
    margin-right: auto;
  }

  .footer-links {
    justify-content: center;
    gap: 18px 24px;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    min-height: 76px;
    padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
    background: rgba(244, 250, 255, 0.86);
    border-top: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 -10px 30px rgba(34, 50, 102, 0.1);
    backdrop-filter: blur(22px);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .mobile-nav a {
    min-width: 0;
    min-height: 58px;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 0.68rem;
    font-weight: 800;
  }

  .mobile-nav a.active {
    color: #745c00;
    background: #fed65b;
    box-shadow: 0 5px 15px rgba(115, 92, 0, 0.2);
  }
}
