*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Quicksand', Arial, sans-serif;
  background: #f7f8fa;
  color: #222;
  min-height: 100vh;
}

html {
  font-size: 17px;
}

/* Headings */
h1 {
  font-size: 2rem; /* 36px */
  font-weight: bold;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.75rem; /* 31.5px */
  margin-bottom: 0.875rem;
}

h3 {
  font-size: 1.5rem; /* 27px */
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.25rem; /* 22.5px */
  margin-bottom: 0.625rem;
}

h5 {
  font-size: 1.125rem; /* 20.25px */
  margin-bottom: 0.5rem;
}

p {
  font-size: 1rem; /* 18px */
  margin-bottom: 1em;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

header {
  background-color: #2f318b;
  color: #ffffff8c;
  font-size: 1em;
}

.header-wrapper .title {
  font-weight: bold;
  font-size: 20px;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-width {
  max-width: 970px;
  margin: 0 auto;
  padding: 0 20px;
}

.user-welcome {
  font-size: 24px;
  text-align: center;
  font-weight: bold;
  text-transform: capitalize;
}

.index-section .title,
.user-welcome-section .title {
  text-align: center;
  color: #2f318b;
  text-transform: uppercase;
  font-weight: bolder;
  font-size: 32px;
  -webkit-text-stroke-width: 2px;
  letter-spacing: 2px;
  margin: 3rem auto;
}

.note {
  font-style: italic;
  font-size: 0.9em;
  margin-top: 20px;
}

.user-welcome-section {
  margin: 3rem auto 1rem auto;
}

.help-section {
  margin-top: 1rem;
}

.ugc-card ol li {
  margin-bottom: 8px;
}

.user-welcome-section .title {
  margin: 0;
  margin-bottom: 2rem;
}

.user-welcome-section .section-content {
  background-color: white;
  box-shadow: 0 0 10px rgb(0 0 0 / 4%);
  border-radius: 10px;
  border: 3px solid #eaeaea;
  padding: 0 25px;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.index-section .section-content {
  background-color: white;
  box-shadow: 0 0 10px rgb(0 0 0 / 4%);
  border-radius: 10px;
  border: 3px solid #eaeaea;
  padding: 10px;
  margin: 0 auto;
}

.redeem-form form {
  display: flex;
  max-width: 600px;
  justify-content: center;
  margin: 0 auto;
}

.redeem-form form input {
  width: 70%;
  padding: 11px;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  border: 2px solid #72c16c;
  font-size: 17.6px;
}

.redeem-form form input:focus {
  outline: none;
  box-shadow: none;
}

.username-form {
  text-align: center;
  margin: 1rem auto;
}

.username-form input {
  width: 100%;
  padding: 11px;
  border: 2px solid #72c16c;
  font-size: 17.6px;
  border-radius: 10px;
}

.username-form button {
  display: block;
  margin: 1rem auto;
}

.logo-wrapper h1 {
  color: white;
  padding: 0;
  margin: 0;
  font-size: 1.25em;
}

.logo-wrapper a {
  text-decoration: none;
}

.redeem-form form button {
  width: 30%;
  background-color: #73c16c;
  border: none;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  color: #ffffff;
  font-weight: bold;
  font-size: 1em;
  display: flex;
  align-items: center;
  justify-content: space-around;
  cursor: pointer;
}

.redeem-form form button:hover,
.cta-btn-primary:hover,
.cta-btn-try-again:hover {
  background-color: #45993e;
}

.redeem-form form button:active {
  background-color: #45993e;
}

.avatar-preview {
  width: 100px;
  border-radius: 10px;
  border: 1px solid #e9e9e9;
}

.logos-section {
  margin: 2rem;
}

.responsive-img {
  max-width: 60%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.logos-section .logos-wrapper {
  align-items: center;
  justify-content: center;
  display: flex;
}

.logos-wrapper span {
  font-size: 1em;
  font-weight: bold;
  color: #808080;
  margin: 0 1rem;
}

footer {
  background-color: #ebebeb;
}

.footer-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

.legal-texts {
  font-size: 0.8em;
}

.cta-btn-primary {
  background: #73c16c;
  color: #ffffff;
  font-weight: bold;
  padding: 8px 20px;
  border-radius: 10px;
  text-decoration: none;
  max-width: 202px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.15);
  font-size: 18px;
  cursor: pointer;
  border: none;
}

.cta-select {
  width: 100%;
  padding: 11px;
  border: 2px solid #72c16c;
  font-size: 1em;
  outline: none;
  appearance: none;
  background-color: white;
  cursor: pointer;
  border-radius: 10px;
}

.cta-btn-try-again {
  background: #73c16c;
  color: #ffffff;
  font-weight: bold;
  padding: 8px 20px;
  border-radius: 10px;
  text-decoration: none;
  max-width: 202px;
  display: flex;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.15);
  font-size: 18px;
}

.cta-btn-wrapper {
  margin-top: 2rem;
}

.cta-btn-text {
  transform: translateY(-2px);
}

.btn-right-arrow {
  width: 11px;
}

input[name='code'] {
  text-transform: uppercase;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

#gameModal {
  padding: 1rem;
}

.modal-box {
  background: #fff;
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
  max-width: 470px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-box h2 {
  margin-top: 0;
  font-size: 24px;
  color: #2f318b;
}

.modal-buttons {
  margin-top: 1.5rem;
  flex-direction: column;
  display: flex;
  justify-content: space-around;
  gap: 1rem;
}

.title-link {
  all: unset;
  cursor: pointer;
}

.tos-privacy-wrapper {
  text-align: center;
  gap: 6px;
  display: flex;
  justify-content: center;
  padding-bottom: 1rem;
  font-size: 0.8em;
}

.select-account-title {
  text-align: center;
}

.select-account-container {
  background-color: white;
  box-shadow: 0 0 10px rgb(0 0 0 / 4%);
  border-radius: 10px;
  border: 3px solid #eaeaea;
  padding: 0 10px;
  margin: 2rem auto;
  max-width: 430px;
}

.avatar-preview {
  width: 100px;
  height: 100px;
  background-size: 128%;
  background-position: center;
}

.attempted-code {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #555;
}
.attempted-code code {
  text-transform: uppercase;
  font-weight: bold;
  background: #f4f4f4;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  display: inline-block;
}

.user-container {
  position: relative;
  display: none;
  align-items: center;
  gap: 21px;
  background: #f5f5f5;
  border-radius: 10px;
  padding: 4px;
  margin: 1rem auto;
}

.user-info-holder {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#icon-arrow-r {
  color: #888; /* Controls stroke color via `currentColor` */
  width: 16px;
  height: auto;
  margin-left: 8px;
  transition: transform 0.2s ease;
}

.arrow-icon {
  position: absolute;
  right: 10px;
}

#username-success {
  color: #2f318b;
  font-weight: bold;
  text-align: center;
  margin-top: 1rem;
}

#username-error {
  color: #ff0000;
  font-weight: bold;
  text-align: center;
  margin-top: 1rem;
}

.text-red {
  color: #ff0000;
  font-weight: bold;
}

.user-container {
  cursor: pointer;
}

#proceed-btn {
  margin-top: 12px;
}

