/* ── Fill viewport with no scroll: header + footer keep natural size, container takes the rest ── */
/* Grid column/row counts come from PHP as --game-cols, --game-rows, --game-rows-3, --game-rows-2 (see game_mode.php) */
html, body {
  height: 100%;
  overflow: hidden;
}
body {
  display: flex;
  flex-direction: column;
  background: url('../../Webpic/bg_gamemode.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
.site-footer {
  flex-shrink: 0;
}
.container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 35px;
}
.container > header {
  flex-shrink: 0;
}
.section-title {
  flex-shrink: 0;
  margin-top: 16px;
  margin-bottom: 16px;
}
.game-mode-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--game-cols), 1fr);
  grid-template-rows: repeat(var(--game-rows), 1fr);
  gap: 45px;
}
.game-mode-card {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 22px;
  background: #06203f;
  cursor: pointer;
  outline-offset: 8px;
  text-decoration: none;
  color: inherit;
}
.game-mode-card-rim {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  padding: 24px 16px;
  border-radius: 22px;
  overflow: hidden;
  text-align: center;
  background: var(--surface);
  box-shadow:
    0 26px 0 rgb(0, 55, 70,1),
    0 20px 26px rgba(0,0,0,0.55);
  transition: transform 110ms ease, box-shadow 110ms ease, filter 150ms ease;
}
.game-mode-card:hover .game-mode-card-rim {
  transform: translateY(-3px);
  filter: brightness(1.1);
  box-shadow:
    0 29px 0 rgb(0, 55, 70,1),
    0 30px 32px rgba(0,0,0,0.6),
    0 0 30px 6px rgba(57, 212, 255, 0.55);
}
.game-mode-card:active .game-mode-card-rim {
  transform: translateY(18px);
  filter: brightness(0.92);
  box-shadow:
    0 8px 0 rgb(0, 55, 70,1),
    0 4px 10px rgba(0,0,0,0.5),
    0 0 18px 3px rgba(57, 212, 255, 0.55);
}
.game-mode-card:focus-visible .game-mode-card-rim {
  outline: 3px solid #35d4ff;
}
.game-mode-card-has-img .game-mode-card-rim {
  position: relative;
  padding: 0;
  justify-content: flex-end;
}
.game-mode-card-locked {
  cursor: not-allowed;
}
.game-mode-card-locked .game-mode-card-rim {
  filter: grayscale(0.2) brightness(0.3);
}
.game-mode-card-locked:hover .game-mode-card-rim,
.game-mode-card-locked:active .game-mode-card-rim {
  transform: none;
  filter: grayscale(0.2) brightness(0.3);
  box-shadow:
    0 26px 0 rgb(0, 55, 70,1),
    0 20px 26px rgba(0,0,0,0.55);
}
.game-mode-card-lock {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 30px;
  z-index: 3;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
  pointer-events: none;
}
.game-mode-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(16,112,148,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--accent);
  font-family: 'Bebas Neue', sans-serif;
}
.game-mode-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.game-mode-card-has-img .game-mode-card-name {
  position: relative;
  width: 100%;
  padding: 40px 16px 16px;
  color: #ffffff;
  background: linear-gradient(0deg, #005165 0%, rgba(0, 0, 0, 0) 100%);
}
.game-mode-card-name {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
@media (max-width: 1024px) {
  .game-mode-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(var(--game-rows-3), 1fr);
  }
}
@media (max-width: 640px) {
  .game-mode-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(var(--game-rows-2), 1fr);
  }
}
