/* Lobby de play.mejorserver.com. Sin framework: dos juegos y nada más. */

:root {
  --bg: #100e0c;
  --bg-2: #1a1612;
  --ink: #f4efe6;
  --muted: #a89b8c;
  --line: #2c261f;
  --red: #ff3a2a;
  --brass: #e0b15a;
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
  --serif: "Fraunces", "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(255, 58, 42, 0.16), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.45;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.25rem 6vw 0;
}

.mark {
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.mark span {
  color: var(--muted);
  font-weight: 400;
}

.top nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); }

.lobby {
  flex: 1;
  padding: 8vh 6vw 6vh;
  max-width: 1100px;
}

.kicker {
  margin: 0 0 0.6rem;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 2.5rem;
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(3.2rem, 8vw, 6.4rem);
  letter-spacing: -0.035em;
  line-height: 0.92;
}

.games {
  display: grid;
  border-top: 1px solid var(--line);
}

.game {
  display: grid;
  grid-template-columns: 4rem 1fr auto;
  grid-template-areas:
    "index name go"
    "index blurb go";
  gap: 0.15rem 1.25rem;
  align-items: center;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.game:hover { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03)); }
.game:hover .go { color: var(--red); }

.index {
  grid-area: index;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.name {
  grid-area: name;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1;
}

.blurb {
  grid-area: blurb;
  color: var(--muted);
  max-width: 38rem;
}

.go {
  grid-area: go;
  font-weight: 600;
}

.game-q2:hover .go { color: var(--brass); }

.page {
  flex: 1;
  width: min(1120px, calc(100% - 8vw));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.page h1 {
  font-size: clamp(2.8rem, 6vw, 4.6rem);
  margin-bottom: 0.4rem;
}

.lede {
  margin: 0 0 1.8rem;
  max-width: 40rem;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(240px, 420px) minmax(260px, 1fr);
  gap: 2rem;
  align-items: start;
}

.stage {
  background: #070605;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 0.75rem;
}

.stage wasm4-app {
  display: block;
  width: 100%;
  aspect-ratio: 1;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input[type="text"], input[type="url"] {
  width: 100%;
  background: var(--bg-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.75rem 0.8rem;
  font: inherit;
}

button, .button {
  appearance: none;
  border: 0;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-weight: 600;
  padding: 0.75rem 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

button:hover, .button:hover { background: var(--red); color: white; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.secondary:hover { border-color: var(--ink); background: transparent; color: var(--ink); }

.row { display: flex; gap: 0.5rem; }
.row > * { flex: 1; }

.note, .status {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.status strong { color: var(--ink); font-weight: 600; }

.keys {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.keys th, .keys td {
  text-align: left;
  padding: 0.35rem 0.6rem 0.35rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.keys th { color: var(--muted); font-weight: 500; width: 7rem; }

.fine {
  font-size: 0.85rem;
  color: var(--muted);
}

.error { color: #ffb4a8; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.pill i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #6b6258;
  display: inline-block;
}

.pill.up i { background: #7dce6a; }
.pill.down i { background: var(--red); }

.bar {
  height: 4px;
  background: var(--line);
  margin-top: 0.4rem;
}

.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brass);
}

.screen {
  background: #000;
  min-height: 280px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 1.5rem;
}

.screen:has(canvas) {
  padding: 0;
  display: block;
}

.screen canvas {
  width: 100%;
  height: auto;
  display: block;
  border: 0;
  outline: none;
}

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .game {
    grid-template-columns: 3rem 1fr;
    grid-template-areas:
      "index name"
      "index blurb"
      "index go";
  }
  .top nav { display: none; }
}
