:root {
  color-scheme: dark;

  --bg: #121212;
  --surface: #1c1c1c;
  --text: #ededed;
  --text-secondary: #b4b4b4;
  --text-muted: #828282;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-dim: #3a3a3a;
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-hover-soft: rgba(255, 255, 255, 0.035);
  --on-status: #141414;
  --green: #3ddc97;
  --yellow: #d3a03c;
  --skip: #767676;
  --red: #d9534f;
  --blue: #2463C8;
  --overlay: rgba(0, 0, 0, 0.6);
  --shadow: rgba(0, 0, 0, 0.45);
  --hover-mix: #ffffff;
  --logo-primary: #ffffff;

  --accent: #2463C8;
  --on-accent: #ffffff;

  --grid-size: 50px;
  --grid-line: color-mix(in srgb, var(--accent) 15%, transparent);
  --grid-region: color-mix(in srgb, var(--accent) 25%, transparent);
  --bg-overlay: color-mix(in srgb, var(--accent) 10%, transparent);
  --outline: color-mix(in srgb, var(--border-dim) 55%, transparent);
  --logo-accent: var(--accent);
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.loader-dots {
  position: relative;
  width: 76px;
  height: 76px;
}

.loader-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.triangle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: rotate(0deg) translateY(-4px);
}

.triangle1 {
  transform: rotate(180deg) translateY(-4px);
}

.dot {
  width: 10px;
  height: 10px;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -5px;
  margin-left: -5px;
}

.dot1 { transform: translateX(16px) translateY(13px); }
.dot2 { transform: translateX(-16px) translateY(13px); }
.dot3 { transform: translateY(-13px); }

.in {
  width: 100%;
  height: 100%;
  background: var(--accent);
  border-radius: 50%;
  transform-origin: 50% 50%;
  animation: glow 0.6s ease-in-out infinite;
}

.triangle1 .in {
  animation-delay: 0.3s;
}

@keyframes glow {
  50% { transform: scale(0.5); }
}

@keyframes glow-soft {
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .in {
    animation: glow-soft 1.6s ease-in-out infinite;
  }

  .triangle1 .in {
    animation-delay: 0.8s;
  }
}

body {
  box-sizing: border-box;
  font-family: "Arimo", Arial, sans-serif;
  font-weight: 400;
  font-size: 14px;
  margin: 0;
  padding: 34px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    var(--region-layer, none),
    repeating-linear-gradient(to right, var(--grid-line) 0 2px, transparent 1px var(--grid-size)),
    repeating-linear-gradient(to bottom, var(--grid-line) 0 2px, transparent 1px var(--grid-size)),
    linear-gradient(var(--bg-overlay, transparent), var(--bg-overlay, transparent));
  background-size: 100% 100vh, auto, auto, auto;
  background-position: 50% 50%, 0 0, 0 0, 0 0;
  background-repeat: no-repeat, repeat, repeat, no-repeat;
  color: var(--text);
}

::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

@media (min-width: 701px) {
  .header-controls {
    align-self: flex-end;
  }

  .mode-switcher-header {
    align-self: flex-end;
  }
}

.main-game-wrapper {
  box-sizing: border-box;
  width: 100%;
  max-width: 900px;
  background: var(--surface);
  border: 1px solid var(--outline);
  padding: 18px;
  border-radius: 20px;
  margin: 10px auto;
}

.container-grid {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.column:first-child {
  flex: 1;
}

.column:last-child {
  flex: 0 1 540px;
}

.box {
  box-sizing: border-box;
  background-color: var(--bg);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.column .box:last-child {
  margin-bottom: 0;
}

.site-header {
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 8px;
  gap: 16px;
}

.logo-img {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 14px;
}

.logo-img svg {
  display: block;
  height: 88px;
  width: auto;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.site-footer {
  width: 100%;
  max-width: 900px;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 14px 18px 0;
  text-align: center;
}

.site-footer .copyright {
  margin-top: 0;
}

.copyright {
  font-size: 12px;
  opacity: 30%;
  text-align: center;
}

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--outline);
  box-sizing: border-box;
  color: var(--accent);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background-color 0.2s, transform 0.1s;
  position: relative;
}

.icon-btn:hover {
  background-color: color-mix(in srgb, var(--surface), var(--hover-mix) 15%);
}

.icon-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background-color: var(--bg);
  border: 1px solid var(--border-dim);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.2s ease;
}

