:root {
  --color-primary: #159141;
  --color-primary-light: #1ed760;
  --color-primary-dark: #1DB954;
  --color-bg-dark: #1a1a2e;
  --color-bg-darker: #16213e;
  --color-bg-darkest: #0d161b;
  --color-white: #fff;
  --color-gray-light: #f5f5f5;
  --color-gray: #aaa;
  --color-gray-dark: #888;
  --color-gray-darker: #666;
  --color-gray-darkest: #333;
  --color-error: #e74c3c;
  --color-warning: #f0a500;
  --color-error-light: #ff7676;
}

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

option {
    background-color: #16213e;
}


.spotify-iframe-container {
  width: 100%;
  max-width: 600px;
  margin: 1rem auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.spotify-iframe-container.hidden {
  display: none;
}


.iframe-test-container {
  margin-top: 1rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.iframe-test-container.hidden {
  display: none;
}


.user-badge {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(15, 17, 34, 0.9);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  z-index: 150;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.user-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #333;
  font-size: 1rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.user-name {
  font-size: 0.87rem;
  color: #fff;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.user-menu-toggle {
  display: none;
}

.user-menu {
  position: fixed;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: rgba(15, 17, 34, 0.95);
  border-radius: 0.75rem;
  padding: 0.5rem;
  min-width: 160px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.user-menu.open .user-menu-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.user-menu-dropdown form {
  margin: 0;
}

.user-menu-dropdown button {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  text-align: left;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.user-menu-dropdown button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.host-actions {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 100;
}

.cast-btn .cast-icon-idle,
.cast-btn .cast-icon-connected {
  transition: opacity 0.2s ease;
}

.cast-btn.cast-connected {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.cast-btn.cast-connected:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.section-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 2rem 0 1.5rem 0;
}


.logo-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  text-decoration: none;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 2.4rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 10px rgba(29, 185, 84, 0.5);
}

.logo-icon {
  font-size: 2rem;
  animation: pulse 2s ease-in-out infinite;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.logo-icon img,
.logo-icon svg {
  width: 1em;
  height: 1em;
  display: block;
  filter: brightness(0) saturate(100%) invert(41%) sepia(6%) saturate(194%) hue-rotate(201deg) brightness(95%) contrast(88%);
}

.logo-text {
  background: linear-gradient(135deg, #159141 0%, #1ed760 50%, #fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.logo-link:hover .logo-icon {
  animation: bounce 0.5s ease;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}


.main-logo {
  font-size: 3rem;
  text-shadow: 0 4px 20px rgba(29, 185, 84, 0.4);
  margin-bottom: 2.5rem;
}

.main-logo .logo-icon {
  font-size: 3rem;
}

.main-logo .logo-text {
  font-size: 3rem;
}


.page-title {
  margin-top: 2rem;
}


.host-screen,
.game-screen {
  padding-top: 4rem;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  min-height: 100vh;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 5rem 1rem 2rem;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.container > * {
  text-align: center;
}

.legal-page {
  max-width: 720px;
}

.legal-page,
.legal-page > * {
  text-align: left;
  align-self: stretch;
}

section.legal-section {
    margin-top: 2em;
}
.site-footer {
  position: fixed;
  bottom: 1rem;
  left: 0;
  right: 0;
  text-align: center;
  padding: 0.5rem;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: #aaa;
  margin-bottom: 2rem;
}

.btn {
  margin: 5px;
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.btn:hover {
  transform: scale(1.05);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: #159141;
  color: #fff;
}

.btn-primary:disabled {
  background: #666;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-primary:disabled:hover {
  transform: none;
}

.btn-spotify {
  background: #159141;
  color: #fff;
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: #fff;
  margin-top: 1rem;
}

.info {
  color: #b0b0b0;
  font-size: 0.85rem;
  margin-top: 1rem;
}

.action-group {
    margin-bottom: 2.5rem;
    margin-top: 0.5rem;
}

.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}

.hint {
  color: #888;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.hint-text {
  color: #888;
  font-size: 0.85rem;
  margin-top: 0.4rem;
  margin-bottom: 0;
}

.link-subtle {
  color: #888;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-block;
}

.link-subtle:hover {
  color: #b0b0b0;
}

.join-game-code {
  font-size: 2.5rem;
  color: #1ed760;
  letter-spacing: 0.2rem;
  margin-bottom: 1.5rem;
}

.app-alert {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.app-alert.visible {
  opacity: 1;
  pointer-events: all;
}

.app-alert .app-alert-content {
  background: #1a1a2e;
  border-radius: 1rem;
  padding: 1.5rem;
  width: min(90%, 420px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  display: flex;
  gap: 1rem;
}

.app-alert-icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(29, 185, 84, 0.15);
  color: #1ed760;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.app-alert-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.app-alert-body p {
  margin: 0;
  font-size: 1rem;
  color: #fff;
}


.page-content {
  max-width: 700px;
  margin: 0 auto;
  text-align: left;
  color: #ccc;
  line-height: 1.6;
}

.page-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #fff;
}

.page-content h3 {
  color: #1DB954;
  margin-bottom: 0.5rem;
}

.page-content section {
  margin-bottom: 2.5rem;
}

.page-content ul,
.page-content ol {
  margin-left: 1.5rem;
  margin-top: 0.5rem;
}

.page-content li {
  margin-bottom: 0.5rem;
}

.page-content a {
  color: #1DB954;
  text-decoration: none;
}

.page-content a:hover {
  text-decoration: underline;
}

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


.score-info {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: #f5f5f5;
}

.score-info h3 {
  margin: 0;
  color: #1ed760;
}

.score-steps {
  margin-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.score-hint {
  font-style: italic;
  color: #c5c5c5;
}

.score-table {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.score-table div {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.main-logo-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}


.category-list {
  width: 100%;
  margin-bottom: 1rem;
}

.category-card {
  display: block;
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  text-decoration: none;
  color: #fff;
  text-align: left;
  transition: background 0.2s;
}

.category-card:hover {
  background: rgba(255,255,255,0.15);
}

.category-card h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.category-card p {
  color: #aaa;
  font-size: 0.9rem;
}


.countdown-screen .instruction {
  font-size: 1.25rem;
  color: #aaa;
  margin-bottom: 2rem;
}

.countdown {
  font-size: 6rem;
  font-weight: bold;
  color: #159141;
}


.game-screen {
  justify-content: flex-start;
  padding-top: 4rem;
}

.state {
  width: 100%;
}

.hidden {
  display: none !important;
}


.music-animation {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 60px;
  gap: 6px;
  margin: 2rem 0;
}

.music-animation span {
  width: 8px;
  background: #159141;
  border-radius: 4px;
  animation: bounce 1s ease-in-out infinite;
}

.music-animation span:nth-child(1) { height: 20px; animation-delay: 0s; }
.music-animation span:nth-child(2) { height: 40px; animation-delay: 0.1s; }
.music-animation span:nth-child(3) { height: 30px; animation-delay: 0.2s; }
.music-animation span:nth-child(4) { height: 50px; animation-delay: 0.3s; }

@keyframes bounce {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.5); }
}

#timer {
  font-size: 3rem;
  font-weight: bold;
  color: #159141;
}


#year-input {
  width: 100%;
  max-width: 200px;
  padding: 1rem;
  font-size: 1.5rem;
  text-align: center;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  color: #fff;
  margin: 1.5rem 0;
}

#year-input:focus {
  outline: none;
  border-color: #159141;
}


#result-icon {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.track-info {
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

#album-cover {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  margin-bottom: 1rem;
  object-fit: cover;
}

#track-name {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

#track-artist {
  color: #aaa;
  margin-bottom: 1rem;
}

.year {
  font-size: 1.1rem;
}

.year strong {
  color: #159141;
  font-size: 1.5rem;
}

#guess-result {
  color: #aaa;
  margin-top: 0.5rem;
}


.results-screen {
  justify-content: flex-start;
  padding-top: 2rem;
}

.results-screen h1 {
  margin-bottom: 1.5rem;
}

.empty-state {
  color: #aaa;
  margin: 2rem 0;
}

.stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.stat {
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: bold;
  color: #159141;
}

.stat-label {
  font-size: 0.85rem;
  color: #aaa;
}

.results-list {
  width: 100%;
  margin-bottom: 1.5rem;
}

.result-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  text-align: left;
  border-left: 4px solid #666;
}

