/* Hub del servidor Minecraft de Luis — misma familia visual que /mc/ */

:root {
  --grass: #5d9c2f;
  --grass-dark: #3b7d23;
  --grass-light: #7fbf45;
  --dirt: #866043;
  --dirt-dark: #5e4129;
  --wood: #a0763f;
  --wood-dark: #6b4c25;
  --stone: #7d7d7d;
  --stone-dark: #4a4a4a;
  --stone-light: #a8a8a8;
  --night: #1d1f24;
  --text: #f4f1e8;
  --gold: #ffd84a;

  --pixel: "Press Start 2P", "Courier New", ui-monospace, monospace;
  --body: "VT323", ui-monospace, "Cascadia Mono", "Consolas", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--body);
  font-size: 1.4rem;
  line-height: 1.35;
  background: var(--night);
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: clamp(4rem, 12vw, 8.5rem) 0 clamp(5rem, 13vw, 9rem);
  background: var(--night);
}

.eyebrow {
  font-family: var(--pixel);
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--stone-light);
  margin: 0 0 2rem;
}

.hero-title {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(1.25rem, 4.6vw, 3.4rem);
  line-height: 1.45;
  margin: 0 0 2rem;
  color: #fff;
  text-shadow: 4px 4px 0 #000;
}
.hero-title .line { display: block; }
.hero-title .line-accent { color: var(--grass-light); }

.hero-sub {
  max-width: 40rem;
  margin: 0 0 2.4rem;
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
  color: var(--stone-light);
}

/* Borde de césped pixelado al pie del hero */
.grass-edge {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 24px;
  background:
    linear-gradient(90deg,
      var(--grass) 0 12.5%, var(--grass-dark) 12.5% 25%,
      var(--grass-light) 25% 37.5%, var(--grass) 37.5% 50%,
      var(--grass-dark) 50% 62.5%, var(--grass) 62.5% 75%,
      var(--grass-light) 75% 87.5%, var(--grass-dark) 87.5% 100%);
  background-size: 128px 100%;
  border-bottom: 10px solid var(--dirt);
}

/* ---------- Botón ---------- */