.icon-btn:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.play-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  cursor: pointer;
  font-size: 24px;
  transition: background-color 0.2s, transform 0.1s;
}

.play-btn:hover {
  background-color: color-mix(in srgb, var(--accent), var(--hover-mix) 15%);
}

.btn-copy,
.btn-skip,
.btn-submit {
  box-sizing: border-box;
  flex: none;
  width: auto;
  border: none;
  padding: 12px 35px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: var(--on-accent);
  transition: background-color 0.2s, transform 0.1s;
}

.btn-copy:hover,
.btn-skip:hover,
.btn-submit:hover {
  background-color: color-mix(in srgb, var(--accent), var(--hover-mix) 15%);
}

.icon-btn:active,
.play-btn:active,
.btn-copy:active,
.btn-skip:active,
.btn-submit:active,
.mode-switch-btn:active {
  transform: scale(0.96);
}

.button-group {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.hamburger-btn {
  display: none;
}

.mode-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 20px;
  padding: 4px;
}

.mode-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 15px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}

.mode-switch-btn:hover {
  background: var(--surface-hover);
}

.mode-switch-btn > i {
  font-size: 13px;
}

.mode-switch-btn.active {
  background: var(--accent);
  color: var(--on-accent);
}

.mode-switch-btn.active > i {
  color: var(--on-accent);
}

.score-row {
  height: 48px;
  justify-content: flex-start;
  padding: 0 16px;
}

.score-display {
  white-space: nowrap;
}

.score-num {
  color: var(--accent);
  font-weight: 800;
  margin-left: 2px;
  margin-right: 12px;
}

.player-container {
  flex-direction: column;
  gap: 12px;
}

.player-instruction {
  font-weight: 700;
  color: var(--text-muted);
}

.progress-bar-bg {
  position: relative;
  width: 100%;
  height: 18px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
}

.progress-unlocked {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent);
  opacity: 40%;
  z-index: 1;
  width: 50%;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent);
  z-index: 2;
  width: 25%;
}

.progress-fill,
.progress-unlocked {
  transition: width 0.3s ease-out;
}

.progress-markers {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

.marker {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--bg);
}

.score-display-inline {
  display: none;
}

.score-display-inline .score-num:last-child {
  margin-right: 0;
}

.time-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.volume-container {
  gap: 15px;
  height: 64px;
}

.volume-container > i {
  flex: 0 0 24px;
  width: 24px;
  text-align: center;
}

.volume-container > i.fa-volume-mute {
  color: var(--red);
}

.slider {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
}

.guess-container {
  flex-direction: column;
  align-items: stretch;
  padding: 10px;
  gap: 6px;
}

.guess-row {
  min-height: 16px;
  padding: 11px 15px 11px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  border: 2px solid transparent;
  font-weight: 800;
}

.guess-content {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.guess-skipped {
  background: color-mix(in srgb, var(--skip), transparent 90%);
  border: 2px solid var(--skip);
  color: var(--skip);
}

.guess-wrong {
  background: color-mix(in srgb, var(--red), transparent 90%);
  border: 2px solid var(--red);
  color: var(--red);
}

.guess-partial {
  background: color-mix(in srgb, var(--yellow), transparent 90%);
  border: 2px solid var(--yellow);
  color: var(--yellow);
}

.guess-partial i {
  color: var(--yellow);
}

.guess-correct {
  background: color-mix(in srgb, var(--green), transparent 90%);
  border: 2px solid var(--green);
  color: var(--green);
}

.guess-empty {
  background: color-mix(in srgb, var(--skip), transparent 97%);
  border: 2px dashed color-mix(in srgb, var(--skip), transparent 80%);
}

.answer-display {
  padding: 0 !important;
  overflow: hidden;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 110px;
}

.answer-img {
  width: 110px;
  object-fit: cover;
}

.answer-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 15px;
  flex-grow: 1;
  text-align: left;
}

