:root {
  --shell-bg: rgba(17, 9, 14, 0.34);
  --shell-border: rgba(255, 244, 230, 0.16);
  --text-strong: #fff8ef;
  --text-soft: rgba(255, 243, 230, 0.82);
  --card-shadow: 0 28px 70px rgba(16, 5, 10, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
  color: var(--text-strong);
  background:
    linear-gradient(180deg, rgba(18, 7, 10, 0.28) 0%, rgba(16, 8, 11, 0.42) 100%),
    url("/assets/icons/lobby-stage.jpg") center center / cover no-repeat fixed;
}

body {
  overflow-x: hidden;
}

.lobby-page {
  min-height: 100vh;
  padding: clamp(10px, 1vw, 18px);
}

.lobby-shell {
  width: 100%;
  min-height: calc(100vh - clamp(20px, 2vw, 36px));
  margin: 0;
  padding: clamp(18px, 2vw, 32px);
  border-radius: 30px;
  border: 1px solid var(--shell-border);
  background: linear-gradient(180deg, rgba(38, 11, 16, 0.18), var(--shell-bg));
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(5px);
}

.lobby-header {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: clamp(120px, 15vh, 180px);
}

.brand-logo {
  position: relative;
  width: clamp(120px, 11vw, 180px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.brand-logo-ring,
.brand-logo-core {
  position: absolute;
  inset: 0;
  border-radius: 34px;
}

.brand-logo-ring {
  background: linear-gradient(135deg, rgba(255, 245, 226, 0.34), rgba(255, 240, 222, 0.06));
  transform: rotate(-8deg);
}

.brand-logo-core {
  inset: 12%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(255, 222, 149, 0.94), rgba(255, 141, 107, 0.92));
  color: #402214;
  font-size: clamp(18px, 1.4vw, 24px);
  font-weight: 900;
  letter-spacing: 0.06em;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.24);
}

.games-section {
  margin-top: 4px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(14px, 1.2vw, 22px);
}

.game-tile {
  min-width: 0;
}

.game-link {
  display: grid;
  grid-template-rows: 1fr auto;
  aspect-ratio: 1 / 1;
  height: 100%;
  padding: clamp(12px, 1vw, 18px);
  border-radius: 28px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, rgba(255, 248, 240, 0.16), rgba(255, 248, 240, 0.08));
  border: 1px solid rgba(255, 246, 234, 0.16);
  box-shadow: 0 20px 48px rgba(10, 4, 8, 0.28);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.game-link:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 248, 238, 0.28);
  box-shadow: 0 26px 56px rgba(10, 4, 8, 0.34);
}

.game-visual {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.visual-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.game-tile-rps .game-visual {
  background: linear-gradient(135deg, rgba(255, 177, 118, 0.94), rgba(255, 110, 134, 0.92));
}

.game-tile-rps .visual-glow {
  background:
    radial-gradient(circle at 24% 26%, rgba(255, 255, 255, 0.48), transparent 24%),
    radial-gradient(circle at 74% 72%, rgba(255, 255, 255, 0.2), transparent 28%);
}

.game-tile-balloon .game-visual {
  background: linear-gradient(135deg, rgba(107, 211, 255, 0.96), rgba(116, 255, 191, 0.9));
}

.game-tile-balloon .visual-glow {
  background:
    radial-gradient(circle at 24% 26%, rgba(255, 255, 255, 0.5), transparent 24%),
    radial-gradient(circle at 76% 74%, rgba(255, 255, 255, 0.18), transparent 28%);
}

.game-icon-image {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: clamp(6px, 0.5vw, 10px);
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.18));
}

.game-meta {
  display: grid;
  gap: 4px;
  padding-top: 12px;
}

.game-meta h2 {
  margin: 0;
  font-size: clamp(18px, 1.35vw, 28px);
  line-height: 1.15;
}

.game-meta p {
  margin: 0;
  font-size: clamp(13px, 0.95vw, 16px);
  color: var(--text-soft);
}

@media (max-width: 1480px) {
  .game-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .game-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  html,
  body {
    background-attachment: scroll;
  }

  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .lobby-page {
    padding: 8px;
  }

  .lobby-shell {
    min-height: calc(100vh - 16px);
    padding: 14px;
    border-radius: 22px;
  }

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