:root {
  color-scheme: dark;
  --paper: #f7f3eb;
  --red: #f04432;
  --gold: #ffc76a;
  --body: "Segoe UI", Arial, sans-serif;
  --display: "Arial Narrow", Impact, "Roboto Condensed", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: #090a0d; color: var(--paper); font-family: var(--body); -webkit-font-smoothing: antialiased; }
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
::selection { color: white; background: var(--red); }

.landing {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background-color: #090a0d;
  background-image:
    linear-gradient(180deg, rgba(4,6,9,.26), rgba(4,6,9,.08) 48%, rgba(4,6,9,.55)),
    linear-gradient(90deg, rgba(4,6,9,.28), transparent 48%, rgba(4,6,9,.28)),
    url("../images/hero-forest-night.png");
  background-position: center, center, center 57%;
  background-size: cover;
}
.firefly-canvas { position: absolute; z-index: 0; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }

.hero {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 48px));
  min-height: 100svh;
  margin: auto;
  padding: 24px 0 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.logo-stage { position: relative; z-index: 0; width: min(100%, 630px); margin: 0 0 -3px; isolation: isolate; animation: logo-arrive .9s cubic-bezier(.18,.75,.25,1) both; }
.logo-stage::before { position: absolute; z-index: -1; inset: 27% 13% 5%; content: ""; border-radius: 50%; background: radial-gradient(ellipse, rgba(255,92,37,.3), rgba(255,169,59,.12) 44%, transparent 74%); filter: blur(28px); opacity: .7; animation: logo-aura 5.8s ease-in-out .9s infinite; }
.network-logo { display: block; width: 100%; max-height: 37svh; height: auto; object-fit: contain; filter: drop-shadow(0 24px 42px rgba(0,0,0,.56)); transform-origin: 50% 58%; animation: logo-float 5.8s ease-in-out .9s infinite; will-change: transform; }
@keyframes logo-arrive { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes logo-float { 0%, 100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(0,-7px,0) scale(1.012); } }
@keyframes logo-aura { 0%, 100% { opacity: .54; transform: scale(.96); } 50% { opacity: .86; transform: scale(1.04); } }

