* {
  font-family: Product Sans;
}

.settings-btn {
  position: fixed;
  top: 20px;
  right: 80px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.9);
  color: #2c5aa0;
  border: 2px solid rgba(90, 159, 255, 0.5);
  border-radius: 8px;
  font-family: 'Product Sans', sans-serif;
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.settings-btn:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(90, 159, 255, 0.3);
  text-decoration: none;
}

.settings-icon {
  width: 20px;
  height: 20px;
}

.theme-toggle-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  position: relative;
  will-change: transform, background-color, border-color;
  transform: translateZ(0);
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle-btn:hover,
.theme-toggle-btn:active {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.theme-toggle-btn:hover .theme-icon,
.theme-toggle-btn:active .theme-icon {
  transform: rotate(15deg);
}

.theme-icon {
  font-size: 20px;
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  transform: translateZ(0);
}

.theme-icon.spin {
  animation: spin 0.6s ease-in-out;
}

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

body {
  background: linear-gradient(135deg, #a8d8ff 0%, #7ec8ff 100%);
  background-image: url("bgLight.avif");
  margin: 0;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition:
    background-image 0.15s ease-in-out,
    filter 0.15s ease-in-out;
  will-change: background-image, filter;
  transform: translateZ(0);
  contain: layout style paint;
  justify-content: center;
  align-items: center;
}

html.dark-theme body,
body.dark-theme {
  background: linear-gradient(135deg, #1a2332 0%, #2d3e50 100%);
  background-image: url("bgDark.avif");
}

body.performance-mode {
  background: #a8d8ff !important;
  background-image: none !important;
}

body.dark-theme.performance-mode {
  background: #1a2332 !important;
  background-image: none !important;
}

body.performance-mode::before {
  display: none !important;
}

body.performance-mode *,
body.performance-mode *::before,
body.performance-mode *::after {
  animation: none !important;
  transition: none !important;
}

/* keep search input visible in performance mode */
body.performance-mode form input {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: inherit;
  background-size: inherit;
  background-repeat: inherit;
  background-position: inherit;
  background-attachment: inherit;
  filter: blur(10px);
  z-index: -1;
}

form input {
  background: #b1c7ee;
  border: 1px solid #b1c7ee;
  color: #000;
  padding: 0 17px;
  height: 48px;
  width: 90%;
  max-width: 800px;
  margin-top: 15px;
  border-radius: 50px;
  outline: none;
  box-shadow: 0 0 15px 0 rgba(5, 5, 5, 0);
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
  will-change: background, border-color, box-shadow;
  transform: translateZ(0);
  font-size: 16px;
  -webkit-appearance: none;
}

form input:focus,
form input:hover {
  background: #cbdcf5;
  border: 1px solid #cbdcf5;
  box-shadow: 0 0 10px 0 rgba(5, 5, 5, 0.514);
}

form input:focus:hover {
  animation-iteration-count: 0;
}

body.dark-theme form input {
  background: #30488a;
  border: 1px solid #30488a;
  color: #fff;
}

body.dark-theme form input:focus,
body.dark-theme form input:hover {
  background: #2f4064;
  border: 1px solid #2f4064;
}

.left-margin,
#uv-register-sw {
  color: #000;
}

a,
.bottomText {
  color: #6e84a7;
}

body.dark-theme .left-margin,
body.dark-theme #uv-register-sw {
  color: #fff;
}

body.dark-theme a,
body.dark-theme .bottomText {
  color: #4872c0;
}

@keyframes dropIn {
  from {
    filter: blur(5px);
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    filter: blur(0);
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes blurOut {
  from {
    filter: blur(5px);
    transform: translateY(15px);
    opacity: 0;
  }
  to {
    filter: blur(0);
    transform: translateY(0);
    opacity: 1;
  }
}

.dropIn,
.blurOut {
  animation-duration: 0.8s;
  animation-timing-function: ease-out;
}

.dropIn {
  animation-name: dropIn;
}

.blurOut {
  opacity: 0;
  animation-name: blurOut;
  animation-delay: 0.5s;
  animation-fill-mode: forwards;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.header-center {
  display: none;
}

.center-margin {
  display: grid;
  place-items: center;
}

.left-margin {
  margin: 0 16px;
}

.banner {
  width: 90%;
  max-width: 720px;
  height: auto;
  aspect-ratio: 720/280;
  transition: opacity 0.2s ease;
  will-change: opacity;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.bottomText {
  position: absolute;
  bottom: 10px;
  letter-spacing: 1px;
  font-weight: 700;
  font-size: 14px;
}

.bottomText.left {
  left: 10px;
}

.bottomText.right {
  right: 10px;
}

a {
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

a:hover,
a:active {
  text-decoration: underline;
}

.unselectable {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#uv-frame {
  display: none;
  border: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #111;
}

#uv-error {
  color: #ff6666 !important;
  white-space: pre-wrap;
  padding: 0 20px;
  text-align: center;
}

#uv-error-code {
  font-size: 12px;
  font-family: "Courier New", Courier, monospace;
  padding: 0 20px;
  overflow-x: auto;
}

#uv-register-sw {
  color: #fff;
  background: #555;
  cursor: pointer;
  outline: none;
  border: none;
  border-radius: 6px;
  padding: 16px 20px;
  line-height: 16px;
  display: none;
  -webkit-tap-highlight-color: transparent;
}

#uv-register-sw:active {
  background: #333;
}

#uv-register-sw.show {
  display: block;
}

@media screen and (max-width: 768px) {
  form input {
    width: 85%;
    height: 52px;
    font-size: 16px;
  }

  .theme-toggle-container {
    top: 15px;
    right: 15px;
  }

  .theme-toggle-btn {
    width: 45px;
    height: 45px;
  }

  .bottomText {
    font-size: 12px;
    letter-spacing: 0.5px;
  }
}

@media screen and (max-width: 480px) {
  form input {
    width: 90%;
    padding: 0 15px;
  }

  .bottomText {
    font-size: 10px;
    bottom: 8px;
  }

  .bottomText.left {
    left: 8px;
  }

  .bottomText.right {
    right: 8px;
  }
  
  .settings-btn {
    right: 15px;
    padding: 10px 16px;
    font-size: 0.9em;
  }
}
