:root {
  --carnivore-bg: #ab1f3e;
  --carnivore-fg: #f0c3b6;

  --herbivore-bg: #abd37a;
  --herbivore-fg: #00594d;

  --biped-bg: #2ab256;
  --biped-fg: #00594d;

  --quadruped-bg: #c9a36f;
  --quadruped-fg: #5c462c;

  --aquatic-bg: #008491;
  --aquatic-fg: #9ecccc;

  --avian-bg: #35c5f2;
  --avian-fg: #e2f4fb;

  --triassic-bg: #e9e03d;
  --triassic-fg: #733f19;

  --jurassic-bg: #f3784f;
  --jurassic-fg: #5a0c0c;

  --cretaceous-bg: #7d2d90;
  --cretaceous-fg: #ddccde;
}


body {
  font-family: system-ui, sans-serif;
  padding: 16px;
  background: #f6f2eb;
}

h1 {
  margin-bottom: 12px;
}

#board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.tile {
  background: white;
  padding: 12px;
  border-radius: 10px;

  display: flex;
  align-items: center;
  gap: 12px;

  transition: opacity 0.2s;
}

.icon img {
  width: 48px;
  height: 48px;
}

.info {
  display: flex;
  flex-direction: column;

  flex: 1;              /* take remaining space */
  align-items: center;  /* center horizontally */
}


.count {
  font-size: 28px;
  font-weight: bold;
}

.set-value {
  font-size: 12px;
  opacity: 0.7;
}



.tile.absent {
  opacity: 0.25;
}

.tile.partial {
  opacity: 0.65;
}

.tile.complete {
  opacity: 1;
}


.tile .set-value {
  font-size: 12px;
  opacity: 0.7;
}


.count {
  font-size: 24px;
  font-weight: bold;
  margin-top: 6px;
}

#footer {
  margin-top: 20px;
}

#variety {
  opacity: 0.3;
  margin-bottom: 8px;
}

.variety-complete #variety {
  opacity: 1;
  font-weight: bold;
}

button {
  margin-top: 8px;
}

/* === Fossilis tile colour bindings === */

.tile.carnivore {
  background-color: var(--carnivore-bg);
  color: var(--carnivore-fg);
}

.tile.herbivore {
  background-color: var(--herbivore-bg);
  color: var(--herbivore-fg);
}

.tile.biped {
  background-color: var(--biped-bg);
  color: var(--biped-fg);
}

.tile.quadruped {
  background-color: var(--quadruped-bg);
  color: var(--quadruped-fg);
}

.tile.aquatic {
  background-color: var(--aquatic-bg);
  color: var(--aquatic-fg);
}

.tile.avian {
  background-color: var(--avian-bg);
  color: var(--avian-fg);
}

.tile.triassic {
  background-color: var(--triassic-bg);
  color: var(--triassic-fg);
}

.tile.jurassic {
  background-color: var(--jurassic-bg);
  color: var(--jurassic-fg);
}

.tile.cretaceous {
  background-color: var(--cretaceous-bg);
  color: var(--cretaceous-fg);
}

/* === Dashboard === */

#dashboard {
  margin-top: 20px;
  padding: 12px;

  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr auto;
  align-items: stretch;
  gap: 12px;

  background: rgba(0, 0, 0, 0.05);
  border-radius: 16px;
}


#dashboard .label {
  font-size: 12px;
  opacity: 0.7;
}

#variety-panel .value {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.8;
}


#variety-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.variety-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.variety-title {
  font-size: 14px;
  font-weight: 600;
  color: #000;
}

.variety-points {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.6;
}


#variety-icons {
  display: flex;
  gap: 6px;
}


#score-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

#score {
  font-size: 36px;
  font-weight: bold;
}


#reset {
  background: none;
  border: none;

  font-size: 32px;
  line-height: 1;
  cursor: pointer;

  padding: 0 16px;
  margin: 4px 0;

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0.5;
}

#reset:hover {
  opacity: 1;
}

#variety-icons img {
  width: 20px;
  height: 20px;

  opacity: 1;
  transition: opacity 0.2s;
}



/* === Confetti === */

/* === Confetti === */

.confetti {
  position: fixed;
  width: var(--size, 10px);
  height: var(--size, 10px);
  border-radius: 2px;
  pointer-events: none;
  z-index: 9999;

  transform: translate(-50%, -50%);
  animation: confetti-fly var(--dur, 1400ms) ease-out forwards;
}

@keyframes confetti-fly {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) translate(0, 0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) rotate(var(--rot));
  }
}


/* === Mobile tweaks === */
@media (max-width: 700px) {
  /* make the big tile icons smaller */
  .icon img {
    width: 32px !important;
    height: 32px !important;
  }

  /* tighten the tile layout so text has room */
  .tile {
    padding: 10px;
    gap: 10px;
  }

  .count {
    font-size: 22px;
  }

  .set-value {
    font-size: 11px;
  }
  /* === Dashboard mobile layout === */
@media (max-width: 700px) {
  #dashboard {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "variety variety"
      "score reset";
    align-items: stretch;
  }

  #variety-panel {
    grid-area: variety;
  }

  /* Let the mini icons wrap instead of exploding sideways */
  #variety-icons {
    flex-wrap: wrap;
  }

  /* Row 3: Score on the left, styled like a “tile” */
  #score-panel {
    grid-area: score;

    /* override the desktop centered stack */
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;

    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.04);
  }

  #score {
    font-size: 40px;
    line-height: 1;
  }

  /* Row 3: Reset on the right, same “tile” feel */
  #reset {
    grid-area: reset;

    width: 72px;
    padding: 12px 14px;
    margin: 0;

    border-radius: 14px;
    background: rgba(0, 0, 0, 0.04);

    font-size: 40px;
    line-height: 1;
  }
}

}
button,
.tile {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none; /* kills long-press copy menu on iOS */
}



