:root {
  --bg: #4f6bff;
  --bg2: #6a4dff;
  --ink: #1d2433;
  --paper: #ffffff;
  --gold: #ffd166;
  --tile: 180px;
  --gap: 16px;
  --radius: 18px;
  --shadow: 0 6px 18px rgba(20, 24, 60, 0.28);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--paper);
  background-color: var(--bg);
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.09) 2px, transparent 2px),
    linear-gradient(160deg, var(--bg) 0%, var(--bg2) 100%);
  background-size: 28px 28px, 100% 100%;
  background-attachment: fixed;
}

a { color: inherit; }

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

/* Grid: uniform square tiles, like a game portal. */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, var(--tile));
  grid-auto-rows: var(--tile);
  gap: var(--gap);
  justify-content: center;
}

.tile {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile .name {
  position: absolute;
  inset: auto 0 0 0;
  padding: 28px 12px 10px;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.2;
  background: linear-gradient(transparent, rgba(16, 18, 40, 0.85));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

a.tile:hover, a.tile:focus-visible {
  transform: scale(1.05);
  box-shadow: 0 12px 28px rgba(20, 24, 60, 0.4);
  outline: none;
}

a.tile:hover .name, a.tile:focus-visible .name { opacity: 1; transform: none; }

/* On touch screens there is no hover: always show the name. */
@media (hover: none) {
  .tile .name { opacity: 1; transform: none; }
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  background: var(--ink);
  text-align: center;
}

.brand img { width: auto; height: 96px; object-fit: contain; }

.brand span { font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, 0.75); }

/* Game page */
.player {
  max-width: 1100px;
  margin: 8px auto 28px;
}

.top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 auto 16px;
  max-width: 1100px;
}

.home {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  background: var(--ink);
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.home img { height: 36px; width: auto; }

.frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0f1226;
  box-shadow: 0 16px 40px rgba(10, 12, 40, 0.45);
}

.frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px 10px 16px;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.bar h1 { margin: 0; font-size: 22px; font-weight: 900; }

.bar p { margin: 2px 0 0; font-size: 15px; color: #4a5266; }

.btn {
  flex: none;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: var(--bg);
  color: var(--paper);
  font: inherit;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 0 #3346c9;
}

.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #3346c9; }

h2 { margin: 0 0 14px; font-size: 20px; font-weight: 900; text-align: center; }

footer {
  margin-top: 40px;
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

@media (max-width: 640px) {
  :root { --tile: 150px; --gap: 12px; }
  .bar { flex-wrap: wrap; }
  .bar h1 { font-size: 19px; }
}

@media (max-width: 360px) {
  :root { --tile: 136px; }
}
