:root {
  --index-gray: #2c2c2c;
  --index-blue: hsl(236, 46%, 39%);
  --index-green: hsl(132, 65%, 29%);
  --index-light-green: hsl(84, 46%, 50%);
  --index-pink: hsl(329, 71%, 57%);
  --index-yellow: hsl(46, 78%, 58%);
  --user-bg-color: linear-gradient(135deg, rgba(225, 232, 243, 0) 0%, rgb(187, 177, 209) 100%);
  --user-button-color: linear-gradient(135deg, cornflowerblue 0%, mediumpurple 100%);
  --user-font-style: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --stroke: rgba(0, 0, 0, 0.08);
}

@keyframes blink {

  0%,
  80%,
  100% {
    opacity: 1;
  }

  81%,
  95% {
    opacity: 0;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--user-font-style);
  display: flex;
  flex-direction: column;
  color: #000;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

.image-box {
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: -5;
}

.image-box__inner {
  width: 100%;
  height: 100%;
}

.image-box__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: -5;
  pointer-events: none;
  user-select: none;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
  z-index: 10;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  position: relative;
  z-index: 10;
}

main>*:not(.pre-footer, .footerImage) {
  flex-grow: 1;
  /* Push pre-footer and footer down */
}


.hide-keep-space {
  visibility: hidden;
  pointer-events: none;
}

.welcome-box {
  width: 100%;
  height: 80px;
  background-color: var(--index-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 20px;
  z-index: 20;
}

.logo-container {
  position: absolute;
  left: 20px;
  display: flex;
  align-items: center;
}

.header-logo {
  height: 120px;
  cursor: pointer;
}

.fade-text {
  font-size: 28px;
  color: var(--index-yellow);
  font-family: var(--user-font-style);
  font-weight: 500;
}

.slim-banner {
  width: 100%;
  background-color: hsla(229, 65%, 29%, 0.475);
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 20;
  flex-shrink: 0;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.banner-text {
  font-size: 20px;
  color: white;
  margin: 0;
  white-space: nowrap;
  animation: blink 3s ease-in-out infinite;
}

.flag {
  height: 25px;
  width: auto;
  vertical-align: middle;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

.modal-content {
  background-color: white;
  padding: 10px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  min-width: 300px;
  max-width: 90%;
  width: 320px;
  height: 300px;
  position: relative;
  z-index: 1010;
}

.modal-content input[type="text"] {
  width: 80%;
  margin: 10px auto;
  display: block;
  z-index: 1010;
}

.modal:not(.hidden) {
  display: flex;
}

.modal.hidden {
  display: none !important;
}

.body-container {
  margin: 50px;
  margin-bottom: 10px;
  padding: 0;
  text-align: center;
  position: relative;
  z-index: 10;
}

button {
  width: 200px;
  height: 70px;
  padding: 10px 20px;
  border-radius: 35px;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  margin-top: 15px;
  background: var(--user-button-color);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  z-index: 10;
}

button:hover {
  background-color: var(--index-green);
  transform: translateY(-2px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.35);
}

.status-text {
  margin-top: 100px;
  text-align: center;
  font-family: var(--user-font-style);
  position: relative;
  z-index: 10;
}

.hidden {
  display: none;
}

input[type="text"] {
  padding: 10px;
  font-size: 16px;
  margin-top: 10px;
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 10;
}

.go-back-btn {
  background-color: transparent;
  color: white;
  border: none;
  padding: 10px 20px;
  font-weight: bold;
  cursor: pointer;
  font-size: 16px;
  margin-top: 15px;
  transition: 0.3s ease;
  position: relative;
  z-index: 1010;
}

.go-back-btn:hover {
  background-color: var(--index-gray);
  color: white;
}

.ua-card {
  width: min(980px, 92%);
  max-width: 100%;
  margin: 18px 0 0;
  /* Adjusted margin to allow left positioning */
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--stroke);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  border-radius: 16px;
  backdrop-filter: blur(6px);
  padding: 14px 18px 14px;
  position: relative;
  top: 40px;
  left: 15%;
  /* Keep on the left for larger screens */
  z-index: 10;
}

.ua-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 10px;
}

.ua-head h3 {
  margin: 0;
  color: var(--index-blue);
  font-weight: 600;
}

.ua-sub {
  color: #555;
  font-size: .9rem;
}

.ua-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* Default: 4 columns */
  gap: 12px;
}

