/* ============================================
   FarmBrawl — Cookie Banner (farm / pixel)
   Wood + gold hard edges. No glass fintech.
   ============================================ */

.cookie-banner {
  position: fixed;
  bottom: 0.85rem;
  left: 50%;
  right: auto;
  transform: translateX(-50%) translateY(120%);
  z-index: 99998;
  width: min(720px, calc(100vw - 1.25rem));
  max-width: min(720px, calc(100vw - 1.25rem));
  max-height: min(48vh, 320px);
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 0.85rem 1rem 0.9rem;
  padding-right: 2.4rem;

  background:
    repeating-linear-gradient(90deg, rgba(255, 220, 150, 0.03) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, #2a1f14 0%, #1a1410 100%);
  border: 2px solid #0a0806;
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(196, 154, 32, 0.4),
    0 12px 32px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 220, 150, 0.08);

  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.3s ease;
  color: #f5e6c8;
}

.cookie-banner.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Hide wins over show / leftover animation classes */
.cookie-banner.hidden,
.cookie-banner.is-hiding,
.cookie-banner.hidden.show,
.cookie-banner.is-hiding.show {
  transform: translateX(-50%) translateY(120%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  animation: none !important;
}

.cookie-banner__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  max-width: 100%;
  box-sizing: border-box;
}

.cookie-banner__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid #0a0806;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(196, 154, 32, 0.28);
}

.cookie-banner__text {
  flex: 1;
  min-width: 0;
}

.cookie-banner__title {
  margin: 0 0 0.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f0d060;
  text-shadow: 1px 1px 0 #0a0806;
  letter-spacing: 0.01em;
}

.cookie-banner__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.4rem;
  font-family: "Press Start 2P", "Fredoka", monospace;
  font-size: 0.48rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1a1410;
  background: linear-gradient(180deg, #f0d060, #c49a20);
  border: 1px solid #0a0806;
  border-radius: 3px;
  text-shadow: none;
}

.cookie-banner__description {
  margin: 0 0 0.25rem;
  max-width: 28rem;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgba(245, 230, 200, 0.82);
}

.cookie-banner__description strong {
  color: #f0d060;
  font-weight: 700;
}

.cookie-banner__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.cookie-banner__link {
  font-size: 0.72rem;
  font-weight: 700;
  color: #9ad44f;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.cookie-banner__link:hover {
  color: #f0d060;
  text-decoration: underline;
}

.cookie-banner__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex-shrink: 0;
  align-items: center;
}

.cookie-banner__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.5rem 0.85rem;
  font-family: "Fredoka", "Nunito", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 5px;
  border: 2px solid #0a0806;
  transition: filter 0.15s ease, transform 0.12s ease;
}

.cookie-banner__button:active {
  transform: translateY(1px);
}

.cookie-banner__button--accept {
  color: #fff;
  background: linear-gradient(180deg, #9ad44f 0%, #5a9a28 55%, #3d7a1f 100%);
  box-shadow:
    0 0 0 1px rgba(196, 154, 32, 0.35),
    0 3px 0 #2a5c15;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
}

.cookie-banner__button--accept:hover {
  filter: brightness(1.08);
}

.cookie-banner__button--configure {
  color: #f5e6c8;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 1px rgba(196, 154, 32, 0.28);
}

.cookie-banner__button--configure:hover {
  color: #f0d060;
  border-color: #0a0806;
  box-shadow: 0 0 0 1px rgba(240, 208, 96, 0.45);
}

.cookie-banner__button--reject {
  color: rgba(245, 230, 200, 0.7);
  background: transparent;
  box-shadow: none;
}

.cookie-banner__button--reject:hover {
  color: #f5e6c8;
  background: rgba(0, 0, 0, 0.25);
}

.cookie-banner__close {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  color: #f5e6c8;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid #0a0806;
  border-radius: 4px;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 0 0 1px rgba(196, 154, 32, 0.25);
}

.cookie-banner__close:hover {
  color: #f0d060;
  background: rgba(80, 20, 20, 0.55);
}

/* ── Settings modal ── */
.cookie-settings-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cookie-settings-modal.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.cookie-settings-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 6, 0.72);
}

.cookie-settings-modal__content {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: min(86vh, 560px);
  overflow: auto;
  padding: 1.1rem 1.15rem 1rem;
  background:
    repeating-linear-gradient(90deg, rgba(255, 220, 150, 0.025) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, #2a1f14 0%, #1a1410 100%);
  border: 2px solid #0a0806;
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(196, 154, 32, 0.4),
    0 20px 48px rgba(0, 0, 0, 0.6);
  color: #f5e6c8;
}

.cookie-settings-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(196, 154, 32, 0.25);
}

.cookie-settings-modal__title {
  margin: 0;
  font-family: "Fredoka", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #f0d060;
  text-shadow: 1px 1px 0 #0a0806;
}

.cookie-settings-modal__close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.15rem;
  color: #f5e6c8;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid #0a0806;
  border-radius: 4px;
  cursor: pointer;
}

.cookie-settings-modal__close:hover {
  color: #f0d060;
}

.cookie-category {
  padding: 0.7rem 0.75rem;
  margin-bottom: 0.55rem;
  background: rgba(0, 0, 0, 0.28);
  border: 2px solid #0a0806;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(196, 154, 32, 0.18);
}

.cookie-category__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
}

.cookie-category__title {
  margin: 0;
  font-family: "Fredoka", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #f5e6c8;
}

.cookie-category__description {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.4;
  color: rgba(245, 230, 200, 0.7);
}

.cookie-category__toggle {
  flex-shrink: 0;
  min-width: 48px;
  padding: 0.28rem 0.5rem;
  font-family: "Press Start 2P", "Fredoka", monospace;
  font-size: 0.5rem;
  letter-spacing: 0.04em;
  color: rgba(245, 230, 200, 0.65);
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid #0a0806;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(196, 154, 32, 0.2);
}

.cookie-category__toggle.is-on {
  color: #1a1410;
  background: linear-gradient(180deg, #9ad44f, #5a9a28);
  box-shadow: 0 0 0 1px rgba(196, 154, 32, 0.35);
}

.cookie-category__toggle.is-locked,
.cookie-category__toggle:disabled {
  opacity: 0.85;
  cursor: not-allowed;
}

.cookie-settings-modal__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(196, 154, 32, 0.22);
}

.cookie-settings-modal__button {
  padding: 0.5rem 0.95rem;
  font-family: "Fredoka", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 5px;
  border: 2px solid #0a0806;
  cursor: pointer;
}

.cookie-settings-modal__button--cancel {
  color: #f5e6c8;
  background: rgba(0, 0, 0, 0.35);
}

.cookie-settings-modal__button--save {
  color: #fff;
  background: linear-gradient(180deg, #9ad44f, #3d7a1f);
  box-shadow: 0 3px 0 #2a5c15;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3);
}

.cookie-settings-modal__button--save:hover {
  filter: brightness(1.06);
}

/* Responsive */
@media (max-width: 720px) {
  .cookie-banner {
    bottom: 0.5rem;
    max-height: min(58vh, 380px);
    padding: 0.75rem 0.8rem 0.8rem;
    padding-right: 2.2rem;
  }

  .cookie-banner__content {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .cookie-banner__icon {
    display: none;
  }

  .cookie-banner__description {
    max-width: none;
  }

  .cookie-banner__buttons {
    width: 100%;
  }

  .cookie-banner__button {
    flex: 1 1 auto;
  }
}

@media (max-width: 480px) {
  .cookie-banner__buttons {
    flex-direction: column;
  }

  .cookie-banner__button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner {
    transition: opacity 0.15s ease;
  }
}
