/* Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body - exact reCAPTCHA style */
body {
  background-color: #fff !important;
  font-family: Roboto, Helvetica, Arial, sans-serif;
  color: #000;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Container */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}

/* Captcha Box - 1.5x Scale */
.captcha-box {
  background-color: #f9f9f9;
  border: 1px solid #d3d3d3;
  border-radius: 5px; /* ~1.5x of 3px */
  padding: 0 18px; /* 1.5x of 12px */
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 111px; /* 1.5x of 74px */
  min-width: 456px; /* 1.5x of 304px */
  box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0.08); /* scaled shadow */
}

.captcha-left {
  display: flex;
  align-items: center;
  gap: 21px; /* 1.5x of 14px */
}

/* Checkbox - 1.5x Scale */
.checkbox-wrapper {
  width: 42px; /* 1.5x of 28px */
  height: 42px; /* 1.5x of 28px */
  border: 3px solid #c1c1c1; /* 1.5x of 2px */
  border-radius: 3px; /* 1.5x of 2px */
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.2s,
    border-color 0.2s;
  position: relative;
}

.checkbox-wrapper:hover {
  border-color: #b9b9b9;
  background-color: #f5f5f5;
}

.checkbox-wrapper.checked {
  border-color: #c1c1c1;
  background: #fff;
}

.checkbox {
  width: 36px; /* 1.5x of 24px */
  height: 36px; /* 1.5x of 24px */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Spinner - 1.5x Scale - Reduced slightly */
.spinner {
  display: none;
  width: 28px; /* Reduced from 36px */
  height: 28px; /* Reduced from 36px */
  position: relative;
}

.spinner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 3px solid transparent; /* Reduced from 4px */
  border-top-color: #4285f4;
  border-radius: 50%;
  animation: recaptcha-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 3px solid transparent; /* Reduced from 4px */
  border-top-color: #4285f4;
  border-radius: 50%;
  animation: recaptcha-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  animation-delay: -0.45s;
  opacity: 0.4;
}

.checkbox-wrapper.loading .spinner {
  display: block;
}

@keyframes recaptcha-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Checkmark - 1.5x Scale */
.checkmark {
  display: none;
  width: 30px; /* 1.5x of 20px */
  height: 30px; /* 1.5x of 20px */
  fill: #00a854;
  animation: checkmark-pop 0.3s ease-out;
}

.checkbox-wrapper.checked .checkmark {
  display: block;
}

@keyframes checkmark-pop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Captcha text - 1.5x Scale */
.captcha-text {
  font-size: 21px; /* 1.5x of 14px */
  font-weight: 400;
  color: #000;
  user-select: none;
}

/* Right side branding - 1.5x Scale */
.captcha-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding-left: 30px; /* 1.5x of 20px */
}

.doomtcha-logo {
  width: 48px; /* 1.5x of 32px */
  height: 48px; /* 1.5x of 32px */
  object-fit: contain;
}

.doomtcha-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 3px; /* ~1.5x of 2px */
}

.brand-name {
  font-size: 15px; /* 1.5x of 10px */
  font-weight: 400;
  color: #555;
  letter-spacing: 0.5px; /* ~1.5x of 0.3px */
}

.brand-links {
  display: flex;
  gap: 5px; /* ~1.5x of 3px */
  font-size: 12px; /* 1.5x of 8px */
}

.brand-links a {
  color: #555;
  text-decoration: none;
}

.brand-links a:hover {
  text-decoration: underline;
}

.brand-links span {
  color: #555;
}

/* Canvas Wrapper */
.canvas-wrapper {
  display: none; /* Toggled to flex by JS */
  flex: 1; /* Take all available space in container */
  width: 100%;
  height: 100%;
  min-height: 0; /* Important for flex child to shrink */
  align-items: center;
  justify-content: center;
  overflow: hidden; /* Prevent overflow */
  position: relative; /* For absolute overlay positioning */
}

/* Canvas */
#canvas {
  /* Fit entirely within the wrapper using object-fit */
  width: 100%;
  height: 100%;
  object-fit: contain;

  image-rendering: pixelated;
  outline: none; /* remove focus outline */
  filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.5));
}

/* Footer */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background-color: #fff;
  color: #70757a;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.author-wrapper {
  position: relative;
  display: inline-block;
}

.author-link {
  color: #70757a;
  text-decoration: none;
}

.author-link:hover {
  text-decoration: underline;
}

/* Hover card */
.hover-card {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  gap: 6px;
  min-width: 130px;
  z-index: 100;
}

.author-wrapper:hover .hover-card {
  display: flex;
}

.hover-card::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #fff;
}

.hover-card a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #202124;
  text-decoration: none;
  font-size: 12px;
  padding: 4px 2px;
  border-radius: 4px;
}

.hover-card a:hover {
  background: #f1f3f4;
  color: #1a73e8;
}

.hover-card a svg {
  flex-shrink: 0;
}
