/* latin - 400 */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-v12-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin - 500 */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-v12-latin-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin - 600 */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-v12-latin-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin - 700 */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-v12-latin-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin - 800 */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-v12-latin-800.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --body-color:       #050508;
  --bg-color:         rgba(18, 18, 24, 0.7);
  --container-color:  rgba(18, 18, 24, 0.9);
  --keyword-color:    #ffd700;
  --button-color:     #7b61ff;
  --buttonhover-color:#6c52ed;
  --selection-color:  #14141d;
  --selectionhover-color: #1e1935;
  --z-index: 9999;
  --star-size: 42px;
  --star-color: rgba(255, 255, 255, 0.1);
  --star-background: #ffd700;
  --text-color:       #f3f4f6;
  --text-muted:       #9ca3af;

  --border-light: rgba(255, 255, 255, 0.08);
  --radius-outer: 24px;
  --radius-inner: 16px;
  --radius-pill: 50px;
  --shadow-glow: 0 0 20px rgba(123, 97, 255, 0.15);
  --shadow-diffuse: 0 20px 40px rgba(0, 0, 0, 0.6);
}

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

* {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html {
  height: 100%;
  background-color: var(--body-color);
}

body {
  margin: 0;
  padding: 0;
  overflow: auto;
  color: var(--text-color);
  background-color: var(--body-color);
  background-image:
    radial-gradient(circle at 50% 15%, rgba(123, 97, 255, 0.18) 0%, rgba(5, 5, 8, 0) 50%),
    radial-gradient(circle at 10% 80%, rgba(168, 85, 247, 0.08) 0%, rgba(5, 5, 8, 0) 40%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: #fff;
  text-decoration: none;
}

header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  font-size: 1.2rem;
  background-color: var(--container-color);
  color: var(--text-color);
  border: none;
  margin: 0;
  padding: 0.85rem 1.5rem;
  font-weight: 500;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.05);
}

#howTo {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-size: 1.1rem;
  text-align: left;
}

#questionMark {
  width: 1.25rem;
  height: auto;
  margin-right: .25rem;
}

nav {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  width: 100%;
  padding: 0.75rem 1.5rem;
  margin-bottom: 1.25rem;
}

#scoreDisplay {
  font-size: 1.1rem;
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.03);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
}

#scoreNumber {
  color: var(--keyword-color);
  margin-left: 0.25rem;
}

#counterContainer {
  font-size: 1.1rem;
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.03);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
}

.game-wrapper {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 2rem 0;
}

.container {
  background-color: var(--bg-color);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  width: 95%;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 0;
  padding-bottom: 1.5rem;
  border-radius: var(--radius-outer);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #ffffff, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  margin: 0;
}

.quote-container {
  padding: 1.5rem 2rem;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quote {
  font-size: 1.25rem;
  line-height: 1.6;
  text-align: left;
  color: var(--text-color);
  margin: 0;
  max-width: 100%;
}

.word-token {
  display: inline-block;
  margin-right: 0.35rem;
  opacity: 0;
  transform: translateY(4px);
  animation: fadeInWord 0.25s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes fadeInWord {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#guess-container {
  padding: 0 2rem 1rem 2rem;
  max-width: 600px;
  margin: 0 auto;
}

label[for="answer"] {
  display: block;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 1.75rem;
  margin-bottom: 0.85rem;
  text-align: center;
}

input#answer {
  width: 100%;
  background-color: #161821;
  border: 1px solid var(--border-light);
  color: var(--text-color);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-inner);
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input#answer:focus {
  border-color: var(--button-color);
  box-shadow: 0 0 10px rgba(123, 97, 255, 0.25);
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1rem;
}

button {
  font-size: 1.05rem;
  padding: 0.7rem 1.5rem;
  background-color: var(--button-color);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover {
  background-color: var(--buttonhover-color);
  transform: translateY(-1px);
}

button:disabled {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

#next-word-btn {
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-light);
  color: var(--text-color);
}

#next-word-btn:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

#skip-btn {
  background-color: transparent;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

#skip-btn:hover {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Attempts tracker styles */
.attempts-container {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  margin: 1.25rem 0 0.5rem 0;
}

.attempt-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-light);
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.attempt-dot.active {
  background-color: var(--button-color);
  box-shadow: var(--shadow-glow);
}

.attempt-dot.lost {
  background-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Result Screen popup */
#resultContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 999;
  display: none;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  padding: 1.5rem;
}

.result-card {
  background-color: var(--container-color);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-outer);
  max-width: 500px;
  width: 100%;
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-diffuse);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  animation: revealCard 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes revealCard {
  from {
    transform: scale(0.95) translateY(10px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

#resultTitle {
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

#resultTitle.won {
  color: #10b981;
}

#resultTitle.lost {
  color: #ef4444;
}

#playerChoice {
  width: 100%;
  background-color: #1a1c23;
  border: 1px solid #2f3342;
  color: var(--text-color);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.65rem 1rem;
  border-radius: 50px;
  margin: 0 auto 1.25rem auto;
  text-align: center;
}

