:root {
  --bg: #0B0E14;
  --amber: #E5A93C;
  --slate: #243346;
  --ice: #E6EDF3;
  --pixel: 'Press Start 2P', ui-monospace, 'Courier New', monospace;
  --body: 'VT323', ui-monospace, 'Courier New', monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  background: var(--bg);
}

body {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  overflow-x: hidden;
  color: var(--ice);
  font-family: var(--body);
  font-size: 1.5rem;
  line-height: 1.25;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(36, 51, 70, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 51, 70, 0.35) 1px, transparent 1px);
  background-size: 32px 32px;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(11, 14, 20, 0) 35%, rgba(11, 14, 20, 0.92) 100%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 0, rgba(0, 0, 0, 0.12) 2px, transparent 2px, transparent 4px);
}

.panel {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  margin: 10px;
  padding: clamp(28px, 6vw, 56px) clamp(18px, 5vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(22px, 4.5vw, 34px);
  text-align: center;
  background: rgba(11, 14, 20, 0.88);
  border: 4px solid var(--slate);
  border-radius: 16px;
  box-shadow: 0 0 0 6px var(--bg), 0 0 0 8px var(--slate);
}

.logo {
  display: block;
  width: clamp(150px, 46vw, 220px);
  height: auto;
  filter: drop-shadow(4px 4px 0 var(--amber));
}

.title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  font-family: var(--pixel);
  font-weight: 400;
}

.name {
  display: block;
  font-size: clamp(0.8rem, 4vw, 1.25rem);
  letter-spacing: 0.1em;
  color: var(--ice);
}

.status {
  display: block;
  font-size: clamp(1.15rem, 6vw, 2.2rem);
  line-height: 1.3;
  color: var(--amber);
  text-shadow: 3px 3px 0 var(--slate);
}

.track {
  width: 100%;
  padding: 0 8px;
  border: 4px solid var(--slate);
  border-radius: 28px;
  background: var(--bg);
}

.lane {
  position: relative;
  height: 44px;
}

.dots {
  position: absolute;
  inset: 0;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dot {
  display: block;
  width: 6px;
  height: 6px;
  background: var(--ice);
}

.dot.pellet {
  width: 12px;
  height: 12px;
}

.dot.eaten {
  visibility: hidden;
}

.chomper {
  position: absolute;
  top: 8px;
  left: 0;
  width: 28px;
  height: 28px;
  background: var(--amber);
  clip-path: polygon(50% 50%, 100% 48%, 70% 0%, 30% 0%, 0% 30%, 0% 70%, 30% 100%, 70% 100%, 100% 52%);
  animation: chomp 0.28s steps(1, end) infinite alternate;
  will-change: transform;
}

.chomper::after {
  content: '';
  position: absolute;
  top: 18%;
  left: 52%;
  width: 4px;
  height: 4px;
  background: var(--bg);
}

@keyframes chomp {
  from {
    clip-path: polygon(50% 50%, 100% 48%, 70% 0%, 30% 0%, 0% 30%, 0% 70%, 30% 100%, 70% 100%, 100% 52%);
  }
  to {
    clip-path: polygon(50% 50%, 100% 30%, 70% 0%, 30% 0%, 0% 30%, 0% 70%, 30% 100%, 70% 100%, 100% 70%);
  }
}

.copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-wrap: balance;
}

.copy p {
  font-size: clamp(1.4rem, 5vw, 1.75rem);
}

.copy .sub {
  color: rgba(230, 237, 243, 0.72);
  font-size: clamp(1.2rem, 4.2vw, 1.5rem);
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 0.9em;
  margin-left: 0.3em;
  vertical-align: -0.1em;
  background: var(--amber);
  animation: blink 1s steps(1, end) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@media (max-width: 380px) {
  body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .panel {
    margin: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chomper,
  .cursor {
    animation: none;
  }
}
