:root {
  --bg: #091426;
  --panel: #10233e;
  --panel-2: #15375d;
  --text: #f5fbff;
  --muted: #a9c4dc;
  --cyan: #33d6ff;
  --gold: #ffd166;
  --danger: #ff5c7a;
  --green: #6bf2a5;
  --purple: #b98cff;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(51, 214, 255, 0.25), transparent 34%),
    linear-gradient(180deg, #07111f, #0b1728 48%, #050b14);
  color: var(--text);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

button,
.donate-link {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  color: #07111f;
  background: linear-gradient(135deg, var(--gold), #ff9f43);
  box-shadow: 0 10px 24px rgba(255, 209, 102, 0.25);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:active,
.donate-link:active {
  transform: translateY(1px) scale(0.99);
}

.donate-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: min(22rem, 92%);
  color: #07111f;
  background: linear-gradient(135deg, var(--gold), #ff9f43);
  box-shadow: 0 10px 24px rgba(255, 209, 102, 0.25);
  line-height: 1.2;
  text-decoration: none;
}

.shooter-events {
  width: min(100%, 27rem);
  margin-top: auto;
  padding: 0.62rem;
  border: 1px solid rgba(51, 214, 255, 0.18);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(11, 30, 52, 0.84), rgba(7, 17, 31, 0.7));
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

.shooter-events-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.shooter-events h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
}

.shooter-events a {
  color: var(--cyan);
  font-size: 0.74rem;
  font-weight: 800;
  text-decoration: none;
}

.shooter-events-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(9.35rem, 46%);
  gap: 0.6rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding-bottom: 0.22rem;
}

.shooter-event-item {
  min-height: 14.6rem;
  overflow: hidden;
  border: 1px solid rgba(245, 251, 255, 0.12);
  border-radius: 16px;
  background: rgba(245, 251, 255, 0.07);
  color: var(--text);
  scroll-snap-align: start;
}

.shooter-event-thumb {
  height: 11.7rem;
  background: rgba(51, 214, 255, 0.08);
}

.shooter-event-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.shooter-event-copy {
  padding: 0.42rem 0.55rem 0.55rem;
  text-align: left;
}

.shooter-event-title {
  display: -webkit-box;
  margin: 0 0 0.4rem;
  overflow: hidden;
  color: var(--text);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.shooter-event-cta {
  color: var(--cyan);
  font-size: 0.64rem;
  font-weight: 800;
}

.shell {
  width: min(100%, 520px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  display: grid;
  gap: 0.9rem;
  align-content: start;
}

.game-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: rgba(16, 35, 62, 0.78);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.36);
  overflow: hidden;
}

.hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(34px, 1fr)) repeat(3, 34px);
  align-items: center;
  gap: 0.36rem;
  padding: 0.62rem;
  background: linear-gradient(180deg, rgba(21, 55, 93, 0.92), rgba(16, 35, 62, 0.82));
}

.hud div {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.hud span {
  color: var(--muted);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hud strong {
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1;
}

.hud-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 0;
  min-height: 34px;
  padding: 0;
  color: var(--text);
  background: rgba(245, 251, 255, 0.12);
  border: 1px solid rgba(245, 251, 255, 0.16);
  box-shadow: none;
  font-size: 0.62rem;
  line-height: 1;
}

.hud-btn[aria-pressed="true"] {
  color: #07111f;
  background: var(--gold);
}

.canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: calc(100svh - 96px);
  background: #06101d;
  overflow: hidden;
  touch-action: none;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.8rem;
  padding: 1.3rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(7, 17, 31, 0.88), rgba(7, 17, 31, 0.68));
  backdrop-filter: blur(6px);
}

#pauseOverlay {
  z-index: 9;
  background: linear-gradient(180deg, rgba(7, 17, 31, 0.72), rgba(7, 17, 31, 0.58));
}

.overlay h1,
.overlay h2,
.overlay p {
  margin: 0;
}

.overlay h1,
.overlay h2 {
  color: var(--text);
  font-size: clamp(2rem, 10vw, 3.2rem);
  line-height: 0.95;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.28);
}

.overlay p {
  max-width: 20rem;
  color: var(--muted);
  line-height: 1.45;
}

.overlay small {
  max-width: 22rem;
  color: rgba(245, 251, 255, 0.68);
  line-height: 1.35;
}

#gameOverOverlay {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.55rem;
  padding: clamp(1.35rem, 5vh, 2.3rem) 1.05rem 0.9rem;
}

.game-over-summary {
  display: grid;
  justify-items: center;
  gap: 0.36rem;
  width: 100%;
}

#gameOverOverlay h2 {
  max-width: 24rem;
  font-size: clamp(1.18rem, 5.2vw, 1.72rem);
  line-height: 1.13;
}

