:root {
  --bg-start: #4a2816;
  --bg-mid: #1d1b22;
  --bg-end: #07142e;
  --text: #e9edf4;
  --muted: #c7ced9;
  --accent: #f2ab58;
  --panel: rgba(10, 16, 28, 0.78);
  --panel-border: rgba(242, 171, 88, 0.65);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 560px at 8% 12%, rgba(242, 171, 88, 0.28), transparent 62%),
    radial-gradient(1000px 520px at 88% 86%, rgba(16, 44, 90, 0.34), transparent 64%),
    linear-gradient(130deg, var(--bg-start) 0%, var(--bg-mid) 34%, var(--bg-end) 100%);
}

.game_page {
  width: min(1140px, 94vw);
  margin: 20px auto 28px;
}

.top_links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.game_donate_link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0.52rem 0.95rem;
  border: 1px solid rgba(255, 196, 142, 0.5);
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(26, 18, 12, 0.9), rgba(10, 12, 17, 0.92));
  color: #ffd7ad;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 22px rgba(2, 6, 15, 0.35);
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease;
}

.game_donate_link:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 196, 142, 0.9);
  color: #ffe2c2;
}

.game_donate_link .material-symbols-outlined {
  font-size: 21px;
  color: #ffffff;
  font-variation-settings: "FILL" 0, "wght" 320, "GRAD" 0, "opsz" 24;
}

.game_donate_wrap {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 44;
  display: block;
  margin-top: 0;
}

.game_donate_link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid #005ea6;
  background: linear-gradient(180deg, #007fd1 0%, #0070ba 100%);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  box-shadow: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.game_donate_link:hover {
  transform: translateY(-1px);
  border-color: #005ea6;
  background: linear-gradient(180deg, #0089df 0%, #0078c8 100%);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 69, 129, 0.36);
  filter: none;
}

.game_donate_link .material-symbols-outlined {
  display: none;
}

.intro {
  margin-bottom: 16px;
}

.intro h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.01em;
}

.intro p {
  margin: 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.55;
  max-width: 860px;
}

.scroll_hint {
  display: none;
  margin: 0 0 10px;
  color: #ffd7ad;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.game_shell {
  position: relative;
  width: min(80vw, 1160px);
  max-width: min(80vw, 1160px);
  border: 1px solid rgba(145, 176, 230, 0.45);
  border-radius: 18px;
  padding: 12px 12px 72px;
  background: #010409;
  box-shadow: 0 20px 42px rgba(2, 6, 15, 0.45);
  overflow: hidden;
  box-sizing: border-box;
  margin: 0 auto;
}

.game_shell:fullscreen,
.game_shell:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #000;
  display: block;
  box-sizing: border-box;
}

.game_shell:fullscreen canvas,
.game_shell:-webkit-full-screen canvas {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 0;
  object-fit: fill;
  cursor: crosshair;
}

.game_shell:fullscreen .pause_fab,
.game_shell:-webkit-full-screen .pause_fab {
  top: max(14px, calc(env(safe-area-inset-top) + 8px));
}

.game_shell:fullscreen .fullscreen_fab,
.game_shell:-webkit-full-screen .fullscreen_fab {
  top: max(14px, calc(env(safe-area-inset-top) + 8px));
  right: max(14px, calc(env(safe-area-inset-right) + 8px));
}

.game_shell:fullscreen .mute_fab,
.game_shell:-webkit-full-screen .mute_fab {
  left: max(14px, calc(env(safe-area-inset-left) + 8px));
  bottom: max(14px, calc(env(safe-area-inset-bottom) + 8px));
}

.game_shell:fullscreen .volume_panel,
.game_shell:-webkit-full-screen .volume_panel {
  left: max(58px, calc(env(safe-area-inset-left) + 52px));
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px));
}

canvas {
  width: 100%;
  height: clamp(560px, 62vh, 820px);
  max-width: 100%;
  border: 1px solid rgba(136, 171, 230, 0.48);
  border-radius: 14px;
  background: linear-gradient(180deg, #050b1a 0%, #09152a 100%);
  display: block;
  cursor: crosshair;
  touch-action: none;
}

#hud {
  display: none;
}

.pause_fab {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 224, 186, 0.7);
  background: linear-gradient(140deg, rgba(44, 29, 20, 0.72), rgba(16, 27, 47, 0.72));
  color: #ffe4bf;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.34);
}

.pause_fab .material-symbols-outlined {
  font-size: 23px;
}

.fullscreen_fab {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 6;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 224, 186, 0.7);
  background: linear-gradient(140deg, rgba(44, 29, 20, 0.72), rgba(16, 27, 47, 0.72));
  color: #ffe4bf;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.34);
}

.fullscreen_fab .material-symbols-outlined {
  font-size: 23px;
}

.mute_fab {
  position: absolute;
  left: 22px;
  bottom: 22px;
  z-index: 6;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 224, 186, 0.7);
  background: linear-gradient(140deg, rgba(44, 29, 20, 0.72), rgba(16, 27, 47, 0.72));
  color: #ffe4bf;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.34);
}