.ua-tile {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ua-label {
  color: #555;
  font-size: .9rem;
}

.ua-value {
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 2px;
}

.ua-delta {
  color: #2e7d32;
  font-size: .85rem;
  margin-top: 4px;
}

.ua-donut-tile {
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: center;
  gap: 10px;
}

.ua-donut {
  --p: 0;
  --track: rgba(0, 0, 0, .08);
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: conic-gradient(var(--index-green) calc(var(--p)*1%), var(--track) 0);
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent 58%, #000 59%);
  mask: radial-gradient(circle at 50% 50%, transparent 58%, #000 59%);
}

.ua-donut-label span {
  font-weight: 700;
  font-size: 1.2rem;
  display: block;
}

.ua-donut-label small {
  color: #555;
}

.ua-bars {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 70px;
  margin-top: 6px;
}

.ua-bars .bar {
  width: 10px;
  border-radius: 8px;
  background: linear-gradient(180deg, #8ea0ff, #6271ff);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15) inset;
}

.ua-bars-legend {
  margin-top: 4px;
  color: #555;
}

.ua-foot {
  margin-top: 10px;
  color: #444;
  font-size: .9rem;
}

/* Footer section */
.pre-footer {
  background-color: #49388e65;
  padding: 40px 0;
  width: 100%;
  max-width: 100%;
  margin-top: 70px;
  text-align: center;
  position: relative;
  z-index: 10;
}

.footer-displays {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}

.word-box {
  background-color: hsla(46, 78%, 58%, 0.799);
  border: 2px solid var(--index-blue);
  border-radius: 10px;
  padding: 12px;
  width: 180px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.word-box h4 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--index-blue);
}

.word-box p {
  font-size: 16px;
  font-weight: bold;
  color: var(--index-gray);
}

footer {
  background-color: var(--index-gray);
  color: #fcfcfc;
  text-align: center;
  width: 100%;
  max-width: 100%;
  padding: 40px 0;
  margin-top: auto;
  position: relative;
  z-index: 10;
}

.footerImage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer-links ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 28px;
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.footer-links li a {
  color: #ffffff;
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
  transition: color 0.3s ease;
}

.footer-links li a:hover,
.footer-links li a:focus {
  color: var(--index-green);
  outline: none;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 12px;
  padding-top: 12px;
}

.footer-bottom h3 {
  font-weight: normal;
  font-size: 0.95rem;
  margin: 0;
  padding: 0 10px;
}

/* Media section */
@media (max-width: 900px) {
  .ua-card {
    left: 0;
    /* Remove left positioning */
    margin: 18px auto;
    /* Center the card */
    width: 90%;
    /* Responsive width */
  }

  .ua-grid {
    grid-template-columns: repeat(2, 1fr);
    /* Changes to 2 columns */
  }

  .ua-donut-tile {
    grid-template-columns: 72px 1fr;
  }

  .ua-donut {
    width: 72px;
    height: 72px;
  }
}

@media (max-width: 520px) {
  .ua-card {
    top: 20px;
    /* Adjust top for smaller screens */
    width: 90%;
    /* Ensure full width on small screens */
  }

  .ua-grid {
    grid-template-columns: 1fr;
    /* Changes to 1 column */
  }
}

@media (max-width: 550px) {
  .welcome-box {
    min-height: 56px;
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .logo-container {
    position: static;
  }

  .header-logo {
    max-height: 36px;
    height: auto;
  }

  .fade-text {
    font-size: clamp(16px, 4.5vw, 22px);
    line-height: 1.2;
    margin: 0;
    text-align: center;
  }

  .slim-banner {
    padding: 4px 6px;
    min-height: auto;
  }

  .banner-content {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .banner-text {
    font-size: clamp(12px, 3.5vw, 16px);
    white-space: normal;
    text-align: center;
  }

  .flag {
    height: 18px;
    width: auto;
  }

  .body-container button {
    width: 44vw;
    max-width: 220px;
    height: 56px;
    border-radius: 12px;
    font-size: 16px;
  }
}

@media (max-width: 450px) {
  .word-box {
    width: 160px;
  }

  .footer-links ul {
    gap: 16px;
  }
}

@media (max-width: 360px) {
  .body-container button {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .word-box {
    width: 160px;
  }

  .footer-links ul {
    gap: 16px;
  }
}

  .footer-links ul {
    gap: 16px;
  }
}