.btn {
  font-family: var(--pixel);
  font-size: clamp(.62rem, 1.8vw, .8rem);
  line-height: 1;
  color: #fff;
  text-decoration: none;
  text-shadow: 2px 2px 0 rgba(0,0,0,.45);
  border: 3px solid #000;
  padding: 1.1em 1.6em;
  display: inline-block;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary {
  background: linear-gradient(180deg, var(--grass-light) 0%, var(--grass-dark) 100%);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.35), inset -2px -3px 0 rgba(0,0,0,.35), 0 5px 0 #000;
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: linear-gradient(180deg, #96d35a 0%, var(--grass) 100%);
  outline: none;
}
.btn-primary:active { transform: translateY(3px); box-shadow: inset 2px 2px 0 rgba(0,0,0,.35), 0 2px 0 #000; }

/* ---------- Tarjetas ---------- */

.cards-section {
  padding: clamp(3rem, 8vw, 6rem) 0;
  background: var(--dirt-dark);
  scroll-margin-top: 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  display: flex;
  flex-direction: column;
  min-height: 22rem;
  padding: 2rem 1.6rem 1.6rem;
  background: var(--night);
  border: 4px solid #000;
  box-shadow: inset 0 6px 0 var(--accent), 0 6px 0 rgba(0,0,0,.4);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover, .card:focus-within {
  transform: translateY(-4px);
  box-shadow: inset 0 6px 0 var(--accent), 0 10px 0 rgba(0,0,0,.4);
}
.card-grass { --accent: var(--grass); }
.card-wood  { --accent: var(--wood); }
.card-stone { --accent: var(--stone); }

.card-icon {
  font-size: 2.6rem;
  margin-bottom: 1.4rem;
  filter: drop-shadow(3px 3px 0 rgba(0,0,0,.5));
}

.card-title {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(.85rem, 1.6vw, 1.05rem);
  line-height: 1.6;
  text-transform: uppercase;
  margin: 0 0 1rem;
  color: #fff;
}

.card-text {
  margin: 0 0 2rem;
  color: var(--stone-light);
}

.card-link {
  margin-top: auto;
  align-self: flex-start;
  font-family: var(--pixel);
  font-size: .62rem;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  padding: .3em 0;
  border-bottom: 3px solid transparent;
}
.card-link span { display: inline-block; transition: transform .15s ease; }
.card-link:hover, .card-link:focus-visible { border-bottom-color: var(--gold); outline: none; }
.card-link:hover span, .card-link:focus-visible span { transform: translateX(4px); }

/* Toda la tarjeta clicable a través del enlace */
.card { position: relative; }
.card-link::after { content: ""; position: absolute; inset: 0; }

/* ---------- Mundos públicos (fusionado desde /mc/) ---------- */

.mundos {
  padding: clamp(3rem, 8vw, 6rem) 0;
  background-color: var(--dirt);
  background-image:
    linear-gradient(45deg, rgba(0,0,0,.10) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.10) 75%),
    linear-gradient(45deg, rgba(255,255,255,.04) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.04) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
  border-top: 6px solid #000;
  scroll-margin-top: 0;
}

.mundos img { max-width: 100%; display: block; }

.mundos code {
  font-family: var(--body);
  background: rgba(0,0,0,.35);
  padding: 0 .35em;
  border-radius: 2px;
  color: var(--gold);
}

.mundos-title {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(1rem, 3.4vw, 1.6rem);
  line-height: 1.5;
  text-align: center;
  margin: 0 0 .6rem;
  color: #fff;
  text-shadow: 3px 3px 0 #000;
}

.mundos-sub {
  font-family: var(--pixel);
  font-size: clamp(.55rem, 2vw, .75rem);
  text-align: center;
  margin: 0 0 2rem;
  color: var(--text);
}

.box-title {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(.8rem, 3vw, 1.05rem);
  line-height: 1.5;
  margin: 0 0 1rem;
  color: var(--gold);
  text-shadow: 2px 2px 0 #000;
}
.section-title { text-align: center; margin-bottom: 1.4rem; }

/* Vídeo + intro */
.mundos-intro {
  max-width: 900px;
  margin: 0 auto 2.2rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.4rem;
  align-items: center;
}

.banner {
  position: relative;
  display: block;
  border: 6px solid var(--wood-dark);
  outline: 4px solid var(--wood);
  box-shadow: 0 8px 0 rgba(0,0,0,.25);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--stone-dark);
}
.banner img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.banner:hover img, .banner:focus-visible img { transform: scale(1.03); }
.banner-play {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  font-size: 2.2rem;
  width: 4.2rem; height: 3rem;
  display: grid; place-items: center;
  background: #e62117;
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 4px 4px 0 rgba(0,0,0,.4);
}

.intro {
  margin: 0 0 1.2rem;
  background: rgba(29,31,36,.88);
  border: 3px solid var(--wood-dark);
  padding: .7rem 1rem;
}

/* Botones de la sección (base .btn ya definida arriba) */
.mundos .btn { cursor: pointer; user-select: none; }

.btn-video {
  font-size: clamp(.55rem, 2vw, .7rem);
  background: linear-gradient(180deg, #e8473c 0%, #b81d13 100%);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.35), inset -2px -3px 0 rgba(0,0,0,.35), 0 5px 0 #000;
}
.btn-video:hover, .btn-video:focus-visible {
  background: linear-gradient(180deg, #f0645a 0%, #c9271c 100%);
  outline: none;
}

.btn-copy {
  font-size: .62rem;
  padding: .75em 1em;
  border-color: #1a1a1a;
  background: linear-gradient(180deg, #8a8a8a 0%, #6f6f6f 100%);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.35), inset -2px -3px 0 rgba(0,0,0,.35);
}
.btn-copy:hover, .btn-copy:focus-visible {
  background: linear-gradient(180deg, #8fb85a 0%, #5d9c2f 100%);
  outline: none;
}
.btn-copy:active { transform: translateY(2px); box-shadow: inset 2px 2px 0 rgba(0,0,0,.35); }
.btn-copy.copied { background: linear-gradient(180deg, #7fbf45, #3b7d23); }

/* Cómo entrar */
.panel-box {
  max-width: 900px;
  margin: 0 auto 2.2rem;
  background: rgba(29,31,36,.88);
  border: 4px solid #000;
  box-shadow: inset 0 0 0 3px var(--stone), 0 6px 0 rgba(0,0,0,.3);
  padding: 1.2rem 1.4rem;
}
.steps { margin: 0 0 1rem; padding-left: 1.6rem; }
.steps li { margin-bottom: .3rem; }
.note { margin: .6rem 0 0; }
.small { font-size: 1.1rem; opacity: .85; }

/* Tarjetas de mundo */
.worlds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.6rem;
}

.world {
  background: var(--night);
  border: 4px solid #000;
  box-shadow: inset 0 0 0 3px var(--wood), 0 6px 0 rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
  scroll-margin-top: 1rem;
}
.world:target { box-shadow: inset 0 0 0 3px var(--gold), 0 0 0 4px var(--gold); }

.preview {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 3px 3px 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  --block: 22px;
}
.preview-img { display: block; background: #000; }
.preview-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.preview-img:hover img, .preview-img:focus-visible img { transform: scale(1.04); }

/* Mundo principal sin foto: bloques de piedra pixelados en CSS */
.preview-stone {
  --block: 26px;
  image-rendering: pixelated;
  background:
    radial-gradient(circle at 22% 30%, #e7b04a 0 3%, transparent 3.5%),
    radial-gradient(circle at 70% 64%, #5fd3e6 0 2.6%, transparent 3%),
    radial-gradient(circle at 84% 22%, #c0392b 0 2.4%, transparent 2.9%),
    linear-gradient(135deg, #8a8a8a 0%, #6b6b6b 45%, #555 100%);
}
.preview-stone::before {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.14) 0 2px, transparent 2px var(--block)),
    repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 2px, transparent 2px var(--block)),
    linear-gradient(45deg, rgba(255,255,255,.07) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.07) 75%);
  background-size: auto, auto, calc(var(--block) * 2) calc(var(--block) * 2);
  pointer-events: none;
}
.preview-emoji {
  position: relative;
  font-size: 3rem;
  filter: drop-shadow(3px 3px 0 rgba(0,0,0,.45));
}
.preview-tag {
  position: absolute;
  left: 8px; bottom: 8px;
  font-family: var(--pixel);
  font-size: .5rem;
  letter-spacing: .03em;
  color: #fff;
  background: rgba(0,0,0,.6);
  border: 2px solid rgba(255,255,255,.6);
  padding: .5em .7em;
  text-transform: uppercase;
}

.world-body {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  flex: 1;
}

.world-title {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: .85rem;
  line-height: 1.55;
  margin: 0;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
}

.conn { display: grid; gap: .5rem; }

.field {
  display: grid;
  grid-template-columns: 6.2rem 1fr auto;
  align-items: center;
  gap: .5rem;
  background: #000;
  border: 2px solid var(--stone);
  padding: .4rem .5rem;
}
.label {
  font-family: var(--pixel);
  font-size: .5rem;
  color: var(--stone-light);
  text-transform: uppercase;
}
.mundos .value {
  font-size: 1.6rem;
  background: none;
  padding: 0;
  color: #fff;
  overflow-wrap: anywhere;
  user-select: all;
}
.mundos .value.port { color: var(--gold); font-size: 2rem; letter-spacing: .05em; }

.seed { font-size: .95em; margin: 0; word-break: break-all; }
.seed code { font-size: .9em; }

.mini-steps { margin: 0; font-size: 1.15rem; opacity: .85; }
.mini-steps code { font-size: 1.15rem; }

.open-badge {
  margin: auto 0 0;
  align-self: flex-start;
  font-size: 1.15rem;
  color: #d9f7b8;
  background: rgba(93,156,47,.25);
  border: 2px solid var(--grass);
  padding: .1rem .6rem;
}

/* Aviso de "copiado" */
.toast {
  position: fixed;
  left: 50%; bottom: 1.4rem;
  transform: translate(-50%, 200%);
  font-family: var(--pixel);
  font-size: .62rem;
  background: #000;
  color: var(--gold);
  border: 3px solid var(--gold);
  padding: .9em 1.2em;
  transition: transform .25s ease;
  z-index: 10;
  max-width: 90vw;
  text-align: center;
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- Franja de mundos ---------- */

.worlds-strip {
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  background: var(--stone-dark);
  border-top: 6px solid #000;
}

.strip-title {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--stone-light);
  margin: 0 0 1.4rem;
}

.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .8rem 1rem;
}

.chip {
  display: inline-block;
  font-size: 1.45rem;
  color: var(--text);
  text-decoration: none;
  padding: .35rem .9rem;
  background: rgba(0,0,0,.3);
  border: 3px solid #000;
  box-shadow: inset 0 0 0 2px var(--stone);
  transition: background .15s ease, box-shadow .15s ease;
}
.chip:hover, .chip:focus-visible {
  background: var(--grass-dark);
  box-shadow: inset 0 0 0 2px var(--grass-light);
  outline: none;
}

/* ---------- Pie ---------- */

.footer {
  background: #000;
  text-align: center;
  padding: 1.2rem 1rem 1.6rem;
  color: var(--stone);
  font-size: 1.15rem;
}
.footer p { margin: .3rem 0 0; }
.footer p:first-child { margin-top: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .mundos-intro { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  body { font-size: 1.3rem; }
  .hero-title { text-shadow: 3px 3px 0 #000; }
  .chips { gap: .6rem; }
  .chip { font-size: 1.3rem; }
  .banner { border-width: 4px; outline-width: 3px; }
  .banner-play { width: 3.2rem; height: 2.3rem; font-size: 1.6rem; }
  .worlds { grid-template-columns: 1fr; }
  .panel-box { padding: 1rem; }
  .field { grid-template-columns: 1fr auto; }
  .field .label { grid-column: 1 / -1; }
  .btn-copy { padding: 1em 1.1em; } /* objetivo táctil más grande */
}

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