html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

body.dq7-bg {
  background-color: #000;
  color: #fff;
  font-family: 'Consolas', 'Courier New', monospace;
  /* Retro feel */
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
}

.main-container {
  max-width: 800px;
  width: 100%;
  padding: 0 10px;
}

/* DQ Dialog Box Style */
.dq-box {
  background-color: #000;
  border: 4px solid #fff;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 0 0 4px #000, 0 0 0 6px #fff;
  /* This creates the double border effect often seen in retro games */
}

@media (max-width: 576px) {
  .dq-box {
    padding: 10px;
    border-width: 2px;
    box-shadow: 0 0 0 2px #000, 0 0 0 4px #fff;
    /* Smaller border effect */
  }

  .dq-title {
    font-size: 1.5rem;
  }
}

.dq-title {
  text-align: center;
  color: #fff;
  margin-bottom: 20px;
  text-shadow: 2px 2px #000;
}

/* Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* grid-template-rows removed to allow auto-rows based on item count */
  gap: 10px;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .card-grid {
    gap: 4px;
    /* Smaller gap on mobile */
  }
}

.card-slot {
  background-color: #4a3b2a;
  /* Fallback */
  background-image: url('../images/dq7-card-back-image.jpg');
  background-size: 100% 100%;
  /* Force stretch to fit */
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid #fff;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  cursor: pointer;
  transition: transform 0.1s;
  position: relative;
  user-select: none;
  min-height: 80px;
  /* Prevent too small */
  aspect-ratio: 1/1;
  /* Keep them square */
  width: 100%;
}

@media (max-width: 768px) {
  .card-slot {
    min-height: 0;
    font-size: 1.2rem;
    border-width: 1px;
  }
}

.card-slot:hover {
  transform: scale(1.05);
  border-color: #ffcc00;
  /* Gold hover */
}

.card-slot.selected {
  border-color: #00ff00;
  box-shadow: 0 0 10px #00ff00;
}

.card-slot.matched {
  border-color: #ffff00;
}

/* Card Types */
.card-slot[data-type^="pair"] {
  background-image: none !important;
}

.card-slot[data-type="pair-1"] {
  background-color: #e74c3c;
  color: white;
}

/* Red */
.card-slot[data-type="pair-2"] {
  background-color: #3498db;
  color: white;
}

/* Blue */
.card-slot[data-type="pair-3"] {
  background-color: #2ecc71;
  color: white;
}

/* Green */
.card-slot[data-type="pair-4"] {
  background-color: #9b59b6;
  color: white;
}

/* Purple */
.card-slot[data-type="pair-5"] {
  background-color: #f1c40f;
  color: black;
}

/* Yellow */
.card-slot[data-type="pair-6"] {
  background-color: #e67e22;
  color: white;
}

/* Orange */
.card-slot[data-type="pair-7"] {
  background-color: #1abc9c;
  color: white;
}

/* Teal */
.card-slot[data-type="pair-8"] {
  background-color: #e84393;
  color: white;
}

/* Pink */
.card-slot[data-type="pair-9"] {
  background-color: #795548;
  color: white;
}

/* Brown */
.card-slot[data-type="pair-10"] {
  background-color: #34495e;
  color: white;
}

/* Navy */
.card-slot[data-type="pair-11"] {
  background-color: #c0ca33;
  color: black;
}

/* Lime */
.card-slot[data-type="pair-12"] {
  background-color: #00bcd4;
  color: white;
}

/* Cyan */
/* Coin - Yellow */
.card-slot[data-type="star"] {
  background-image: url('../images/dq7-chance-panel.png');
  background-size: 100% 100%;
  background-position: center;
  background-color: transparent;
  color: transparent;
  /* Hide text if image has it */
  border: none;
  /* Optional: remove border if image includes it, or keep for consistency */
}

/* Star - Orange */
.card-slot[data-type="slime"] {
  background-image: url('../images/dq7-shuffle-panel.png');
  background-size: 100% 100%;
  background-position: center;
  background-color: transparent;
  color: transparent;
  /* Hide text if image has it */
}

.card-text {
  font-weight: bold;
}

.status-panel {
  text-align: center;
  margin-top: 20px;
  font-size: 1.2rem;
}

.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
  /* Allow wrapping on small screens */
}

@media (max-width: 768px) {
  .controls .btn-dq {
    flex: 1 1 45%;
    /* Buttons take up ~half width */
    margin-bottom: 5px;
    font-size: 0.9rem;
  }
}

.btn-dq {
  background-color: #000;
  color: #fff;
  border: 2px solid #fff;
  padding: 5px 15px;
  font-family: inherit;
  cursor: pointer;
}

.btn-dq:hover {
  background-color: #fff;
  color: #000;
}