:root {
  --bg: #f4faff;
  --ink: #12263a;
  --muted: #516a80;
  --line: #cfe0ef;
  --panel: #ffffff;
  --primary: #0ea5a4;
  --secondary: #2563eb;
  --warn: #f59e0b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Nunito Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 6% 8%, rgba(14, 165, 164, 0.2), transparent 35%),
    radial-gradient(circle at 94% 10%, rgba(37, 99, 235, 0.17), transparent 35%),
    linear-gradient(180deg, #f6fbff, #eff6ff);
}

.launch {
  width: min(1240px, calc(100% - 2rem));
  margin: 1rem auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 36px rgba(18, 38, 58, 0.1);
  padding: 1.2rem 1.5rem;
  display: grid;
  gap: 0.8rem;
}

/* ── Header ── */

.launch-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.back-link {
  text-decoration: underline;
  color: #326089;
  font-weight: 700;
  font-size: 0.9rem;
}

.mode-badge {
  margin: 0;
  border: 1px solid #9adfd7;
  border-radius: 999px;
  background: #e8fbf8;
  color: #0c6663;
  font-weight: 800;
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 0.03em;
  padding: 0.3rem 0.55rem;
}

/* ── Short link bar ── */

.short-link-bar {
  background: linear-gradient(110deg, #184770, #1d5a94);
  border-radius: 14px;
  padding: 0.7rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.short-link-label {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 800;
  font-size: clamp(0.9rem, 1.6vw, 1.1rem);
  white-space: nowrap;
}

.short-link-url {
  color: #ffffff;
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  font-size: clamp(1.2rem, 2.8vw, 1.8rem);
  letter-spacing: 0.01em;
  word-break: break-all;
  user-select: all;
  cursor: text;
}

/* ── Split panel ── */

.split-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

/* ── Info panel (left) ── */

.info-panel {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.preview-thumb {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #f0f6fc;
  border: 1px solid #d2deea;
}

.preview-thumb svg {
  display: block;
  width: 100%;
  height: auto;
}

.preview-thumb .placeholder-thumb {
  width: 100%;
  aspect-ratio: 300 / 154;
  display: grid;
  place-items: center;
  font-size: 3rem;
  color: #b0c8df;
}

h1 {
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: clamp(1.3rem, 2.6vw, 2.2rem);
  line-height: 1.15;
  color: #184770;
}

.game-description {
  margin: 0;
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  color: var(--muted);
  font-weight: 600;
  line-height: 1.45;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.game-tags .tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #edf3ff;
  color: #3060a0;
  border: 1px solid #c4d8f0;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn {
  border: 1px solid;
  border-radius: 12px;
  padding: 0.55rem 0.85rem;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  min-width: 120px;
  transition: transform 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  border-color: #59cdc7;
  color: #fff;
  background: linear-gradient(110deg, var(--primary), var(--secondary));
}

.btn.secondary {
  border-color: #a8c2ed;
  color: #1f4fae;
  background: #edf3ff;
}

.btn.btn-sm {
  min-width: 0;
  font-size: 0.8rem;
  padding: 0.4rem 0.7rem;
}

.btn.disabled {
  border-color: #d5deea;
  color: #839bb4;
  background: #f5f8fc;
  pointer-events: none;
}

/* ── QR panel (right) ── */

.qr-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 1rem;
  display: grid;
  gap: 0.6rem;
  justify-items: center;
}

.join-prompt {
  margin: 0;
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.qr-shell {
  width: 100%;
  display: grid;
  place-items: center;
  background: #f5f9ff;
  border: 1px dashed #b8cfe6;
  border-radius: 14px;
  padding: 0.8rem;
}

.qr-code {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #d2deea;
  overflow: hidden;
}

.qr-code img,
.qr-code canvas {
  width: 100%;
  height: 100%;
  image-rendering: crisp-edges;
}

/* ── Status / footer ── */

.status {
  margin: 0;
  min-height: 1rem;
  font-size: 0.85rem;
  color: #57708a;
  font-weight: 700;
  text-align: center;
}

.status.warn {
  color: #a7650f;
}

.shortcuts {
  text-align: center;
  color: #5f7b95;
  font-size: 0.78rem;
  font-weight: 700;
}

/* ── Responsive ── */

@media (max-width: 800px) {
  .launch {
    width: min(1240px, calc(100% - 1rem));
    margin: 0.5rem auto;
    padding: 0.7rem;
  }

  .split-panel {
    grid-template-columns: 1fr;
  }

  .qr-panel {
    order: -1;
  }

  .qr-code {
    max-width: 320px;
  }

  .btn {
    min-width: 100px;
    flex: 1 1 140px;
  }
}
