html, body { height: 100%; margin: 0; }

body {
  background-color: #242930;
  font-family: sans-serif;
  margin: 0;
  padding: 0;
  color: #afbac4;
  align-items: center;
}

.button-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1em;
}

button {
  font-family: sans-serif;
  color: #ffffff;
  background-color: #000000;
  border: 2px solid #48d597;
  border-radius: 8px; /* rounded corners */
  padding: 0.75em 1.5em; /* responsive spacing */
  text-align: center;
  font-size: 1rem; /* adjusts with media queries */
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  display: inline-block;
}

button:hover {
  background-color: #111111; /* subtle hover darkening */
}

button:active {
  transform: scale(0.98); /* small click effect */
}

.description {
  text-align: center;
  margin: 2rem auto;
  max-width: 600px;
  padding: 0 1rem;
  color: #afbac4;
}

.outer {
  width: 90vw;                 /* 90% of viewport width */
  max-width: 800px;            /* never bigger than desktop size */
  aspect-ratio: 8 / 12.14;     /* keeps proportion based on original 800×1214 */
  background: url("./card-background-SH-Edition.webp") center/cover no-repeat;
  display: grid;
  place-items: center;
  margin: auto;                /* center on small screens */
  border: #48d597;
  border-style: solid;
  border-radius: 25px;
}

.inner {
  margin-top: calc(22.63% + 11%);
  margin-left: 6.72%;
  margin-right: 2.2%;
  height: calc(100% - 22.63%);
  width: calc(100% - 8.92%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.8vw;                  /* scales with viewport */
  box-sizing: border-box;
}

.confetti {
  position: fixed;
  top: 0;
  width: 10px;
  height: 10px;
  background-color: red;
  opacity: 0.8;
  animation: fall linear forwards;
  z-index: 9999;
}

@keyframes fall {
  to {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0.9;
  }
}

.cell {
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(0,0,0,0.25);
  display: grid;
  place-items: center;
  text-align: center;
  font: 600 clamp(8px, 2vw, 15px) system-ui, sans-serif;
  min-width: 40px;
  min-height: 40px;
  padding: 0.2em;

  position: relative;      /* <-- key */
  overflow: hidden;        /* clip overlay edges */
}
.cell.checked {
}

.cell p {
  margin: 0;
  padding: 0.2em;
  word-break: break-word;
  hyphens: auto;
}

.cell:hover {
  animation: glow 1s ease-in-out infinite alternate;
}

.overlay {
  position: absolute;
  inset: 2px;
  margin: 2.5%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  z-index: 2;
  pointer-events: none;
}

.overlay svg {
  width: 50%;
  height: auto;
  stroke: #48d597;
  filter: drop-shadow(10px 10px 5px rgba(0,0,0,1));
}



@media (max-width: 500px) {
  button {
    font-size: 0.9rem; /* slightly smaller on mobile */
    padding: 0.6em 1.2em;
  }
  .outer {
    width: 100vw;
    height: auto;
    aspect-ratio: 8 / 12.14;
  }
  .inner {
    margin-top: calc(22.63% + 11%);
    margin-left: 6.72%;
    margin-right: 2.2%;
    height: calc(100% - 22.63%);
    width: calc(100% - 8.92%);

    gap: 1vw;
  }
  .cell {
    font-size: clamp(2vw, 2.25vw, 12px);
    aspect-ratio: 1 / 1;
    border: 1px solid rgba(0,0,0,0.25);
    display: grid;
    place-items: center;
    text-align: center;
    padding: 0.2em;
  }
  .cell.checked {
    content: "";
    background-image: url('oxide-check.svg');
    background-size: 50%;
    background-repeat: no-repeat;
    background-position: center;

  }
}


@keyframes glow {
  from {
    text-shadow:
        0 0 20px #fff,
        0 0 30px #122322,
        0 0 40px #122322,
        0 0 50px #122322,
        0 0 60px #122322,
        0 0 70px #122322,
        0 0 80px #122322;
  }
  to {

    text-shadow:
        0 0 10px #fff,
        0 0 20px #fff,
        0 0 30px #48d597,
        0 0 40px #48d597,
        0 0 50px #48d597,
        0 0 60px #48d597,
        0 0 70px #48d597;
  }
}