/* Avatar skeleton loading */
.avatar-preview.loading {
  background-image: none !important;
  background-color: #ddd;
  animation: pulse 1.2s infinite ease-in-out;
}

/* Simple skeleton pulse effect */
.skeleton-line {
  background-color: #eee;
  border-radius: 4px;
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}

/* Small devices (landscape phones, less than 768px) */
@media (max-width: 767.98px) {
  .header-container {
    flex-direction: column-reverse;
    text-align: center;
    padding: 10px 0;
  }

  .header-wrapper .title {
    margin-bottom: 3px;
    font-size: 15px;
    margin-top: 0;
  }

  .logo-wrapper h1 {
    margin: revert;
    margin-top: 0;
    margin-bottom: 0;
  }

  .responsive-img {
    max-width: 100%;
  }
}

/* -------------- ADMIN --------------- */
.admin-login .login-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 400px;
  margin: 0 auto;
  text-align: left;
}

.admin-login .form-group {
  display: flex;
  flex-direction: column;
}

.admin-login .username-input {
  width: 100%;
  padding: 11px;
  border: 2px solid #72c16c;
  font-size: 17.6px;
  border-radius: 10px;
}

.admin-login .cta-btn-primary {
  align-self: flex-start;
}

@media (max-width: 575.98px) {
  .index-section .title {
    font-size: 24px;
    margin: 3rem auto 2rem auto;
  }

  .user-welcome-section .title {
    font-size: 24px;
  }
}

