/*
  Josh's Custom CSS Reset
  https://www.joshwcomeau.com/css/custom-css-reset/
*/
*, *::before, *::after {box-sizing: border-box;}
* {margin: 0;}
img, picture, video, canvas, svg {display: block; max-width: 100%;}
input, button, textarea, select {font: inherit;}
p, h1, h2, h3, h4, h5, h6 {overflow-wrap: break-word;}
#root, #__next {isolation: isolate;}

/* ruphware palette & base */
:root {
  --navy: #0d1a26;
  --gold: #ecc569;
  --gold-2: #d3b361;
  --sand: #a99255;
  --olive: #6f6543;
  --text: #f5f5f5;
  --muted: #c7c7c7;
  --radius: 14px;
  --space: clamp(12px, 2vw, 24px);
  --maxw: 860px;
}

html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--navy);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

main {
	flex: 1 0 auto; /* grow to fill available vertical space */
	padding: 12px;
	user-select: none;
}

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover {
  color: var(--gold-2);
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space);
}

.skip {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip:focus {
  left: var(--space);
  top: var(--space);
  width: auto;
  height: auto;
  background: #000;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
}

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--space) * 1.5) var(--space) 0;
}

.logo {
  height: 128px;
  width: auto;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .2));
}

.hero {
  position: relative;
  padding: clamp(48px, 8vw, 96px) 0;
}

.hero h1 {
  margin: 0 0 12px 0;
  font-size: clamp(34px, 6vw, 64px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--gold);
}

.hero .sub {
  margin: 0 0 32px 0;
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--muted);
}

/* When counter is active, hide hero text and center the counter */
.hero.counter-active {
  display: grid;
  place-items: center;
}
.hero.counter-active > h1,
.hero.counter-active > .sub {
  display: none;
}

@media (max-width: 600px) {
  .hero {
    padding: 96px 0 56px;
    text-align: center;
  }
}

.site-foot {
  padding: 24px 0;
  color: #b9b9b9;
  font-size: 0.9rem;
  border-top: 1px solid rgba(236, 197, 105, 0.08);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.palette-info {
  color: #777;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.75em;
  opacity: 0.7;
}

.footer-email {
  color: var(--gold);
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.85em;
  opacity: 0.85;
}
.footer-email:hover {
  color: var(--gold-2);
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 600px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important
  }
}

.ant {
  position: fixed;
  width: 24px;
  height: 24px;
  transition: opacity 1s ease-in-out;
  background-image: url('assets/ant_topdown_walk_aligned.gif');
  cursor: pointer;
  background-size: cover;
  image-rendering: pixelated;
  z-index: 9999;
  /* More robust reset for hover/click effects */
  outline: none;
  border: none;
  text-decoration: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.ant.squashed {
  background-image: url('assets/ant-squash.png');
  background-size: 200% 200%; /* To make each quadrant fill the element */
  width: 31px;
  height: 31px;
  text-decoration: none; /* Ensure no underline on squashed state */
  border: none !important;
  outline: none !important;
}

/* Final override for any stubborn browser focus rings */
.ant:focus, .ant:active,
.ant.squashed:focus, .ant.squashed:active {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

/* Kill Counter */
.kill-counter {
  /* It is positioned via the parent .hero.counter-active grid */
  font-size: clamp(80px, 20vw, 200px);
  font-weight: bold;
  color: var(--gold);
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
  pointer-events: none;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  opacity: 0; /* hidden until first squish */
  transition: opacity 0.2s ease-in-out;
  display: none; /* hidden by default */
}

.kill-counter.visible { 
  display: block;
  opacity: 1; 
}

.kill-counter.show {
  animation: softPulse 1.2s ease-in-out;
}

@keyframes softPulse {
  0% { transform: scale(0.92); filter: drop-shadow(0 0 0 rgba(236,197,105,0)); }
  20% { transform: scale(1.08); filter: drop-shadow(0 0 18px rgba(236,197,105,0.25)); }
  80% { transform: scale(1.0); filter: drop-shadow(0 0 8px rgba(236,197,105,0.12)); }
  100% { transform: scale(0.98); filter: drop-shadow(0 0 0 rgba(236,197,105,0)); }
}

/* Game Over Screen */
.game-over {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease-in-out;
}

.game-over.hidden {
  opacity: 0;
  pointer-events: none;
}

.game-over-content {
  text-align: center;
  color: #fff;
}

.game-over-text {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: clamp(24px, 4vw, 32px);
  margin-bottom: 40px;
  color: #fff;
}

.game-over-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
}

/* Pixelated Buttons */
.pixel-btn {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 16px;
  font-weight: bold;
  padding: 12px 24px;
  border: 3px solid;
  background: none;
  cursor: pointer;
  text-transform: lowercase;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  transition: all 0.1s ease;
  min-width: 80px;
}

.pixel-btn-red {
  color: #ff4444;
  border-color: #ff4444;
  background: rgba(255, 68, 68, 0.1);
}

.pixel-btn-red:hover {
  background: #ff4444;
  color: #000;
  transform: scale(1.05);
}

.pixel-btn-blue {
  color: #4488ff;
  border-color: #4488ff;
  background: rgba(68, 136, 255, 0.1);
}

.pixel-btn-blue:hover {
  background: #4488ff;
  color: #000;
  transform: scale(1.05);
}


.pixel-btn-blue:hover {
  background: #4488ff;
  color: #000;
  transform: scale(1.05);
}