.result-card.correct {
  border-left-color: #159141;
}

.result-card.close {
  border-left-color: #f0a500;
}

.result-album {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
}

.result-info {
  flex: 1;
  min-width: 0;
}

.result-info h3 {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-artist {
  font-size: 0.8rem;
  color: #aaa;
  margin-bottom: 0.25rem;
}

.result-years {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
  align-items: center;
}

.correct-year strong,
.guessed-year strong {
  color: #fff;
}

.diff-badge {
  background: rgba(255,255,255,0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
}

.diff-badge.perfect {
  background: #159141;
  color: #fff;
}

.btn-danger {
  background: #e74c3c;
  color: #fff;
  margin-top: 0.5rem;
}


.results-list.compact {
  width: 100%;
  margin-bottom: 1rem;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 0.5rem;
  margin-bottom: 0.35rem;
  border-left: 3px solid #666;
}

.result-row.correct {
  border-left-color: #159141;
}

.result-row.close {
  border-left-color: #f0a500;
}

.play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #159141;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-btn:hover {
  background: #1ed760;
}

.result-thumb {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.result-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.result-title {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-artist-small {
  font-size: 0.7rem;
  color: #aaa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  min-width: 45px;
}

.year-correct {
  font-size: 0.9rem;
  font-weight: bold;
  color: #159141;
}

.diff-small {
  font-size: 0.7rem;
  color: #aaa;
}

.diff-small.perfect {
  color: #159141;
  font-weight: bold;
}




.create-form,
.join-form {
  width: 100%;
  max-width: 320px;
}

.form-group {
  margin-bottom: 1.75rem;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  color: #bbb;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #159141;
}

/* Hide default number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Custom number input wrapper with spinner buttons */
.number-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.number-input-wrapper input[type="number"] {
  padding-right: 3rem;
}

.number-spinner {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: 2.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.spinner-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 0.7rem;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.spinner-btn:active {
  background: rgba(255, 255, 255, 0.15);
}

.spinner-up {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0 6px 0 0;
}

.spinner-down {
  border-radius: 0 0 6px 0;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

.device-input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.device-input-row select {
  flex: 1;
  padding: 0.75rem 1rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: none;
  margin-right: -0.5em;
}

.device-input-row::after {
  content: '▼';
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: var(--color-gray);
  pointer-events: none;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.icon-btn:hover {
  transform: scale(1.05);
  background: rgba(29, 185, 84, 0.2);
  border-color: #1ed760;
}

.icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-hint {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: #bbb;
}

.form-hint.success {
  color: #1ed760;
}

.form-hint.error {
  color: #ff7676;
}

.error-msg {
  color: #e74c3c;
  margin-bottom: 1rem;
}


.host-screen {
  justify-content: flex-start;
  padding-top: 2rem;
}

.game-code-box {
  margin: 2.5rem 0;
}

.game-code-box p {
  color: #aaa;
  font-size: 0.9rem;
}

.game-code {
  font-size: 4rem;
  font-weight: bold;
  letter-spacing: 0.5rem;
  color: #159141;
}

.qr-box {
  margin-bottom: 1.5rem;
}

.qr-code {
  width: 15rem;
  height: 15rem;
  border-radius: 8px;
}

.join-url {
  font-size: 0.75rem;
  color: #aaa;
  word-break: break-all;
  margin: 0.5rem 0;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-icon {
  padding: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
}

.btn-icon svg {
  display: block;
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

.players-box {
  width: 100%;
  margin-bottom: 1.5rem;
}

.players-box h3 {
  margin-bottom: 0.75rem;
}

.player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.player-chip {
  background: rgba(255,255,255,0.1);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
}


.player-screen {
  justify-content: flex-start;
  padding-top: 5rem;
}

.waiting-box {
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.waiting-box p {
  margin: 0;
}

.spinner {
  width: 108px;
  height: 48px;
}

.spinner,
.loader {
  position: relative;
  width: 120px;
  display: flex;
  justify-content: space-between;
  margin: 2em;
}

.spinner::after,
.spinner::before,
.loader::after,
.loader::before {
  content: '';
  display: inline-block;
  width: 48px;
  height: 48px;
  background-color: #fff;
  background-image: radial-gradient(circle 14px, #0d161b 100%, transparent 0);
  background-repeat: no-repeat;
  border-radius: 50%;
  animation: eyeMove 10s infinite, blink 10s infinite;
}

@keyframes eyeMove {
  0%, 10% { background-position: 0 0; }
  13%, 40% { background-position: -15px 0; }
  43%, 70% { background-position: 15px 0; }
  73%, 90% { background-position: 0 15px; }
  93%, 100% { background-position: 0 0; }
}

@keyframes blink {
  0%, 10%, 12%, 20%, 22%, 40%, 42%, 60%, 62%, 70%, 72%, 90%, 92%, 98%, 100% { height: 48px; }
  11%, 21%, 41%, 61%, 71%, 91%, 99% { height: 18px; }
}

.player-name {
  font-size: 1.25rem;
  color: #159141;
  margin-top: 1rem;
}


.round-info {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-bottom: 1.5rem;
  margin-top: 3em;
  font-size: 0.9rem;
  color: #aaa;
}

.timer {
  color: #159141;
  font-weight: bold;
}


.guess-form {
  width: 100%;
}

.guess-form h2 {
  margin-bottom: 1rem;
}

.guess-form input {
  width: 100%;
  max-width: 200px;
  padding: 1rem;
  font-size: 2rem;
  text-align: center;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  color: #fff;
  margin-bottom: 1rem;
}

.btn-large {
    padding: 1.5rem 2.5rem;
    font-size: 1.4rem;
}
.guess-sent {
  text-align: center;
}

.check-icon {
  font-size: 4rem;
  color: #159141;
}

.guess-display {
  font-size: 2rem;
  font-weight: bold;
  color: #159141;
}


.guess-progress {
  font-size: 1.1rem;
  margin: 1.5rem 0;
  color: #aaa;
}


.track-reveal {
  margin: 1.5rem 0;
}

.reveal-album {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.reveal-year strong {
  color: #159141;
  font-size: 1.5rem;
}


.round-results {
  width: 100%;
  margin: 1rem 0;
}

.round-results .result-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
}

.result-rank {
  width: 24px;
  font-weight: bold;
  color: #aaa;
}

.result-name {
  flex: 1;
  text-align: left;
}

.result-guess {
  color: #aaa;
}

.result-points {
  color: #159141;
  font-weight: bold;
}


.my-result {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
}

.my-guess strong {
  color: #fff;
}

.my-diff {
  font-size: 1.25rem;
  margin: 0.5rem 0;
}

.my-points {
  color: #159141;
  font-size: 1.5rem;
  font-weight: bold;
}

.my-rank {
  color: #aaa;
  font-size: 0.9rem;
}

.waiting-next {
  color: #aaa;
  font-size: 0.9rem;
}


.leaderboard {
  width: 100%;
  margin: 1rem 0;
}

.leaderboard-row {
  width: 100%;
  margin: 1rem 0;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.lb-rank,
.display-result-row .rank {
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
}

.leaderboard-medal {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.35));
}

.leaderboard-row.winner {
  background: rgba(29, 185, 84, 0.2);
  border: 2px solid #159141;
}

.leaderboard-row.me {
  border: 2px solid #fff;
}

.lb-rank {
  width: 30px;
  font-size: 1.25rem;
}

.lb-name {
  flex: 1;
  text-align: left;
  font-weight: 500;
}

.lb-score {
  font-weight: bold;
  color: #159141;
}

.my-final-rank {
  margin: 1rem 0;
  font-size: 1.1rem;
}

.my-final-rank strong {
  color: #159141;
}


.device-list {
  width: 100%;
  margin: 1rem 0;
}

.device-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.device-card:hover {
  background: rgba(255,255,255,0.15);
}

.device-card.device-active {
  border-color: #159141;
}

.device-card.device-selected {
  background: rgba(29, 185, 84, 0.2);
}

.device-icon {
  font-size: 2rem;
}

.device-name {
  flex: 1;
  font-weight: 600;
}

.device-status {
  font-size: 0.75rem;
  color: #159141;
  background: rgba(29, 185, 84, 0.2);
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
}


.device-dropdown {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: #fff;
  margin-bottom: 0.5rem;
}

.device-dropdown option {
  background: #1a1a1a;
  color: #fff;
}

.btn-link {
  background: none;
  border: none;
  color: #159141;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.5rem;
  text-decoration: underline;
}

.btn-link:hover {
  color: #1ed760;
}

div#gameend-state {
    padding-top: 4rem;
}


.score-info-btn {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #aaa;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.score-info-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}


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

.modal-content {
  background: #1a1a2e;
  border-radius: 1rem;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: #888;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}

.modal-content h3 {
  margin-bottom: 1rem;
  color: #159141;
}

.confirm-modal {
  text-align: center;
}

.confirm-modal p {
  margin-bottom: 1.5rem;
  color: #f5f5f5;
  font-size: 1rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.modal-actions .btn {
  flex: 1 1 120px;
  margin: 0;
}

.score-formula {
  background: rgba(21, 145, 65, 0.2);
  padding: 1rem;
  border-radius: 0.5rem;
  font-family: monospace;
  font-size: 1rem;
  text-align: center;
  margin-bottom: 1rem;
  color: #fff;
}

.score-examples {
  list-style: none;
  font-size: 0.9rem;
}

.score-examples li {
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.score-examples li:last-child {
  border-bottom: none;
}

div#roundend-state {
    padding-top: 3rem;
}

/* Category Selector Full Page Overlay */
.category-page {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100vh;
  background: var(--color-bg-darker);
  overflow-y: auto;
  animation: expandFromButton 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center top;
}

.category-page.active {
  display: block;
}

@keyframes expandFromButton {
  from {
    opacity: 0;
    transform: scale(0.3);
    border-radius: 50%;
  }
  to {
    opacity: 1;
    transform: scale(1);
    border-radius: 0;
  }
}

.category-page-header {
  position: sticky;
  top: 0;
  background: var(--color-bg-darker);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.category-page-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--color-white);
}

.category-page-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--color-gray);
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.category-page-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
}

.category-page-content {
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.category-groups {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.category-group {
  display: block;
}

.category-group-title {
  font-size: 1.1rem;
  color: var(--color-primary-light);
  margin-bottom: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.75rem;
}

.category-item {
  background: var(--color-bg-dark);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--color-white);
}

.category-item:hover {
  border-color: var(--color-primary);
  background: rgba(21, 145, 65, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(21, 145, 65, 0.2);
}

.category-item:active {
  transform: translateY(0);
}

.category-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-white);
}

.category-description {
  font-size: 0.85rem;
  color: var(--color-gray);
}

/* Category Button (replacement for select) */
#category-button {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--color-gray);
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}

#category-button:hover {
  border-color: var(--color-primary);
  background: rgba(21, 145, 65, 0.05);
}

#category-button.selected {
  color: var(--color-white);
}

#category-button:focus {
  border-color: var(--color-primary);
  outline: none;
}

#category-button::after {
  content: '▼';
  font-size: 0.8rem;
  color: var(--color-gray);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .category-selector-content {
    width: 98%;
    max-width: none;
    max-height: 92vh;
    padding: 0;
  }
  
  .modal-header {
    padding: 1rem;
  }
  
  .category-items {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  .category-item {
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
  }
  
  .modal-header h2 {
    font-size: 1.2rem;
  }
  
  .modal-body {
    padding: 0.75rem;
    max-height: calc(92vh - 60px);
  }
}