/* Guess The Number Challenge Styles */

.guess-number-section {
  max-width: 780px;
  margin: 20px auto 0 auto;
  padding: 24px;
  background: #FAE9D5;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.74);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.guess-number-section::before {
  content: '';
  position: absolute;
  inset: -2px;
  filter: blur(0.2px);
  pointer-events: none;
  opacity: 0.9;
}

.guess-number-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0) 40%);
  pointer-events: none;
  opacity: 0.55;
}

.feedback {
  margin-bottom: 16px;
  text-align: center;
  color: #7c4b01;
  font-family: "Clash";
  font-weight: 500;
  font-size: 1rem;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* feedback status colors (keep these local to this file) */
.feedback.up {
  color: #ff0800;
}

.feedback.down {
  color: #0093f5;
}

.feedback.correct {
  color: #00ac48;
}

.gn-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center !important;
  justify-content: center !important;
  backdrop-filter: blur(8px);
  z-index: 30;
}

.gn-overlay-card {
  width: min(420px, calc(100% - 48px));
  background: rgba(255, 255, 255, 0.92);
  border-radius: 22px;
  padding: 22px 22px 20px;
  text-align: center;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
}

/* Force overlay card centering as a fallback if other rules interfere */
.gn-overlay>.gn-overlay-card,
.gn-overlay>.qm-overlay-card {
  margin: auto;
  align-self: center !important;
}

.gn-overlay-title {
  font-family: "Clash";
  font-size: 2.1rem;
  font-weight: 900;
  color: #0d1020;
  letter-spacing: 0.01em;
}

.gn-score-label {
  margin-top: 16px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(13, 16, 32, 0.55);
}

.gn-score {
  margin-top: 6px;
  font-size: 4.1rem;
  font-weight: 900;
  line-height: 1;
  color: #0d1020;
  font-family: "Clash", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  font-weight: 900;
}

.gn-input {
  width: 120px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(0, 0, 0, 0.267);
  padding: 12px;
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.04);
}

.gn-input-boxes {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1px;
  min-height: 24px;
}

.gn-digit-box {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Clash';
  font-size: 1.5rem;
  font-weight: 900;
  color: #111;
}

.option-btn {
  border-radius: 12px;
  background: #fd4242;
  padding: 15px;
  color: #fdfdfd;
  font-family: "Clash";
  font-weight: 900;
  font-size: 1.2rem;
  border: 0.1rem solid #ff7676;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  position: relative;
}

/* remove blinking caret and style placeholder */
/* (removed - no longer using input element) */

.history {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  max-height: 100px;
  overflow-y: auto;
  justify-content: center;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 1.8rem;
  padding: 2px 6px;
  /* background: rgba(255, 255, 255, 0); */
  border-radius: 6px;
}

.history-guess {
  font-family: "Clash";
  color: #000;
}

.history-status {
  min-width: 60px;
  text-align: center;
  color: #fff;
  padding: 2px 6px;
  display: inline-block;
  font-family: "Clash";
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.history-status.up {
  color: #ff0800;
}

.history-status.down {
  color: #0093f5;
}

.history-status.correct {
  color: #01f768;
}

.controls-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 8px;
}

/* inline layout: place input and guess button on same line */
.guess-input-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.controls-row {
  align-items: center;
}

.controls-row .option-btn {
  margin-top: 0;
}

.keypad {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.key-row {
  display: flex;
  gap: 8px;
}

.key {
  width: 64px;
  height: 56px;
  border-radius: 12px;
  background: #46BBF6;
  padding: 15px;
  color: #fdfdfd;
  font-family: "Clash";
  font-weight: 900;
  font-size: 1.2rem;
  border: 0.1rem solid #39caff;
  box-shadow: 5px 10px 10px rgba(83, 83, 83, 0.24);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
  display: flex;
  justify-content: center;
  align-items: center;
}

.key:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.14);
  background: rgba(255, 255, 255, 1);
}

.key:active {
  transform: translateY(1px);
}

@media (max-width: 1000px) {
  .guess-number-section {
    max-width: 580px;
    margin: 10px auto 0 auto;
    padding: 10px 18px;
  }

  .gn-overlay-card {
    padding: 14px 14px 14px;
    width: min(420px, calc(100% - 40px));
  }

  .gn-overlay-title {
    font-size: 1.6rem;
  }
}

@media (max-width: 800px) {
  .guess-number-section {
    max-width: 480px;
    margin: 10px auto 0 auto;
    padding: 12px 16px;
  }

  .gn-overlay-card {
    padding: 12px 12px 12px;
    width: min(380px, calc(100% - 32px));
  }

  .gn-overlay-title {
    font-size: 1.4rem;
  }

  /* tighten inline layout on smaller screens */
  .guess-input-container {
    gap: 8px;
  }

  .gn-input,
  .option-btn {
    width: 100px;
    padding: 10px;
    font-size: 20px;
  }

  .gn-digit-box {
    font-size: 20px;
    font-weight: 900;
  }

  .controls-row .option-btn {
    padding: 12px 14px;
    font-size: 1rem;
  }
}

@media (max-width: 600px) {
  .guess-number-section {
    max-width: 90%;
    margin: 10px auto 0 auto;
    padding: 12px 14px;
  }

  .gn-overlay-card {
    padding: 10px 10px 10px;
    width: min(360px, calc(100% - 32px));
  }

  .gn-overlay-title {
    font-size: 1.2rem;
  }

  .guess-input-container {
    gap: 8px;
  }

  .controls-row .option-btn {
    padding: 10px 12px;
    font-size: 0.95rem;
  }

  .feedback {
    margin-bottom: 12px;
    font-size: 0.6rem;
  }

  .history-item {
    gap: 2px;
    font-size: 0.8rem;
    padding: 1px 4px;
  }

  .history-status {
    min-width: 60px;
    padding: 2px 6px;
    font-size: 0.6rem;
    letter-spacing: 0.03em;
  }

  .gn-input,
  .option-btn {
    width: 90px;
    padding: 10px;
    font-size: 0.8rem;
  }

  .gn-digit-box {
    font-size: 1.2rem;
    font-weight: 900;
  }

  .key {
    width: 54px;
    height: 46px;
    border-radius: 12px;
    padding: 15px;
    font-weight: 900;
    font-size: 1.2rem;
  }
}