.result-text {
  margin: 0;
  margin-bottom: 2px;
  font-size: 20px;
  font-weight: 800;
  color: var(--green);
}

.answer-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  color: var(--text-secondary);
}

.answer-line:first-of-type {
  margin-top: 10px;
}

.answer-line i {
  width: 16px;
  text-align: center;
  color: var(--accent);
}

.endgame-container-daily,
.endgame-container-infinite {
  flex-direction: column;
  gap: 10px;
}

.next-song-label {
  color: var(--text);
}

.countdown-timer {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 2px;
}

.kofi-container {
  display: none;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
}

.kofi-container.visible {
  display: flex;
}

.kofi-content {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  box-sizing: border-box;
  text-align: left;
}

.kofi-icon {
  flex: none;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.kofi-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.kofi-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.kofi-title {
  font-weight: 800;
  color: var(--text);
}

.kofi-subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-secondary);
}

.btn-kofi {
  flex: none;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s, transform 0.1s;
}

.btn-kofi:hover {
  background-color: color-mix(in srgb, var(--accent), var(--hover-mix) 15%);
}

.btn-kofi:active {
  transform: scale(0.96);
}

.controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.controls .music-list-btn {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: var(--bg);
  border: 2px solid var(--border-dim);
  transition: border-color 0.2s, transform 0.1s;
}

.controls .music-list-btn:hover {
  background: var(--bg);
  border-color: var(--accent);
}

.search-container {
  position: relative;
  width: 100%;
}

.search-bar {
  box-sizing: border-box;
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid var(--border-dim);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s;
}

.search-bar:focus {
  outline: none;
  border-color: var(--accent);
}

.search-results-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 100%;
  max-height: 300px;
  background: var(--bg);
  border: 2px solid var(--accent);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  overflow-y: auto;
  display: none;
  z-index: 100;
}

.result-item {
  padding: 10px 15px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.2s;
}

.result-item:hover {
  background: color-mix(in srgb, var(--accent), transparent 80%);
}

.result-content {
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.item-title {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 2px;
}

.item-game,
.item-game-yellow {
  display: block;
  font-size: 12px;
  line-height: 1.2;
  margin-top: 2px;
}

.item-game {
  color: var(--accent);
  font-weight: 400;
}

.item-game-yellow {
  color: var(--yellow);
  font-weight: 600;
}

.search-results-dropdown::-webkit-scrollbar {
  width: 6px;
}

.search-results-dropdown::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 999;
}

.sidebar {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -44%) scale(0.96);
  width: 480px;
  max-width: calc(100vw - 32px);
  height: 820px;
  max-height: 80vh;
  background: var(--bg);
  z-index: 1000;
  border-radius: 16px;
  border: 1px solid var(--border-dim);
  box-shadow: 0 12px 32px var(--shadow);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.22s ease;
}

.sidebar.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: all;
}

.sidebar-header {
  padding: 20px 20px 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.sidebar-top h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.close-sidebar,
.close-filter,
.close-stats,
.close-settings,
.close-changelog {
  background: var(--bg);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
  line-height: 1;
}

.close-sidebar:hover,
.close-filter:hover,
.close-stats:hover,
.close-settings:hover,
.close-changelog:hover {
  background-color: color-mix(in srgb, var(--bg), var(--hover-mix) 12%);
  color: var(--text);
}

.sidebar-header input[type="text"] {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 2px solid var(--border-dim);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 14px;
  transition: border-color 0.2s;
}

.sidebar-header input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

.options-remaining,
.filter-stats {
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px 0;
  border-top: 1px solid var(--border-subtle);
}

#optionsCount,
#totalSelected {
  color: var(--accent);
  margin-left: 4px;
}

.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
  border-radius: 0 0 16px 16px;
  scrollbar-color: var(--accent) var(--surface);
  scrollbar-width: thin;
}

.sidebar-list::-webkit-scrollbar {
  width: 6px;
}

.sidebar-list::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

.filter-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: var(--surface-hover-soft);
  border-left: 4px solid var(--accent);
  margin-top: 8px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.2s ease;
}


