/*Default styles*/
@import url("/assets/360ba8c0b5e6a1bc7473/styles/fonts.css");

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Iceland", sans-serif;
}

body {
  background-color: rgb(25, 25, 25);
  color: white;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex-grow: 1;
  position: relative;
  overflow: hidden;
}

.bg-particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bg-particles span {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: rgba(98, 165, 92, 0.06);
  animation: particleDrift linear infinite;
}


@keyframes particleDrift {
  0% {
    transform: translateY(110vh) translateX(0) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
    transform: translateY(90vh) translateX(10px) scale(1);
  }
  50% {
    transform: translateY(50vh) translateX(-15px) scale(1.1);
  }
  90% {
    opacity: 1;
    transform: translateY(10vh) translateX(8px) scale(0.9);
  }
  100% {
    transform: translateY(-5vh) translateX(0) scale(0);
    opacity: 0;
  }
}

button {
  cursor: pointer;
}

.container {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 60px;
}

/*Navbar*/
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding: 10px 20px;
  color: white;
  font-size: 48px;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, transparent, rgb(83, 141, 78), rgb(98, 165, 92), rgb(83, 141, 78), transparent) 1;
}

.nav-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.nav-left, .nav-right {
  display: flex;
}

.nav-button {
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: none;
  background: none;
  margin: 0px 10px;
}

.nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  padding: 0;
  margin: 0 6px;
  cursor: pointer;
  font-family: inherit;
}

.nav-icon-circle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.35);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  color: #fff;
  transition: background 0.2s, color 0.2s, transform 0.15s ease;
}

.nav-icon-circle::before {
  content: '';
  position: absolute;
  inset: 2px;
  background: rgb(25, 25, 25);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.nav-icon-circle > * {
  position: relative;
  z-index: 1;
}

.nav-icon-btn:hover .nav-icon-circle {
  background: rgb(83, 141, 78);
  color: rgb(98, 165, 92);
  transform: scale(1.08);
}

.nav-icon-btn:active .nav-icon-circle {
  transform: scale(0.92);
  transition-duration: 0.05s;
}

.nav-icon-circle svg {
  flex-shrink: 0;
}

.nav-profile-initial-wrap .nav-profile-initial {
  font-size: 1rem;
  font-weight: 700;
  color: rgb(98, 165, 92);
}

.nav-icon-btn:hover .nav-profile-initial-wrap .nav-profile-initial {
  color: #fff;
}

.nav-desktop-only {
  display: flex;
}

.nav-mobile-only {
  display: none;
}

@media (max-width: 599px) {
  .nav-desktop-only {
    display: none !important;
  }

  .nav-mobile-only {
    display: block;
  }

  .nav-mobile-menu {
    position: absolute;
    right: 12px;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
  }

  .nav-mobile-menu .nav-icon-btn:hover .nav-icon-circle {
    transform: none;
  }

  .nav-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 220px;
    padding: 8px 0;
    background: linear-gradient(165deg, #2d2d2d 0%, #1f1f1f 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    transform-origin: top right;
    animation: navDropdownOpen 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  }

  .nav-dropdown.nav-dropdown-closing {
    animation: navDropdownClose 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }

  .nav-dropdown-item {
    animation: navDropdownItemIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  }

  .nav-dropdown-item:nth-child(1) { animation-delay: 0.04s; }
  .nav-dropdown-item:nth-child(2) { animation-delay: 0.07s; }
  .nav-dropdown-item:nth-child(3) { animation-delay: 0.1s; }
  .nav-dropdown-item:nth-child(4) { animation-delay: 0.13s; }

  .nav-dropdown:not([hidden]):not(.nav-dropdown-closing) .js-mobile-profile-avatar > * {
    animation: mobileProfileArrive .4s ease-out .13s backwards;
  }
  .nav-dropdown-profile-avatar {
    transition: transform .18s ease, color .18s ease, background .18s ease;
  }
  .js-profile-button:is(:hover, :focus-visible) .nav-dropdown-profile-avatar {
    color: rgb(98, 165, 92);
    background: rgb(83, 141, 78);
    transform: scale(1.08);
  }
  .js-profile-button:active .nav-dropdown-profile-avatar { transform: scale(.92); }


  .nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
  }

  .nav-dropdown-item:hover,
  .nav-dropdown-item:focus-visible {
    background: rgba(83, 141, 78, 0.2);
    outline: none;
  }

  .nav-dropdown-item-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 0;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    color: #fff;
    flex-shrink: 0;
  }

  .nav-dropdown-item-icon::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: #252525;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  }

  .nav-dropdown-item-icon > * {
    position: relative;
    z-index: 1;
  }

  .nav-dropdown-profile-avatar {
    font-size: 14px;
  }

  .nav-dropdown .nav-profile-initial-wrap .nav-profile-initial {
    font-size: 0.85rem;
  }

  .navbar {
    font-size: 28px;
    padding: 12px 56px 12px 16px;
    min-height: 56px;
    box-sizing: border-box;
    align-items: center;
  }

  .nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 120px);
    pointer-events: none;
  }

  .nav-center .nav-text {
    pointer-events: auto;
  }
}

@keyframes navDropdownOpen {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes navDropdownClose {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.88) translateY(-12px);
  }
}