#poster {
  width: 100%;
  max-width: 180px;
  margin: 0 auto 1.25rem auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-light);
}

#resultInfo {
  font-size: 1.05rem;
  color: var(--text-color);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

#shareContainer {
  width: 100%;
  margin-bottom: 1.5rem;
}

#shareBtn {
  font-size: 1.1rem;
  padding: 0.75rem 2.25rem;
  margin-bottom: 0.5rem;
}

#shareText {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0.25rem auto 0 auto;
}

.countdown {
  font-size: 1rem;
  font-weight: 600;
  color: var(--keyword-color);
  margin-top: 0.5rem;
}

/* Autocomplete JQuery UI Style overrides */
.ui-autocomplete {
  background: #121218 !important;
  background-color: #121218 !important;
  border: 1px solid #2f3342 !important;
  border-radius: var(--radius-inner) !important;
  max-height: 250px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 10000;
  padding: 0.5rem !important;
  box-shadow: var(--shadow-diffuse);
}

.ui-menu-item {
  list-style: none !important;
  background: transparent !important;
  color: var(--text-color) !important;
  border: none !important;
  padding: 0 !important;
}

.ui-menu-item-wrapper {
  color: var(--text-color) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  padding: 0.6rem 0.85rem !important;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

/* Hover / Focus state */
.ui-menu-item-wrapper.ui-state-active,
.ui-menu-item-wrapper.ui-state-focus,
.ui-menu-item-wrapper:hover {
  background-color: var(--button-color) !important;
  color: #ffffff !important;
  border-color: var(--button-color) !important;
  outline: none;
}

.ui-helper-hidden-accessible {
  display: none;
}

/* Instructions Overlay */
.transpartentLayer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.transpartentLayer.active {
  opacity: 1;
  visibility: visible;
}

#instructionContainer {
  background-color: var(--container-color);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-diffuse);
  border: 1px solid var(--border-light);
  color: var(--text-color);
  max-width: 500px;
  width: 90%;
  padding: 2.25rem 2rem 2rem 2rem;
  border-radius: var(--radius-outer);
  position: relative;
  text-align: left;
  animation: revealCard 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

#instructionContainer h2 {
  margin-top: 0;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--button-color);
}

.rules-steps {
  margin-bottom: 2rem;
  margin-top: 1.5rem;
}

.rules-step {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.rules-step:last-child {
  margin-bottom: 0;
}

.step-badge {
  background-color: rgba(123, 97, 255, 0.15);
  border: 1px solid var(--button-color);
  color: var(--text-color);
  font-weight: 800;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
  box-shadow: 0 0 10px rgba(123, 97, 255, 0.2);
}

.step-content {
  flex-grow: 1;
}

.step-content h3 {
  margin: 0 0 0.35rem 0 !important;
  font-size: 1.15rem !important;
  color: var(--text-color) !important;
  font-weight: 700;
}

.step-content p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

#closeButton {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 1.25rem;
  height: auto;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

#closeButton:hover {
  opacity: 1;
}


#countdownGame {
  display: flex;
  justify-content: center;
}

.countdown-card {
  margin: 2rem auto;
  max-width: 500px;
  width: 90%;
  padding: 2.5rem 2rem;
  background-color: var(--container-color);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-outer);
  text-align: center;
  box-shadow: var(--shadow-diffuse);
}

.countdown-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.countdown-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.4;
}

.countdown-timer-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
}

.timer-segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 75px;
}

.timer-val {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--button-color);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.timer-divider {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: -1.25rem;
}

.timer-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
}

/* Footer styles */
footer {
  width: 100%;
  background-color: var(--container-color);
  padding: 15px 10px;
  text-align: center;
  margin-top: auto;
  font-size: 0.9rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-color);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.footer-separator {
  margin: 0 0.5rem;
  color: var(--border-light);
}

.more-games-link {
  margin-top: 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.more-games-link a {
  color: var(--button-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.more-games-link a:hover {
  color: var(--buttonhover-color);
  text-decoration: underline;
}

/* Responsive adjust */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    text-align: center;
  }
  h1 {
    font-size: 1.25rem;
  }
  #howTo {
    font-size: 0.95rem;
    justify-content: center;
  }
  .quote-container {
    padding: 1rem 1.25rem;
  }
  .quote {
    font-size: 1.1rem;
  }
  #guess-container {
    padding: 0 1.25rem 1rem 1.25rem;
  }
  .result-card {
    padding: 1.5rem 1.25rem;
  }
  #resultTitle {
    font-size: 1.5rem;
  }
  .countdown-card {
    padding: 1.5rem 1rem;
  }
  .timer-val {
    font-size: 2rem;
  }
}