.game-header-default {
  color: var(--text);
  border-left-color: var(--accent);
}

.game-header-locked {
  color: var(--yellow);
  border-left-color: var(--yellow);
}

.category-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.category-controls {
  display: flex;
  gap: 6px;
}

.cat-btn {
  background: var(--surface-hover);
  border: 1px solid var(--border-dim);
  color: var(--text-muted);
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent), transparent 90%);
}

.sidebar-song-item {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  contain: content;
}

.sidebar-song-item:hover {
  background: color-mix(in srgb, var(--accent), transparent 90%);
  color: var(--text);
}

.song-group-cover img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

@media (max-width: 700px) {
  .song-group-cover {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: var(--surface);
    border-left: 4px solid var(--accent);
    border-bottom: 1px solid var(--border-subtle);
  }

  .song-group-cover img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    margin-right: 0;
  }

  .song-group-cover strong {
    color: var(--text);
    display: inline;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .song-group-cover small {
    display: inline;
    margin-left: auto;
    color: var(--text-muted);
  }
}

@media (min-width: 701px) {
  #sidebar {
    width: 880px;
    max-width: calc(100vw - 32px);
    height: 680px;
    max-height: 85vh;
  }

  .song-group {
    display: flex;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .song-group-cover {
    flex: 0 0 110px;
    text-align: center;
    position: sticky;
    top: 12px;
    align-self: flex-start;
  }

  .song-group-cover img {
    width: 110px;
    height: 110px;
    border-radius: 12px;
    object-fit: cover;
    display: block;
  }

  .song-group-cover strong {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.3;
    color: var(--text);
  }

  .song-group-cover small {
    color: var(--text-muted);
    font-size: 11px;
  }

  .song-group-list {
    flex: 1;
    min-width: 0;
  }

  #sidebarContent .sidebar-song-item {
    border-bottom: none;
    padding: 8px 10px;
    border-radius: 8px;
  }
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px 16px 20px;
  box-sizing: border-box;
  background: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.filter-actions button {
  flex: 1 1 calc(50% - 4px);
  padding: 10px 16px;
  font-size: 11px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-actions .restore-defaults-btn {
  flex: 1 1 100%;
  background: transparent;
  color: var(--accent);
  border: 1px dashed var(--accent);
}

.filter-actions button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.filter-actions .restore-defaults-btn:hover {
  background: color-mix(in srgb, var(--accent), transparent 90%);
  border-style: solid;
}

.filter-actions button:active {
  transform: scale(0.96);
}

.filter-actions #selectAll:active,
.filter-actions #deselectAll:active,
.filter-actions #restoreDefaults:active {
  transform: none;
}

#applyFilters {
  flex: 1 1 100% !important;
  background: var(--green);
  border-color: var(--green);
  color: var(--on-status);
}

#applyFilters:hover {
  background: color-mix(in srgb, var(--green), var(--hover-mix) 15%);
  border-color: color-mix(in srgb, var(--green), var(--hover-mix) 15%);
}

.filter-search {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 14px 0;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

.filter-search:focus {
  outline: none;
  border-color: var(--accent);
}

#filterWarning {
  padding: 10px 20px;
  font-size: 12px;
  color: var(--red);
  font-weight: 700;
  text-align: center;
  background: color-mix(in srgb, var(--red), transparent 95%);
  border-bottom: 1px solid var(--border-subtle);
  display: none;
}

.filter-category-group {
  display: flex;
  flex-direction: column;
}

.filter-item {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}

.filter-item:hover {
  background: color-mix(in srgb, var(--accent), transparent 90%);
  color: var(--text);
}

.filter-item input[type="checkbox"] {
  margin-right: 12px;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.filter-item span {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
}

.filter-items-grid {
  display: flex;
  flex-direction: column;
}

.filter-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.filter-item-name {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.3;
}

.filter-item-name strong {
  display: block;
  font-size: 13px;
  color: var(--text);
}

.filter-item-name small {
  display: block;
  font-weight: 400;
  opacity: 0.65;
}

#filterSidebar {
  width: min(480px, 94vw);
  height: auto;
  max-height: 88dvh;
}