@keyframes navDropdownItemIn {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.nav-text {
  cursor: default;
  transition: text-shadow 0.3s ease;
}

.nav-text:hover {
  animation: titleFlicker 1.5s ease-in-out infinite;
}

@keyframes titleFlicker {
  0%, 100% {
    text-shadow: 0 0 4px rgba(98, 165, 92, 0.2);
  }
  10% {
    text-shadow: 0 0 8px rgba(98, 165, 92, 0.5),
                 0 0 20px rgba(98, 165, 92, 0.15);
  }
  12% {
    text-shadow: none;
  }
  14% {
    text-shadow: 0 0 6px rgba(98, 165, 92, 0.4),
                 0 0 16px rgba(98, 165, 92, 0.12);
  }
  50% {
    text-shadow: 0 0 10px rgba(98, 165, 92, 0.5),
                 0 0 24px rgba(98, 165, 92, 0.2);
  }
  52% {
    text-shadow: 0 0 2px rgba(98, 165, 92, 0.15);
  }
  54% {
    text-shadow: 0 0 12px rgba(98, 165, 92, 0.55),
                 0 0 28px rgba(98, 165, 92, 0.2);
  }
}

@keyframes electricPulse {
  0% {
    color: rgb(98, 165, 92);
    text-shadow: 0 0 6px rgba(98, 165, 92, 0.5),
                 0 0 14px rgba(98, 165, 92, 0.25);
  }
  100% {
    color: rgb(140, 210, 135);
    text-shadow: 0 0 12px rgba(98, 165, 92, 0.8),
                 0 0 30px rgba(98, 165, 92, 0.35),
                 0 0 50px rgba(98, 165, 92, 0.1);
  }
}

.green-letter {
  color: rgb(98, 165, 92);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.green-letter.n-flicker-1 { animation: nFlicker1 0.35s ease-in-out; }
.green-letter.n-flicker-2 { animation: nFlicker2 0.6s ease-in-out; }
.green-letter.n-flicker-3 { animation: nFlicker3 0.9s ease-in-out; }

.nav-text:hover .green-letter {
  animation: electricPulse 0.8s ease-in-out infinite alternate;
}

@keyframes nFlicker1 {
  0%, 100% { color: rgb(98, 165, 92); text-shadow: none; }
  50% {
    color: rgb(140, 210, 135);
    text-shadow: 0 0 8px rgba(98, 165, 92, 0.6), 0 0 20px rgba(98, 165, 92, 0.2);
  }
}

@keyframes nFlicker2 {
  0%, 100% { color: rgb(98, 165, 92); text-shadow: none; }
  25% {
    color: rgb(140, 210, 135);
    text-shadow: 0 0 8px rgba(98, 165, 92, 0.6), 0 0 20px rgba(98, 165, 92, 0.2);
  }
  50% { color: rgb(98, 165, 92); text-shadow: none; }
  75% {
    color: rgb(150, 220, 140);
    text-shadow: 0 0 10px rgba(98, 165, 92, 0.7), 0 0 28px rgba(98, 165, 92, 0.25);
  }
}

@keyframes nFlicker3 {
  0%, 100% { color: rgb(98, 165, 92); text-shadow: none; }
  17% {
    color: rgb(140, 210, 135);
    text-shadow: 0 0 8px rgba(98, 165, 92, 0.6), 0 0 20px rgba(98, 165, 92, 0.2);
  }
  33% { color: rgb(98, 165, 92); text-shadow: none; }
  50% {
    color: rgb(150, 220, 140);
    text-shadow: 0 0 10px rgba(98, 165, 92, 0.7), 0 0 28px rgba(98, 165, 92, 0.25);
  }
  67% { color: rgb(98, 165, 92); text-shadow: none; }
  83% {
    color: rgb(135, 205, 130);
    text-shadow: 0 0 6px rgba(98, 165, 92, 0.5), 0 0 16px rgba(98, 165, 92, 0.15);
  }
}

/*Guessing area*/
.guess-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.guess-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  max-width: 440px;
}

.guess-row .autocomplete-wrapper {
  flex: 1;
  min-width: 0;
}

.guess-row .guess-input {
  width: 100%;
}

.guess-row .guess-button {
  flex-shrink: 0;
}

.guess-input {
  font-size: 1.3rem;
  padding: 12px 32px 12px 14px;
  background-color: rgb(42, 42, 42);
  border: 2px solid rgba(255, 255, 255, 0.25);
  color: white;
  width: 300px;
  border-radius: 10px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.guess-input:-webkit-autofill,
.guess-input:-webkit-autofill:hover,
.guess-input:-webkit-autofill:focus,
.guess-input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px rgb(42, 42, 42) inset !important;
  box-shadow: 0 0 0 1000px rgb(42, 42, 42) inset !important;
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff;
}

.guess-input:autofill {
  box-shadow: 0 0 0 1000px rgb(42, 42, 42) inset;
  color: #fff;
}

.guess-input:focus {
  outline: none;
  border-color: rgb(83, 141, 78);
  box-shadow: 0 0 0 3px rgba(83, 141, 78, 0.25);
}

.guess-input:disabled,
.guess-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(0.4);
}

.guess-button,
.hint-button {
  font-size: 1.05rem;
  font-family: inherit;
  font-weight: 600;
  padding: 12px 0;
  border: none;
  background: linear-gradient(180deg, rgb(98, 165, 92), rgb(70, 125, 66));
  color: white;
  width: 110px;
  border-radius: 10px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 2px 8px rgba(83, 141, 78, 0.3);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.hint-button {
  width: 46px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  flex-shrink: 0;
}

.hint-container {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: 0;
  z-index: 8;
  padding: 13px 18px 14px;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.92);
  background: linear-gradient(145deg, rgba(48, 62, 48, 0.98), rgba(32, 40, 32, 0.98));
  border: 1px solid rgba(98, 165, 92, 0.38);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(98, 165, 92, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-5px);
  text-align: center;
  line-height: 1.4;
}

.hint-container::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 16px;
  width: 11px;
  height: 11px;
  background: rgba(48, 62, 48, 0.98);
  border-top: 1px solid rgba(98, 165, 92, 0.38);
  border-left: 1px solid rgba(98, 165, 92, 0.38);
  transform: rotate(45deg);
}

.hint-container.hint-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

@keyframes signupPromptRipple {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

@keyframes signupPromptGlow {
  0%, 100% {
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.2),
                0 0 48px rgba(245, 158, 11, 0.1),
                0 12px 40px rgba(0, 0, 0, 0.4);
  }
  50% {
    border-color: rgba(251, 191, 36, 0.75);
    box-shadow: 0 0 32px rgba(245, 158, 11, 0.35),
                0 0 64px rgba(245, 158, 11, 0.15),
                0 12px 40px rgba(0, 0, 0, 0.4);
  }
}

