:root {
  --bg-color: #0f1115;
  --panel-bg: #1a1d24;
  --text-primary: #f8f9fa;
  --text-secondary: #8b949e;
  --accent-color: #1db954;
  --accent-hover: #1ed760;
  --danger-color: #f85149;
  --border-color: #30363d;
  --font-main: 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
  --track-empty: #21262d;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-primary);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}


header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(15, 17, 21, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left,
.header-right {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-right {
  justify-content: flex-end;
}

.header-center {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.logo {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #fff, #a0a0a0);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  padding: 0.5rem;
}

.icon-btn:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}


main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem;
  margin: 0 auto;
  width: 100%;
}

.game-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}


.art-frame-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 1rem;
}

.art-frame-container {
  width: 100%;
  max-width: min(100%, calc(100vh - 300px));
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  background-color: var(--panel-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  position: relative;
}

.art-frame {
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;

  background-size: 1000%;
  transition: background-size 0.5s cubic-bezier(0.25, 1, 0.5, 1), background-position 0.5s ease;
}

.art-frame.revealed {
  background-size: 100% !important;
  background-position: center !important;
}


.progress-track {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 2rem;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--track-empty);
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.dot.wrong {
  background-color: var(--danger-color);
  transform: scale(1.2);
}

.dot.correct {
  background-color: var(--accent-color);
  transform: scale(1.2);
  box-shadow: 0 0 10px var(--accent-color);
}

.dot.partial {
  background-color: #e3b341;
  transform: scale(1.2);
  box-shadow: 0 0 10px #e3b341;
}


.search-container {
  width: 100%;
  max-width: 500px;
  position: relative;
}

#search-wrapper {
  position: relative;
  width: 100%;
}

#guess-input {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-main);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#guess-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.2);
}

#guess-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.autocomplete-list {
  position: absolute;
  bottom: 100%;
  top: auto;
  left: 0;
  right: 0;
  background-color: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 4px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 10;
  list-style: none;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

.autocomplete-list li {
  padding: 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease;
}

.autocomplete-list li:last-child {
  border-bottom: none;
}

.autocomplete-list li:hover {
  background-color: var(--track-empty);
}

.autocomplete-list li .album-name {
  font-weight: 600;
  color: var(--text-primary);
}

.autocomplete-list li .artist-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

#game-status-message {
  text-align: center;
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.status-win {
  color: var(--accent-color);
}

.status-loss {
  color: var(--danger-color);
}


.post-game-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn {
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-main);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background-color: var(--accent-color);
  color: #fff;
  box-shadow: 0 4px 15px rgba(29, 185, 84, 0.3);
}


.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  padding: 2rem;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  z-index: 1001;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-btn:hover {
  color: var(--text-primary);
}

.modal-content h2 {
  margin-bottom: 1rem;
  font-family: var(--font-display);
}

.modal-content p,
.modal-content ul {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.modal-content ul {
  padding-left: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.stat-box {
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.mode-option:hover {
  background: var(--track-empty) !important;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.hidden {
  display: none !important;
}


@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

/* Help Modal Styles */
.help-content {
  text-align: center;
}

.help-subtitle {
  font-size: 1.1rem;
  margin-bottom: 1.5rem !important;
}

.help-examples {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.help-example {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
}

.example-box {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.correct-box {
  background-color: var(--accent-color);
  color: white;
  box-shadow: 0 0 10px rgba(29, 185, 84, 0.4);
}

.partial-box {
  background-color: #e3b341;
  color: white;
  box-shadow: 0 0 10px rgba(227, 179, 65, 0.4);
}

.wrong-box {
  background-color: var(--danger-color);
  color: white;
  box-shadow: 0 0 10px rgba(248, 81, 73, 0.4);
}

.example-text {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.help-rules {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
  margin-bottom: 1.5rem;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.4;
}

.rule-icon {
  color: var(--text-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.help-start-btn {
  width: 100%;
  font-size: 1.1rem;
  padding: 0.8rem;
  margin-top: 0.5rem;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}


::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--panel-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--track-empty);
  transition: .4s;
  border: 1px solid var(--border-color);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .4s;
}

input:checked+.slider {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

input:checked+.slider:before {
  transform: translateX(22px);
  background-color: #fff;
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

body.light-mode {
  --bg-color: #f8f9fa;
  --panel-bg: #ffffff;
  --text-primary: #1a1d24;
  --text-secondary: #5c6570;
  --border-color: #e1e4e8;
  --track-empty: #e1e4e8;
}

body.light-mode header {
  background-color: rgba(248, 249, 250, 0.8);
}

body.light-mode .logo {
  background: linear-gradient(135deg, #1a1d24, #5c6570);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-mode .help-examples {
  background: rgba(0, 0, 0, 0.05);
}

body.light-mode .stat-box {
  background: rgba(0, 0, 0, 0.05);
}

body.light-mode .mode-option {
  background: rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .mode-option:hover {
  background: rgba(0, 0, 0, 0.1) !important;
}

@media (max-width: 600px) {
  header {
    padding: 0.8rem 1rem;
  }

  .header-left,
  .header-right {
    gap: 0.5rem;
    flex: unset;
  }

  .header-center {
    flex: 1;
    justify-content: center;
  }

  .logo {
    font-size: 1.3rem;
    gap: 0.25rem !important;
  }

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

  .icon-btn {
    padding: 0.25rem;
  }

  .icon-btn svg {
    width: 20px;
    height: 20px;
  }
}