/* ==========================================================================
   DISEÑO SIMPLE DE LA WEB
   --------------------------------------------------------------------------
   Portada, lobby y pantalla de contraseña. Sin terminal, sin rejillas raras y
   con un botón grande para lo único importante: jugar.
   ========================================================================== */

:root {
  --fondo: #0a0d12;
  --panel: #11161d;
  --panel-2: #161d26;
  --borde: #26303b;
  --texto: #f2f5f7;
  --tenue: #9aa8b5;
  --verde: #7ee787;
  --verde-fuerte: #56d364;
  --verde-tinta: #07120a;
  --rojo: #ff8a8a;
  --radio: 20px;
  --ancho: 880px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 50% -180px, rgba(126, 231, 135, .09), transparent 65%),
    var(--fondo);
  color: var(--texto);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--verde); color: var(--verde-tinta); }

a { color: var(--verde); text-decoration: none; }
a:hover { color: #a7f3b0; }

.shell { width: min(var(--ancho), 92vw); margin: 0 auto; }

/* ---------- barra de arriba ---------- */
.topbar {
  border-bottom: 1px solid var(--borde);
  background: rgba(10, 13, 18, .86);
}

.topbar .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  color: var(--texto);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.brand:hover { color: var(--texto); }
.brand span { color: var(--verde); }

.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: .95rem;
}
.top-actions a { color: var(--tenue); font-weight: 600; }
.top-actions a:hover { color: var(--texto); }
.top-actions .btn { color: var(--verde-tinta); }
.top-actions .btn:hover { color: var(--verde-tinta); }

/* ---------- botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 14px 24px;
  border: 0;
  border-radius: 14px;
  background: var(--verde);
  color: var(--verde-tinta);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.btn:hover {
  background: #a7f3b0;
  color: var(--verde-tinta);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid #d2ffd7; outline-offset: 3px; }

.btn--small {
  min-height: 44px;
  padding: 10px 16px;
  font-size: .95rem;
}

.btn--ghost {
  background: transparent;
  color: var(--texto);
  border: 1px solid var(--borde);
}
.btn--ghost:hover { background: var(--panel-2); color: var(--texto); }

.btn--full { width: 100%; }

/* ---------- portada ---------- */
.hero { padding: clamp(48px, 9vw, 88px) 0 8px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--verde);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero h1,
.lobby-head h1 {
  max-width: 15ch;
  margin: 0 0 16px;
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.045em;
}

.hero p,
.lobby-head p {
  max-width: 55ch;
  margin: 0;
  color: var(--tenue);
  font-size: 1.12rem;
}

/* ---------- tarjeta de juego ---------- */
.game-card {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 36px 0 0;
  padding: 30px;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: 0 24px 50px -34px rgba(0, 0, 0, .9);
}

.game-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border: 1px solid var(--borde);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 40%, rgba(126, 231, 135, .16), transparent 70%),
    #0c1117;
  color: #f5f2e8;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 74px;
  line-height: 1;
}

.game-body { min-width: 0; }
.game-body h2 {
  margin: 0 0 6px;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.game-body p {
  max-width: 52ch;
  margin: 0 0 18px;
  color: var(--tenue);
  font-size: 1rem;
}
.game-body .note { margin: 14px 0 0; font-size: .88rem; }

.note { color: var(--tenue); }
.note--center { text-align: center; margin: 28px 0 0; }

/* ---------- secciones ---------- */
.section {
  margin-top: 48px;
  padding-top: 30px;
  border-top: 1px solid var(--borde);
}
.section h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
}
.section p {
  max-width: 65ch;
  margin: 0;
  color: var(--tenue);
}

footer {
  margin-top: 64px;
  padding: 28px 0 44px;
  border-top: 1px solid var(--borde);
  color: var(--tenue);
  font-size: .9rem;
}
footer .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- lobby ---------- */
.lobby-head { padding: clamp(44px, 8vw, 76px) 0 4px; }
.lobby-head h1 { max-width: 12ch; }
.lobby-head p { max-width: 45ch; }

