html.launcher-page,
html:has(body.launcher-page) {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

body.launcher-page {
  align-items: center;
  background-color: var(--bg-base);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  font-family: var(--font-main);
  justify-content: flex-start;
  margin: 0;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  padding: 0;
  position: relative;
  width: 100%;
}

body.launcher-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(circle at 12% 14%, var(--page-glow-blue), transparent 42%),
    radial-gradient(circle at 88% 18%, var(--page-glow-red), transparent 44%),
    radial-gradient(circle at 50% 88%, var(--page-glow-yellow), transparent 48%),
    radial-gradient(var(--grid-line) 1.5px, transparent 1.5px),
    linear-gradient(180deg, var(--bg-warm) 0%, var(--bg-base) 100%);
  background-size:
    auto,
    auto,
    auto,
    28px 28px,
    auto;
  background-repeat:
    no-repeat,
    no-repeat,
    no-repeat,
    repeat,
    no-repeat;
  pointer-events: none;
}

.launcher-shell {
  margin: auto 0;
  padding: clamp(28px, 6vh, 60px) 0 clamp(24px, 5vh, 44px);
  position: relative;
  width: min(1080px, calc(100% - 48px));
  z-index: 1;
}

.launcher-header {
  margin-bottom: clamp(24px, 4.5vh, 44px);
}

.category-back {
  align-items: center;
  color: var(--text-primary);
  display: inline-flex;
  font-size: 0.88rem;
  font-weight: 800;
  gap: 10px;
  margin-bottom: 22px;
  min-height: 52px;
  padding: 8px 18px 8px 14px;
  text-decoration: none;
}

.launcher-return {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-soft);
  color: var(--text-primary);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.launcher-return span {
  font-size: 1.25rem;
  line-height: 1;
  color: var(--accent-blue);
  transition: transform 180ms ease;
}

.launcher-return:hover,
.launcher-return:focus-visible {
  border-color: var(--accent-blue);
  box-shadow: 0 10px 24px var(--accent-blue-glow);
  outline: none;
  transform: translateY(-3px);
}

.launcher-return:hover span {
  transform: translateX(-3px);
}

.launcher-return:active {
  transform: translateY(0) scale(0.98);
}

.launcher-header-row {
  align-items: flex-end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
}

.launcher-header h1 {
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.15;
  color: var(--text-primary);
}

.launcher-status {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.launcher-status span {
  background: var(--accent-mint);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-mint-glow);
  height: 9px;
  width: 9px;
}

.portal-badge {
  align-items: center;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-card);
  color: var(--text-primary);
  display: inline-flex;
  gap: 14px;
  min-height: 64px;
  padding: 8px 24px 8px 12px;
  position: relative;
  text-decoration: none;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms ease, border-color 200ms ease;
  white-space: nowrap;
}

.portal-badge:hover,
.portal-badge:focus-visible {
  border-color: var(--portal-accent);
  box-shadow: 0 14px 34px var(--portal-glow);
  outline: none;
  transform: translateY(-3px);
}

.portal-badge:active {
  transform: translateY(0) scale(0.98);
}

.portal-badge-ping {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 7px;
  height: 7px;
  background: var(--portal-accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--portal-accent);
}

.portal-badge-icon {
  align-items: center;
  background: var(--portal-accent-soft);
  border-radius: 50%;
  display: flex;
  font-size: 1.45rem;
  height: 48px;
  justify-content: center;
  transition: transform 220ms ease;
  width: 48px;
}

.portal-badge:hover .portal-badge-icon {
  transform: scale(1.1) rotate(8deg);
}

.portal-badge-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.portal-badge-tag {
  color: var(--portal-accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.portal-badge-url {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.portal-badge-arrow {
  color: var(--portal-accent);
  font-size: 1.25rem;
  font-weight: 800;
  transition: transform 200ms ease;
}

.portal-badge:hover .portal-badge-arrow {
  transform: translate(2px, -2px);
}

.game-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.game-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 28px;
  position: relative;
  text-decoration: none;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 220ms ease, border-color 220ms ease;
  overflow: hidden;
}

.game-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-mint));
  opacity: 0;
  transition: opacity 220ms ease;
}

.game-card:nth-child(2)::after {
  background: linear-gradient(90deg, var(--accent-pink), var(--accent-yellow));
}

.game-card:nth-child(3)::after {
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue));
}

.game-card:not(.game-card-locked):hover,
.game-card:not(.game-card-locked):focus-visible {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-hover);
  outline: none;
  transform: translateY(-4px);
}

.game-card:not(.game-card-locked):hover::after {
  opacity: 1;
}

.game-card:active {
  transform: translateY(-1px) scale(0.99);
}

.game-card-index {
  align-self: flex-start;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 5px 12px;
}

.game-card strong {
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  font-weight: 900;
  letter-spacing: -0.3px;
  margin-top: auto;
  color: var(--text-primary);
}

.game-card-icon {
  align-items: center;
  background: var(--accent-blue-soft);
  border-radius: var(--radius-md);
  display: flex;
  font-size: 2rem;
  height: 64px;
  justify-content: center;
  margin: 18px 0 10px;
  width: 64px;
  transition: transform 220ms ease;
}

.game-card:nth-child(2) .game-card-icon {
  background: var(--accent-yellow-soft);
}

.game-card:nth-child(3) .game-card-icon {
  background: var(--accent-mint-soft);
}

.game-card:hover .game-card-icon {
  transform: scale(1.08) rotate(4deg);
}

.game-card > span:not(.game-card-index):not(.launch-label):not(.game-card-icon) {
  color: var(--text-muted);
  font-size: 0.94rem;
  font-weight: 600;
  margin-top: 6px;
  line-height: 1.4;
}

.launch-label {
  align-items: center;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  display: inline-flex;
  font-size: 0.84rem;
  font-weight: 800;
  gap: 8px;
  margin-top: 24px;
  padding: 8px 16px;
  width: fit-content;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.launch-label b {
  font-weight: 800;
}

.game-card:hover .launch-label {
  background: var(--accent-blue);
  color: #FFFFFF;
  transform: translateX(4px);
}

.game-card-locked {
  opacity: 0.65;
  cursor: not-allowed;
}

.launcher-footer {
  align-items: center;
  border-top: 1.5px dashed var(--border-medium);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin-top: clamp(28px, 5vh, 48px);
  padding-top: 22px;
}

.launcher-footer-notice,
.launcher-footer-copy {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.launcher-footer-copy {
  color: var(--text-primary);
  font-weight: 800;
  background: var(--bg-surface);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-soft);
  border: 1.5px solid var(--border-subtle);
}

.launcher-footer-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lang-toggle-btn {
  align-items: center;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-soft);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  gap: 6px;
  min-height: 38px;
  min-width: auto;
  padding: 6px 14px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, color 180ms ease;
}

.lang-toggle-btn:hover,
.lang-toggle-btn:focus-visible {
  border-color: var(--accent-blue);
  box-shadow: 0 6px 18px var(--accent-blue-glow);
  color: var(--badge-text);
  outline: none;
  transform: translateY(-2px);
}

.lang-toggle-btn:active {
  transform: translateY(0) scale(0.98);
}

.launcher-footer-divider {
  display: none;
}

@media (max-width: 760px) {
  .launcher-shell {
    width: min(100% - 32px, 540px);
    padding-bottom: 40px;
  }

  .launcher-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .portal-badge {
    width: 100%;
    justify-content: space-between;
  }

  .game-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .game-card {
    min-height: 200px;
    padding: 22px;
  }

  .launcher-footer {
    align-items: center;
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}