body.game-page {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  touch-action: manipulation;
}

body.game-page header.site-header {
  padding: 10px 20px;
  flex-shrink: 0;
}

body.game-page header.site-header a {
  font-size: 1.1rem;
}

body.game-page main.wide {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 20px;
}

body.game-page .page-meta {
  flex-shrink: 0;
}

body.game-page .page-meta h1 {
  font-size: 1.2rem;
  margin: 0 0 2px;
}

body.game-page .page-meta .subtitle {
  font-size: 0.8rem;
  margin: 0;
}

body.game-page footer {
  display: none;
}

.game-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}

.game-wrap:fullscreen {
  background: #062338;
}

#game {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  background: #062338;
  border-radius: 6px;
  border: 1px solid #334155;
  touch-action: manipulation;
}

.hud-buttons {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 10px;
  z-index: 5;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.icon-btn:hover {
  background: rgba(15, 23, 42, 0.8);
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  border-radius: 8px;
  cursor: pointer;
}

.overlay-content {
  text-align: center;
  color: #fff;
  padding: 16px;
}

.overlay-content h2 {
  margin: 0 0 8px;
}

.overlay-content p {
  margin: 4px 0;
}

.best-score {
  color: #facc15;
  font-weight: 700;
}

#pause-overlay {
  cursor: default;
}

.pause-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  justify-content: center;
}

.pause-btn {
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}

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

.pause-btn.resume {
  background: #38bdf8;
  color: #0f172a;
}

.pause-btn.resume:hover {
  background: #7dd3fc;
}

.pause-btn.exit {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.pause-btn.exit:hover {
  background: rgba(255, 255, 255, 0.22);
}

.hidden {
  display: none !important;
}

.rotate-hint {
  display: none;
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  font-size: 0.75rem;
  padding: 6px 14px;
  border-radius: 999px;
  z-index: 4;
  white-space: nowrap;
}

@media (max-width: 640px) {
  body.game-page header.site-header {
    padding: 8px 14px;
  }

  body.game-page header.site-header a {
    font-size: 0.95rem;
  }

  body.game-page main.wide {
    padding: 8px 10px;
  }

  body.game-page .page-meta h1 {
    font-size: 1rem;
  }

  body.game-page .page-meta .subtitle {
    font-size: 0.7rem;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .hud-buttons {
    top: 8px;
    right: 8px;
    gap: 6px;
  }

  .pause-buttons {
    flex-wrap: wrap;
  }

  .pause-btn {
    padding: 10px 18px;
    font-size: 0.9rem;
  }
}

@media (max-width: 640px) and (orientation: portrait) {
  .rotate-hint {
    display: block;
  }
}
