:root {
  color-scheme: dark;
  --page: #191b1f;
  --panel: #1f2227;
  --panel-soft: #25282d;
  --line: #777a80;
  --ink: #f4f4f5;
  --muted: #a4a7ad;
  --input: #a9a9a9;
  --green: #3d7d3c;
  --red: #d94b4b;
  --blue: #4547ff;
  --button: #ececec;
  --button-ink: #111216;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.menu-button,
button[aria-label="Meny"] {
  display: none !important;
}

.game-shell {
  display: grid;
  grid-template-rows: 42px auto minmax(0, 1fr);
  min-height: 100vh;
  padding: 0;
}

.wordle-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  min-height: 42px;
  border-bottom: 1px solid #34363b;
  background: #121314;
  padding: 0 14px;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  grid-column: 2;
}

.logo-mark {
  display: grid;
  position: relative;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--page) 0 7px, transparent 8px),
    repeating-radial-gradient(circle at center, #111216 0 5px, #2b2e34 6px 9px);
  box-shadow:
    0 0 0 1px #3437ff,
    0 0 14px rgba(69, 71, 255, 0.34);
}

.logo-mark::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
}

.logo-mark span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.kicker {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.42rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: lowercase;
}

.top-icons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  grid-column: 3;
  color: var(--muted);
  font-size: 0.92rem;
}

.icon-control:hover {
  background: #24262b;
}

.quiz-meta {
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.ghost-button,
.primary-button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 15px;
  font-weight: 800;
}

.ghost-button {
  background: #2c3036;
  color: var(--ink);
}

.ghost-button:hover {
  background: #353940;
}

.primary-button {
  background: var(--button);
  color: var(--button-ink);
}

.primary-button:hover {
  background: #fff;
}

.stage {
  display: grid;
  position: relative;
  place-items: center;
  min-height: 0;
  background: #121314;
  padding: 18px 0 28px;
}

.info-popover {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: transparent;
}

.info-popover:hover,
.info-popover:focus-within {
  background: #24262b;
}

.info-popover::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0px;
  width: 34px;
  height: 14px;
}

.info-button {
  font-size: 1.18rem;
  font-weight: 900;
  line-height: 1;
}

.info-flyout {
  position: absolute;
  top: calc(100% + 10px);
  right: -6px;
  z-index: 10;
  width: 220px;
  border-radius: 6px;
  background: #24262b;
  padding: 13px 14px 14px;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
  pointer-events: none;
  text-align: left;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.36);
}

.info-flyout::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 17px;
  width: 12px;
  height: 12px;
  background: #24262b;
  transform: rotate(45deg);
}

.info-flyout strong {
  display: block;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
}

.info-popover:hover .info-flyout,
.info-popover:focus-within .info-flyout {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.info-names,
.start-names {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.info-names {
  justify-content: flex-start;
  margin-top: 10px;
}

.info-names span,
.start-names span {
  border: 1px solid #3c4047;
  border-radius: 999px;
  background: #17191d;
  color: var(--ink);
  padding: 7px 11px;
  font-size: 0.86rem;
  font-weight: 800;
}

.volume-popover {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: transparent;
  transition:
    background 170ms ease,
    box-shadow 170ms ease;
}

.volume-popover:hover,
.volume-popover:focus-within {
  background: #24262b;
  box-shadow: none;
}

.volume-popover::after {
  content: "";
  position: absolute;
  top: 100%;
  right: -6px;
  width: 170px;
  height: 14px;
}

.icon-control {
  display: grid;
  position: relative;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
}

.speaker-svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.speaker-svg path:first-child {
  stroke: none;
}

.volume-flyout {
  position: absolute;
  top: calc(100% + 10px);
  right: -6px;
  z-index: 30;
  width: 170px;
  border-radius: 6px;
  background: #24262b;
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
  pointer-events: none;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.36);
}

.volume-flyout::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 17px;
  width: 12px;
  height: 12px;
  background: #24262b;
  transform: rotate(45deg);
}