/* =========================
   REDEEM RESULT PAGE STYLES
   ========================= */

.result-page {
  margin-top: 3rem;
  text-align: center;
}

.result-heading {
  font-size: 1.8rem;
  font-weight: bold;
  color: #2f318b;
  margin-bottom: 1.5rem;
}

/* --- Shared Card Style --- */
.result-card {
  background-color: #fff;
  box-shadow: 0 0 10px rgb(0 0 0 / 4%);
  border-radius: 10px;
  border: 3px solid #eaeaea;
  padding: 25px;
  max-width: 600px;
  margin: 0 auto 2rem auto;
  text-align: left;
}

.result-card h3 {
  color: #2f318b;
  margin-top: 0;
}

/* --- UGC Section --- */
.ugc-card {
  border-color: #b6e0ff;
  background-color: #e9f6ff;
  padding: 10px 0;
}

.ugc-code {
  display: inline-block;
  background: #fff;
  border: 2px dashed #2f318b;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: bold;
  color: #2f318b;
  font-size: 1.2rem;
  letter-spacing: 1px;
  margin-left: 4px;
}

.ugc-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.ugc-btn {
  background-color: #73c16c;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  font-size: 1em;
}

.ugc-btn:hover {
  background-color: #45993e;
  transform: translateY(-2px);
}

.ugc-btn-copy {
  background-color: #2f318b;
}

.ugc-btn-copy:hover {
  background-color: #23256a;
}

.ugc-btn-redeem {
  background-color: #73c16c;
}

.ugc-btn-redeem:hover {
  background-color: #45993e;
}

/* --- Pending Section --- */
.pending-card {
  background-color: #fffbe6;
  border-color: #ffe58f;
}

.pending-info {
  border-radius: 10px;
}

.pending-info ul {
  margin: 10px 0;
  padding-left: 20px;
  text-align: left;
}

.ugc-steps {
  text-align: left;
}

.note {
  font-size: 0.9em;
  color: #555;
  margin-top: 12px;
}

/* --- DEV Section --- */
.dev-card {
  background-color: #f9fff9;
  border-color: #b6ffb6;
}

/* --- Error Section --- */
.error-card {
  background-color: #fff1f0;
  border-color: #ffa39e;
  color: #c10000;
  padding: 10px 0;
}

.help-section ul {
  margin-top: 10px;
  padding-left: 20px;
  list-style-type: none;
}

/* --- CTA --- */
.cta-btn-try-again {
  background: #73c16c;
  color: #fff;
  font-weight: bold;
  padding: 10px 24px;
  border-radius: 10px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.15);
  margin: 1rem auto 2rem auto;
  transition: background 0.2s ease;
}

.cta-btn-try-again:hover {
  background: #45993e;
}

/* --- Mobile --- */
@media (max-width: 575.98px) {
  .result-card {
    padding: 20px;
  }

  .ugc-code {
    display: block;
    text-align: center;
    margin: 10px auto;
  }

  .ugc-buttons {
    flex-direction: column;
  }

  .ugc-btn {
    width: 100%;
  }
}