@keyframes signupPromptShimmer {
  0% { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}

@keyframes signupPromptFadeIn {
  to {
    opacity: 1;
  }
}

@keyframes signupPromptCardIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Signup prompt popover – near profile/menu button, non-blocking */
.signup-prompt-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 20px;
  z-index: 200;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.signup-prompt-popover.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.signup-prompt-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: linear-gradient(145deg, rgba(35, 32, 28, 0.98) 0%, rgba(28, 25, 22, 0.98) 100%);
  border: 2px solid rgba(245, 158, 11, 0.5);
  border-radius: 12px;
  max-width: min(320px, calc(100vw - 40px));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  overflow: visible;
}

.signup-prompt-card::after {
  content: '';
  position: absolute;
  top: -8px;
  right: 24px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid rgba(245, 158, 11, 0.5);
}

.signup-prompt-popover.is-visible .signup-prompt-card {
  animation: signupPromptCardIn 0.35s ease-out forwards,
             signupPromptGlow 2.5s ease-in-out 0.35s infinite,
             signupPromptRipple 3s ease-in-out 0.35s infinite;
}

.signup-prompt-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 40%,
    rgba(251, 191, 36, 0.08) 50%,
    transparent 60%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: signupPromptShimmer 4s ease-in-out infinite;
  pointer-events: none;
}

.signup-prompt-text {
  font-size: clamp(0.95rem, 2.5vw, 1.08rem);
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
  line-height: 1.4;
}

.signup-prompt-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.signup-prompt-btn {
  font-family: inherit;
  font-size: clamp(0.95rem, 2.2vw, 1rem);
  padding: 10px 20px;
  min-height: 44px;
  min-width: 44px;
  background: linear-gradient(180deg, rgb(251, 191, 36), rgb(245, 158, 11));
  color: rgb(25, 25, 25);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.signup-prompt-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.5);
  filter: brightness(1.1);
}

.signup-prompt-btn:active {
  transform: translateY(0) scale(1);
}

.signup-prompt-dismiss {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.5);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.signup-prompt-dismiss:hover {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 599px) {
  .signup-prompt-popover {
    right: 12px;
    top: calc(100% + 8px);
  }

  .signup-prompt-card::after {
    right: 12px;
  }
}

@media (max-width: 480px) {
  .signup-prompt-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 10px;
    padding: 12px 14px;
  }

  .signup-prompt-actions {
    justify-content: center;
  }

  .signup-prompt-text {
    min-width: 0;
  }
}

.guess-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(83, 141, 78, 0.45);
  filter: brightness(1.1);
}

.hint-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.3);
  filter: brightness(1.2);
}

.guess-button:active,
.hint-button:active {
  transform: translateY(0);
}

.autocomplete-list {
  list-style: none;
  padding: 6px 0;
  margin: 6px 0 0;
  position: absolute;
  width: 100%;
  z-index: 10;
  background: rgba(32, 32, 32, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(83, 141, 78, 0.08);
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  animation: acDropIn 0.18s ease-out;
  transform-origin: top center;
}

@keyframes acDropIn {
  from {
    opacity: 0;
    transform: scaleY(0.6) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scaleY(1) translateY(0);
  }
}

.autocomplete-list::-webkit-scrollbar {
  width: 6px;
}

.autocomplete-list::-webkit-scrollbar-track {
  background: transparent;
}

.autocomplete-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.autocomplete-list li {
  border: none;
  background: transparent;
}

.autocomplete-list button {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 11px 16px;
  font-size: 1.15rem;
  font-family: inherit;
  cursor: pointer;
  border-radius: 8px;
  margin: 0 6px;
  width: calc(100% - 12px);
  transition: background 0.15s ease, color 0.15s ease;
}

.autocomplete-list button:hover,
.autocomplete-list button:focus-visible,
.autocomplete-list button.ac-active {
  background: rgba(83, 141, 78, 0.2);
  color: #fff;
  outline: none;
}

.autocomplete-list button.ac-active {
  border-left: 3px solid rgb(83, 141, 78);
  padding-left: 13px;
}

.autocomplete-list button .ac-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.autocomplete-list button .ac-match {
  color: rgb(98, 165, 92);
  font-weight: 700;
}

.autocomplete-wrapper {
  display: inline-block;
  position: relative;
}

.input-clear-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: color 0.15s ease, background 0.15s ease;
  z-index: 2;
}

.input-clear-btn.visible {
  display: flex;
}

.input-clear-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
}

.input-clear-btn:active {
  transform: translateY(-50%) scale(0.9);
  transition-duration: 0.05s;
}

/*Display results*/
.correct-guess-container {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.js-additional-info,
.js-share-button {
  display: flex;
}

a.additional-info,
.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: auto;
  line-height: normal;
  padding: 10px 18px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  font-size: 0.95rem;
  font-family: inherit;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

a.additional-info:hover,
.share-button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

a.additional-info:active,
.share-button:active {
  transform: scale(0.95);
  transition-duration: 0.05s;
}

.guess-button:disabled {
  border-color: rgba(255, 255, 255, 0.25);
}

/*Popup*/
.popup {
  position: fixed;
  top: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  background: rgba(38, 38, 38, 0.95);
  color: #fff;
  padding: 16px 36px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(83, 141, 78, 0.15);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: normal;
  width: max-content;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
  overflow-wrap: anywhere;
  z-index: 9999;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.3s ease;
  opacity: 0;
}

.popup.popup-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.popup.popup-exit {
  transform: translateX(-50%) translateY(-40%);
  opacity: 0;
  transition: transform 0.25s ease-in,
              opacity 0.25s ease-in;
}

.overlay {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999;
  color: white;
  font-size: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

body.modal-open {
  overflow: hidden;
}

/*Display guesses section*/
.grid-container {
  margin-top: 55px;
  display: flex;
  justify-content: center;
}

.element-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 20px;
}

.element {
  position: relative;
  width: 250px;
  height: 250px;
  border: 2px solid rgb(97, 97, 97);
  border-radius: 15px;
  background-color: rgb(42, 42, 42);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.3s ease;
}

.element.guessed-element {
  overflow: hidden;
}

.element.guessed-element::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.35) 100%);
  pointer-events: none;
  z-index: 1;
}