#gameOverOverlay .donate-link,
#gameOverOverlay button {
  min-height: 42px;
  padding: 0.66rem 1.05rem;
}

#gameOverOverlay .donate-link {
  max-width: min(21rem, 94%);
  font-size: 0.82rem;
}

#gameOverOverlay small {
  margin-top: -0.08rem;
  font-size: 0.78rem;
}

@media (hover: hover) and (pointer: fine) {
  #gameOverOverlay .donate-link {
    min-height: 66px;
    max-width: min(19rem, 92%);
    padding: 0.78rem 1.2rem;
    font-size: inherit;
    line-height: 1.2;
    white-space: normal;
  }
}

.eyebrow {
  color: var(--cyan) !important;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cheat-trigger {
  cursor: pointer;
}

.god-alert {
  position: absolute;
  z-index: 8;
  top: 22%;
  left: 50%;
  width: min(20rem, calc(100% - 2rem));
  padding: 0.92rem 1rem;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(107, 242, 165, 0.48);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(11, 34, 34, 0.92), rgba(16, 35, 62, 0.84));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.36), 0 0 34px rgba(107, 242, 165, 0.2);
  text-align: center;
  pointer-events: none;
}

.god-alert strong {
  display: block;
  color: var(--green);
  font-size: clamp(1rem, 4.6vw, 1.34rem);
  line-height: 1.12;
  letter-spacing: 0.04em;
  text-shadow: 0 0 18px rgba(107, 242, 165, 0.28);
}

.boss-ui {
  position: absolute;
  z-index: 4;
  top: 10px;
  left: 14px;
  right: 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem;
  align-items: center;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

.boss-ui span {
  white-space: nowrap;
}

.boss-ui div {
  height: 10px;
  border: 1px solid rgba(245, 251, 255, 0.28);
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.62);
  overflow: hidden;
}

.boss-ui i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--danger), var(--gold));
  transform-origin: left center;
}

.boss-alert {
  position: absolute;
  z-index: 7;
  top: 42%;
  left: 50%;
  width: min(19rem, calc(100% - 2rem));
  padding: 1rem 1.1rem;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 209, 102, 0.5);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(7, 17, 31, 0.9), rgba(16, 35, 62, 0.82));
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.38), 0 0 34px rgba(255, 209, 102, 0.18);
  text-align: center;
}

.boss-alert p {
  margin: 0 0 0.32rem;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.boss-alert strong {
  display: block;
  color: var(--text);
  font-size: clamp(1.25rem, 6vw, 1.8rem);
  line-height: 1.05;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.28);
}

.power-ui {
  position: absolute;
  z-index: 4;
  top: 30px;
  left: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: 72%;
  pointer-events: none;
}

.power-chip {
  border-radius: 999px;
  padding: 0.28rem 0.5rem;
  color: #07111f;
  background: rgba(245, 251, 255, 0.88);
  font-size: 0.68rem;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.power-chip.god-chip {
  color: #07111f;
  background: linear-gradient(135deg, rgba(107, 242, 165, 0.96), rgba(51, 214, 255, 0.92));
  box-shadow: 0 10px 22px rgba(51, 214, 255, 0.22);
}

.bomb-hint {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  min-height: 38px;
  max-width: calc(100% - 34px);
  padding: 0.55rem 0.78rem;
  border: 1px solid rgba(245, 251, 255, 0.18);
  border-radius: 999px;
  color: var(--text);
  background: rgba(7, 17, 31, 0.62);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  pointer-events: none;
  text-align: center;
  backdrop-filter: blur(8px);
}

.bomb-hint-empty {
  opacity: 0.58;
}

.pause-pill {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  color: #07111f;
  background: rgba(245, 251, 255, 0.88);
  font-weight: 800;
}

.hidden {
  display: none !important;
}

.notes {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 0.9rem;
  background: rgba(16, 35, 62, 0.52);
}

.notes h2,
.notes p {
  margin: 0;
}

.notes h2 {
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.notes p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

code {
  color: var(--gold);
}

@media (max-width: 380px) {
  .hud {
    grid-template-columns: repeat(4, minmax(28px, 1fr)) repeat(3, 30px);
    gap: 0.25rem;
    padding: 0.5rem;
  }

  .hud-btn {
    width: 30px;
    min-height: 30px;
    font-size: 0.56rem;
  }

  .hud span {
    font-size: 0.5rem;
  }

  .hud strong {
    font-size: 0.9rem;
  }
}

@media (min-width: 760px) {
  .shell {
    padding-top: 22px;
  }

  .game-card {
    border-radius: 28px;
  }
}
