/* Layout for a 3x3 responsive grid */
.qr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.2rem;
}

.qr-tile {
  position: relative;
  aspect-ratio: 1 / 1;           /* Perfect square tiles */
  border-radius: .75rem;
  overflow: hidden;
  box-shadow: 0 .125rem .5rem rgba(0,0,0,.12);
  border: 1px solid rgba(0,0,0,.08);
  background: #fff;
  cursor: pointer;
  transition: transform .08s ease-in-out, box-shadow .2s ease-in-out;
}

.qr-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 .25rem .85rem rgba(0,0,0,.18);
}

.qr-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.qr-label {
    position: absolute;
    left: -0.05em;
    bottom: -0.05em;
    background: rgba(0, 31, 96, .6);
    color: #fff;
    font-size: .85rem;
    padding: .15rem .45rem;
    border-radius: 0 1rem 0 0;
    text-align: left;
}

.qr-tile.solved {
  cursor: default;
  outline: 3px solid #199ca7; /* Bootstrap success */
}

/* Check overlay when solved */
.qr-tile.solved::after {
  content: "✔";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(3rem, 15vw, 5rem);
  font-weight: 800;
  color: #199ca7;
  background: rgba(25, 135, 84, 0.08);
  text-shadow: 0 2px 0 rgba(0,0,0,.25);
}

/* Keep the green ring even when the button is focused/active */
.qr-tile.solved,
.qr-tile.solved:focus,
.qr-tile.solved:focus-visible,
.qr-tile.solved:active {
  outline: 3px solid #199ca7 !important; /* beats Bootstrap reset */
  outline-offset: 0;
}

/* SweetAlert modal scan area */
#swal-scan-wrap {
  margin-top: .5rem;
  display: grid;
  gap: .5rem;
}

#swal-qr-region {
  width: min(420px, 80vw);
  height: min(420px, 80vw);
  margin-inline: auto;
  border-radius: .5rem;
  overflow: hidden;
  background: #000;
}

.swal2-actions .swal2-confirm {
  min-width: 140px;
}

.navbar-brand img {
    height: 24px;
    margin: 0 7px 5px 0;
}

.qr-tile .mystery {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2rem, 12vw, 4rem);
  font-weight: bold;
  color: rgba(0, 0, 0, 0.6);
  background: rgba(0, 0, 0, 0.05);
}