.mute_fab .material-symbols-outlined {
  font-size: 23px;
}

.volume_panel {
  position: absolute;
  left: 72px;
  bottom: 26px;
  z-index: 6;
  width: 168px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 160, 0.6);
  background: linear-gradient(145deg, rgba(28, 19, 15, 0.78), rgba(10, 20, 38, 0.78));
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.34);
}

.volume_panel .material-symbols-outlined {
  font-size: 16px;
  color: #ffd7a2;
  font-variation-settings: "FILL" 0, "wght" 360, "GRAD" 0, "opsz" 24;
}

#volumeSlider {
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(243, 168, 89, 0.85), rgba(147, 197, 253, 0.72));
  outline: none;
}

#volumeSlider::-webkit-slider-thumb {
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(255, 221, 181, 0.9);
  background: #fff3dc;
  box-shadow: 0 0 0 3px rgba(242, 171, 88, 0.2);
  cursor: pointer;
}

#volumeSlider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(255, 221, 181, 0.9);
  background: #fff3dc;
  box-shadow: 0 0 0 3px rgba(242, 171, 88, 0.2);
  cursor: pointer;
}

.overlay_card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  width: min(560px, calc(100% - 44px));
  padding: 20px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 214, 160, 0.52);
  background: rgba(5, 10, 20, 0.8);
  backdrop-filter: blur(4px);
  text-align: center;
}

.overlay_card h2 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.overlay_card p {
  margin: 0;
  color: #cbd5e1;
}

.overlay_actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.overlay_actions button,
.pause_actions button {
  min-height: 40px;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255, 214, 160, 0.58);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(42, 30, 21, 0.72), rgba(16, 27, 47, 0.74));
  color: #ffe0b4;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.overlay_actions button:hover,
.pause_actions button:hover,
.pause_fab:hover,
.fullscreen_fab:hover,
.mute_fab:hover,
.volume_panel:hover,
.game_donate_link:hover {
  filter: brightness(1.07);
}

#restartBtn {
  display: none;
}

.pause_menu {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 7;
  width: min(480px, calc(100% - 44px));
  padding: 18px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 214, 160, 0.56);
  background: rgba(6, 12, 24, 0.88);
  backdrop-filter: blur(4px);
  text-align: center;
  display: none;
}

.pause_menu h3 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.pause_menu p {
  margin: 0;
  color: #cbd5e1;
}

.pause_actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.mobile_controls {
  display: none;
}

@media (max-width: 760px) {
  .game_page {
    width: 95vw;
    margin-top: 14px;
  }

  .top_links {
    gap: 8px;
    margin-bottom: 14px;
  }

  .game_donate_link {
    min-height: 38px;
    padding: 0.42rem 0.8rem;
    font-size: 0.82rem;
  }

  .intro p {
    font-size: 0.96rem;
  }

  .scroll_hint {
    display: block;
    margin: 0 0 8px;
    text-align: center;
  }

  .game_shell {
    width: 100%;
    max-width: 100%;
    min-height: 100svh;
    height: 100svh;
    padding: 8px 8px 110px;
    border-radius: 14px;
  }

  canvas {
    height: auto;
  }

  .pause_fab {
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 38px;
    height: 38px;
  }

  .fullscreen_fab {
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
  }

  .mute_fab {
    left: 14px;
    bottom: 14px;
    width: 38px;
    height: 38px;
  }

  .volume_panel {
    left: 58px;
    bottom: 18px;
    width: 142px;
    height: 30px;
    padding: 0 8px;
    gap: 6px;
  }

  .volume_panel .material-symbols-outlined {
    font-size: 14px;
  }

  .overlay_card h2 {
    font-size: 1.6rem;
  }

  .pause_menu h3 {
    font-size: 1.45rem;
  }

  .mobile_controls {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 8;
    display: flex;
    align-items: flex-end;
  }

  .mobile_actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .mobile_ctrl_btn {
    border: 1px solid rgba(255, 214, 160, 0.7);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(40, 27, 20, 0.86), rgba(11, 20, 36, 0.84));
    color: #ffe4bf;
    font: 700 0.9rem Outfit, Segoe UI, sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 14px rgba(0, 0, 0, 0.32);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }

  .mobile_ctrl_btn:active {
    filter: brightness(1.08);
  }

  .mobile_fire_btn {
    width: 84px;
    height: 52px;
    font-size: 0.95rem;
  }

  .mobile_full_btn {
    width: 84px;
    height: 36px;
    font-size: 0.8rem;
  }

  .top_links a[href*="paypal.com/donate"],
  .top_links a[href*="paypal.me"] {
    width: auto !important;
    max-width: none !important;
    padding: 0.42rem 0.8rem !important;
  }

  .game_donate_wrap {
    position: static;
    top: auto;
    right: auto;
    display: flex;
    justify-content: center;
    margin-top: 10px;
    margin-bottom: 12px;
  }

  .game_donate_link {
    width: min(100%, 290px);
    justify-content: center;
  }
}

