:root {
  font-family: Inter, ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f8fbff;
  background: #0d1d32;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

body {
  background:
    radial-gradient(circle at 12% 12%, #53b3cb33 0 180px, transparent 360px),
    radial-gradient(circle at 88% 70%, #7fbf6640 0 190px, transparent 390px),
    linear-gradient(145deg, #0d1d32, #163548 55%, #244c38);
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.loading {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: #dce8ed;
  font-size: 13px;
  font-weight: 750;
}

body:not(.auth-pending) .loading { display: none; }

.brand-mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #55bad3, #477c50);
  border: 3px solid #ffffffdd;
  border-radius: 20px;
  box-shadow: 0 14px 36px #0007;
  font-size: 31px;
  font-weight: 950;
}

.brand-mark.small { width: 44px; height: 44px; border-width: 2px; border-radius: 13px; font-size: 22px; }

.login-view {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-view[hidden], .dashboard[hidden] { display: none; }

.login-card {
  width: min(430px, 100%);
  padding: 30px;
  color: #10213a;
  background: #f8fbf3;
  border: 2px solid #ffffffaa;
  border-radius: 26px;
  box-shadow: 0 26px 90px #0008;
}

.eyebrow { margin: 18px 0 2px; color: #72d5f2; font-size: 12px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.login-card .eyebrow { color: #557063; }
.login-card h1 { margin: 0 0 10px; font-size: 42px; letter-spacing: -.045em; }
.intro { margin: 0 0 20px; color: #415263; line-height: 1.5; }

form { display: grid; gap: 8px; }
#invite-fields { display: grid; gap: 8px; }
#invite-fields[hidden] { display: none; }
#invite-fields p { margin: 0; color: #68777f; font-size: 11px; line-height: 1.4; }
label { margin-top: 5px; font-size: 13px; font-weight: 800; }
input {
  width: 100%; min-height: 48px; padding: 11px 14px;
  color: #10213a; background: #fff; border: 2px solid #cad8d0; border-radius: 11px; outline: none;
}
input:focus { border-color: #53b3cb; box-shadow: 0 0 0 4px #53b3cb22; }

.login-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
button, .play-button {
  min-height: 46px; border: 0; border-radius: 11px; cursor: pointer; font-weight: 850;
}
.login-actions button { color: #fff; background: #315c3a; }
.login-actions .secondary { color: #10213a; background: #dce8ed; }
button:hover, .play-button:hover { filter: brightness(1.08); }
button:disabled { cursor: wait; opacity: .55; }
.message { min-height: 20px; margin: 3px 0 0; color: #a23643; font-size: 13px; font-weight: 750; }
.message.success { color: #315c3a; }
.privacy-note { margin: 12px 0 0; color: #68777f; font-size: 11px; line-height: 1.45; }

.dashboard { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding-bottom: 28px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand strong { display: block; font-size: 20px; letter-spacing: .06em; }
.brand small { display: block; margin-top: 1px; color: #a9bdca; font-size: 11px; }
.account { display: flex; align-items: center; gap: 12px; }
.account span { color: #dce8ed; font-size: 14px; font-weight: 750; }
.account button { min-height: 38px; padding: 7px 14px; color: #fff; background: #ffffff16; border: 1px solid #ffffff3d; }

.hero { padding: clamp(34px, 7vw, 76px) 0 34px; }
.hero .eyebrow { margin-top: 0; }
.hero h1 { max-width: 760px; margin: 4px 0 10px; font-size: clamp(35px, 6vw, 68px); line-height: .98; letter-spacing: -.055em; }
.hero p:last-child { max-width: 670px; margin: 0; color: #b8cad5; font-size: clamp(15px, 2vw, 18px); line-height: 1.55; }

.games-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(230px, .8fr); gap: 20px; }
.game-card { overflow: hidden; background: #f7faef; border: 1px solid #ffffff55; border-radius: 24px; box-shadow: 0 22px 70px #0005; }
.featured { display: grid; grid-template-columns: minmax(250px, .85fr) minmax(320px, 1.15fr); }
.game-art { position: relative; min-height: 390px; overflow: hidden; background: linear-gradient(#94d982, #73bc6d); }
.game-art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 15% 24%, #fff3 0 3px, transparent 4px), radial-gradient(circle at 72% 70%, #fff2 0 4px, transparent 5px); background-size: 75px 68px, 110px 98px; }
.path { position: absolute; width: 145%; height: 82px; top: 44%; left: -22%; background: #e5cb91; border: 8px solid #977044; border-radius: 999px; transform: rotate(-18deg); box-shadow: 0 9px 0 #315c3a33; }
.tower { position: absolute; display: grid; width: 66px; height: 66px; place-items: center; color: #10213a; border: 7px solid #315c3a; border-radius: 50%; box-shadow: 0 10px 20px #17372455; font-size: 24px; font-weight: 950; }
.tower.air { top: 18%; left: 17%; background: #f2b84b; }
.tower.earth { right: 12%; bottom: 13%; background: #79a84b; }
.enemy { position: absolute; top: 46%; right: 35%; display: grid; width: 54px; height: 54px; place-items: center; color: #412b29; background: #e8b58d; border: 5px solid #e45756; border-radius: 50%; font-size: 25px; box-shadow: 0 8px 15px #0003; }
.game-copy { display: flex; flex-direction: column; padding: clamp(24px, 4vw, 42px); color: #10213a; }
.game-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.tag { color: #557063; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.game-card h2 { margin: 4px 0 12px; font-size: clamp(27px, 4vw, 42px); letter-spacing: -.04em; }
.game-copy > p { margin: 0; color: #4f6069; line-height: 1.55; }
.ready { flex: none; padding: 6px 9px; color: #24633b; background: #d9f0d6; border-radius: 999px; font-size: 11px; font-weight: 850; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.stat { padding: 8px 10px; color: #3c5360; background: #e5ece9; border-radius: 9px; font-size: 12px; font-weight: 780; }
.play-button { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: auto; padding: 0 18px; color: #fff; background: linear-gradient(110deg, #315c3a, #397c64); text-decoration: none; }
.play-button span { font-size: 23px; }
.coming-soon { display: flex; min-height: 300px; flex-direction: column; justify-content: center; align-items: center; padding: 30px; color: #dce8ed; text-align: center; background: #ffffff0b; border: 2px dashed #ffffff30; box-shadow: none; }
.coming-soon .plus { display: grid; width: 62px; height: 62px; margin-bottom: 20px; place-items: center; color: #8be8ff; background: #ffffff0d; border: 1px solid #ffffff2b; border-radius: 20px; font-size: 37px; font-weight: 300; }
.coming-soon .tag { color: #8be8ff; }
.coming-soon h2 { margin-bottom: 5px; font-size: 27px; }
.coming-soon p { margin: 0; color: #9fb3bf; }
footer { padding: 28px 0 0; color: #8197a4; font-size: 11px; text-align: center; }

@media (max-width: 820px) {
  .games-grid { grid-template-columns: 1fr; }
  .featured { grid-template-columns: 1fr; }
  .game-art { min-height: 250px; }
  .coming-soon { min-height: 220px; }
}

@media (max-width: 520px) {
  .login-view { padding: 14px; }
  .login-card { padding: 22px; border-radius: 20px; }
  .login-actions { grid-template-columns: 1fr; }
  .dashboard { width: min(100% - 20px, 1180px); }
  .site-header { align-items: flex-start; }
  .brand small { display: none; }
  .account { flex-direction: column; align-items: flex-end; gap: 5px; }
  .account button { min-height: 34px; }
  .hero { padding-top: 28px; }
  .game-heading { display: block; }
  .ready { display: inline-block; margin-bottom: 8px; }
}