#filterSidebar .filter-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  padding: 14px;
}

@media (min-width: 701px) {
  #filterSidebar {
    width: 1080px;
    max-width: calc(100vw - 32px);
    height: 700px;
    max-height: 85vh;
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-rows: auto auto auto 1fr;
  }

  #filterSidebar .sidebar-header {
    grid-column: 1;
    border-radius: 16px 0 0 0;
    border-bottom: none;
  }

  #filterSidebar .filter-actions {
    grid-column: 1;
    flex-direction: column;
    flex-wrap: nowrap;
    border-bottom: none;
  }

  #filterSidebar .filter-actions button {
    flex: 0 0 auto;
  }

  #filterSidebar #filterWarning {
    grid-column: 1;
  }

  #filterSidebar .sidebar-list {
    grid-column: 2;
    grid-row: 1 / 5;
    border-left: 1px solid var(--border-subtle);
    border-radius: 0 16px 16px 0;
    padding: 10px 0;
  }

  #filterSidebar .filter-items-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
  }
}

#filterSidebar .filter-item {
  flex-direction: column;
  align-items: stretch;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  position: relative;
  background: var(--surface);
  text-align: center;
}

#filterSidebar .filter-item:hover {
  border-color: color-mix(in srgb, var(--accent), transparent 50%);
}

#filterSidebar .filter-item.checked {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

#filterSidebar .filter-item input[type="checkbox"] {
  position: absolute;
  top: 12px;
  left: 12px;
  margin-right: 0;
  z-index: 2;
}

#filterSidebar .filter-item:not(.checked) .filter-cover {
  opacity: 0.4;
  filter: grayscale(70%);
}

.settings-list {
  padding: 0;
}

.settings-section {
  padding: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-section-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.danger-label {
  color: var(--red);
}

.settings-option-group {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-option-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-option-group:first-child {
  padding-top: 0;
}

.settings-appearance-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
}

.settings-appearance-row .settings-option-group {
  flex: 1;
  min-width: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.settings-appearance-row .settings-option-group-accent {
  flex: 1.8;
}

@media (max-width: 700px) {
  .settings-appearance-row {
    gap: 8px;
  }

  .settings-appearance-row .theme-select {
    padding: 11px 22px 11px 8px;
  }

  .settings-appearance-row .theme-select-wrap::after {
    right: 8px;
  }
}

.settings-option-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.settings-radio-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-radio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-dim);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.settings-radio-row:hover {
  background: color-mix(in srgb, var(--accent), transparent 92%);
  border-color: var(--accent);
}

.settings-radio-row input[type="radio"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}

.settings-radio-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-radio-label span {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.settings-radio-label small {
  font-size: 11px;
  color: var(--text-muted);
}

.settings-section-danger {
  border-bottom: none;
}

.theme-select-wrap {
  position: relative;
  display: block;
}

.theme-select-wrap::after {
  content: "";
  position: absolute;
  right: 17px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -5px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  pointer-events: none;
}

.theme-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 44px 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-dim);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  accent-color: initial;
  transition: border-color 0.15s ease;
}

.theme-select option {
  background: var(--bg);
  color: var(--text);
}

.theme-select:hover {
  border-color: var(--accent);
}

.theme-select:focus {
  outline: none;
  border-color: var(--accent);
}

.settings-danger-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.settings-danger-actions .btn-danger {
  flex: 1 1 150px;
  width: auto;
}

.btn-danger {
  width: 100%;
  padding: 11px 16px;
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s ease;
}

.btn-danger:hover {
  background: color-mix(in srgb, var(--red), transparent 90%);
}