.volume-popover:hover .volume-flyout,
.volume-popover:focus-within .volume-flyout {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.volume-flyout input {
  width: 100%;
  accent-color: var(--ink);
}

.start-panel,
.track-card,
.empty-state,
.summary,
.loading-state {
  display: grid;
  justify-items: center;
  width: min(720px, calc(100vw - 48px));
  text-align: center;
}

.start-panel {
  align-content: center;
  min-height: min(700px, calc(100vh - 116px));
  padding: 34px 18px;
}

.start-logo {
  display: grid;
  position: relative;
  width: 92px;
  height: 92px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #121314 0 23%, transparent 24%),
    repeating-radial-gradient(circle at center, #15171a 0 9px, #34373e 10px 14px);
  box-shadow:
    0 0 0 2px #4547ff,
    0 18px 50px rgba(0, 0, 0, 0.34),
    0 0 30px rgba(69, 71, 255, 0.22);
}

.start-logo::before {
  content: "";
  position: absolute;
  inset: 17px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.start-logo span {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--blue);
}

.start-panel h2 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: 0;
}

.start-copy {
  max-width: 430px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.45;
}

.start-names {
  width: min(430px, 86vw);
  margin-bottom: 28px;
}

.start-button {
  min-width: min(320px, 82vw);
}

.track-card {
  align-content: center;
  min-height: min(760px, calc(100vh - 104px));
  padding: 34px 20px;
}

.progress-line {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.cover-wrap {
  position: relative;
  width: 250px;
  aspect-ratio: 1;
  margin-bottom: 14px;
}

#coverImage,
.cover-fallback {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  object-fit: cover;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.cover-fallback {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #d3d335 0 10%, transparent 10.5%),
    repeating-linear-gradient(135deg, #dad735 0 16px, #b9b626 16px 32px);
}

.cover-fallback span {
  width: 44%;
  aspect-ratio: 1;
  border: 18px solid rgba(25, 27, 31, 0.78);
  border-radius: 50%;
}

.cover-fallback.big {
  width: 180px;
  height: 180px;
  margin-bottom: 24px;
}

.play-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(244, 244, 245, 0.94);
  color: #111216;
  font-size: 1.1rem;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.audio-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: min(410px, 82vw);
  min-height: 44px;
  margin-bottom: 18px;
}

.replay-button,
.pause-button {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--blue);
  font-size: 2.05rem;
  font-weight: 900;
  line-height: 1;
  transition:
    transform 140ms ease,
    color 140ms ease,
    background 140ms ease;
}

.replay-button:hover {
  background: rgba(69, 71, 255, 0.12);
  transform: rotate(-26deg);
}

.replay-button:active {
  transform: rotate(-70deg) scale(0.94);
}

.replay-button.is-disabled {
  color: #656870;
}

.pause-button {
  color: var(--ink);
  font-size: 1rem;
}

.pause-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.pause-button:active {
  transform: scale(0.94);
}

.pause-button.is-disabled {
  color: #656870;
}

.pause-icon {
  position: relative;
  width: 18px;
  height: 20px;
}

.pause-icon::before,
.pause-icon::after {
  content: "";
  position: absolute;
  top: 2px;
  width: 6px;
  height: 16px;
  border-radius: 2px;
  background: currentColor;
}

.pause-icon::before {
  left: 2px;
}

.pause-icon::after {
  right: 2px;
}

.pause-button.is-paused .pause-icon::before {
  left: 4px;
  top: 2px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid currentColor;
  border-radius: 0;
  background: transparent;
}

.pause-button.is-paused .pause-icon::after {
  display: none;
}

.track-copy {
  margin-bottom: 26px;
}

#trackTitle {
  margin-bottom: 5px;
  font-size: clamp(1.75rem, 5vw, 2.2rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

#trackArtist {
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(1.45rem, 4.5vw, 2rem);
  line-height: 1.12;
}

.answer-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 36px;
  min-height: 44px;
  margin-bottom: 8px;
}

.dot {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #a7a7a7;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.22),
    0 2px 7px rgba(0, 0, 0, 0.26);
}

.dot.found {
  background: var(--green);
}

.dot.found::after {
  content: "";
  width: 14px;
  height: 8px;
  border-left: 3px solid #eaf7ea;
  border-bottom: 3px solid #eaf7ea;
  transform: rotate(-45deg) translate(1px, -3px);
}

.found-status {
  min-height: 23px;
  margin: 0 0 118px;
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 650;
}

.guess-field {
  width: min(410px, 82vw);
  min-height: 48px;
  margin-bottom: 18px;
  background: var(--input);
  transition:
    background 120ms ease,
    transform 120ms ease,
    box-shadow 120ms ease;
}

.guess-field input {
  width: 100%;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: #16181c;
  outline: none;
  padding: 0 14px;
  text-align: center;
  font-weight: 760;
}

.guess-field input::placeholder {
  color: rgba(22, 24, 28, 0.62);
}

.guess-field.wrong {
  animation: shake 260ms linear;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(217, 75, 75, 0.18);
}

.found-names {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
}

.found-names span {
  border-radius: 999px;
  background: rgba(61, 125, 60, 0.24);
  color: #a9e4a8;
  padding: 7px 12px;
  font-weight: 800;
}

#nextTrack {
  margin-top: 12px;
}

