/* Test buttons styling */
.test-buttons {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    gap: 5px;
    padding: 5px;
    background: rgba(0, 0, 0, 1);
}

.test-buttons button {
    padding: 5px 10px;
    background: #ffffff;
    color: rgb(0, 0, 0);
    border: none;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
}

.test-buttons button:hover {
    background: #ffffff;
}

/* Basic Reset and Body Styling */
:root {
    /* Theme variables (defaults keep your current look) */
    --bg-color: #ffcbc9;
    --primary-color: #1b1b1b;
    --secondary-color: #1b1b1b;
    /* Modal variables derived from theme at runtime (with fallbacks) */
    --modal-overlay-color: rgba(27, 27, 27, 0.85);
    --modal-frame-bg-color: #ffffff;
    --modal-border-color: #1b1b1b;
    --modal-close-bg: #ffffff;
    --modal-close-fg: #1b1b1b;
    --modal-close-border: #1b1b1b;
}
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    background-color: var(--bg-color, #ffcbc9);
    color: #1b1b1b;
    overflow: hidden;
}

/* ── 5. REWARD MODAL STYLES (NEW) ───────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay-color, rgba(27, 27, 27, 0.85)); /* Dark backdrop */
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    position: relative;
    padding: 10px; /* inner frame spacing */
    background: var(--modal-frame-bg-color, #ffffff);
    border: 4px solid var(--modal-border-color, #1b1b1b);
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    border-radius: 5px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    max-width: 90vw;
    max-height: 90vh;
    box-sizing: border-box;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.reward-image {
    display: block;
    max-width: calc(90vw - 20px);
    max-height: calc(90vh - 20px);
    width: auto;
    height: auto;
    object-fit: contain;
}

.modal-close-button {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 35px;
    height: 35px;
    background: var(--modal-close-bg, #ffffff);
    color: var(--modal-close-fg, #1b1b1b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-family: sans-serif;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    border: 2px solid var(--modal-close-border, #1b1b1b);
    transition: transform 0.2s ease;
}

.modal-close-button:hover {
    transform: scale(1.1) rotate(90deg);
}

/* ── CODE-ENTRY SCREEN ─────────────────────────────── */
.code-entry-screen {
  position: fixed;
  inset: 0;                     /* full viewport */
  background: #ffcbc9;          /* same pink as body */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  z-index: 3000;                /* sits above everything */
  animation: fade-in 0.4s ease;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.code-entry-logo {
  width: min(70vw, 320px);
  height: auto;
}

.code-entry-separator {
  width: 80%;
  height: 2px;
  background: rgba(0,0,0,0.15);
  border: 0;
}

.code-entry-label {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.04em;
}

.code-entry-form {
  display: flex;
  width: min(90vw, 420px);
  min-height: 75px;
  gap: 0;
}

.code-entry-form input {
  flex: 1;
  font: 600 1.75rem/1 'Poppins', sans-serif;
  text-align: center;
  letter-spacing: 0.5rem;
  text-transform: uppercase;
  border: none;
  border-radius: 8px 0 0 8px;
  background: #fff;
  color: #4a4a4a;
  outline: none;
  min-width: 0; /* Allows input to shrink below default min-width */
}

.code-entry-form button {
  width: 30%;
  min-width: 90px;
  border: none;
  border-radius: 0 8px 8px 0;
  background: #1c82ff;
  color: #fff;
  font: 700 1rem/1 'Poppins', sans-serif;
  cursor: pointer;
  transition: filter 0.2s;
}

.code-entry-form button:hover { filter: brightness(1.1); }

/* Mobile-specific adjustments */
@media (max-width: 480px) {
  .code-entry-form {
    width: 90vw;
    height: 52px;
  }
  
  .code-entry-form input {
    font-size: 2rem;
    letter-spacing: 1rem;
  }
  
  .code-entry-form button {
    width: 28%;
    min-width: 80px;
    font-size: 1rem;
  }
}

/* Extra small screens */
@media (max-width: 360px) {
  .code-entry-form input {
    font-size: 2rem;
    letter-spacing: 1rem;
  }
  
  .code-entry-form button {
    width: 30%;
    min-width: 80px;
    font-size: 1rem;
  }
}

.code-entry-screen.hidden { display: none; }