.delete-confirm {
  margin-top: 12px;
  padding: 12px;
  background: color-mix(in srgb, var(--red), transparent 92%);
  border: 1px solid color-mix(in srgb, var(--red), transparent 70%);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.delete-confirm-btns {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn-danger-confirm {
  flex: 1;
  padding: 8px;
  background: var(--red);
  color: var(--on-status);
  border: none;
  border-radius: 6px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-danger-confirm:hover {
  background: color-mix(in srgb, var(--red), var(--hover-mix) 15%);
}

.btn-danger-cancel {
  flex: 1;
  padding: 8px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-danger-cancel:hover {
  background: color-mix(in srgb, var(--bg), var(--hover-mix) 10%);
}

.mobile-nav-drawer {
  display: none;
}

.mobile-nav-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-nav-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: background-color 0.2s;
  box-sizing: border-box;
}

.mobile-nav-action-btn i {
  color: var(--accent);
  width: 18px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

.mobile-nav-action-btn:hover {
  background: color-mix(in srgb, var(--surface), var(--hover-mix) 10%);
}

.changelog-list {
  box-sizing: border-box;
  width: 100%;
  padding: 18px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.changelog-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0;
}

.changelog-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.changelog-version-btn {
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-dim);
  background: var(--bg);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

.changelog-version-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--accent);
  background-color: color-mix(in srgb, var(--bg), var(--hover-mix) 8%);
}

.changelog-version-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.changelog-current-version {
  min-width: 64px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text);
}

.changelog-dev-comment {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  background: var(--surface);
}

.changelog-dev-comment-first {
  margin-top: 0;
  margin-bottom: 16px;
}

.changelog-dev-comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.changelog-dev-comment-head i {
  color: var(--accent);
}

.changelog-dev-comment p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.changelog-dev-comment p + p {
  margin-top: 8px;
}

.changelog-dev-comment strong {
  font-weight: 800;
  color: var(--text);
}

.changelog-version-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 13px;
}

.changelog-version-tag {
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 9px;
  border-radius: 999px;
}

.changelog-version-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.changelog-version-date {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.changelog-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.changelog-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.changelog-item i {
  width: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  text-align: center;
  font-size: 12px;
}

.changelog-item strong {
  font-weight: 800;
  color: var(--text);
}

.changelog-add i     { color: var(--green); }
.changelog-fix i     { color: var(--text-muted); }
.changelog-improve i { color: var(--yellow); }
.changelog-remove i  { color: var(--red); }
.changelog-change i  { color: var(--blue); }

.changelog-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}

.changelog-section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-dim);
}

.changelog-section-head strong {
  color: inherit;
}