.element.guessed-element:hover {
  transform: scale(1.025);
  box-shadow: rgba(255, 255, 255, 0.16) 0px 5px 18px 0px, rgba(255, 255, 255, 0.06) 0px 0px 0px 1px;
}

.name {
  font-size: 20px;
}

.atomic-number,
.family {
  position: absolute;
  color: rgba(255, 255, 255, 0.85);
  font-size: 20px;
}

.atomic-number {
  top: 5px;
  left: 5px;
}

.atomic-signal {
  display: inline-block;
}

.atomic-signal.signal-bounce {
  animation: signalBounce 0.5s ease-out;
}

@keyframes signalBounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.5) translateY(-3px); }
  60% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.family {
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
}

.symbol {
  font-size: 80px;
}

.element-slot-number {
  font-size: 2rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.08);
  user-select: none;
}

.element:not(.guessed-element) {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.12);
  background-color: rgba(42, 42, 42, 0.5);
}

.element:not(.guessed-element).next-slot {
  border-color: rgba(83, 141, 78, 0.45);
  animation: nextSlotPulse 2.4s ease-in-out infinite;
}

@keyframes nextSlotPulse {
  0%, 100% {
    border-color: rgba(83, 141, 78, 0.25);
    box-shadow: 0 0 0 0 rgba(83, 141, 78, 0);
  }
  50% {
    border-color: rgba(83, 141, 78, 0.55);
    box-shadow: 0 0 12px 2px rgba(83, 141, 78, 0.15);
  }
}

.element.shimmer,
.game-loading .element:not(.guessed-element) {
  overflow: hidden;
  position: relative;
}

.element.shimmer::after,
.game-loading .element:not(.guessed-element)::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 25%,
    rgba(255, 255, 255, 0.04) 37%,
    rgba(255, 255, 255, 0.07) 50%,
    rgba(255, 255, 255, 0.04) 63%,
    transparent 75%
  );
  background-size: 300% 100%;
  animation: shimmerSlide 2s linear infinite;
}

@keyframes shimmerSlide {
  0% { background-position: 0% 0; }
  100% { background-position: 300% 0; }
}

.element.shimmer-done {
  animation: shimmerReveal 0.35s ease-out forwards;
}

.element.shimmer-done::after {
  display: none;
}

