/* =========================================================
   EmeraldMC — design tokens
   ========================================================= */
:root{
  --bg: #0B120E;
  --bg-elevated: #101A14;
  --panel: #142016;
  --panel-border: #21341F;
  --pine: #123A26;
  --emerald: #1E9E62;
  --emerald-bright: #23B26B;
  --emerald-glow: #4ADE80;
  --gold: #D8A24A;
  --lifesteal: #C24141;
  --text: #EAF3EC;
  --text-muted: #8FA69A;
  --text-faint: #5C7267;

  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius-sm: 3px;
  --radius-md: 6px;
  --wrap: 1180px;
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3{ font-family: var(--font-display); color: var(--text); margin: 0 0 .5em; line-height: 1.15; }
p{ margin: 0 0 1em; color: var(--text-muted); }
a{ color: inherit; }
.mono{ font-family: var(--font-mono); }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

:focus-visible{ outline: 2px solid var(--emerald-glow); outline-offset: 2px; border-radius: var(--radius-sm); }

.wrap{ max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* =========================================================
   Terreno decorativo
   ========================================================= */
.terrain{
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.terrain__layer{ position: absolute; bottom: 0; left: -5%; width: 110%; height: 42vh; min-height: 300px; }
.terrain__layer--back{ opacity: .55; animation: driftSlow 90s linear infinite alternate; }
.terrain__layer--mid{ opacity: .75; animation: driftSlow 60s linear infinite alternate-reverse; }
.terrain__layer--front{ opacity: .95; animation: driftSlow 40s linear infinite alternate; }
@keyframes driftSlow{ from{ transform: translateX(0); } to{ transform: translateX(-3%); } }
.terrain__glow{
  position: absolute; top: -10%; right: 8%; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(74,222,128,.18), transparent 70%);
  filter: blur(10px);
}

/* =========================================================
   Header
   ========================================================= */
.site-header{
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,18,14,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--panel-border);
}
.site-header__inner{ display: flex; align-items: center; gap: 24px; height: 68px; }

.brand{ display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: 8px; }
.brand__mark svg{ width: 26px; height: 26px; display: block; }
.brand__name{ font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: .01em; }
.brand__name em{ font-style: normal; color: var(--emerald-bright); }

.main-nav{ display: flex; gap: 28px; margin-right: auto; }
.main-nav a{ text-decoration: none; color: var(--text-muted); font-weight: 500; font-size: .93rem; transition: color .15s; }
.main-nav a:hover{ color: var(--text); }

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

.ip-pill{
  display: none;
  align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 7px 12px;
  font-family: var(--font-mono); font-size: .8rem; color: var(--text-muted);
  cursor: pointer;
}
.ip-pill:hover{ border-color: var(--emerald); color: var(--text); }
@media (min-width: 900px){ .ip-pill{ display: inline-flex; } }
.ip-pill__dot{ width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex: none; }
.ip-pill__dot.is-online{ background: var(--emerald-glow); box-shadow: 0 0 6px var(--emerald-glow); }
.ip-pill__dot.is-offline{ background: var(--lifesteal); }

.nav-toggle{
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  width: 36px; height: 36px; padding: 0; border: none; background: none; cursor: pointer;
}
.nav-toggle span{ display: block; height: 2px; background: var(--text); border-radius: 2px; }
@media (min-width: 900px){ .nav-toggle{ display: none; } }

@media (max-width: 899px){
  .main-nav{
    position: absolute; top: 68px; left: 0; right: 0;
    background: var(--bg-elevated); border-bottom: 1px solid var(--panel-border);
    flex-direction: column; gap: 0; padding: 8px 24px 16px;
    display: none;
  }
  .main-nav.is-open{ display: flex; }
  .main-nav a{ padding: 12px 0; border-bottom: 1px solid var(--panel-border); }
}

/* =========================================================
   Buttons
   ========================================================= */
.btn{
  font-family: var(--font-body); font-weight: 600; font-size: .9rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 10px 18px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
  transition: transform .12s ease, border-color .15s, background .15s;
  white-space: nowrap;
}
.btn:active{ transform: translateY(1px); }
.btn--solid{ background: var(--emerald); color: #08150E; border-color: var(--emerald); }
.btn--solid:hover{ background: var(--emerald-bright); }
.btn--ghost{ background: transparent; color: var(--text); border-color: var(--panel-border); }
.btn--ghost:hover{ border-color: var(--emerald); }
.btn--lg{ padding: 14px 22px; font-size: .95rem; }
.btn--block{ width: 100%; }
.btn--oauth{
  flex: 1; background: var(--bg-elevated); border-color: var(--panel-border); color: var(--text);
}
.btn--oauth:hover{ border-color: var(--emerald); }
.btn--oauth svg{ width: 18px; height: 18px; }

/* =========================================================
   Hero
   ========================================================= */
.hero{
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr;
  gap: 40px;
  padding: 72px 24px 96px;
  align-items: center;
}
@media (min-width: 960px){
  .hero{ grid-template-columns: 1.15fr .85fr; padding-top: 96px; }
}
.hero__title{
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  max-width: 14ch;
}
.hero__lead{ max-width: 46ch; font-size: 1.05rem; }
.hero__cta{ display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 24px; }

#copyIpHero{ flex-direction: column; align-items: flex-start; gap: 2px; }
#copyIpHero .copy-hint{ font-size: .72rem; font-weight: 500; opacity: .65; }

.server-status{
  display: flex; align-items: center; gap: 10px;
  font-size: .85rem; color: var(--text-muted);
}
.server-status__dot{ width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex: none; }
.server-status__dot.is-online{ background: var(--emerald-glow); box-shadow: 0 0 6px var(--emerald-glow); }
.server-status__dot.is-offline{ background: var(--lifesteal); }
.server-status__divider{ width: 1px; height: 14px; background: var(--panel-border); }

.hero__panel{ display: flex; justify-content: center; }
.ore-block{ width: min(280px, 60vw); animation: floaty 6s ease-in-out infinite; }
.ore-block svg{ width: 100%; height: 100%; filter: drop-shadow(0 10px 30px rgba(35,178,107,.25)); }
@keyframes floaty{ 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-14px); } }