.stats-list {
  box-sizing: border-box;
  width: 100%;
  padding: 18px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stats-mode-toggle {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.stats-mode-toggle button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  background: var(--surface-hover-soft);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.stats-mode-toggle button:hover {
  color: var(--text-secondary);
  background: var(--surface-hover);
}

.stats-mode-toggle button.active {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stats-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 13px 6px;
  background: var(--surface-hover-soft);
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  text-align: center;
}

.stats-stat-value {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}

.stats-stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stats-chart-label {
  margin-bottom: -8px;
}

.stats-chart {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.stats-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-row-label {
  flex: 0 0 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
}

.stats-bar-track {
  flex: 1;
  height: 26px;
  display: flex;
  align-items: center;
  background: var(--surface-hover-soft);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}

.stats-bar-fill {
  height: 100%;
  min-width: 2px;
  background: var(--accent);
  border-radius: 5px 0 0 5px;
  transition: width 0.4s ease;
}

.stats-row.is-failed .stats-bar-fill {
  background: var(--red);
}

.stats-bar-count {
  box-sizing: border-box;
  flex: 0 0 48px;
  padding: 0 12px 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: right;
}

.stats-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0;
}

@media (max-width: 700px) {

  body {
    padding: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow-x: hidden;
    background-image: none;
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--bg);
    border-radius: 0;
    margin-bottom: 0;
    padding: 0 12px;
    padding-top: env(safe-area-inset-top, 0px);
    height: 64px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
  }

  .logo-img {
    padding: 6px 10px;
    border-radius: 11px;
  }

  .logo-img svg { height: 48px; }

  .header-controls {
    display: none;
  }

  .mode-switcher-header {
    display: none;
  }

  .hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: none;
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    flex-shrink: 0;
    transition: background-color 0.2s;
  }

  .hamburger-btn:active {
    background: color-mix(in srgb, var(--surface), var(--hover-mix) 20%);
    transform: scale(0.94);
  }

  .mobile-nav-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: -100%;
    width: min(300px, 85vw);
    height: 100dvh;
    background: var(--bg);
    border-left: 1px solid var(--border-subtle);
    z-index: 200;
    transition: right 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-nav-drawer.open {
    right: 0;
  }

  .mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: 199;
  }

  .mobile-nav-overlay.open {
    display: block;
  }

  .mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(54px + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid var(--border-subtle);
    background: var(--surface);
    flex-shrink: 0;
    box-sizing: border-box;
  }

  .mobile-nav-header span {
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
  }

  .mobile-nav-close {
    background: var(--bg);
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
  }

  .mobile-nav-close:hover {
    background: color-mix(in srgb, var(--bg), var(--hover-mix) 12%);
    color: var(--text);
  }

  .mobile-nav-section {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .mobile-nav-section-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
  }

  .mobile-nav-footer-section {
    border-bottom: none;
  }

  .mobile-nav-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .mobile-nav-footer .copyright {
    margin-top: 0;
    opacity: 40%;
    text-align: center;
  }

  .mode-switcher-mobile {
    width: 100%;
  }

  .mode-switcher-mobile .mode-switch-btn {
    flex: 1;
    justify-content: center;
  }

  .mobile-nav-action-btn.filter-daily-hidden {
    display: none;
  }

  .main-game-wrapper {
    flex: 1;
    max-width: 100%;
    padding: 0;
    padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
    margin: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    overflow-y: visible;
  }

  .container-grid {
    flex-direction: column;
    gap: 0;
    margin-bottom: 0;
    align-items: center;
    width: 100%;
  }

  .column:first-child,
  .column:last-child {
    display: contents;
  }

  .answer-display { order: 1; }
  .player-container { order: 2; }
  .guess-container { order: 3; }
  .endgame-container-daily,
  .endgame-container-infinite { order: 4; }
  .kofi-container { order: 5; }

  .box {
    border-radius: 10px;
    margin: 6px 10px;
    border-bottom: none;
    padding: 14px;
    box-sizing: border-box;
    width: calc(100% - 20px);
    max-width: 680px;
  }

  .column .box:last-child {
    margin-bottom: 6px;
  }

  .volume-container { display: none; }

  .score-row { display: none; }

  .score-display-inline {
    display: block;
    font-size: 12px;
    color: var(--text);
  }

  .player-container {
    padding: 20px 16px 16px;
    gap: 14px;
    background: var(--bg);
    border: 1px solid var(--border-dim);
  }

  .player-instruction { font-size: 13px; }

  .play-btn {
    width: 64px;
    height: 64px;
    font-size: 26px;
  }

  .progress-bar-bg {
    height: 22px;
    border-radius: 6px;
  }

  .time-labels {
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text);
  }

  .guess-container {
    padding: 10px 12px;
    gap: 6px;
    background: var(--bg);
    border: 1px solid var(--border-dim);
  }

  .guess-row {
    padding: 10px 12px;
    font-size: 13px;
  }

  .answer-display {
    min-height: 90px;
    background: var(--bg);
    border: 1px solid var(--border-dim);
  }

  .answer-img { width: 90px; }
  .result-text { font-size: 17px; }
  .answer-details { padding-left: 14px; }

  .endgame-container-daily,
  .endgame-container-infinite {
    padding: 16px;
    background: var(--bg);
    border: 1px solid var(--border-dim);
  }

  .kofi-container {
    border: 1px solid var(--border-dim);
  }

  .kofi-content {
    flex-wrap: nowrap;
    padding: 14px;
    text-align: left;
  }

  .countdown-timer { font-size: 28px; }
  .btn-copy { padding: 12px 24px; }

  .controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--bg);
    padding: 10px 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border-dim);
    box-shadow: 0 -6px 20px var(--shadow);
    box-sizing: border-box;
    max-width: 100vw;
    overflow: visible;
  }

  .search-results-dropdown {
    position: absolute;
    bottom: 100%;
    top: auto;
    left: 0;
    width: 100%;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
    max-height: 50vh;
    z-index: 200;
    box-shadow: 0 -8px 24px var(--shadow);
  }

  .search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
  }

  .controls .music-list-btn {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .controls .search-container {
    flex: 1;
    min-width: 0;
    position: relative;
  }

  .search-bar {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 12px;
    font-size: 16px;
    border-radius: 10px;
  }

  /* 16px keeps iOS from zooming in when a field is focused */
  .sidebar-header input[type="text"],
  .filter-search,
  .theme-select {
    font-size: 16px;
  }

  /* Allow scrolling only: no pinch or double-tap zoom */
  * {
    touch-action: pan-x pan-y;
  }

  .button-group {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
  }

  .btn-skip,
  .btn-submit {
    flex: 0 0 auto;
    height: 48px;
    padding: 0 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 10px;
    min-width: 0;
  }

  .btn-skip span, .btn-submit span { display: none; }

  .settings-links-section { display: none; }

  .site-footer { display: none; }

  .sidebar {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.98);
    width: min(480px, 94vw);
    max-width: 94vw;
    max-height: 88dvh;
    background: var(--bg);
    border-radius: 14px;
    box-shadow: 0 20px 40px var(--shadow);
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    transition: transform 0.22s cubic-bezier(0.4,0,0.2,1), opacity 0.18s ease;
    z-index: 1000;
  }

  .sidebar.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: all;
  }

  .sidebar-header {
    border-radius: 14px 14px 0 0;
    padding: 14px 16px;
    background: var(--surface);
    position: relative;
    z-index: 10;
    border-bottom: 1px solid var(--border-subtle);
  }

  .sidebar-list {
    border-radius: 0;
    max-height: calc(88dvh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .filter-actions { border-radius: 0 0 14px 14px; }

  .stats-list { padding: 16px 14px 20px; }

  .stats-summary {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stats-stat { padding: 11px 4px; }

  .stats-stat-value { font-size: 18px; }

}

@media (max-width: 390px) {

  .logo-img { padding: 5px 9px; border-radius: 9px; }
  .logo-img svg { height: 40px; }
  .hamburger-btn { width: 36px; height: 36px; font-size: 16px; }
  .play-btn { width: 58px; height: 58px; font-size: 22px; }

}

html[data-theme="light"] {
  color-scheme: light;

  --bg: #f6f6f7;
  --grid-size: 50px;
  --grid-line: color-mix(in srgb, var(--accent) 11%, transparent);
  --surface: #ffffff;
  --text: #16181c;
  --text-secondary: #41454e;
  --text-muted: #61667a;
  --border-subtle: rgba(0, 0, 0, 0.07);
  --border-dim: #bcc2cf;
  --surface-hover: rgba(0, 0, 0, 0.05);
  --surface-hover-soft: rgba(0, 0, 0, 0.03);
  --on-status: #ffffff;
  --green: #157f4f;
  --yellow: #8f6404;
  --skip: #6b7280;
  --red: #cf2f27;
  --overlay: rgba(0, 0, 0, 0.35);
  --shadow: rgba(0, 0, 0, 0.13);
  --hover-mix: #000000;
  --logo-primary: #000000;
}

html[data-theme="light"] .guess-empty {
  background: color-mix(in srgb, var(--skip), transparent 95%);
  border-color: var(--skip);
}

html[data-accent="green"] {
  --accent: #08784F;
  --on-accent: #ffffff;
}

html[data-accent="blue"] {
  --accent: #2463C8;
  --on-accent: #ffffff;
}

html[data-accent="purple"] {
  --accent: #8c5ec0;
  --on-accent: #ffffff;
}

html[data-accent="red"] {
  --accent: #e03131;
  --on-accent: #ffffff;
}

html[data-accent="teal"] {
  --accent: #16796F;
  --on-accent: #ffffff;
}

html[data-accent="pink"] {
  --accent: #A83D7B;
  --on-accent: #ffffff;
}

html[data-accent="orange"] {
  --accent: #C45D22;
  --on-accent: #FFFFFF;
}

html[data-accent="yellow"] {
  --accent: #F0C94D;
  --on-accent: #382A10;
}