/* Mario-style platformer — fan homage, not affiliated with Nintendo */

:root {
  --mp-bg: #5c94fc;
  --mp-panel: #0f172a;
  --mp-text: #f8fafc;
  --mp-muted: #94a3b8;
  --mp-btn: #e5252a;
  --mp-btn-hover: #ff4d4d;
}

* {
  box-sizing: border-box;
}

body.mp-page {
  margin: 0;
  min-height: 100vh;
  background: var(--mp-bg);
  color: var(--mp-text);
  font-family: "Segoe UI", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 12px 24px;
}

.mp-page h1 {
  margin: 0 0 4px;
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #f0f9ff;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(147, 197, 253, 0.35);
}

.mp-disclaimer {
  font-size: 0.75rem;
  color: rgba(248, 250, 252, 0.85);
  max-width: 520px;
  text-align: center;
  margin: 0 0 12px;
  line-height: 1.4;
}

.mp-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

.mp-bar button,
.mp-bar a.btn-link {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 4px 0 #7f1d1d, 0 6px 16px rgba(0, 0, 0, 0.25);
}

.mp-bar button:hover,
.mp-bar a.btn-link:hover {
  background: var(--mp-btn-hover);
}

.mp-bar button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #8b1519;
}

.mp-hud {
  display: flex;
  gap: 16px;
  font-weight: 700;
  font-size: 0.95rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.mp-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 16px 48px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(59, 130, 246, 0.15);
  background: #0c1222;
  touch-action: none;
  max-width: min(100%, 720px);
  margin: 0 auto;
}

#gameCanvas {
  display: block;
  width: min(100vw - 24px, 720px);
  height: auto;
  vertical-align: middle;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.mp-touch {
  display: none;
  width: min(100vw - 24px, 720px);
  margin-top: 8px;
  gap: 8px;
  justify-content: space-between;
  user-select: none;
}

.mp-touch.show {
  display: flex;
}

.mp-touch button {
  flex: 1;
  min-height: 48px;
  font-size: 18px;
  font-weight: 800;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
}

.mp-touch button:active {
  background: rgba(229, 37, 42, 0.9);
}

.mp-help {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--mp-muted);
  text-align: center;
  max-width: 520px;
}

.mp-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  z-index: 15;
}

.mp-overlay .cmg-btn-yellow {
  display: inline-block;
  background: #f7ce46;
  color: #1a1505;
  font-weight: 800;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}
.mp-overlay .cmg-btn-yellow:hover {
  filter: brightness(1.08);
}

.mp-overlay h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.mp-overlay p {
  margin: 0 0 16px;
  font-size: 0.95rem;
  color: var(--mp-muted);
  max-width: 320px;
}

.mp-hidden {
  display: none !important;
}