.player-banner {
  width: fit-content;
  max-width: 100%;
  min-height: 52px;
  margin: 8px 0 15px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(203,235,153,.34);
  border-radius: 4px;
  background: linear-gradient(100deg, rgba(74,111,48,.96), rgba(69,103,47,.96));
  box-shadow: 0 8px 30px rgba(0,0,0,.34), 0 0 25px rgba(133,190,77,.12);
  color: white;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
  transition: filter .2s ease, transform .2s ease;
}
.player-banner:hover { filter: brightness(1.1); transform: translateY(-1px); }
.player-banner:focus-visible { outline: 2px solid white; outline-offset: 4px; }
.player-banner[data-state="offline"] { border-color: rgba(255,197,139,.45); background: linear-gradient(100deg, rgba(113,69,43,.97), rgba(90,55,40,.97)); }
.player-banner[data-state="error"] { border-color: rgba(220,220,220,.22); background: linear-gradient(100deg, rgba(57,58,63,.96), rgba(45,46,51,.96)); }
.status-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #bff178; box-shadow: 0 0 10px rgba(191,241,120,.75); }
.player-banner[data-state="offline"] .status-dot { background: #ff9a71; box-shadow: 0 0 10px rgba(255,154,113,.7); }
.player-banner[data-state="error"] .status-dot { background: #c6c6c6; box-shadow: 0 0 8px rgba(220,220,220,.5); }
.player-banner strong { font-weight: 800; }
.player-banner code { color: #fff6df; font: 800 15px/1 var(--body); white-space: nowrap; }
.player-banner .copy-icon { width: 15px; height: 15px; flex: 0 0 15px; fill: none; stroke: #e8f4d5; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; opacity: .9; }

.action-grid { width: min(1120px, 100%); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; align-items: end; }
.action-card { min-width: 0; display: flex; flex-direction: column; align-items: center; color: white; outline-offset: 5px; }
.action-art { position: relative; width: min(100%, 220px); height: 168px; margin-bottom: -2px; display: grid; place-items: center; }
.action-art::before { position: absolute; inset: 33% 22% 8%; content: ""; border-radius: 50%; background: radial-gradient(ellipse, rgba(9,11,15,.7), transparent 72%); filter: blur(12px); }
.action-art::after { position: absolute; inset: 17% 9% 1%; content: ""; border-radius: 50%; background: radial-gradient(ellipse, rgba(255,177,74,.12), transparent 68%); opacity: 0; filter: blur(13px); transition: opacity .28s ease; }
.action-icon { position: relative; z-index: 1; display: block; width: 96px; height: 96px; padding: 23px; overflow: visible; border: 1px solid rgba(255,255,255,.14); border-radius: 26px; background: linear-gradient(145deg, rgba(29,31,37,.96), rgba(12,13,17,.96)); box-shadow: inset 0 1px rgba(255,255,255,.1), 0 12px 26px rgba(0,0,0,.48); filter: drop-shadow(0 12px 16px rgba(0,0,0,.25)); stroke-width: 1.8; transition: transform .28s cubic-bezier(.2,.75,.3,1), filter .28s ease, border-color .28s ease, background .28s ease; }
.community-icon { color: #c1b6ff; border-color: rgba(169,148,255,.35); background: linear-gradient(145deg, rgba(49,39,74,.96), rgba(19,17,29,.97)); }
.store-icon { color: #ffd28a; border-color: rgba(255,196,108,.36); background: linear-gradient(145deg, rgba(69,48,27,.96), rgba(25,20,16,.97)); }
.leaderboard-icon { color: #f4be71; border-color: rgba(240,172,87,.38); background: linear-gradient(145deg, rgba(75,43,30,.96), rgba(27,18,17,.97)); }
.staff-icon { color: #a8ead5; border-color: rgba(131,221,191,.34); background: linear-gradient(145deg, rgba(31,63,56,.96), rgba(15,23,23,.97)); }
.action-card:hover .action-icon { transform: translateY(-7px) scale(1.035) rotate(-2deg); filter: drop-shadow(0 18px 21px rgba(0,0,0,.5)); }
.action-card:hover .action-art::after { opacity: 1; }
.action-card:focus-visible { outline: 2px solid var(--gold); }
.action-label { position: relative; z-index: 2; width: min(100%, 205px); min-height: 38px; padding: 9px 14px; display: grid; place-items: center; border: 1px solid #d39a58; border-bottom: 4px solid #422a1b; border-radius: 2px; background: repeating-linear-gradient(0deg, transparent 0 7px, rgba(48,26,15,.11) 7px 8px), linear-gradient(180deg, rgba(177,111,52,.97), rgba(118,69,34,.98) 70%, #60391f); box-shadow: 0 8px 18px rgba(0,0,0,.45), inset 0 1px rgba(255,230,174,.44), inset 0 -1px rgba(31,18,12,.3); color: #fff8e9; font: 700 19px/1 var(--display); letter-spacing: .045em; text-shadow: 0 2px 2px rgba(30,16,7,.85); transition: filter .2s ease, transform .2s ease; }
.action-card:hover .action-label { filter: brightness(1.12); transform: translateY(-2px); }

.toast { position: fixed; z-index: 5; left: 50%; bottom: 28px; padding: 12px 18px; border: 1px solid rgba(255,255,255,.18); background: #17181d; color: white; box-shadow: 0 12px 40px rgba(0,0,0,.45); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-height: 820px) and (min-width: 641px) {
  .hero { padding-block: 18px 30px; }
  .network-logo { max-height: 34svh; }
  .action-grid { gap: 18px; }
  .action-art { height: 140px; }
}
@media (max-width: 640px) {
  .hero { width: calc(100% - 28px); padding: 22px 0 32px; justify-content: center; }
  .logo-stage { width: min(100%, 560px); }
  .network-logo { max-height: 37svh; }
  .player-banner { min-height: 46px; margin: 7px 0 12px; padding: 9px 11px; gap: 6px; flex-wrap: wrap; font-size: 11px; }
  .status-dot { width: 7px; height: 7px; flex-basis: 7px; }
  .player-banner code { font-size: 11px; }
  .player-banner .copy-icon { width: 13px; height: 13px; flex-basis: 13px; }
  .action-grid { width: min(440px, 100%); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .action-art { width: 100%; height: 105px; }
  .action-icon { width: 78px; height: 78px; padding: 18px; border-radius: 22px; }
  .action-label { width: 100%; min-height: 34px; padding: 8px 3px; font-size: 14px; letter-spacing: .015em; }
}
@media (max-width: 370px) {
  .player-banner { font-size: 10px; gap: 5px; }
  .player-banner code { font-size: 10px; }
  .action-grid { gap: 9px; }
  .action-art { height: 92px; }
  .action-icon { width: 70px; height: 70px; padding: 16px; border-radius: 20px; }
  .action-label { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .network-logo, .logo-stage::before { transform: none !important; }
}