@keyframes shimmerReveal {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.element.card-flip {
  opacity: 0;
  transform: rotateX(90deg) scale(0.95);
  animation: cardFlip 0.65s ease-out forwards;
}

@keyframes cardFlip {
  0% {
    transform: rotateX(90deg) scale(0.95);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: rotateX(0deg) scale(1);
    opacity: 1;
  }
}

.element.correct-card {
  border-color: rgb(83, 141, 78);
  animation: winGlow 2s ease-in-out infinite alternate;
}

.element.correct-card.card-flip {
  opacity: 0;
  transform: rotateX(90deg) scale(0.95);
  animation: cardFlip 0.65s ease-out forwards, winGlow 2s ease-in-out 0.65s infinite alternate;
}


@keyframes winGlow {
  from {
    box-shadow: 0 0 12px rgba(83, 141, 78, 0.4),
                0 0 24px rgba(83, 141, 78, 0.15);
  }
  to {
    box-shadow: 0 0 20px rgba(83, 141, 78, 0.6),
                0 0 40px rgba(83, 141, 78, 0.25);
  }
}

.green {
  color: rgb(83, 141, 78);
}

.family.family-flash {
  animation: familyFlash 0.8s ease-out 0.4s;
}

@keyframes familyFlash {
  0% {
    color: rgb(83, 141, 78);
    text-shadow: none;
  }
  30% {
    color: rgb(140, 220, 130);
    text-shadow: 0 0 8px rgba(83, 141, 78, 0.7), 0 0 20px rgba(83, 141, 78, 0.3);
  }
  100% {
    color: rgb(83, 141, 78);
    text-shadow: none;
  }
}

.yellow {
  color: rgb(181, 159, 59);
}

.reveal-answer {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  background: rgba(42, 42, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 22px;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
}

.reveal-answer-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: linear-gradient(145deg, rgb(83, 141, 78), rgb(55, 100, 52));
  flex-shrink: 0;
}

.reveal-answer-badge-symbol {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.reveal-answer-badge-num {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1;
  margin-top: 2px;
}

.reveal-answer-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.reveal-answer-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 1px;
}

/*Shake animation*/
.shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0% { transform: translateX(0); }
  15% { transform: translateX(-6px); }
  30% { transform: translateX(5px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

.glow-red {
  animation: redGlowFade 0.6s ease-out forwards;
}

@keyframes redGlowFade {
  0% {
    border-color: #f87171;
    box-shadow: 0 0 12px rgba(248, 113, 113, 0.6),
                0 0 24px rgba(248, 113, 113, 0.2);
  }
  100% {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: none;
  }
}

/* Modal popups (Statistics & How to Play) */
.modal-card {
  background: linear-gradient(165deg, #2d2d2d 0%, #1f1f1f 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  color: white;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: modalAppear 0.25s ease-out;
  margin: auto;
}

@keyframes modalAppear {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-card.modal-closing {
  animation: modalExit 0.2s ease-in forwards;
}

@keyframes modalExit {
  to {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 24px 0;
  letter-spacing: 0.02em;
  color: #fff;
}

.modal-back-button {
  font-size: 1rem;
  padding: 12px 28px;
  background-color: rgb(83, 141, 78);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 24px;
  transition: background-color 0.2s ease, transform 0.1s ease;
  font-family: inherit;
}

.modal-back-button:hover {
  background-color: rgb(98, 165, 92);
}

.modal-back-button:active {
  transform: scale(0.95);
  transition-duration: 0.05s;
}

/* Statistics modal */
.stats-modal .stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stats-modal .stat-item {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transform: translateY(10px);
  animation: statFadeIn 0.4s ease-out forwards;
}

.stats-modal .stat-item:nth-child(1) { animation-delay: 0.1s; }
.stats-modal .stat-item:nth-child(2) { animation-delay: 0.18s; }
.stats-modal .stat-item:nth-child(3) { animation-delay: 0.26s; }
.stats-modal .stat-item:nth-child(4) { animation-delay: 0.34s; }
.stats-modal .stat-item:nth-child(5) { animation-delay: 0.42s; }

@keyframes statFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stats-modal .stat-item-wide {
  grid-column: span 2;
}

.stats-modal .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  opacity: 0;
  transform: scale(0.7);
  animation: statPop 0.4s ease-out forwards;
}

.stats-modal .stat-item:nth-child(1) .stat-value { animation-delay: 0.2s; }
.stats-modal .stat-item:nth-child(2) .stat-value { animation-delay: 0.28s; }
.stats-modal .stat-item:nth-child(3) .stat-value { animation-delay: 0.36s; }
.stats-modal .stat-item:nth-child(4) .stat-value { animation-delay: 0.44s; }
.stats-modal .stat-item:nth-child(5) .stat-value { animation-delay: 0.52s; }

.stats-modal .stat-value.stat-pop-reset {
  animation: none;
  transform: scale(0.7);
  opacity: 0.4;
}

.stats-modal .stat-value.stat-pop {
  opacity: 1;
  transform: scale(1);
  animation: statPopUpdate 0.35s ease-out;
}

@keyframes statPop {
  to { opacity: 1; transform: scale(1); }
}

@keyframes statPopUpdate {
  0% { transform: scale(0.7); opacity: 0.4; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.stats-modal .stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stats-modal .guess-distribution {
  text-align: left;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-modal .distribution-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: rgba(255, 255, 255, 0.9);
}

.stats-modal .bars-container {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  min-height: 120px;
}

.stats-modal .bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.stats-modal .bar-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 6px;
  min-height: 1.2em;
}

.stats-modal .bar-track {
  width: 100%;
  height: 100px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px 6px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.stats-modal .bar-fill {
  width: 100%;
  min-height: 4px;
  background: linear-gradient(180deg, rgb(98, 165, 92), rgb(83, 141, 78));
  border-radius: 6px 6px 0 0;
  transform: scaleY(0);
  transform-origin: bottom;
  animation: barGrow 0.5s ease-out forwards;
}

@keyframes barGrow {
  to {
    transform: scaleY(1);
  }
}

.stats-modal .bar-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 6px;
}

/* How to Play modal */
.help-modal {
  max-width: 480px;
  text-align: left;
}

.help-modal .modal-title {
  text-align: center;
}

.help-modal .help-content {
  margin-bottom: 8px;
}

.help-modal .help-intro {
  margin: 0 0 20px 0;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  opacity: 0;
  animation: helpFadeIn 0.4s ease-out 0.05s forwards;
}

.help-modal .help-section {
  margin-bottom: 20px;
}

.help-modal .help-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 10px 0;
  color: rgba(255, 255, 255, 0.95);
}

.help-modal .help-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.help-modal .help-list li {
  padding: 8px 0;
  padding-left: 28px;
  position: relative;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  opacity: 0;
  transform: translateX(-8px);
  animation: helpItemIn 0.35s ease-out forwards;
}

.help-modal .help-list li:nth-child(1) { animation-delay: 0.15s; }
.help-modal .help-list li:nth-child(2) { animation-delay: 0.25s; }
.help-modal .help-list li:nth-child(3) { animation-delay: 0.35s; }
.help-modal .help-list li:nth-child(4) { animation-delay: 0.45s; }
.help-modal .help-list li:nth-child(5) { animation-delay: 0.55s; }

@keyframes helpItemIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes helpFadeIn {
  to {
    opacity: 1;
  }
}

.help-modal .help-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: rgb(83, 141, 78);
  font-weight: bold;
}

.help-modal .help-icon {
  margin-right: 6px;
}

.help-modal .help-letter.green {
  color: rgb(83, 141, 78);
  font-weight: 600;
}

.help-modal .help-letter.yellow {
  color: rgb(181, 159, 59);
  font-weight: 600;
}

.help-modal .help-tip {
  margin: 0;
  padding: 12px 14px;
  background: rgba(83, 141, 78, 0.15);
  border-radius: 10px;
  font-size: 0.95rem;
  opacity: 0;
  animation: helpFadeIn 0.4s ease-out 0.65s forwards;
  color: rgba(255, 255, 255, 0.9);
}

.help-modal .modal-back-button {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Timebox */
.timebox {
  display: none;
  justify-content: center;
  margin-top: 28px;
}

.timebox p {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(42, 42, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 22px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
}


.timebox .countdown-text {
  margin-right: 4px;
}

.timebox .js-hours,
.timebox .js-minutes,
.timebox .js-seconds {
  font-family: "Courier Prime", monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: rgb(98, 165, 92);
  min-width: 1.6ch;
  text-align: center;
}

.timebox .colon-text {
  font-family: "Courier Prime", monospace;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
}

/*Fade animation*/
@keyframes fadeInText {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in-text {
  animation: fadeInText 0.5s ease-in forwards;
}

.credit {
  opacity: 0.7;
}

/*Adjusting for screens under 1201px wide*/
@media (max-width: 1200px) {

  h1 {
    font-size: 50px;
  }

  .element {
    width: 200px;
    height: 200px;
    padding: 10px;
  }

  .element-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .atomic-number,
  .family {
    font-size: 16px;
  }

  .symbol {
    font-size: 64px;
  }

  .container {
    padding: 10px;
  }

  .modal-card {
    max-width: 95%;
    padding: 24px 20px;
  }

  .navbar {
    font-size: 30px;
  }
}

@media (max-width: 700px){
  .navbar {
    font-size: 25px;
  }
}

/* Wikipedia and Share buttons on mobile */
@media (max-width: 599px) {
  .correct-guess-container {
    align-items: stretch;
    gap: 12px;
  }

  .js-additional-info,
  .js-share-button {
    flex: 1;
    min-width: 0;
    display: flex;
  }

  a.additional-info,
  .share-button {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  .share-button {
    width: 100%;
  }
}

/*Adjusting for screens under 451px wide*/
@media (max-width: 450px) {
  .guess-form {
    max-width: 100%;
    padding: 0 8px;
    box-sizing: border-box;
  }

  .guess-input {
    font-size: 1.1rem;
    padding: 10px 28px 10px 12px;
    flex: 1;
    min-width: 0;
  }

  .guess-button {
    width: 72px;
    font-size: 0.88rem;
    padding: 10px 0;
  }

  .hint-button {
    width: 38px;
  }

  .element {
    width: 150px;
    height: 150px;
    padding: 8px;
  }

  .element-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 8px;
  }

  .atomic-number,
  .family {
    font-size: 12px;
  }

  .symbol {
    font-size: 48px;
  }

  .stats-modal .stats-grid {
    gap: 12px;
  }
  
  .stats-modal .stat-value {
    font-size: 1.5rem;
  }
  
  .modal-card {
    max-width: 95%;
    padding: 20px 16px;
  }

  .navbar {
    font-size: 24px;
  }
  
  .nav-button {
    font-size: 10px;
    margin: 0 5px;
  }
}

/* Auth / profile */
.auth-overlay {
  z-index: 1001;
}

.auth-modal-wide {
  max-width: 400px;
  text-align: left;
}

.auth-modal-brand {
  text-align: center;
  font-size: 1.35rem;
  margin-bottom: 20px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 22px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-tab {
  flex: 1;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 1rem;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.auth-tab.is-active {
  background: rgba(83, 141, 78, 0.25);
  color: #fff;
  font-weight: 600;
}

.auth-tab:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.auth-panel.is-hidden {
  display: none;
}

.auth-label {
  display: block;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
  margin-top: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-label:first-of-type {
  margin-top: 0;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  background: rgb(42, 42, 42);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input:focus {
  outline: none;
  border-color: rgb(83, 141, 78);
  box-shadow: 0 0 0 3px rgba(83, 141, 78, 0.2);
}

.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px rgb(42, 42, 42) inset !important;
  box-shadow: 0 0 0 1000px rgb(42, 42, 42) inset !important;
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
  transition: background-color 9999s ease-in-out 0s;
}

.auth-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px rgb(42, 42, 42) inset, 0 0 0 3px rgba(83, 141, 78, 0.2) !important;
  box-shadow: 0 0 0 1000px rgb(42, 42, 42) inset, 0 0 0 3px rgba(83, 141, 78, 0.2) !important;
  border: 2px solid rgb(83, 141, 78) !important;
}

.auth-input:autofill {
  box-shadow: 0 0 0 1000px rgb(42, 42, 42) inset;
  color: #fff;
}

.auth-error {
  min-height: 1.25em;
  margin-top: 12px;
  font-size: 0.9rem;
  color: #f87171;
}

.auth-error.auth-success {
  color: rgb(98, 165, 92);
}

.auth-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.auth-forgot-link {
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}

.auth-forgot-link:hover {
  color: #fff;
}

.auth-help-text {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 4px 0 10px;
  line-height: 1.4;
}

.reset-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-btn {
  width: 100%;
  margin-top: 18px;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 1.05rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.auth-btn-primary {
  background: rgb(83, 141, 78);
  color: #fff;
  font-weight: 600;
}

.auth-btn-primary:hover {
  background: rgb(98, 165, 92);
}

.auth-btn-primary:active {
  transform: scale(0.96);
  transition-duration: 0.05s;
}

.auth-btn-primary:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.auth-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: authSpinner 0.7s linear infinite;
  vertical-align: -0.15em;
  margin-right: 6px;
}

@keyframes authSpinner {
  to { transform: rotate(360deg); }
}

.auth-error-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.8);
}

.auth-btn-outline {
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.25);
  margin-top: 16px;
}

.auth-btn-outline:hover {
  border-color: #8ec987;
  color: #8ec987;
}

.auth-btn-outline.js-auth-logout:hover {
  border-color: #f87171;
  color: #f87171;
}

.auth-btn-outline:active {
  transform: scale(0.96);
  transition-duration: 0.05s;
}

.auth-close-muted {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-close-muted:hover {
  background: rgba(255, 255, 255, 0.14);
}

.auth-account-card {
  text-align: center;
  padding: 8px 0 20px;
}

.auth-account-avatar {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: 0;
  background: linear-gradient(145deg, rgb(83, 141, 78), rgb(50, 90, 48));
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
}

.auth-account-name {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-account-email {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.6);
  word-break: break-all;
}


/* Leaderboard */
.stats-modal {
  display: flex;
  flex-direction: column;
}

.stats-modal .modal-back-button {
  flex-shrink: 0;
}

/* Stats modal header w/ fire toggle */
.stats-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.stats-modal-header .modal-title {
  margin: 0;
}

.stats-fire-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.stats-fire-btn:hover {
  background: rgba(249, 115, 22, 0.25);
  color: rgb(251, 146, 60);
  transform: scale(1.08);
}

.stats-fire-btn:active {
  transform: scale(0.92);
  transition-duration: 0.05s;
}

.stats-fire-btn.is-active {
  background: linear-gradient(180deg, rgb(249, 115, 22), rgb(194, 65, 12));
  color: #fff;
  animation: fireBtnGlow 1.8s ease-in-out infinite alternate;
}

@keyframes fireBtnGlow {
  from { box-shadow: 0 0 8px rgba(249, 115, 22, 0.4); }
  to   { box-shadow: 0 0 18px rgba(249, 115, 22, 0.7), 0 0 32px rgba(249, 115, 22, 0.25); }
}

/* Swipe mechanism */
.stats-swipe-viewport {
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.stats-swipe-track {
  display: flex;
  width: 200%;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}

.stats-swipe-track.is-leaderboard-view {
  transform: translateX(-50%);
}

.stats-swipe-panel {
  width: 50%;
  flex-shrink: 0;
  box-sizing: border-box;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.leaderboard-panel-view {
  overflow: hidden;
}

.leaderboard-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.leaderboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.leaderboard-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.leaderboard-back-btn:hover {
  background: rgba(83, 141, 78, 0.25);
  color: #fff;
}

.leaderboard-back-btn:active {
  transform: scale(0.9);
}

.leaderboard-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.leaderboard-title i {
  color: rgb(251, 146, 60);
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(8px);
  animation: leaderboardRowIn 0.35s ease-out forwards;
  animation-delay: calc(var(--row-i, 0) * 0.05s + 0.05s);
}

@keyframes leaderboardRowIn {
  to { opacity: 1; transform: translateY(0); }
}

.leaderboard-row.is-current-user {
  background: rgba(83, 141, 78, 0.16);
  border-color: rgba(98, 165, 92, 0.45);
  box-shadow: 0 0 0 1px rgba(83, 141, 78, 0.15);
}

.leaderboard-row.is-current-user .leaderboard-username {
  color: rgb(186, 230, 182);
}

.leaderboard-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}

.leaderboard-row.rank-1 .leaderboard-rank {
  background: linear-gradient(145deg, #ffd76a, #d69b1f);
  color: #1a1a1a;
}
.leaderboard-row.rank-2 .leaderboard-rank {
  background: linear-gradient(145deg, #e2e2e2, #a3a3a3);
  color: #1a1a1a;
}
.leaderboard-row.rank-3 .leaderboard-rank {
  background: linear-gradient(145deg, #d38a54, #9c5a2c);
  color: #1a1a1a;
}

.leaderboard-username {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-streak {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  font-size: 1rem;
  color: rgb(251, 146, 60);
  flex-shrink: 0;
}

.leaderboard-streak i {
  font-size: 0.9rem;
}

.leaderboard-loading,
.leaderboard-empty,
.leaderboard-error {
  text-align: center;
  padding: 24px 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.95rem;
}

.loading-dots::after {
  content: '';
  animation: loadingDots 1.2s steps(4, end) infinite;
}

/* Fire icon flicker + ember sparks */
.stats-fire-btn {
  position: relative;
  overflow: visible; /* let sparks escape the button bounds */
}

.stats-fire-btn i {
  position: relative;
  z-index: 2;
  animation: fireIconFlicker 2.4s ease-in-out infinite;
  transform-origin: center bottom;
}

@keyframes fireIconFlicker {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    filter: brightness(1);
  }
  20% {
    transform: scale(1.05) rotate(-2deg);
    filter: brightness(1.15);
  }
  45% {
    transform: scale(0.96) rotate(1deg);
    filter: brightness(0.95);
  }
  70% {
    transform: scale(1.04) rotate(-1deg);
    filter: brightness(1.1);
  }
}

/* Ember sparks: small glowing dots drifting upward off the icon */
.stats-fire-btn::before,
.stats-fire-btn::after {
  content: '';
  position: absolute;
  bottom: 55%;
  left: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgb(251, 146, 60);
  box-shadow: 0 0 4px 1px rgba(251, 146, 60, 0.8);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}

.stats-fire-btn::before {
  animation: emberRise1 1.8s ease-out infinite;
  animation-delay: 0.2s;
}

.stats-fire-btn::after {
  animation: emberRise2 2.2s ease-out infinite;
  animation-delay: 1s;
}

@keyframes emberRise1 {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.6);
  }
  15% {
    opacity: 1;
  }
  80% {
    opacity: 0.4;
  }
  100% {
    opacity: 0;
    transform: translate(-140%, -34px) scale(0.3);
  }
}

@keyframes emberRise2 {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.5);
  }
  15% {
    opacity: 1;
  }
  80% {
    opacity: 0.4;
  }
  100% {
    opacity: 0;
    transform: translate(60%, -30px) scale(0.25);
  }
}

/* Extra spark using a span we can inject, OR simulate with a radial glow pulse instead */
.stats-fire-btn.is-active {
  animation: fireBtnGlow 1.8s ease-in-out infinite alternate;
}

.stats-fire-btn.is-active i {
  animation: fireIconFlicker 1.4s ease-in-out infinite;
}

@keyframes loadingDots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

/* Navigation now uses ordinary page links. */
.nav-icon-btn, .nav-dropdown-item { color: inherit; text-decoration: none; }

@keyframes mobileProfileArrive {
  from { opacity:0; transform:translateY(6px) scale(.8) rotate(-12deg); }
  to { opacity:1; transform:translateY(0) scale(1) rotate(0); }
}
@media (prefers-reduced-motion:reduce) {
  .nav-dropdown:not([hidden]):not(.nav-dropdown-closing) .js-mobile-profile-avatar > * { animation:none; }
  .nav-dropdown-profile-avatar { transition:none; }
}

@media (prefers-reduced-motion:reduce) {
  .element { transition:none; }
  .element:not(.guessed-element).next-slot { animation:none; border-color:#538d4e; }
}

/* Hint confirmation stays beside the game instead of opening a browser dialog. */
.hint-confirmation strong { display:block; font-size:1.1rem; }
.hint-confirmation p { margin:6px 0 14px; font-size:.9rem; color:#c9d6c7; }
.hint-confirmation-actions { display:flex; justify-content:center; flex-wrap:wrap; gap:10px; }
.hint-confirmation-actions button { min-height:42px; padding:9px 15px; border:1px solid #71916d; border-radius:8px; background:#263126; color:#e9f1e7; font:inherit; font-size:.9rem; cursor:pointer; }
.hint-confirmation-actions .hint-reveal { background:#538d4e; border-color:#8ec987; color:white; }
.hint-confirmation-actions button:hover { filter:brightness(1.15); }
.hint-confirmation-actions button:focus-visible { outline:2px solid #b0dfa7; outline-offset:3px; }

/* The daily post-game coach entry. */
.elbot-brand { color: rgb(83, 141, 78); }
.correct-guess-container.has-game-analysis { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:fit-content; max-width:100%; margin-left:auto; margin-right:auto; }
.has-game-analysis .js-analysis-button { grid-column:1 / -1; grid-row:1; width:100%; margin:0; gap:8px; box-sizing:border-box; }
.has-game-analysis .js-additional-info,.has-game-analysis .js-share-button { min-width:0; }
.has-game-analysis .additional-info,.has-game-analysis .js-share-button .share-button { width:100%; box-sizing:border-box; }
/* Match the two guess cards, including the space between them. */
@media(max-width:599px) {
  .correct-guess-container,
  .correct-guess-container.has-game-analysis {
    width:min(100%,420px);
    column-gap:20px;
    margin-left:auto;
    margin-right:auto;
  }
}
@media(max-width:450px) {
  .correct-guess-container,
  .correct-guess-container.has-game-analysis {
    width:min(100%,308px);
    column-gap:8px;
  }
}

.has-game-analysis .share-button,.has-game-analysis .additional-info { height:44px; min-height:44px; box-sizing:border-box; }
.analysis-button-icon { width:24px; height:24px; flex:0 0 24px; object-fit:contain; image-rendering:pixelated; }
@media(max-width:599px) { .has-game-analysis .share-button,.has-game-analysis .additional-info { height:48px; min-height:48px; } }

/* Reveal the finished-game controls once; syncing never restarts their entrance. */
.correct-guess-container.post-game-ready { animation:postGameEnter .38s ease-out both; }
.timebox.post-game-ready { animation:postGameEnter .38s ease-out .08s both; }
.timebox .js-hours,.timebox .js-minutes,.timebox .js-seconds { width:2ch; min-width:2ch; font-variant-numeric:tabular-nums; }
@keyframes postGameEnter { from { opacity:0; transform:translateY(7px); } to { opacity:1; transform:translateY(0); } }
@media(prefers-reduced-motion:reduce) { .correct-guess-container.post-game-ready,.timebox.post-game-ready { animation:none; } }

.leaderboard-username { display:flex; align-items:center; gap:7px; }
.leaderboard-name-text { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.leaderboard-lab-icon { width:18px; height:18px; flex-shrink:0; object-fit:contain; border-radius:4px; }

.game-loading .element:not(.guessed-element)::after { display:block; }
@media (prefers-reduced-motion:reduce) { .element.shimmer::after,.game-loading .element:not(.guessed-element)::after { animation:none; } }
.hint-button.hint-loading { cursor:wait; position:relative; }
.hint-button.hint-loading svg, .hint-button.hint-loading img { opacity:.25; }
.hint-button.hint-loading::after { content:""; position:absolute; width:16px; height:16px; left:calc(50% - 10px); top:calc(50% - 10px); border:2px solid #8ec98755; border-top-color:#8ec987; border-radius:50%; animation:hintLoadingSpin .75s linear infinite; }
@keyframes hintLoadingSpin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .hint-button.hint-loading::after { animation:none; } }
/* Keep the answer reveal in the same compact, neutral style as game controls. */
.reveal-answer-container:has(.reveal-answer) { margin:24px 0; }
.reveal-answer-container:has(.reveal-answer) + .grid-container { margin-top:0; }
.reveal-answer { display:flex; width:max-content; min-width:min(320px,100%); max-width:100%; box-sizing:border-box; margin:0 auto; padding:10px 16px; gap:16px; text-align:left; background:#2a2a2a; border:1px solid #ffffff1a; box-shadow:none; border-radius:10px; animation:answerRevealEnter .3s ease-out both; }
.reveal-answer .reveal-answer-badge { width:52px; height:56px; box-sizing:border-box; border-radius:7px; background:#538d4e; }
.reveal-answer .reveal-answer-badge-num { margin:0 0 5px; font-size:.65rem; font-variant-numeric:tabular-nums; }
.reveal-answer .reveal-answer-badge-symbol { font-size:1.4rem; }
.reveal-answer-copy { min-width:0; }
.reveal-answer-eyebrow { color:#a7a7a7; font-size:.7rem; font-weight:400; margin-bottom:3px; }
.reveal-answer .reveal-answer-name { font-size:1.1rem; line-height:1.2; white-space:nowrap; font-weight:600; }
.reveal-answer .reveal-answer-label { margin-top:3px; color:#999; font-size:.75rem; line-height:1.4; white-space:nowrap; }
@keyframes answerRevealEnter { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
@media(prefers-reduced-motion:reduce) { .reveal-answer { animation:none; } }

@media(max-width:600px) { .popup { top:max(16px,env(safe-area-inset-top)); padding:12px 16px; font-size:1rem; line-height:1.4; } }

/* Arabic text flows right to left; chemical symbols and scientific grids do not. */
html[dir="rtl"] .home-logo,
html[dir="rtl"] .grid-container,
html[dir="rtl"] .periodic-table,
html[dir="rtl"] .cell-symbol,
html[dir="rtl"] .symbol,
html[dir="rtl"] .reveal-answer-symbol,
html[dir="rtl"] .atomic-number,
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="password"],
html[dir="rtl"] .auth-account-email { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .cell-name { direction: rtl; }
html[dir="rtl"] .auth-label { letter-spacing: normal; }
html[dir="rtl"] .help-article,
html[dir="rtl"] .account-billing,
html[dir="rtl"] .elo-help-tooltip,
html[dir="rtl"] .elelo-tiers li,
html[dir="rtl"] .elelo-tiers li span,
html[dir="rtl"] .elelo-tiers small,
html[dir="rtl"] .element-properties caption,
html[dir="rtl"] .element-properties th,
html[dir="rtl"] .element-properties td,
html[dir="rtl"] .guess-turn { text-align: start; }