.loading-state {
  gap: 16px;
  color: var(--muted);
}

.loader {
  width: 56px;
  height: 56px;
  border: 7px solid #3a3d43;
  border-top-color: var(--button);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.empty-state,
.summary {
  align-content: center;
  min-height: min(680px, calc(100vh - 116px));
}

.summary {
  position: relative;
  overflow: hidden;
  padding: 28px 18px;
}

.empty-state h2,
.summary h2 {
  margin-bottom: 8px;
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 600;
}

.summary .kicker {
  color: #9ca3ff;
  font-size: 0.82rem;
  margin-bottom: 10px;
}

.empty-state p {
  margin-bottom: 22px;
  color: var(--muted);
}

.summary-copy,
.summary-countdown {
  color: var(--muted);
  font-size: 1.02rem;
  margin-bottom: 8px;
}

.summary-countdown {
  margin-bottom: 22px;
  color: var(--ink);
  font-weight: 800;
}

.confetti {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.confetti i {
  position: absolute;
  top: 24%;
  left: 50%;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: confetti-pop 1.35s cubic-bezier(0.16, 1, 0.3, 1) var(--d) forwards;
}

.summary-list {
  display: grid;
  gap: 8px;
  width: min(560px, 88vw);
  margin: 18px 0 22px;
  max-height: 310px;
  overflow: auto;
}

.summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid #34373d;
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px 14px;
  text-align: left;
}

.summary-row strong {
  overflow-wrap: anywhere;
}

.summary-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-9px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-6px);
  }
  80% {
    transform: translateX(5px);
  }
}

@keyframes confetti-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg) scale(0.6);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r)) scale(1);
  }
}

@media (max-width: 700px) {
  .game-shell {
    padding: 0;
  }

  .stage {
    min-height: calc(100vh - 100px);
  }

  .volume-popover:hover,
  .volume-popover:focus-within {
    background: #24262b;
  }

  .volume-flyout {
    width: 150px;
    right: -4px;
  }

  .info-flyout {
    right: -50px;
    width: min(220px, calc(100vw - 28px));
  }

  .track-card {
    width: min(100%, calc(100vw - 22px));
    padding: 24px 14px;
  }

  .cover-wrap {
    width: min(220px, 62vw);
  }

  .answer-dots {
    gap: 20px;
  }

  .audio-controls {
    margin-bottom: 14px;
  }

  .dot {
    width: 34px;
    height: 34px;
  }

  .found-status {
    margin-bottom: 68px;
  }

  .summary-row {
    grid-template-columns: 1fr;
  }
}