/* ---------- entrar ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 4vw;
}
.auth-card {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid var(--borde);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, .95);
}
.auth-card h1 {
  margin: 0 0 8px;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.035em;
}
.auth-intro {
  margin: 0 0 24px;
  color: var(--tenue);
}
.auth-card .brand { display: inline-block; margin-bottom: 26px; }

.form-row { margin-bottom: 18px; }
label {
  display: block;
  margin-bottom: 7px;
  font-size: .9rem;
  font-weight: 700;
}

input[type=password],
input[type=text] {
  width: 100%;
  height: 56px;
  padding: 0 14px;
  border: 1px solid var(--borde);
  border-radius: 12px;
  background: #080c11;
  color: var(--texto);
  font-family: inherit;
  font-size: 1.1rem;
}
input[type=password]:focus,
input[type=text]:focus {
  outline: 3px solid rgba(126, 231, 135, .35);
  outline-offset: 1px;
  border-color: var(--verde);
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 20px;
  color: var(--tenue);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
}
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--verde); }

.alert {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: .92rem;
}
.alert--info { border: 1px solid var(--borde); background: #0d131a; color: var(--tenue); }
.alert--ok { border: 1px solid rgba(126, 231, 135, .35); background: rgba(126, 231, 135, .08); color: var(--verde); }
.alert--error { border: 1px solid rgba(255, 138, 138, .35); background: rgba(255, 138, 138, .08); color: var(--rojo); }

.aviso-error:empty { display: none; }

.auth-links { margin: 20px 0 0; text-align: center; font-size: .9rem; }
.muted-link { color: var(--tenue); }
.auth-note { margin: 16px 0 0; color: var(--tenue); font-size: .82rem; }

/* ---------- recomendaciones en el lobby ---------- */
.lobby-extra {
  margin-top: 44px;
  padding-top: 30px;
  border-top: 1px solid var(--borde);
}
.lobby-extra .form-card { max-width: 640px; margin: 0 auto; }
.mensaje-card { max-width: 640px; margin: 30px auto 0; }

/* ---------- pedir acceso ---------- */
.request-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
  margin-top: 30px;
  align-items: start;
}
.form-card,
.info-card {
  padding: 28px;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.form-card h2,
.info-card h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.form-card > p,
.info-card > p {
  margin: 0 0 22px;
  color: var(--tenue);
}
textarea {
  width: 100%;
  min-height: 108px;
  padding: 13px 14px;
  border: 1px solid var(--borde);
  border-radius: 12px;
  background: #080c11;
  color: var(--texto);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  resize: vertical;
}
textarea:focus {
  outline: 3px solid rgba(126, 231, 135, .35);
  outline-offset: 1px;
  border-color: var(--verde);
}
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-status:empty { display: none; }
.form-status { margin-top: 18px; }
.info-card hr { margin: 22px 0; border: 0; border-top: 1px solid var(--borde); }
.info-card .btn { margin-bottom: 8px; }
.info-card .note { font-size: .9rem; }

/* ---------- 404 ---------- */
.not-found { text-align: center; }
.not-found h1 { margin: 0 0 8px; font-size: 4rem; letter-spacing: -.06em; }
.not-found p { margin: 0 0 24px; color: var(--tenue); }

/* ---------- móvil ---------- */
@media (max-width: 680px) {
  body { font-size: 16px; }
  .topbar .shell { min-height: 62px; }
  .top-actions { gap: 14px; }
  .hero { padding-top: 42px; }
  .hero h1, .lobby-head h1 { font-size: clamp(2.35rem, 12vw, 3.2rem); }
  .hero p, .lobby-head p { font-size: 1.02rem; }
  .game-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    margin-top: 28px;
    padding: 22px;
  }
  .game-icon { width: 86px; height: 86px; border-radius: 20px; font-size: 56px; }
  .game-body h2 { font-size: 1.5rem; }
  .game-actions { width: 100%; }
  .game-actions .btn { width: 100%; }
  .auth { padding: 22px 4vw; }
  .auth-card { padding: 24px; border-radius: 20px; }
  .auth-card h1 { font-size: 1.9rem; }
  .request-grid { grid-template-columns: 1fr; }
  .form-card, .info-card { padding: 22px; }
  footer { margin-top: 44px; }
  footer .shell { display: block; }
  footer .shell > * + * { margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