/* =========================================================
   Section head
   ========================================================= */
.section-head{ max-width: 56ch; margin: 0 auto 44px; text-align: center; }
.section-head--left{ text-align: left; margin: 0 0 32px; }
.section-head h2{ font-size: clamp(1.6rem, 2.6vw, 2.1rem); }

section{ position: relative; z-index: 1; padding: 88px 0; }

/* =========================================================
   Modalità
   ========================================================= */
.modes__grid{
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--panel-border);
  border: 1px solid var(--panel-border);
}
.mode-card{
  background: var(--bg-elevated);
  padding: 28px 24px;
}
.mode-card--accent{ background: linear-gradient(180deg, rgba(194,65,65,.08), var(--bg-elevated) 60%); }
.mode-card__icon{ width: 40px; height: 40px; margin-bottom: 16px; }
.mode-card__icon svg{ width: 100%; height: 100%; }
.mode-card h3{ font-size: 1.05rem; margin-bottom: 8px; }
.mode-card p{ font-size: .92rem; margin: 0; }

/* =========================================================
   Come iniziare
   ========================================================= */
.join__grid{ display: grid; gap: 40px; }
@media (min-width: 900px){ .join__grid{ grid-template-columns: .8fr 1.2fr; align-items: start; } }

.steps{ list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.steps__item{
  display: flex; gap: 18px; align-items: flex-start;
  padding: 20px 0; border-top: 1px solid var(--panel-border);
}
.steps__item:last-child{ border-bottom: 1px solid var(--panel-border); }
.steps__num{
  font-family: var(--font-mono); font-size: .85rem; color: var(--emerald-bright);
  border: 1px solid var(--panel-border); border-radius: var(--radius-sm);
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  flex: none; margin-top: 2px;
}
.steps__item h3{ font-size: 1rem; margin-bottom: 4px; }
.steps__item p{ margin: 0; font-size: .92rem; }

/* =========================================================
   Store — rank staircase
   ========================================================= */
.ranks{ display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--panel-border); }
.rank{
  display: grid; grid-template-columns: auto 1fr auto auto;
  align-items: center; gap: 20px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--panel-border);
  border-left: 3px solid transparent;
  transition: border-color .15s, background .15s;
}
.rank:hover{ background: rgba(255,255,255,.015); border-left-color: var(--rank-color, var(--emerald)); }
.rank__badge{
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  background: var(--panel); border: 1px solid var(--panel-border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: .8rem; color: var(--rank-color, var(--emerald-bright));
}
.rank__name{ font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.rank__perks{ font-size: .85rem; color: var(--text-muted); margin-top: 4px; }
.rank__price{ font-family: var(--font-mono); font-size: 1.05rem; color: var(--text); white-space: nowrap; }
.rank__buy{ padding: 9px 16px; font-size: .85rem; }

@media (max-width: 640px){
  .rank{ grid-template-columns: auto 1fr; grid-template-areas: "badge name" "perks perks" "price buy"; row-gap: 8px; }
  .rank__badge{ grid-area: badge; }
  .rank__name{ grid-area: name; }
  .rank__perks{ grid-area: perks; }
  .rank__price{ grid-area: price; }
  .rank__buy{ grid-area: buy; justify-self: end; }
}

/* =========================================================
   Community CTA
   ========================================================= */
.community{ background: var(--bg-elevated); border-top: 1px solid var(--panel-border); border-bottom: 1px solid var(--panel-border); }
.community__inner{
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
}
.community h2{ font-size: clamp(1.4rem, 2.4vw, 1.9rem); max-width: 22ch; margin-bottom: 8px; }
.community p{ max-width: 46ch; margin: 0; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer{ position: relative; z-index: 1; padding: 40px 0; }
.site-footer__inner{
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.brand--footer .brand__name{ font-size: 1rem; }
.footer__ip{ color: var(--text-faint); font-size: .8rem; }
.footer__links{ display: flex; gap: 20px; }
.footer__links a{ text-decoration: none; color: var(--text-muted); font-size: .85rem; }
.footer__links a:hover{ color: var(--text); }

/* =========================================================
   Toast
   ========================================================= */
.toast{
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--panel); border: 1px solid var(--panel-border);
  color: var(--text); font-size: .88rem;
  padding: 12px 18px; border-radius: var(--radius-md);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  z-index: 200;
  max-width: min(92vw, 380px);
}
.toast.is-visible{ opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

/* =========================================================
   Modale autenticazione
   ========================================================= */
.modal-overlay{
  position: fixed; inset: 0; z-index: 100;
  background: rgba(6,10,8,.72);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .18s;
}
.modal-overlay.is-open{ opacity: 1; pointer-events: auto; }

.modal{
  position: relative;
  width: 100%; max-width: 420px;
  max-height: 90vh; overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 32px 28px 28px;
}
.modal__close{
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: none; border: 1px solid transparent; color: var(--text-muted);
  font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.modal__close:hover{ border-color: var(--panel-border); color: var(--text); }

.modal__tabs{ display: flex; gap: 4px; background: var(--panel); border-radius: var(--radius-sm); padding: 3px; margin-bottom: 22px; }
.modal__tab{
  flex: 1; padding: 8px; border: none; background: none; color: var(--text-muted);
  font-family: var(--font-body); font-weight: 600; font-size: .85rem; border-radius: 3px; cursor: pointer;
}
.modal__tab[aria-selected="true"]{ background: var(--emerald); color: #08150E; }

.modal__title{ font-size: 1.2rem; margin-bottom: 18px; }

.oauth-row{ display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.google-btn-slot{ display: flex; justify-content: center; min-height: 40px; }
.google-btn-slot.is-empty::after{
  content: "Continua con Google";
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px 18px;
  border: 1px solid var(--panel-border); border-radius: var(--radius-sm);
  background: var(--bg-elevated); color: var(--text); font-size: .9rem; font-weight: 600;
  cursor: pointer;
}

.divider{ display: flex; align-items: center; gap: 12px; margin: 4px 0 20px; color: var(--text-faint); font-size: .78rem; }
.divider::before, .divider::after{ content: ""; flex: 1; height: 1px; background: var(--panel-border); }

.auth-form{ display: flex; flex-direction: column; gap: 16px; }
.field{ display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--text-muted); }
.field input{
  font-family: var(--font-body); font-size: .95rem; color: var(--text);
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.field input:focus{ border-color: var(--emerald); outline: none; }
.field.has-error input{ border-color: var(--lifesteal); }
.field__error{ min-height: 14px; color: var(--lifesteal); font-size: .76rem; }

.auth-form__row{ display: flex; align-items: center; justify-content: space-between; font-size: .82rem; }
.checkbox{ display: flex; align-items: center; gap: 8px; color: var(--text-muted); cursor: pointer; }
.checkbox input{ accent-color: var(--emerald); }
.link-btn{ background: none; border: none; color: var(--text-muted); font-size: .82rem; cursor: pointer; text-decoration: underline; padding: 0; }
.link-btn:hover{ color: var(--text); }

.strength-meter{ display: flex; gap: 4px; margin-top: -8px; }
.strength-meter span{ flex: 1; height: 3px; border-radius: 2px; background: var(--panel-border); }
.strength-meter.level-1 span:nth-child(1){ background: var(--lifesteal); }
.strength-meter.level-2 span:nth-child(1),
.strength-meter.level-2 span:nth-child(2){ background: var(--gold); }
.strength-meter.level-3 span:nth-child(1),
.strength-meter.level-3 span:nth-child(2),
.strength-meter.level-3 span:nth-child(3){ background: var(--emerald); }
.strength-meter.level-4 span{ background: var(--emerald-glow); }

.auth-form__note{ font-size: .76rem; color: var(--text-faint); margin: 0; }
