:root {
  color-scheme: light;
  --ink: #181a16;
  --muted: #687064;
  --line: #d9dfd5;
  --paper: #fffdf7;
  --surface: #eef2ea;
  --sidebar: #263020;
  --sidebar-muted: #c7d3b1;
  --accent: #1f7a6d;
  --accent-strong: #155c54;
  --success: #168a4a;
  --danger: #c43b32;
  --warm: #f0a51a;
  --mango: #f6b72f;
  --mango-ripe: #e55f2a;
  --leaf: #4f8f3a;
  --shadow: 0 18px 42px rgba(24, 26, 22, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 12%, rgba(246, 183, 47, 0.22), transparent 28%),
    radial-gradient(circle at 18% 78%, rgba(79, 143, 58, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(255, 253, 247, 0.94), rgba(238, 242, 234, 0.94)),
    repeating-linear-gradient(135deg, rgba(31, 122, 109, 0.08) 0 1px, transparent 1px 18px);
}

body.songs-popup-open {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  right: 4vw;
  top: 6vh;
  z-index: 0;
  pointer-events: none;
  width: clamp(120px, 18vw, 260px);
  aspect-ratio: 0.78;
  border-radius: 54% 46% 58% 42% / 62% 48% 52% 38%;
  background:
    radial-gradient(circle at 68% 72%, rgba(229, 95, 42, 0.5), transparent 28%),
    radial-gradient(circle at 36% 28%, rgba(255, 231, 124, 0.75), transparent 24%),
    linear-gradient(135deg, rgba(246, 183, 47, 0.28), rgba(229, 95, 42, 0.18));
  opacity: 0.55;
  transform: rotate(-18deg);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0 42px,
      rgba(32, 37, 31, 0.07) 42px 44px,
      transparent 44px 54px,
      rgba(32, 37, 31, 0.07) 54px 56px,
      transparent 56px 66px,
      rgba(32, 37, 31, 0.07) 66px 68px,
      transparent 68px 78px,
      rgba(32, 37, 31, 0.07) 78px 80px,
      transparent 80px 140px
    );
}

button,
textarea,
select,
input:not([type="number"]) {
  font: inherit;
}

.title-bar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(360px, 520px) auto;
  min-height: 62px;
  align-items: center;
  gap: 10px;
  padding: 5px clamp(14px, 2.4vw, 28px);
  color: #fff;
  background:
    linear-gradient(90deg, rgba(38, 48, 32, 0.96), rgba(31, 122, 109, 0.92)),
    radial-gradient(circle at 88% 18%, rgba(246, 183, 47, 0.42), transparent 30%);
  border-bottom: 4px solid var(--mango);
  box-shadow: 0 14px 34px rgba(24, 26, 22, 0.18);
}

.title-logo {
  position: relative;
  width: 48px;
  height: 34px;
  flex: 0 0 auto;
}

.mango {
  position: absolute;
  display: block;
  width: 26px;
  height: 34px;
  border-radius: 55% 45% 58% 42% / 62% 46% 54% 38%;
  background:
    radial-gradient(circle at 68% 72%, var(--mango-ripe), transparent 28%),
    radial-gradient(circle at 33% 24%, #ffe67d, transparent 22%),
    linear-gradient(135deg, var(--mango), #f08a24);
  box-shadow: inset -7px -9px 12px rgba(142, 68, 25, 0.2), 0 8px 18px rgba(0, 0, 0, 0.2);
}

.mango::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 8px;
  left: 11px;
  top: -5px;
  border-radius: 100% 0 100% 0;
  background: var(--leaf);
  transform: rotate(-20deg);
}

.mango-a {
  left: 5px;
  top: 1px;
  transform: rotate(-18deg);
}

.mango-b {
  right: 3px;
  top: 4px;
  transform: rotate(16deg) scale(0.9);
}

.title-name {
  font-size: clamp(21px, 1.9vw, 29px);
  font-weight: 950;
  line-height: 1;
}

.title-copy {
  min-width: 0;
}

.title-tagline {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: calc(100vh - 62px);
}

.nav-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  justify-content: stretch;
}

.mobile-nav-dropdown {
  display: contents;
}

.mobile-language-options {
  display: none;
}

.mobile-nav-more {
  display: none;
}

.nav-link {
  width: auto;
  min-height: 24px;
  justify-content: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 7px;
  font-size: 11px;
  white-space: nowrap;
}

.nav-icon {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: rgba(246, 183, 47, 0.22);
  border: 1px solid rgba(246, 183, 47, 0.28);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
}

.nav-link[data-view-target="gameView"] {
  border: 2px solid #20e8ff;
  border-radius: 2px;
  color: #ffe34d;
  background: #160b3d;
  box-shadow: 2px 2px 0 #ff2cd6;
  font-family: "Courier New", ui-monospace, monospace;
  font-weight: 900;
  text-shadow: 1px 1px 0 #b217ad;
  text-transform: uppercase;
}

.nav-link[data-view-target="gameView"] .nav-icon {
  border-color: #ff2cd6;
  border-radius: 1px;
  color: #ffe34d;
  background: #35146e;
}

.nav-link[data-view-target="gameView"]:hover,
.nav-link[data-view-target="gameView"].active,
.nav-link[data-view-target="impostorView"]:hover,
.nav-link[data-view-target="impostorView"].active {
  border-color: #ffe34d;
  color: #20e8ff;
  background: #35146e;
  box-shadow: 3px 3px 0 #ff2cd6, 0 0 9px rgba(32, 232, 255, 0.6);
}

body.arcade-game-active .title-bar {
  border-bottom: 4px solid #ff2cd6;
  color: #f8fbff;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, #09051e, #24105a 52%, #47116c);
  box-shadow: 0 0 0 2px #35146e, 0 8px 24px rgba(32, 232, 255, 0.35);
  font-family: "Courier New", ui-monospace, monospace;
}

body.arcade-game-active {
  color: #f8fbff;
  background:
    radial-gradient(circle at 50% 28%, rgba(124, 98, 255, 0.28), transparent 30%),
    radial-gradient(circle at 12% 64%, rgba(255, 44, 214, 0.2), transparent 28%),
    radial-gradient(circle at 88% 72%, rgba(32, 232, 255, 0.18), transparent 30%),
    linear-gradient(180deg, #050313 0%, #0b0625 58%, #16093d 100%);
  transition: background 240ms ease, color 240ms ease;
}

.arcade-vinyl-field {
  position: fixed;
  inset: 62px 0 0;
  z-index: 0;
  display: none;
  overflow: hidden;
  pointer-events: none;
}

body.arcade-game-active .arcade-vinyl-field {
  display: block;
}

.arcade-vinyl {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--vinyl-size, 150px);
  aspect-ratio: 1;
  border: 2px solid rgba(124, 98, 255, 0.34);
  border-radius: 50%;
  opacity: var(--vinyl-opacity, 0.2);
  background:
    radial-gradient(circle, #09051e 0 4%, var(--vinyl-label, #ff2cd6) 5% 18%, #120b31 19% 23%, transparent 24%),
    repeating-radial-gradient(circle, rgba(32, 232, 255, 0.15) 0 1px, transparent 2px 9px),
    #09051e;
  box-shadow: 0 0 16px color-mix(in srgb, var(--vinyl-label, #ff2cd6) 35%, transparent);
  will-change: transform;
  animation-duration: var(--vinyl-speed, 120s);
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.vinyl-a { top: 10%; --vinyl-size: 310px; --vinyl-speed: 138s; --vinyl-opacity: 0.2; animation-name: vinyl-east; }
.vinyl-b { top: 62%; --vinyl-size: 250px; --vinyl-speed: 104s; --vinyl-label: #20e8ff; --vinyl-opacity: 0.17; animation-name: vinyl-west; animation-delay: -38s; }
.vinyl-c { left: 12%; --vinyl-size: 290px; --vinyl-speed: 152s; --vinyl-label: #ffe34d; --vinyl-opacity: 0.16; animation-name: vinyl-south; animation-delay: -77s; }
.vinyl-d { left: 72%; --vinyl-size: 230px; --vinyl-speed: 116s; --vinyl-label: #7c62ff; --vinyl-opacity: 0.2; animation-name: vinyl-north; animation-delay: -51s; }
.vinyl-e { --vinyl-size: 275px; --vinyl-speed: 164s; --vinyl-label: #20e8ff; --vinyl-opacity: 0.14; animation-name: vinyl-southeast; animation-delay: -89s; }
.vinyl-f { --vinyl-size: 210px; --vinyl-speed: 128s; --vinyl-label: #ff2cd6; --vinyl-opacity: 0.18; animation-name: vinyl-northwest; animation-delay: -27s; }
.vinyl-g { --vinyl-size: 260px; --vinyl-speed: 146s; --vinyl-label: #ffe34d; --vinyl-opacity: 0.13; animation-name: vinyl-southwest; animation-delay: -106s; }

body.arcade-game-active::before {
  inset: auto -15vw -26vh;
  width: auto;
  height: 70vh;
  aspect-ratio: auto;
  border-radius: 0;
  background:
    repeating-linear-gradient(90deg, rgba(32, 232, 255, 0.28) 0 1px, transparent 1px 58px),
    repeating-linear-gradient(0deg, rgba(255, 44, 214, 0.25) 0 1px, transparent 1px 42px);
  box-shadow: 0 -5px 28px rgba(255, 44, 214, 0.42);
  opacity: 0.72;
  transform: perspective(360px) rotateX(58deg);
  transform-origin: center bottom;
}

body.arcade-game-active::after {
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.025) 3px 4px),
    linear-gradient(90deg, rgba(255, 44, 214, 0.05), transparent 35%, transparent 65%, rgba(32, 232, 255, 0.05));
  opacity: 1;
}

body.arcade-game-active .app-shell {
  background:
    linear-gradient(180deg, rgba(9, 5, 30, 0.08), rgba(9, 5, 30, 0.46)),
    radial-gradient(circle at 50% 0, rgba(32, 232, 255, 0.08), transparent 42%);
}

body.arcade-game-active .title-name {
  color: #ffe34d;
  letter-spacing: 0.04em;
  text-shadow: 2px 2px 0 #b217ad, 0 0 8px rgba(255, 227, 77, 0.45);
}

body.arcade-game-active .title-tagline {
  color: #20e8ff;
  text-transform: uppercase;
}

body.arcade-game-active .mango {
  border: 2px solid #20e8ff;
  border-radius: 2px;
  background: #24105a;
  box-shadow: 3px 3px 0 #ff2cd6, 0 0 8px rgba(32, 232, 255, 0.55);
}

body.arcade-game-active .mango::before {
  border-radius: 1px;
  background: #ffe34d;
}

body.arcade-game-active .nav-link:not([data-view-target="gameView"]):not([data-view-target="impostorView"]) {
  border: 1px solid #654bad;
  border-radius: 1px;
  color: #b8a8e8;
  background: #160b3d;
  box-shadow: none;
  font-family: "Courier New", ui-monospace, monospace;
}

body.arcade-game-active .nav-link:not([data-view-target="gameView"]):not([data-view-target="impostorView"]):hover {
  border-color: #20e8ff;
  color: #20e8ff;
  background: #24105a;
}

body.arcade-game-active .nav-icon,
body.arcade-game-active .language-button {
  border-color: #654bad;
  border-radius: 1px;
  background: #24105a;
}

body.arcade-game-active .language-button {
  box-shadow: 2px 2px 0 #ff2cd6;
}

body.impostor-active {
  color: #f8f3eb;
  background:
    linear-gradient(115deg, rgba(21, 25, 35, 0.94), rgba(35, 57, 93, 0.86)),
    repeating-linear-gradient(90deg, rgba(255, 250, 242, 0.04) 0 1px, transparent 1px 42px),
    #151923;
}

body.impostor-active::before {
  inset: 94px 8vw auto;
  width: auto;
  height: 48vh;
  border: 1px solid rgba(217, 164, 65, 0.24);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30, 117, 111, 0.28), transparent 64%);
  opacity: 0.5;
  box-shadow: none;
}

body.impostor-active::after {
  opacity: 0.35;
  background:
    linear-gradient(90deg, rgba(217, 164, 65, 0.06), transparent 30%, transparent 70%, rgba(142, 49, 83, 0.08)),
    repeating-linear-gradient(0deg, transparent 0 12px, rgba(255, 250, 242, 0.025) 12px 13px);
}

body.impostor-active .title-bar {
  border-bottom: 4px solid #1e756f;
  color: #fffaf2;
  background: linear-gradient(90deg, #151923, #23395d 56%, #2f2638);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

body.impostor-active .title-name {
  color: #d9a441;
}

body.impostor-active .title-tagline {
  color: rgba(255, 250, 242, 0.76);
}

body.impostor-active .nav-link[data-view-target="impostorView"].active {
  border-color: #d9a441;
  color: #fffaf2;
  background: #1e756f;
  box-shadow: 3px 3px 0 #8e3153;
}

body.impostor-active .app-shell {
  background: linear-gradient(180deg, rgba(21, 25, 35, 0.1), rgba(21, 25, 35, 0.44));
}

.language-selector {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.language-button {
  display: grid;
  width: 40px;
  min-height: 32px;
  place-items: center;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
}

.language-button:hover,
.language-button[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.16);
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 8;
  min-width: 178px;
  padding: 6px;
  background: #fffdf7;
  border: 1px solid rgba(24, 26, 22, 0.12);
  border-radius: 10px;
  box-shadow: 0 16px 34px rgba(24, 26, 22, 0.22);
}

.language-menu button {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 850;
  text-align: left;
}

.language-menu button:hover,
.language-menu button[aria-current="true"] {
  background: var(--surface);
}

.language-flag {
  position: relative;
  display: inline-block;
  width: 26px;
  height: 18px;
  overflow: hidden;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(24, 26, 22, 0.14);
}

.flag-es {
  background: linear-gradient(to bottom, #c60b1e 0 25%, #ffc400 25% 75%, #c60b1e 75% 100%);
}

.flag-ca {
  background:
    repeating-linear-gradient(
      to bottom,
      #ffd447 0 11.11%,
      #c9272d 11.11% 22.22%
    );
}

.flag-en {
  background: #012169;
}

.flag-en > span:nth-child(1),
.flag-en > span:nth-child(2),
.flag-en > span:nth-child(3),
.flag-en > span:nth-child(4) {
  position: absolute;
  inset: -2px 11px;
  background: #fff;
}

.flag-en > span:nth-child(1) {
  transform: rotate(56deg);
}

.flag-en > span:nth-child(2) {
  transform: rotate(-56deg);
}

.flag-en > span:nth-child(3) {
  width: 5px;
  inset: -2px auto -2px 10.5px;
}

.flag-en > span:nth-child(4) {
  height: 5px;
  inset: 6.5px -2px auto -2px;
}

.flag-en > span:nth-child(5),
.flag-en > span:nth-child(6),
.flag-en > span:nth-child(7),
.flag-en > span:nth-child(8) {
  position: absolute;
  background: #c8102e;
}

.flag-en > span:nth-child(5) {
  width: 3px;
  inset: -2px auto -2px 11.5px;
}

.flag-en > span:nth-child(6) {
  height: 3px;
  inset: 7.5px -2px auto -2px;
}

.flag-en > span:nth-child(7) {
  width: 3px;
  height: 28px;
  left: 11.5px;
  top: -5px;
  transform: rotate(56deg);
}

.flag-en > span:nth-child(8) {
  width: 3px;
  height: 28px;
  left: 11.5px;
  top: -5px;
  transform: rotate(-56deg);
}

.content {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 44px;
}

.view {
  display: grid;
  gap: 22px;
}

.view[hidden] {
  display: none !important;
}

.topbar {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(36px, 6vw, 72px);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 16px;
}

.tool-stack {
  display: grid;
  gap: 16px;
  justify-items: center;
}

.input-panel,
.csv-panel,
.converter-status,
.audio-status,
.queue {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: var(--shadow);
}

.queue {
  width: 100%;
}

.input-panel,
.csv-panel,
.converter-status,
.audio-status {
  padding: 18px;
}

.input-panel {
  border-top: 5px solid var(--accent);
}

.csv-panel,
.converter-status,
.audio-status {
  border-top: 5px solid var(--warm);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 10px;
}

.section-heading span {
  color: var(--muted);
  font-weight: 800;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 850;
}

label + select {
  margin-bottom: 12px;
}

textarea,
select,
input[type="number"],
input:not([type="number"]) {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 180px;
  resize: vertical;
  padding: 13px;
}

select {
  min-height: 44px;
  padding: 0 12px;
}

input[type="number"] {
  min-height: 42px;
  padding: 0 10px;
  font-weight: 850;
}

input:not([type="number"]) {
  min-height: 44px;
  padding: 0 12px;
  font-weight: 750;
}

textarea:focus,
select:focus,
input[type="number"]:focus,
input:not([type="number"]):focus {
  outline: 3px solid rgba(31, 122, 109, 0.2);
  border-color: var(--accent);
}

.audio-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 12px;
  align-items: end;
  width: min(100%, 320px);
  margin-left: auto;
}

.audio-options label {
  margin-bottom: 0;
  font-size: 13px;
}

.audio-options label span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

button,
.download {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  color: #fff;
  background: var(--accent);
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.download:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

button.secondary {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}

button.secondary:hover {
  background: #e2e8df;
}

.meter-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  font-weight: 850;
}

.meter {
  position: relative;
  height: 22px;
  overflow: hidden;
  margin: 12px 0;
  border-radius: 999px;
  border: 1px solid rgba(32, 37, 31, 0.14);
  background: #dde5d9;
  box-shadow: inset 0 1px 4px rgba(24, 26, 22, 0.16);
}

.meter span {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-shadow: 0 1px 3px rgba(24, 26, 22, 0.55);
}

.meter div {
  position: relative;
  display: block;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, var(--accent), var(--warm)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.32) 0 10px, rgba(255, 255, 255, 0) 10px 20px);
  background-blend-mode: screen;
  box-shadow: 0 0 18px rgba(31, 122, 109, 0.35);
  transition: width 180ms ease;
}

.meter div::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.48), transparent);
  transform: translateX(-100%);
}

.meter div.is-active::after {
  animation: meter-shine 1.05s linear infinite;
}

.meter div.is-active {
  animation: meter-pulse 900ms ease-in-out infinite alternate;
}

.converter-meter {
  margin-top: 12px;
}

.message {
  min-height: 24px;
  color: var(--muted);
}

.message.subtle {
  min-height: 0;
  font-size: 14px;
}

.queue {
  overflow: hidden;
}

.queue-head,
.item {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) 92px;
  gap: 14px;
  align-items: start;
}

.queue-head.audio-head,
.item.audio-item {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(180px, 0.55fr) 100px;
}

.queue-head {
  padding: 13px 16px;
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.items:empty::before {
  content: "No results yet";
  display: block;
  padding: 28px 16px;
  color: var(--muted);
}

body[data-language="ca"] .items:empty::before {
  content: "Encara no hi ha resultats";
}

body[data-language="es"] .items:empty::before {
  content: "Todavía no hay resultados";
}

.item {
  min-height: 72px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.source,
.links {
  min-width: 0;
}

.source strong,
.source small,
.links a,
.links span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source strong + small {
  margin-top: 6px;
}

.source small,
.links span {
  color: var(--muted);
}

.links a {
  color: var(--accent-strong);
  font-weight: 750;
}

.copy-cell {
  display: flex;
  justify-content: flex-start;
}

.copy-cell button {
  min-height: 36px;
  width: 76px;
  padding: 0 10px;
}

.audio-status-cell {
  display: grid;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
  font-weight: 850;
}

.status-pill.running {
  color: #fff;
  background: var(--accent);
}

.status-pill.complete {
  color: #fff;
  background: var(--accent-strong);
}

.status-pill.failed {
  color: #fff;
  background: var(--warm);
}

.status-pill.expired {
  color: #fff;
  background: #5c6258;
}

.mini-progress {
  position: relative;
  height: 30px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(32, 37, 31, 0.14);
  background: #dde5d9;
}

.small-download {
  min-height: 36px;
  width: 76px;
  padding: 0 10px;
}

.muted-cell {
  color: var(--muted);
  font-weight: 850;
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--warm));
}

.mini-progress strong {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  text-shadow: 0 1px 3px rgba(24, 26, 22, 0.55);
}

.game-setup,
.group-setup,
.invite-join-setup,
.game-controls,
.player-panel,
.guess-panel,
.summary-box {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: var(--shadow);
}

.game-setup,
.group-setup,
.invite-join-setup {
  padding: 16px;
  border-top: 5px solid var(--accent);
}

.game-setup {
  display: grid;
  gap: 16px;
  align-items: stretch;
}

.group-setup {
  position: relative;
  display: grid;
  gap: 16px;
}

.invite-join-setup {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.invite-join-setup[hidden] {
  display: none;
}

.invite-room-label {
  max-width: min(100%, 520px);
  overflow: hidden;
  padding: 8px 16px;
  border: 2px solid var(--warm);
  border-radius: 8px;
  color: var(--accent-strong);
  background: #fff8e6;
  font-size: 18px;
  font-weight: 950;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-identity-row {
  width: min(100%, 360px);
}

.invite-join-setup .message {
  text-align: center;
}

#groupSetup .section-heading {
  display: grid;
  justify-content: start;
  gap: 4px;
  margin-bottom: 0;
}

#instructionsButton {
  justify-self: center;
}

.setup-room-label {
  justify-self: center;
  max-width: min(100%, 520px);
  overflow: hidden;
  padding: 8px 16px;
  border: 2px solid var(--warm);
  border-radius: 8px;
  color: var(--accent-strong);
  background: #fff8e6;
  font-size: 18px;
  font-weight: 950;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-link-button {
  position: static;
}

.multiplayer-setup {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.multiplayer-setup[hidden] {
  display: none;
}

.multiplayer-form {
  display: grid;
  gap: 9px;
  align-content: start;
  padding: 12px;
  border-radius: 7px;
  background: var(--paper);
}

.multiplayer-form h3 {
  margin: 0;
}

.multiplayer-form > span {
  color: var(--muted);
  font-size: 12px;
}

.player-identity-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
}

.player-identity-row select {
  min-width: 0;
  font-size: 24px;
  text-align: center;
}

.multiplayer-setup .message {
  grid-column: 1 / -1;
}

.setup-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.setup-row label {
  margin-bottom: 0;
}

.game-setup[hidden],
.group-setup[hidden],
.game-controls[hidden],
.game-grid[hidden] {
  display: none;
}

.game-controls {
  display: grid;
  grid-template-columns: minmax(160px, 0.34fr) minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: stretch;
  padding: 10px;
  border-top: 4px solid var(--accent);
  background: rgba(255, 253, 247, 0.9);
}

.clue-link {
  min-height: 54px;
  gap: 8px;
  color: var(--ink);
  background: #fff8e6;
  border: 1px solid rgba(240, 165, 26, 0.55);
  padding: 0 14px;
  white-space: nowrap;
}

.clue-link:hover {
  color: var(--ink);
  background: #ffe9ad;
}

.clue-link::before {
  content: "?";
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--warm);
  font-size: 14px;
  font-weight: 950;
}

#changeChallengeButton {
  min-height: 54px;
  gap: 8px;
  padding: 0 14px;
  white-space: nowrap;
}

#changeChallengeButton::before {
  content: "?";
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 15px;
  font-weight: 950;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.button-grid button {
  min-height: 40px;
  gap: 7px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}

.button-icon {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.42);
  font-size: 14px;
  line-height: 1;
}

.button-grid button:hover,
.button-grid button.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.score-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  min-height: 54px;
  align-content: center;
  padding: 8px 12px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--sidebar));
}

.score-strip::before,
.active-config::before {
  display: grid;
  grid-row: 1 / span 2;
  width: 32px;
  height: 32px;
  place-items: center;
  align-self: center;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 950;
}

.score-strip::before {
  content: "#";
  color: var(--sidebar);
  background: var(--mango);
}

.score-strip span {
  grid-column: 2;
  font-size: 12px;
  font-weight: 850;
  opacity: 0.82;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-strip strong {
  grid-column: 2;
  font-size: 24px;
  line-height: 1;
}

.active-config {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  min-height: 54px;
  align-content: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.active-config::before {
  content: "?";
  color: #fff;
  background: var(--accent);
}

.active-config span {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.active-config strong {
  grid-column: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  line-height: 1.2;
}

.group-cards {
  display: grid;
  grid-template-columns: repeat(var(--category-columns, 4), 292px);
  grid-auto-rows: 124px;
  gap: 6px;
  justify-content: center;
}

.group-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 4px 8px;
  align-items: center;
  width: 100%;
  height: 124px;
  min-height: 0;
  padding: 6px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  text-align: left;
}

.group-card:hover,
.group-card.active {
  color: var(--ink);
  background: #fff8e6;
  border-color: var(--warm);
}

.group-card > img,
.group-collage,
.custom-playlist-icon {
  width: 112px;
  height: 112px;
  grid-row: 1 / 3;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
}

.group-card > img {
  object-fit: cover;
}

.group-card > span,
.group-card > small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.group-card > span {
  align-self: end;
  display: -webkit-box;
  line-height: 1.15;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
}

.group-card > small {
  align-self: start;
  display: -webkit-box;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  white-space: normal;
}

.group-collage {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
}

.group-collage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.group-card span {
  font-weight: 900;
}

.group-card small {
  color: var(--muted);
  font-weight: 800;
}

.leaderboard-button {
  min-height: 54px;
  gap: 8px;
  padding: 0 14px;
  color: #fff;
  border: 1px solid rgba(33, 122, 76, 0.65);
  background: linear-gradient(135deg, #176a40, #244b35);
  white-space: nowrap;
}

.leaderboard-button::before {
  content: "?";
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  color: #553700;
  background: var(--mango);
}

.leaderboard-button:hover {
  filter: brightness(1.08);
}

.custom-playlist-group-card {
  align-content: center;
}

.custom-playlist-icon {
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--warm));
  font-size: 42px;
  font-weight: 300;
}

.artist-loading {
  display: grid;
  min-height: 280px;
  place-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: var(--shadow);
}

.artist-loading[hidden] {
  display: none;
}

.artist-loading strong {
  color: var(--accent-strong);
  font-size: 22px;
  letter-spacing: 0.12em;
}

.loading-disc {
  width: 132px;
  aspect-ratio: 1;
  border-radius: 999px;
  background:
    radial-gradient(circle, var(--paper) 0 9%, var(--sidebar) 10% 17%, transparent 18%),
    repeating-radial-gradient(circle, rgba(255, 255, 255, 0.18) 0 4px, rgba(24, 26, 22, 0.12) 5px 9px),
    conic-gradient(from 0deg, var(--accent), var(--warm), var(--mango-ripe), var(--accent));
  box-shadow: 0 18px 38px rgba(24, 26, 22, 0.18), inset 0 0 0 10px rgba(255, 253, 247, 0.28);
  animation: artwork-spin 900ms linear infinite, loading-breathe 900ms ease-in-out infinite alternate;
}

.game-grid {
  display: grid;
  grid-template-columns: minmax(280px, 430px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.game-grid:has(.multiplayer-players-panel:not([hidden])) {
  grid-template-columns: minmax(160px, 220px) minmax(260px, 390px) minmax(0, 1fr);
}

.multiplayer-players-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--mango-ripe);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: var(--shadow);
}

.multiplayer-players-panel[hidden] {
  display: none;
}

.multiplayer-room-head {
  display: grid;
  gap: 3px;
}

.multiplayer-room-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.multiplayer-players-list {
  display: grid;
  gap: 7px;
}

.multiplayer-players-list article {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 2px 7px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.multiplayer-players-list article.is-current {
  border-color: var(--accent);
  background: #e7f5f0;
}

.multiplayer-players-list article.is-disconnected {
  opacity: 0.62;
}

.multiplayer-players-list article.is-disconnected small {
  color: var(--warm);
}

.multiplayer-players-list article > span {
  grid-row: span 2;
  font-size: 22px;
}

.multiplayer-players-list article b,
.multiplayer-players-list article small {
  font-size: 11px;
}

.multiplayer-players-list article small {
  color: var(--success);
  font-weight: 900;
}

.game-grid.summary-only {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}

.game-grid.summary-only:has(.multiplayer-players-panel:not([hidden])) {
  grid-template-columns: minmax(160px, 220px) minmax(0, 760px);
}

.game-grid.summary-only .player-panel,
.game-grid.summary-only .status-card,
.game-grid.summary-only .guess-form,
.game-grid.summary-only .guess-list,
.game-grid.summary-only .result-box {
  display: none;
}

.player-panel,
.guess-panel {
  padding: 16px;
}

.player-panel {
  display: grid;
  gap: 14px;
  border-top: 5px solid var(--warm);
}

.guess-panel {
  display: grid;
  gap: 14px;
  border-top: 5px solid var(--accent);
}

.artwork-progress {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--sidebar));
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.artwork-progress[hidden] {
  display: none;
}

.artwork {
  position: relative;
  display: grid;
  min-height: 260px;
  overflow: hidden;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(38, 48, 32, 0.18), rgba(38, 48, 32, 0.88)),
    linear-gradient(135deg, var(--accent), var(--warm));
  background-position: center;
  background-size: cover;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.artwork::before {
  content: "";
  position: absolute;
  z-index: 1;
  width: min(52%, 190px);
  aspect-ratio: 1;
  border-radius: 999px;
  opacity: 0;
  background:
    radial-gradient(circle, rgba(255, 253, 247, 0.94) 0 8%, transparent 9% 20%, rgba(255, 253, 247, 0.2) 21% 28%, transparent 29%),
    conic-gradient(from 0deg, rgba(246, 183, 47, 0.92), rgba(31, 122, 109, 0.9), rgba(246, 183, 47, 0.92));
  box-shadow: 0 0 34px rgba(246, 183, 47, 0.4);
}

.artwork::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  backdrop-filter: blur(18px);
  background: rgba(38, 48, 32, 0.46);
  transition: opacity 180ms ease;
}

.artwork.is-veiled::after {
  opacity: 1;
}

.artwork.is-hidden-artwork {
  background-image:
    linear-gradient(135deg, rgba(38, 48, 32, 0.96), rgba(24, 26, 22, 0.96)) !important;
}

.artwork.is-hidden-artwork::after {
  opacity: 0;
  backdrop-filter: none;
}

.artwork.is-hidden-artwork span {
  opacity: 0;
}

.artwork.is-playing {
  animation: artwork-pulse 780ms ease-in-out infinite alternate;
}

.artwork.is-playing::before {
  opacity: 0.72;
  animation: artwork-spin 2.4s linear infinite;
}

.artwork span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
  border-radius: 999px;
  color: var(--sidebar);
  background: var(--mango);
  font-size: 44px;
  font-weight: 950;
}

.clip-console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px 88px;
  gap: 10px;
  align-items: center;
}

.clip-console > div {
  display: grid;
  gap: 4px;
  min-height: 60px;
  align-content: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.clip-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

#clipLength {
  font-size: 24px;
  line-height: 1;
}

.round-action {
  background: var(--warm);
}

.round-action:hover {
  background: #d99014;
}

.clip-track {
  position: relative;
  height: 46px;
  overflow: hidden;
  border: 1px solid rgba(32, 37, 31, 0.14);
  border-radius: 8px;
  background: #dde5d9;
  box-shadow: inset 0 1px 5px rgba(24, 26, 22, 0.16);
}

.clip-track-wave {
  position: absolute;
  inset: 8px 10px;
  display: flex;
  gap: 3px;
  align-items: center;
  color: rgba(32, 37, 31, 0.24);
}

.clip-track-bar {
  display: block;
  flex: 1 1 0;
  min-width: 2px;
  height: var(--rest, 50%);
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
  transition: height 160ms ease;
}

.clip-track-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--warm));
  transition: width 80ms linear;
}

.clip-track-fill .clip-track-wave {
  inset: 8px auto 8px 10px;
  color: rgba(255, 255, 255, 0.72);
  width: calc(var(--clip-track-width, 460px) - 20px);
}

.clip-track.is-playing .clip-track-bar {
  animation: clip-wave 620ms ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}

.clip-track.is-playing .clip-track-fill {
  box-shadow: 0 0 18px rgba(31, 122, 109, 0.28);
}

.steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.step {
  display: grid;
  min-height: 36px;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 850;
}

.step.active {
  color: #fff;
  background: var(--accent);
}

.step.used {
  color: #fff;
  background: var(--warm);
}

.youtube-shell {
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.status-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 12px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--sidebar), var(--accent));
}

.status-card span {
  font-size: 12px;
  font-weight: 850;
  opacity: 0.82;
  text-transform: uppercase;
}

.status-card strong {
  min-width: 0;
  text-align: right;
}

.guess-form {
  display: grid;
  gap: 8px;
}

.guess-heading,
.songs-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.compact-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.guess-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 10px;
}

.suggestion-list {
  display: grid;
  gap: 8px;
}

.suggestion-list[hidden] {
  display: none;
}

.suggestion-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  min-height: 72px;
  justify-content: stretch;
  padding: 8px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  text-align: left;
}

.suggestion-card:hover {
  color: var(--ink);
  background: #fff8e6;
  border-color: var(--warm);
}

.suggestion-card img {
  width: 72px;
  aspect-ratio: 16 / 9;
  align-self: center;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface);
}

.suggestion-card span {
  display: grid;
  gap: 4px;
  min-width: 0;
  align-content: center;
}

.suggestion-card strong,
.suggestion-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-card small {
  color: var(--muted);
  font-weight: 800;
}

.guess-list {
  display: grid;
  gap: 8px;
  min-height: 44px;
}

.guess-list:empty::before {
  content: "No guesses yet";
  color: var(--muted);
  font-weight: 750;
}

body[data-language="ca"] .guess-list:empty::before {
  content: "Encara no hi ha intents";
}

body[data-language="es"] .guess-list:empty::before {
  content: "Todavía no hay intentos";
}

.guess-item,
.summary-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(96px, auto);
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  animation: item-pop 220ms ease-out;
}

.guess-item span,
.summary-item span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.guess-item.correct span {
  background: var(--accent);
}

.guess-item.wrong span {
  background: var(--warm);
}

.guess-item.skip span {
  background: #5c6258;
}

.guess-item strong,
.summary-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guess-item small,
.summary-item small {
  color: var(--muted);
  font-weight: 850;
  text-align: right;
}

.result-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.result-box[hidden] {
  display: none;
}

.result-box > span,
.summary-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.result-box > strong {
  font-size: 22px;
  line-height: 1.15;
}

.summary-box {
  overflow: hidden;
}

.summary-box[hidden] {
  display: none;
}

.summary-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.summary-head strong {
  display: block;
  margin-top: 2px;
  font-size: 22px;
  line-height: 1;
}

.summary-list {
  display: grid;
  gap: 5px;
  padding: 8px;
}

.leaderboard-panel {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #fff, var(--surface));
}

.leaderboard-head,
.leaderboard-form,
.leaderboard-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.leaderboard-head span,
.leaderboard-head strong {
  font-size: 11px;
}

.leaderboard-head strong {
  display: block;
  color: var(--muted);
}

.leaderboard-form input {
  min-width: 0;
  flex: 1;
}

.leaderboard-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: leaderboard;
}

.leaderboard-list li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  min-height: 34px;
  padding: 3px 7px 3px 3px;
  border: 1px solid rgba(31, 122, 109, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 850;
}

.leaderboard-rank {
  display: grid;
  width: 34px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  color: var(--accent-strong);
  background: linear-gradient(135deg, #ffe688, var(--mango));
  font-size: 15px;
  font-weight: 950;
  letter-spacing: -0.05em;
}

.leaderboard-list li strong {
  margin-right: auto;
}

.leaderboard-list time,
.leaderboard-popup-list time {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.leaderboard-ticker {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  overflow: hidden;
  margin-top: 7px;
  border: 3px solid #20e8ff;
  border-radius: 4px;
  color: #f8fbff;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    linear-gradient(100deg, #08051c, #171047 55%, #09051f);
  box-shadow:
    0 0 0 2px #35146e,
    0 0 15px rgba(32, 232, 255, 0.55),
    inset 0 0 18px rgba(255, 44, 214, 0.12);
  font-family: "Courier New", ui-monospace, monospace;
}

.leaderboard-ticker::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: arcade-scan 4s linear infinite;
}

.leaderboard-ticker[hidden] {
  display: none;
}

.leaderboard-ticker > strong {
  z-index: 1;
  align-self: stretch;
  display: grid;
  place-items: center;
  padding: 6px 10px;
  border-right: 3px solid #ff2cd6;
  color: #160625;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0 2px, transparent 2px 5px),
    #ffe34d;
  text-shadow: 1px 1px 0 #fff;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.leaderboard-ticker-window {
  position: relative;
  z-index: 1;
  overflow-x: auto;
  scrollbar-color: #ff2cd6 #130a3d;
  scrollbar-width: thin;
  min-width: 0;
}

.leaderboard-ticker-track {
  display: flex;
  width: max-content;
  min-width: 100%;
  gap: 8px;
  padding: 5px 14px;
  white-space: nowrap;
}

.leaderboard-ticker-entry {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 2px 10px 2px 2px;
  border: 1px solid #7c62ff;
  border-radius: 2px;
  background: rgba(19, 10, 61, 0.88);
  box-shadow: inset 0 0 8px rgba(32, 232, 255, 0.12);
  font-size: 12px;
  font-weight: 800;
}

.leaderboard-ticker-rank {
  display: grid;
  min-width: 42px;
  height: 34px;
  place-items: center;
  border-right: 2px solid #ff2cd6;
  border-radius: 1px;
  color: #ffe34d;
  background: #24105a;
  box-shadow:
    inset 0 0 0 1px #20e8ff,
    0 0 7px rgba(32, 232, 255, 0.55);
  text-shadow: 2px 2px 0 #b217ad;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -0.08em;
}

.leaderboard-ticker-entry b {
  color: #20e8ff;
  text-shadow: 0 0 7px rgba(32, 232, 255, 0.7);
}

.leaderboard-ticker-entry time {
  color: #b8a8e8;
  font-size: 10px;
}

.songs-popup-card.leaderboard-popup-card {
  position: relative;
  overflow: hidden;
  gap: 0;
  width: min(480px, calc(100% - 24px));
  height: auto;
  max-height: min(72vh, 600px);
  padding: 0;
  border: 4px solid #20e8ff;
  border-radius: 5px;
  color: #f8fbff;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px),
    #09051e;
  box-shadow:
    0 0 0 4px #31126d,
    0 0 0 7px #ff2cd6,
    0 0 35px rgba(32, 232, 255, 0.55);
  font-family: "Courier New", ui-monospace, monospace;
}

.leaderboard-popup-card .songs-popup-head {
  padding: 11px 13px;
  color: #ffe34d;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 8px),
    linear-gradient(90deg, #24105a, #47116c);
  border-bottom: 4px solid #ff2cd6;
}

.leaderboard-popup-card .songs-popup-head h2 {
  margin: 0 0 2px;
  font-size: 21px;
  letter-spacing: 0.06em;
  text-shadow: 2px 2px 0 #b217ad, 0 0 8px rgba(255, 227, 77, 0.5);
  text-transform: uppercase;
}

.leaderboard-popup-card .songs-popup-head span {
  color: #20e8ff;
  font-size: 11px;
  text-transform: uppercase;
}

.leaderboard-popup-card .songs-popup-head button {
  border: 2px solid #20e8ff;
  border-radius: 2px;
  color: #20e8ff;
  background: #130a3d;
  box-shadow: 2px 2px 0 #ff2cd6;
  font-family: inherit;
  text-transform: uppercase;
}

.leaderboard-popup-list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 5px;
  overflow: auto;
  max-height: calc(min(72vh, 600px) - 72px);
  margin: 0;
  padding: 8px;
  list-style: none;
}

.leaderboard-popup-list li {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  column-gap: 10px;
  row-gap: 1px;
  align-items: center;
  min-height: 48px;
  padding: 5px 10px 5px 5px;
  border: 1px solid #4c378a;
  border-radius: 1px;
  color: #f8fbff;
  background: rgba(25, 12, 70, 0.82);
  box-shadow: inset 3px 0 0 #20e8ff;
}

.leaderboard-popup-list li:nth-child(-n + 3) {
  border-color: #ff2cd6;
  background: linear-gradient(90deg, rgba(80, 18, 112, 0.96), rgba(25, 12, 70, 0.92));
  box-shadow: inset 3px 0 0 #ffe34d, 0 0 8px rgba(255, 44, 214, 0.3);
}

.leaderboard-popup-list .leaderboard-rank {
  grid-row: 1 / 3;
  width: 46px;
  height: 38px;
  border: 1px solid #ff2cd6;
  border-radius: 1px;
  color: #ffe34d;
  background: #24105a;
  box-shadow: inset 0 0 0 1px #20e8ff;
  text-shadow: 2px 2px 0 #b217ad;
  font-size: 21px;
}

.leaderboard-popup-list li strong {
  overflow: hidden;
  font-size: 16px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multiplayer-podium-card {
  width: min(700px, calc(100% - 24px));
}

.multiplayer-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 230px;
}

.podium-place {
  display: grid;
  gap: 7px;
  justify-items: center;
  padding: 16px 8px;
  border-radius: 9px 9px 0 0;
  color: #fff;
  background: var(--accent);
  text-align: center;
  transform-origin: bottom center;
  animation: podium-place-rise 800ms cubic-bezier(0.2, 0.9, 0.25, 1.2) both;
}

.podium-place span {
  font-size: 42px;
}

.podium-place.place-1 {
  min-height: 210px;
  order: 2;
  background: #c99313;
  animation-delay: 1400ms;
}

.podium-place.place-2 {
  min-height: 165px;
  order: 1;
  background: #71818b;
  animation-delay: 700ms;
}

.podium-place.place-3 {
  min-height: 130px;
  order: 3;
  background: #a9653d;
  animation-delay: 0ms;
}

.multiplayer-final-list {
  display: grid;
  gap: 7px;
  padding: 0;
  list-style: none;
}

.multiplayer-final-list li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.leaderboard-popup-list li b {
  grid-column: 3;
  grid-row: 1 / 3;
  color: #20e8ff;
  text-shadow: 0 0 6px rgba(32, 232, 255, 0.65);
  font-size: 15px;
}

.leaderboard-popup-list time {
  grid-column: 2;
  grid-row: 2;
  color: #9f8dd7;
  font-size: 11px;
}

@keyframes arcade-scan {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.summary-item {
  grid-template-columns: 26px 64px minmax(0, 1fr) auto minmax(120px, auto);
  min-height: 38px;
  padding: 6px 8px;
  color: var(--ink);
  text-decoration: none;
}

.summary-item.is-solved {
  border-color: rgba(22, 138, 74, 0.45);
  background: #e6f7ed;
}

.summary-item.is-missed {
  border-color: rgba(190, 52, 42, 0.4);
  background: #fdeceb;
}

.summary-item:hover {
  border-color: var(--warm);
  filter: brightness(0.98);
}

.summary-item span {
  width: 24px;
  height: 24px;
}

.summary-item img {
  width: 64px;
  aspect-ratio: 16 / 9;
  border-radius: 5px;
  object-fit: cover;
  background: var(--surface);
}

.summary-points {
  min-width: 54px;
  padding: 5px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  text-align: center;
}

.summary-item.is-solved .summary-points {
  color: #fff;
  background: var(--success);
  box-shadow: 0 3px 10px rgba(22, 138, 74, 0.25);
}

.summary-item small {
  font-size: 12px;
}

.round-popup {
  position: fixed;
  left: 0;
  right: 0;
  top: 62px;
  bottom: 0;
  z-index: 3;
  display: grid;
  align-items: start;
  justify-items: center;
  overflow: auto;
  padding: 20px;
  background: rgba(24, 26, 22, 0.42);
}

.round-popup[hidden] {
  display: none;
}

.round-popup-card {
  display: grid;
  gap: 6px;
  width: min(300px, calc(100% - 24px));
  margin: min(5vh, 34px) auto 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 28px 70px rgba(24, 26, 22, 0.3);
  animation: popup-in 240ms ease-out;
}

.round-popup.is-correct .round-popup-card {
  border: 2px solid var(--success);
}

.round-popup.is-wrong .round-popup-card {
  border: 2px solid var(--danger);
}

.perfect-guess-rain {
  position: fixed;
  inset: 0;
  z-index: 8;
  overflow: hidden;
  pointer-events: none;
}

.perfect-guess-rain img {
  position: absolute;
  top: -35vh;
  left: var(--rain-left);
  width: var(--rain-size);
  height: auto;
  opacity: 0;
  filter: drop-shadow(0 8px 5px rgba(24, 26, 22, 0.24));
  animation: perfect-guess-fall var(--rain-duration) linear var(--rain-delay) forwards;
  will-change: transform;
}

.game-complete-flybys {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  pointer-events: none;
}

.game-complete-flyby {
  position: absolute;
  top: 0;
  left: 0;
  height: auto;
  opacity: 0;
  border: 3px solid #fff;
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(24, 26, 22, 0.45);
  pointer-events: none;
  will-change: transform, opacity;
}

.multiplayer-score-notifications {
  position: fixed;
  top: 82px;
  right: 18px;
  z-index: 11;
  display: grid;
  width: min(330px, calc(100vw - 24px));
  gap: 8px;
  pointer-events: none;
  font-family: "Courier New", ui-monospace, monospace;
}

.multiplayer-score-notification {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 8px 10px 8px 7px;
  border: 3px solid #20e8ff;
  border-radius: 2px;
  color: #f8fbff;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, #24105a, #09051e);
  box-shadow: 3px 3px 0 #ff2cd6, 0 0 18px rgba(32, 232, 255, 0.5);
  animation: multiplayer-score-flash 3.4s ease var(--notification-delay, 0ms) both;
}

.multiplayer-score-notification span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #ff2cd6;
  background: #24105a;
  box-shadow: 2px 2px 0 #ff2cd6;
  font-size: 23px;
}

.multiplayer-score-notification strong {
  overflow: hidden;
  color: #ffe34d;
  font-size: 15px;
  text-overflow: ellipsis;
  text-shadow: 2px 2px 0 #b217ad;
  text-transform: uppercase;
  white-space: nowrap;
}

.multiplayer-score-notification b {
  color: #20e8ff;
  font-size: 15px;
  text-shadow: 0 0 7px rgba(32, 232, 255, 0.75);
  white-space: nowrap;
}

@keyframes perfect-guess-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -10vh, 0) rotate(0);
  }

  8% {
    opacity: 1;
  }

  92% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--rain-drift), 150vh, 0) rotate(var(--rain-spin));
  }
}

@keyframes multiplayer-score-flash {
  0% {
    opacity: 0;
    transform: translateX(32px) scale(0.94);
  }

  10%,
  78% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }

  88% {
    filter: brightness(1.35);
  }

  100% {
    opacity: 0;
    transform: translateX(22px) scale(0.97);
  }
}

@keyframes podium-place-rise {
  0% {
    opacity: 0;
    transform: translateY(80px) scale(0.82);
  }

  70% {
    opacity: 1;
    transform: translateY(-8px) scale(1.03);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .perfect-guess-rain img {
    animation-duration: 800ms;
    animation-delay: 0s;
  }

  .perfect-guess-rain img:nth-child(n + 9) {
    display: none;
  }

  .multiplayer-score-notification {
    animation-duration: 2.4s;
  }

  .podium-place {
    animation: none;
  }
}

.round-popup-card > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.popup-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 150px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(24, 26, 22, 0.16);
  animation: item-pop 260ms ease-out;
}

.popup-cover[hidden] {
  display: none;
}

.round-popup-card h2 {
  font-size: 22px;
  line-height: 1.05;
}

.round-popup-card > strong {
  width: max-content;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 9px;
  color: #fff;
  background: var(--accent);
  font-size: 18px;
}

.round-popup.is-wrong .round-popup-card > strong {
  background: var(--danger);
}

.round-popup-card p {
  margin-top: 0;
  font-size: 13px;
  font-weight: 800;
}

.round-popup-card .result-actions {
  gap: 6px;
  margin-top: 6px;
}

.round-popup-card .result-actions .download,
.round-popup-card .result-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.round-popup-card p:empty {
  display: none;
}

.songs-popup {
  position: fixed;
  inset: 62px 0 0;
  z-index: 4;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 20px;
  background: rgba(24, 26, 22, 0.54);
}

.songs-popup[hidden] {
  display: none;
}

.songs-popup-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  width: min(760px, 100%);
  height: min(78vh, 680px);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 28px 70px rgba(24, 26, 22, 0.3);
}

.custom-playlist-card {
  display: grid;
  gap: 14px;
  width: min(560px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 28px 70px rgba(24, 26, 22, 0.3);
}

.songs-popup-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.songs-popup-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 6px 10px;
  overflow: auto;
  padding-right: 4px;
}

.songs-popup-list article {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
  padding: 5px;
  border-radius: 5px;
  background: var(--surface);
}

.songs-popup-list img {
  width: 52px;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  object-fit: cover;
  background: var(--line);
}

.songs-popup-list span {
  overflow: hidden;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-config-card {
  height: auto;
  max-width: 520px;
}

.host-config-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.host-config-list div {
  display: grid;
  grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.host-config-list dt,
.host-config-list dd {
  margin: 0;
}

.host-config-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.host-config-list dd {
  min-width: 0;
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-play .player-panel {
  animation: feedback-glow 520ms ease;
}

.feedback-correct .guess-panel {
  animation: feedback-correct 520ms ease;
}

.feedback-wrong .guess-panel {
  animation: feedback-wrong 520ms ease;
}

.feedback-skip .guess-panel,
.feedback-select .guess-form {
  animation: feedback-nudge 340ms ease;
}

.group-setup.is-loading .group-card {
  opacity: 0.72;
}

/* MANGOless arcade cabinet theme */
.game-view {
  --arcade-bg: #09051e;
  --arcade-panel: #160b3d;
  --arcade-soft: #24105a;
  --arcade-cyan: #20e8ff;
  --arcade-pink: #ff2cd6;
  --arcade-yellow: #ffe34d;
  --arcade-purple: #7c62ff;
  padding: 10px;
  border: 3px solid #35146e;
  border-radius: 4px;
  background:
    linear-gradient(rgba(9, 5, 30, 0.9), rgba(9, 5, 30, 0.9)),
    repeating-linear-gradient(90deg, #20e8ff 0 1px, transparent 1px 24px),
    repeating-linear-gradient(0deg, #ff2cd6 0 1px, transparent 1px 24px);
  box-shadow: inset 0 0 35px rgba(32, 232, 255, 0.12);
  font-family: "Courier New", ui-monospace, monospace;
}

.game-view .topbar,
.game-view .game-setup,
.game-view .group-setup,
.game-view .invite-join-setup,
.game-view .artist-loading,
.game-view .game-controls,
.game-view .player-panel,
.game-view .guess-panel {
  border: 3px solid var(--arcade-cyan);
  border-radius: 4px;
  color: #f8fbff;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px),
    var(--arcade-bg);
  box-shadow: 0 0 0 2px #35146e, 0 0 14px rgba(32, 232, 255, 0.3), inset 0 0 20px rgba(255, 44, 214, 0.08);
}

.game-view .topbar {
  border-color: var(--arcade-pink);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 8px),
    linear-gradient(90deg, #24105a, #47116c);
}

.game-view .topbar h1,
.game-view .section-heading h2 {
  color: var(--arcade-yellow);
  text-shadow: 2px 2px 0 #b217ad, 0 0 8px rgba(255, 227, 77, 0.45);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.game-view .topbar p,
.game-view .section-heading span,
.game-view .setup-row label,
.game-view .guess-heading label,
.game-view .clip-label {
  color: var(--arcade-cyan);
  font-weight: 900;
  text-transform: uppercase;
}

.game-view button,
.game-view .download {
  border: 2px solid var(--arcade-cyan);
  border-radius: 2px;
  color: var(--arcade-cyan);
  background: var(--arcade-panel);
  box-shadow: 2px 2px 0 var(--arcade-pink);
  font-family: inherit;
  font-weight: 900;
  text-transform: uppercase;
}

.game-view button:hover,
.game-view .download:hover,
.game-view .button-grid button.active {
  border-color: var(--arcade-yellow);
  color: var(--arcade-yellow);
  background: #35146e;
  box-shadow: 3px 3px 0 var(--arcade-pink), 0 0 9px rgba(32, 232, 255, 0.5);
}

.game-view .button-grid button {
  border-color: #654bad;
  color: #f8fbff;
  background: var(--arcade-panel);
}

.game-view .group-card {
  grid-template-columns: 112px minmax(0, 1fr);
  width: 100%;
  height: 124px;
  border: 2px solid #654bad;
  border-radius: 2px;
  color: #f8fbff;
  background: var(--arcade-panel);
  box-shadow: 3px 3px 0 #35146e;
}

.game-view .group-card:hover,
.game-view .group-card.active {
  border-color: var(--arcade-yellow);
  color: var(--arcade-yellow);
  background: #35146e;
  box-shadow: 4px 4px 0 var(--arcade-pink), 0 0 12px rgba(32, 232, 255, 0.45);
}

.game-view .group-card small {
  color: #b8a8e8;
}

.game-view .group-card > img,
.game-view .group-collage,
.game-view .custom-playlist-icon {
  border: 2px solid var(--arcade-cyan);
  border-radius: 1px;
}

.game-view .score-strip,
.game-view .active-config,
.game-view .status-card,
.game-view .clip-console > div {
  border: 2px solid var(--arcade-purple);
  border-radius: 2px;
  color: #f8fbff;
  background: var(--arcade-panel);
  box-shadow: inset 3px 0 0 var(--arcade-cyan);
}

.game-view .score-strip strong,
.game-view #clipLength,
.game-view .summary-head strong {
  color: var(--arcade-yellow);
  text-shadow: 2px 2px 0 #b217ad;
}

.game-view .score-strip span,
.game-view .active-config span,
.game-view .status-card span {
  color: var(--arcade-cyan);
  opacity: 1;
}

.game-view .score-strip::before,
.game-view .active-config::before,
.game-view #changeChallengeButton::before,
.game-view .leaderboard-button::before,
.game-view .clue-link::before {
  border-radius: 1px;
  color: #160625;
  background: var(--arcade-yellow);
  box-shadow: 2px 2px 0 var(--arcade-pink);
}

.game-view .artwork {
  border: 3px solid var(--arcade-pink);
  border-radius: 2px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 5px),
    linear-gradient(135deg, #24105a, #09051e);
  box-shadow: 0 0 16px rgba(255, 44, 214, 0.35);
}

.game-view .artwork span {
  border: 3px solid var(--arcade-cyan);
  border-radius: 2px;
  color: var(--arcade-yellow);
  background: var(--arcade-soft);
  box-shadow: 4px 4px 0 var(--arcade-pink);
  text-shadow: 2px 2px 0 #b217ad;
}

.game-view .artwork::before {
  border: 3px solid var(--arcade-cyan);
  border-radius: 2px;
  background:
    radial-gradient(circle, var(--arcade-yellow) 0 7%, #09051e 8% 17%, var(--arcade-pink) 18% 21%, transparent 22% 31%, var(--arcade-cyan) 32% 35%, transparent 36%),
    repeating-conic-gradient(from 0deg, #24105a 0deg 12deg, #35146e 12deg 24deg);
  box-shadow:
    4px 4px 0 var(--arcade-pink),
    0 0 14px rgba(32, 232, 255, 0.7),
    inset 0 0 18px rgba(255, 44, 214, 0.7);
}

.game-view .artwork.is-playing::before {
  opacity: 0.92;
  animation: artwork-spin 1.4s steps(12) infinite;
}

.game-view .artwork-progress,
.game-view .step {
  border: 1px solid var(--arcade-purple);
  border-radius: 1px;
  color: #b8a8e8;
  background: var(--arcade-panel);
}

.game-view .step.active,
.game-view .step.used {
  border-color: var(--arcade-cyan);
  color: var(--arcade-yellow);
  background: #35146e;
  box-shadow: 0 0 7px rgba(32, 232, 255, 0.45);
}

.game-view .clip-track {
  border: 2px solid var(--arcade-cyan);
  border-radius: 1px;
  background: var(--arcade-panel);
  box-shadow: inset 0 0 10px rgba(32, 232, 255, 0.22);
}

.game-view .clip-track-wave {
  color: rgba(124, 98, 255, 0.65);
}

.game-view .clip-track-fill {
  background: linear-gradient(90deg, var(--arcade-pink), var(--arcade-cyan));
}

.game-view input {
  border: 2px solid var(--arcade-purple);
  border-radius: 2px;
  color: #f8fbff;
  background: var(--arcade-bg);
  font-family: inherit;
}

.game-view input:focus {
  border-color: var(--arcade-cyan);
  outline: 2px solid rgba(255, 44, 214, 0.55);
}

.game-view .suggestion-card,
.game-view .guess-item,
.game-view .summary-item,
.game-view .result-box,
.game-view .summary-head,
.game-view .leaderboard-panel {
  border: 1px solid #4c378a;
  border-radius: 1px;
  color: #f8fbff;
  background: rgba(25, 12, 70, 0.9);
}

.game-view .suggestion-card:hover {
  border-color: var(--arcade-yellow);
  color: var(--arcade-yellow);
  background: #35146e;
}

.game-view .guess-list:empty::before,
.game-view .suggestion-card small,
.game-view .guess-item small,
.game-view .summary-item small,
.game-view .result-box > span,
.game-view .summary-head span,
.game-view .leaderboard-head strong {
  color: #b8a8e8;
}

.game-view .round-popup-card,
.game-view .songs-popup-card:not(.leaderboard-popup-card),
.game-view .custom-playlist-card {
  border: 4px solid var(--arcade-cyan);
  border-radius: 4px;
  color: #f8fbff;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px),
    var(--arcade-bg);
  box-shadow: 0 0 0 4px #35146e, 0 0 0 7px var(--arcade-pink);
  font-family: inherit;
}

.game-view .group-cards {
  grid-template-columns: repeat(var(--category-columns, 4), 292px);
  grid-auto-rows: 124px;
  justify-content: center;
}

.game-view .host-config-list div {
  border: 1px solid #4c378a;
  border-radius: 1px;
  color: #f8fbff;
  background: rgba(25, 12, 70, 0.9);
  box-shadow: inset 3px 0 0 var(--arcade-cyan);
}

.game-view .host-config-list dt {
  color: var(--arcade-cyan);
}

.game-view .host-config-list dd {
  color: var(--arcade-yellow);
  text-shadow: 2px 2px 0 #b217ad;
}

.game-view .multiplayer-setup {
  gap: 10px;
  padding: 10px;
  border: 2px solid var(--arcade-purple);
  border-radius: 2px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px),
    var(--arcade-panel);
  box-shadow: inset 3px 0 0 var(--arcade-cyan), 0 0 10px rgba(32, 232, 255, 0.18);
}

.game-view .multiplayer-form {
  position: relative;
  gap: 10px;
  overflow: hidden;
  padding: 13px;
  border: 1px solid #4c378a;
  border-radius: 1px;
  color: #f8fbff;
  background: rgba(9, 5, 30, 0.86);
  box-shadow: inset 3px 0 0 var(--arcade-pink);
}

.game-view .multiplayer-form:nth-child(2) {
  box-shadow: inset 3px 0 0 var(--arcade-cyan);
}

.game-view .multiplayer-form::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(110deg, transparent 35%, rgba(32, 232, 255, 0.05), transparent 65%);
}

.game-view .multiplayer-form h3 {
  z-index: 1;
  color: var(--arcade-yellow);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-shadow: 2px 2px 0 #b217ad;
  text-transform: uppercase;
}

.game-view .multiplayer-form > span,
.game-view .multiplayer-setup .message {
  z-index: 1;
  color: #b8a8e8;
  font-weight: 800;
}

.game-view .setup-room-label {
  border: 2px solid var(--arcade-yellow);
  border-radius: 2px;
  color: var(--arcade-yellow);
  background: var(--arcade-panel);
  box-shadow: 3px 3px 0 var(--arcade-pink), 0 0 10px rgba(255, 227, 77, 0.3);
  font-family: inherit;
  letter-spacing: 0.06em;
  text-shadow: 2px 2px 0 #b217ad;
  text-transform: uppercase;
}

.game-view .invite-room-label {
  border: 2px solid var(--arcade-yellow);
  border-radius: 2px;
  color: var(--arcade-yellow);
  background: var(--arcade-panel);
  box-shadow: 3px 3px 0 var(--arcade-pink), 0 0 10px rgba(255, 227, 77, 0.3);
  font-family: inherit;
  letter-spacing: 0.06em;
  text-shadow: 2px 2px 0 #b217ad;
  text-transform: uppercase;
}

.game-view .invite-join-setup select,
.game-view .invite-join-setup input {
  min-height: 42px;
  border: 2px solid var(--arcade-purple);
  border-radius: 2px;
  color: #f8fbff;
  background: var(--arcade-bg);
  font-family: inherit;
  font-weight: 800;
}

.game-view .invite-join-setup select {
  color-scheme: dark;
  cursor: pointer;
}

.game-view .multiplayer-form input,
.game-view .multiplayer-form select {
  z-index: 1;
  min-height: 42px;
  border: 2px solid var(--arcade-purple);
  border-radius: 2px;
  color: #f8fbff;
  background: var(--arcade-bg);
  font-family: inherit;
  font-weight: 800;
}

.game-view .multiplayer-form select {
  color-scheme: dark;
  cursor: pointer;
}

.game-view .multiplayer-form input::placeholder {
  color: #9f8dd7;
  opacity: 1;
}

.game-view .multiplayer-form input:focus,
.game-view .multiplayer-form select:focus {
  border-color: var(--arcade-cyan);
  outline: 2px solid rgba(255, 44, 214, 0.55);
  box-shadow: 0 0 9px rgba(32, 232, 255, 0.4);
}

.game-view .multiplayer-form button {
  z-index: 1;
}

.game-view .multiplayer-players-panel {
  position: relative;
  gap: 8px;
  overflow: hidden;
  padding: 9px;
  border: 3px solid var(--arcade-cyan);
  border-radius: 4px;
  color: #f8fbff;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px),
    var(--arcade-bg);
  box-shadow: 0 0 0 2px #35146e, 0 0 14px rgba(32, 232, 255, 0.3), inset 0 0 20px rgba(255, 44, 214, 0.08);
}

.game-view .multiplayer-room-head {
  position: relative;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid var(--arcade-pink);
  border-radius: 1px;
  background: linear-gradient(90deg, #24105a, #47116c);
  box-shadow: inset 3px 0 0 var(--arcade-yellow);
}

.game-view .multiplayer-room-head span {
  color: var(--arcade-cyan);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.game-view .multiplayer-room-head strong {
  overflow: hidden;
  color: var(--arcade-yellow);
  font-size: 17px;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-shadow: 2px 2px 0 #b217ad;
  text-transform: uppercase;
  white-space: nowrap;
}

.game-view .multiplayer-players-list {
  gap: 5px;
}

.game-view .multiplayer-players-list article {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 2px 7px;
  min-width: 0;
  padding: 7px;
  border: 1px solid #4c378a;
  border-radius: 1px;
  color: #f8fbff;
  background: rgba(25, 12, 70, 0.82);
  box-shadow: inset 3px 0 0 var(--arcade-purple);
}

.game-view .multiplayer-players-list article.is-current {
  border-color: var(--arcade-pink);
  color: var(--arcade-yellow);
  background: linear-gradient(90deg, rgba(80, 18, 112, 0.96), rgba(25, 12, 70, 0.92));
  box-shadow: inset 3px 0 0 var(--arcade-yellow), 0 0 8px rgba(255, 44, 214, 0.3);
}

.game-view .multiplayer-players-list article > span {
  grid-row: 1 / 3;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--arcade-cyan);
  border-radius: 1px;
  background: var(--arcade-soft);
  box-shadow: 2px 2px 0 var(--arcade-pink);
  font-size: 19px;
}

.game-view .multiplayer-players-list article strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.game-view .multiplayer-players-list article b {
  grid-column: 3;
  grid-row: 1 / 3;
  align-self: center;
  color: var(--arcade-cyan);
  font-size: 11px;
  text-shadow: 0 0 6px rgba(32, 232, 255, 0.65);
  white-space: nowrap;
}

.game-view .multiplayer-players-list article small {
  grid-column: 2;
  color: var(--arcade-yellow);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.game-view .multiplayer-podium-popup {
  background:
    repeating-linear-gradient(0deg, rgba(32, 232, 255, 0.035) 0 1px, transparent 1px 5px),
    rgba(9, 5, 30, 0.88);
}

.game-view .multiplayer-podium-card {
  position: relative;
  overflow: hidden;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  height: auto;
  max-height: min(82vh, 720px);
  padding: 0;
  border: 4px solid var(--arcade-cyan);
  border-radius: 4px;
  color: #f8fbff;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px),
    var(--arcade-bg);
  box-shadow: 0 0 0 4px #35146e, 0 0 0 7px var(--arcade-pink), 0 0 35px rgba(32, 232, 255, 0.55);
}

.game-view .multiplayer-podium-card .songs-popup-head {
  padding: 12px 14px;
  border-bottom: 4px solid var(--arcade-pink);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 8px),
    linear-gradient(90deg, #24105a, #47116c);
}

.game-view .multiplayer-podium-card .songs-popup-head h2 {
  margin: 0;
  color: var(--arcade-yellow);
  letter-spacing: 0.07em;
  text-shadow: 2px 2px 0 #b217ad, 0 0 8px rgba(255, 227, 77, 0.5);
  text-transform: uppercase;
}

.game-view .multiplayer-podium {
  gap: 6px;
  min-height: 230px;
  padding: 12px 12px 0;
}

.game-view .podium-place {
  position: relative;
  gap: 5px;
  padding: 17px 7px 12px;
  border: 2px solid var(--arcade-purple);
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  color: #f8fbff;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 5px),
    var(--arcade-panel);
  box-shadow: inset 0 4px 0 var(--arcade-cyan), 0 0 10px rgba(32, 232, 255, 0.2);
}

.game-view .podium-place::before {
  display: grid;
  width: 28px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--arcade-pink);
  color: var(--arcade-yellow);
  background: var(--arcade-soft);
  box-shadow: 2px 2px 0 var(--arcade-pink);
  content: "#";
  font-size: 14px;
  font-weight: 950;
}

.game-view .podium-place.place-1 {
  background: linear-gradient(180deg, #4b2264, #24105a);
  box-shadow: inset 0 5px 0 var(--arcade-yellow), 0 0 16px rgba(255, 227, 77, 0.34);
}

.game-view .podium-place.place-1::before {
  content: "#1";
}

.game-view .podium-place.place-2::before {
  content: "#2";
}

.game-view .podium-place.place-3::before {
  content: "#3";
}

.game-view .podium-place span {
  font-size: 40px;
  filter: drop-shadow(3px 3px 0 rgba(255, 44, 214, 0.7));
}

.game-view .podium-place strong {
  overflow: hidden;
  max-width: 100%;
  color: var(--arcade-yellow);
  font-size: 13px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.game-view .podium-place b {
  color: var(--arcade-cyan);
  font-size: 12px;
  text-shadow: 0 0 6px rgba(32, 232, 255, 0.65);
}

.game-view .multiplayer-final-list {
  gap: 5px;
  overflow: auto;
  margin: 0;
  padding: 0 12px 12px;
}

.game-view .multiplayer-final-list li {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  padding: 6px 9px 6px 5px;
  border: 1px solid #4c378a;
  border-radius: 1px;
  color: #f8fbff;
  background: rgba(25, 12, 70, 0.82);
  box-shadow: inset 3px 0 0 var(--arcade-cyan);
}

.game-view .multiplayer-final-list li > span {
  display: grid;
  height: 30px;
  place-items: center;
  border: 1px solid var(--arcade-pink);
  color: var(--arcade-yellow);
  background: var(--arcade-soft);
  font-weight: 950;
}

.game-view .multiplayer-final-list li strong {
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.game-view .multiplayer-final-list li b {
  color: var(--arcade-cyan);
  text-shadow: 0 0 6px rgba(32, 232, 255, 0.65);
}

.game-view .songs-popup-list article {
  border: 1px solid #4c378a;
  border-radius: 1px;
  color: #f8fbff;
  background: var(--arcade-panel);
}

.game-view .artist-loading strong {
  color: var(--arcade-yellow);
  text-shadow: 2px 2px 0 #b217ad;
}

.impostor-view {
  --psy-ink: #151923;
  --psy-panel: #f8f3eb;
  --psy-paper: #fffaf2;
  --psy-teal: #1e756f;
  --psy-burgundy: #8e3153;
  --psy-gold: #d9a441;
  --psy-blue: #23395d;
  display: grid;
  gap: 4px;
}

.impostor-header {
  min-height: 28px;
  display: grid;
  align-items: center;
  margin-top: -14px;
  color: var(--psy-paper);
}

.impostor-lobby-title {
  text-align: center;
}

.impostor-lobby-title h1 {
  margin: 0;
  color: var(--psy-paper);
  font-size: clamp(2.2rem, 7vw, 4.6rem);
  line-height: 0.95;
}

.impostor-lobby-title p {
  max-width: 640px;
  margin: 10px auto 0;
  color: rgba(255, 250, 242, 0.78);
}

.impostor-room-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.impostor-lobby-title[hidden],
.impostor-room-header[hidden] {
  display: none;
}

.impostor-room-header .impostor-round-counter {
  grid-column: 2;
}

.impostor-room-header #impostorShareButton {
  grid-column: 3;
  justify-self: end;
}

.impostor-lobby,
.impostor-game {
  display: grid;
  gap: 6px;
}

.impostor-choice[hidden],
.impostor-form[hidden],
.impostor-lobby[hidden],
.impostor-game[hidden] {
  display: none;
}

.impostor-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.impostor-choice-button,
.impostor-form {
  border: 1px solid rgba(21, 25, 35, 0.16);
  border-radius: 6px;
  color: var(--psy-ink);
  background: var(--psy-panel);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.impostor-choice-button {
  min-height: 210px;
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 24px;
  border-top: 5px solid var(--psy-teal);
  font-size: 1.2rem;
}

.impostor-choice-button:nth-child(2) {
  border-top-color: var(--psy-burgundy);
}

.impostor-choice-button span {
  display: grid;
  width: 64px;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: var(--psy-gold);
  background: var(--psy-ink);
  font-size: 2.2rem;
  line-height: 1;
}

.impostor-form {
  display: grid;
  width: min(100%, 560px);
  justify-self: center;
  gap: 14px;
  padding: 22px;
  border-top: 5px solid var(--psy-teal);
}

.impostor-form h2 {
  margin: 0;
  font-size: 1.2rem;
}

.impostor-form input,
.impostor-form select {
  border-color: rgba(21, 25, 35, 0.2);
  background: var(--psy-paper);
}

.impostor-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.impostor-main-button {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  min-height: clamp(58px, 13%, 94px);
  width: clamp(118px, 28%, 190px);
  border: 3px solid rgba(248, 238, 213, 0.88);
  border-radius: 999px;
  color: var(--psy-paper);
  background: linear-gradient(180deg, #b43f67, #741f43);
  letter-spacing: 0;
  transform: translate(-50%, -50%);
  box-shadow:
    0 16px 28px rgba(0, 0, 0, 0.38),
    inset 0 4px 0 rgba(255, 255, 255, 0.18),
    inset 0 -5px 0 rgba(0, 0, 0, 0.22);
  font-size: clamp(0.78rem, 2.3vw, 1.05rem);
}

.impostor-main-button:hover {
  border-color: var(--psy-gold);
  color: var(--psy-ink);
  background: var(--psy-gold);
}

.impostor-table-wrap {
  display: grid;
  justify-items: center;
  gap: 0;
}

.impostor-round-counter {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  color: var(--psy-paper);
  text-transform: uppercase;
}

.impostor-round-counter span {
  color: rgba(255, 250, 242, 0.68);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.impostor-round-counter strong {
  color: var(--psy-gold);
  font-size: clamp(1.7rem, 4.2vw, 3.1rem);
  line-height: 1;
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
}

.impostor-circle {
  position: relative;
  width: min(86vw, 760px, calc(100svh - 105px));
  aspect-ratio: var(--table-aspect, 1 / 1);
  justify-self: center;
  border: clamp(10px, 2vw, 18px) solid #4a3148;
  border-radius: 999px;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.22), transparent 34%),
    radial-gradient(ellipse at center, #59628b 0 44%, #3f4771 45% 64%, #7b4b61 65% 76%, #2a2231 77% 100%);
  box-shadow:
    0 30px 48px rgba(0, 0, 0, 0.42),
    0 14px 0 #1e1724,
    inset 0 0 0 clamp(8px, 1.7vw, 16px) #d1a85b,
    inset 0 0 0 clamp(18px, 3.4vw, 34px) #5a3b52,
    inset 0 0 58px rgba(10, 10, 24, 0.48);
  overflow: visible;
  transform: perspective(1100px) rotateX(7deg);
  transform-origin: center center;
}

.impostor-circle::before,
.impostor-circle::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.impostor-circle::before {
  z-index: 0;
  inset: 13%;
  border-radius: inherit;
  background:
    repeating-radial-gradient(ellipse at center, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 24px),
    radial-gradient(ellipse at 50% 38%, #6f78a6, #47507d 64%, #31395f);
  box-shadow:
    inset 0 0 34px rgba(0, 0, 0, 0.35),
    0 0 0 2px rgba(255, 255, 255, 0.08);
}

.impostor-circle::after {
  z-index: 0;
  inset: 4%;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.26), transparent 31%, transparent 68%, rgba(0, 0, 0, 0.24));
  mix-blend-mode: soft-light;
}

.impostor-chair,
.impostor-chip {
  position: absolute;
  transform: translate(-50%, -50%);
}

.impostor-chair {
  z-index: 4;
  display: grid;
  place-items: center;
  width: calc(clamp(30px, 6vw, 52px) * var(--seat-scale, 1));
  aspect-ratio: 1.35 / 1;
  border: 2px solid rgba(34, 20, 18, 0.88);
  border-radius: 42% 42% 50% 50%;
  color: #f8ead0;
  background: linear-gradient(180deg, #9d6043, #4e2d28 58%, #241714);
  font-weight: 900;
  box-shadow:
    0 10px 16px rgba(0, 0, 0, 0.32),
    inset 0 4px 0 rgba(255, 255, 255, 0.12),
    inset 0 -5px 0 rgba(0, 0, 0, 0.24);
  font-size: calc(0.88rem * var(--seat-scale, 1));
}

.impostor-chip {
  z-index: 3;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "emoji name";
  align-items: center;
  column-gap: calc(8px * var(--seat-scale, 1));
  width: calc(clamp(72px, 14vw, 126px) * var(--seat-scale, 1));
  min-height: calc(38px * var(--seat-scale, 1));
  padding: calc(6px * var(--seat-scale, 1)) calc(8px * var(--seat-scale, 1));
  border: 1px solid rgba(21, 25, 35, 0.3);
  border-top: 4px solid var(--psy-teal);
  border-radius: calc(7px * var(--seat-scale, 1));
  color: var(--psy-ink);
  background: linear-gradient(180deg, #fffdf8, #e9dfcf);
  box-shadow:
    0 12px 20px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: left 1150ms cubic-bezier(0.28, 0.84, 0.32, 1), top 1150ms cubic-bezier(0.28, 0.84, 0.32, 1), transform 1150ms ease;
}

.impostor-circle.is-orbiting .impostor-chip {
  animation: impostor-card-orbit 4.4s ease-in-out both;
  transition: none;
}

.impostor-circle.is-shaking .impostor-chip.is-trigger-player {
  animation: impostor-card-shake 2.05s ease-in-out both;
}

.impostor-circle.is-orbiting .impostor-chip.is-trigger-player {
  animation: impostor-card-orbit 4.4s ease-in-out both;
}

.impostor-chip.is-current {
  border-top-color: var(--psy-burgundy);
  background: linear-gradient(180deg, #f8ffff, #dff3ed);
}

.impostor-chip.is-disconnected {
  opacity: 0.45;
}

.impostor-chip span {
  grid-area: emoji;
  font-size: calc(1.45rem * var(--seat-scale, 1));
}

.impostor-chip strong {
  min-width: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  white-space: normal;
  font-size: calc(clamp(0.62rem, 1.45vw, 0.92rem) * var(--seat-scale, 1) * var(--name-scale, 1));
  line-height: 1.02;
}

.impostor-chip strong {
  grid-area: name;
}


@media (min-width: 901px) {
  .game-view {
    gap: 12px;
  }

  .game-view .topbar {
    max-width: none;
    margin-top: -8px;
    text-align: left;
  }

  .game-view .topbar h1 {
    font-size: clamp(34px, 3.2vw, 50px);
    line-height: 0.98;
  }

  .game-view .topbar p {
    margin-top: 4px;
    font-size: 14px;
  }

  .game-grid {
    grid-template-columns: minmax(250px, 360px) minmax(0, 1fr);
    gap: 14px;
  }

  .game-grid:has(.multiplayer-players-panel:not([hidden])) {
    grid-template-columns: minmax(140px, 180px) minmax(240px, 330px) minmax(0, 1fr);
  }

  .player-panel,
  .guess-panel {
    gap: 10px;
    padding: 12px;
  }

  .artwork-progress {
    min-height: 24px;
    padding: 0 9px;
    font-size: 12px;
  }

  .artwork {
    min-height: 190px;
    max-height: 24vh;
  }

  .artwork span {
    width: 68px;
    height: 68px;
    font-size: 36px;
  }

  .clip-console {
    grid-template-columns: minmax(0, 1fr) 78px 78px;
    gap: 8px;
  }

  .clip-console > div {
    min-height: 48px;
    padding: 8px 10px;
  }

  #clipLength {
    font-size: 21px;
  }

  .clip-track {
    height: 38px;
  }

  .clip-track-wave,
  .clip-track-fill .clip-track-wave {
    top: 7px;
    bottom: 7px;
  }

  .step {
    min-height: 30px;
    font-size: 11px;
  }

  .status-card {
    min-height: 54px;
    padding: 9px 12px;
  }

  .guess-form {
    gap: 6px;
  }

  .guess-row {
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 8px;
  }

  .guess-row input,
  .guess-row button {
    min-height: 40px;
  }

  .guess-list {
    min-height: 34px;
  }

  .suggestion-card {
    grid-template-columns: 58px minmax(0, 1fr);
    min-height: 60px;
  }

  .suggestion-card img {
    width: 58px;
  }
}

@media (max-width: 900px) {
  .title-bar {
    display: flex;
    min-height: 66px;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 10px 14px;
  }

  .title-logo {
    width: 52px;
    height: 36px;
  }

  .title-copy {
    flex: 1 1 180px;
  }

  .mango {
    width: 28px;
    height: 36px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 66px);
  }

  .round-popup {
    top: 88px;
  }

  .round-popup-card {
    margin-top: 24px;
  }

  .nav-menu {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 52px;
    order: 4;
    width: 100%;
    gap: 8px;
    z-index: 6;
  }

  .language-selector {
    display: none;
  }

  .nav-menu .nav-link {
    display: none;
  }

  .mobile-nav-dropdown {
    display: none;
  }

  .nav-menu .nav-link[data-view-target="gameView"],
  .nav-menu:not(.mobile-menu-open) .nav-link.active {
    display: inline-flex;
    grid-column: 1;
    grid-row: 1;
    min-height: 44px;
  }

  .nav-menu:not(.mobile-menu-open) .nav-link[data-view-target="gameView"]:not(.active) {
    display: none;
  }

  .mobile-nav-more {
    display: inline-grid;
    grid-column: 2;
    grid-row: 1;
    min-height: 44px;
    place-items: center;
    padding: 0;
    border: 2px solid #20e8ff;
    border-radius: 2px;
    color: #ffe34d;
    background: #160b3d;
    box-shadow: 2px 2px 0 #ff2cd6;
    font-family: "Courier New", ui-monospace, monospace;
    font-size: 22px;
    font-weight: 950;
    letter-spacing: 0.08em;
  }

  .mobile-nav-more:hover,
  .mobile-nav-more[aria-expanded="true"] {
    border-color: #ffe34d;
    color: #20e8ff;
    background: #35146e;
    box-shadow: 3px 3px 0 #ff2cd6, 0 0 9px rgba(32, 232, 255, 0.6);
  }

  .nav-menu.mobile-menu-open .mobile-nav-dropdown {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    left: 0;
    z-index: 8;
    display: grid;
    gap: 6px;
    padding: 7px;
    border: 3px solid #20e8ff;
    border-radius: 2px;
    background:
      repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
      #09051e;
    box-shadow: 4px 4px 0 #ff2cd6, 0 0 18px rgba(32, 232, 255, 0.45);
  }

  .nav-menu.mobile-menu-open .nav-link:not([data-view-target="gameView"]) {
    position: relative;
    z-index: 2;
    display: inline-flex;
    min-height: 44px;
    justify-content: flex-start;
    border: 2px solid #654bad;
    border-radius: 2px;
    color: #f8fbff;
    background: #160b3d;
    box-shadow: 3px 3px 0 #35146e;
    font-family: "Courier New", ui-monospace, monospace;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .nav-menu.mobile-menu-open .nav-link:not([data-view-target="gameView"]):hover,
  .nav-menu.mobile-menu-open .nav-link:not([data-view-target="gameView"]).active {
    border-color: #20e8ff;
    color: #ffe34d;
    background: #35146e;
    box-shadow: 3px 3px 0 #ff2cd6;
  }

  .nav-menu.mobile-menu-open .mobile-language-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding-top: 7px;
    border-top: 2px solid #ff2cd6;
  }

  .mobile-language-options button {
    display: grid;
    min-height: 48px;
    place-items: center;
    gap: 3px;
    padding: 5px;
    border: 2px solid #654bad;
    border-radius: 2px;
    color: #f8fbff;
    background: #160b3d;
    box-shadow: 2px 2px 0 #35146e;
    font-family: "Courier New", ui-monospace, monospace;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .mobile-language-options button:hover,
  .mobile-language-options button[aria-current="true"] {
    border-color: #ffe34d;
    color: #20e8ff;
    background: #35146e;
    box-shadow: 2px 2px 0 #ff2cd6;
  }

  .content {
    width: min(100% - 20px, 1120px);
    padding: 22px 0;
  }

  .queue-head,
  .item {
    grid-template-columns: 1fr;
  }

  .queue-head {
    display: none;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .game-setup,
  .game-controls,
  .game-grid,
  .setup-row,
  .clip-console,
  .status-card,
  .summary-head {
    grid-template-columns: 1fr;
  }

  .game-grid {
    gap: 14px;
  }

  .clip-console,
  .status-card,
  .summary-head {
    display: grid;
    align-items: stretch;
  }

  .button-grid {
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  }

  .group-cards,
  .game-view .group-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 8px;
    justify-content: stretch;
  }

  .group-card,
  .game-view .group-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 6px;
    height: auto;
    min-height: 0;
    padding: 7px;
  }

  .group-card > img,
  .group-collage,
  .custom-playlist-icon,
  .game-view .group-card > img,
  .game-view .group-collage,
  .game-view .custom-playlist-icon {
    grid-row: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  .group-card > span {
    align-self: auto;
  }

  .group-card > small {
    align-self: auto;
  }

  .score-strip {
    min-height: 58px;
  }

  .artwork {
    min-height: 220px;
  }

  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .guess-row,
  .suggestion-card,
  .guess-item {
    grid-template-columns: 1fr;
  }

  .multiplayer-setup,
  .game-grid:has(.multiplayer-players-panel:not([hidden])) {
    grid-template-columns: 1fr;
  }

  .game-grid.summary-only:has(.multiplayer-players-panel:not([hidden])) {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  .game-grid.summary-only .multiplayer-players-panel,
  .game-grid.summary-only .guess-panel,
  .game-grid.summary-only .summary-box,
  .game-grid.summary-only .summary-list {
    width: 100%;
    min-width: 0;
  }

  .game-grid.summary-only .guess-panel {
    max-width: 760px;
  }

  .game-view .multiplayer-players-panel {
    order: -1;
  }

  .game-view .multiplayer-players-list {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

  .game-view .multiplayer-podium-popup {
    padding: 10px;
  }

  .game-view .multiplayer-podium-card {
    width: calc(100% - 8px);
  }

  .game-view .multiplayer-podium {
    min-height: 190px;
    padding: 8px 6px 0;
  }

  .game-view .podium-place {
    padding: 10px 4px 8px;
  }

  .game-view .podium-place.place-1 {
    min-height: 180px;
  }

  .game-view .podium-place.place-2 {
    min-height: 145px;
  }

  .game-view .podium-place.place-3 {
    min-height: 118px;
  }

  .game-view .podium-place span {
    font-size: 30px;
  }

  .game-view .podium-place strong,
  .game-view .podium-place b {
    font-size: 10px;
  }

  .game-view .multiplayer-final-list {
    padding: 0 6px 8px;
  }

  #songsPopup {
    inset: var(--songs-popup-top, 66px) 0 0;
    z-index: 20;
    place-items: stretch;
    overflow: hidden;
    height: auto;
    padding:
      8px
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
    background: rgba(9, 5, 30, 0.96);
  }

  #songsPopup .songs-popup-card {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    padding: 8px;
  }

  #songsPopup .songs-popup-head {
    z-index: 2;
    align-items: flex-start;
    padding-bottom: 8px;
    background: var(--arcade-bg);
  }

  #songsPopup .songs-popup-head button {
    flex: 0 0 auto;
  }

  #songsPopup .songs-popup-list {
    grid-template-columns: 1fr;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    -webkit-overflow-scrolling: touch;
  }

  #songsPopup .songs-popup-list article {
    grid-template-columns: 72px minmax(0, 1fr);
    padding: 7px;
  }

  #songsPopup .songs-popup-list img {
    width: 72px;
  }

  #songsPopup .songs-popup-list span {
    overflow: visible;
    font-size: 12px;
    line-height: 1.35;
    text-overflow: clip;
    white-space: normal;
  }

  .multiplayer-score-notifications {
    top: 76px;
    right: 8px;
    width: calc(100vw - 16px);
  }

  .multiplayer-score-notification {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    padding: 6px 8px 6px 5px;
  }

  .multiplayer-score-notification span {
    width: 34px;
    height: 34px;
    font-size: 20px;
  }

  .multiplayer-score-notification strong,
  .multiplayer-score-notification b {
    font-size: 12px;
  }

  .summary-item {
    grid-template-columns: 26px 58px minmax(0, 1fr) auto;
  }

  .summary-item img {
    width: 58px;
  }

  .summary-item small {
    grid-column: 3 / -1;
  }

  .leaderboard-list li {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .leaderboard-list time {
    grid-column: 2;
  }

  .leaderboard-ticker {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .leaderboard-ticker-entry time {
    display: none;
  }

  .songs-popup-card.leaderboard-popup-card {
    width: calc(100% - 12px);
  }

  .leaderboard-popup-list {
    padding: 5px;
  }

  .suggestion-card img {
    width: 100%;
  }

  .guess-item span {
    width: 100%;
    border-radius: 8px;
  }

  .guess-item small,
  .status-card strong {
    text-align: left;
  }

  .impostor-choice {
    grid-template-columns: 1fr;
  }

  .impostor-choice-button {
    min-height: 138px;
  }

  .impostor-form {
    width: 100%;
    padding: 18px;
    box-sizing: border-box;
  }

  .impostor-form .player-identity-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .impostor-form-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .impostor-form-actions button {
    width: 100%;
    min-width: 0;
    padding-inline: 10px;
  }

  .impostor-game {
    gap: 4px;
  }

  .impostor-header {
    min-height: 28px;
    margin-top: -8px;
  }

  .impostor-room-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .impostor-room-header .impostor-round-counter {
    grid-column: 1;
    justify-self: center;
  }

  .impostor-room-header #impostorShareButton {
    grid-column: 2;
    padding-inline: 9px;
    white-space: nowrap;
  }

  .impostor-round-counter strong {
    font-size: clamp(1.45rem, 7vw, 2.35rem);
  }

  .impostor-circle {
    width: min(88vw, 500px, calc(100svh - 108px));
    border-width: 8px;
  }

  .impostor-main-button {
    width: clamp(104px, 30%, 146px);
    min-height: clamp(52px, 13%, 70px);
    font-size: 0.9rem;
  }

  .impostor-chip {
    width: calc(clamp(68px, 21vw, 98px) * var(--seat-scale, 1));
    min-height: calc(36px * var(--seat-scale, 1));
    padding: calc(6px * var(--seat-scale, 1));
    font-size: 0.82rem;
  }

  .impostor-chip span {
    font-size: 1.25rem;
  }
}

.impostor-board {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(320px, 1.25fr);
  grid-template-areas:
    "status players"
    "role actions";
  gap: 14px;
  align-items: start;
}

.impostor-status-panel,
.impostor-role-card,
.impostor-action-panel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #fffaf2;
  background: rgba(16, 15, 32, 0.78);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

.impostor-status-panel {
  grid-area: status;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.impostor-status-panel span,
.impostor-role-card span {
  color: rgba(255, 250, 242, 0.68);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.impostor-status-panel strong,
.impostor-role-card strong {
  display: block;
  margin-top: 3px;
  color: #ffe34d;
  font-size: clamp(1.1rem, 3vw, 2rem);
  line-height: 1.05;
}

.impostor-status-panel .message {
  min-height: 42px;
  margin: 0;
  color: rgba(255, 250, 242, 0.86);
}

.impostor-main-button {
  position: static;
  width: 100%;
  min-height: 48px;
  border-radius: 4px;
  transform: none;
}

.impostor-role-card {
  grid-area: role;
  display: grid;
  gap: 8px;
  padding: 18px;
  border-top: 4px solid #1fbf9f;
}

.impostor-role-card[hidden],
.impostor-guess-form[hidden] {
  display: none;
}

.impostor-role-card.is-impostor {
  border-top-color: #ff2cd6;
}

.impostor-role-card.is-eliminated {
  opacity: 0.68;
}

.impostor-role-card p {
  margin: 0;
  color: rgba(255, 250, 242, 0.8);
}

.impostor-circle {
  grid-area: players;
  display: grid;
  width: 100%;
  max-width: none;
  aspect-ratio: auto;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(12, 13, 27, 0.78);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  overflow: visible;
  transform: none;
}

.impostor-circle::before,
.impostor-circle::after,
.impostor-chair {
  display: none;
}

.impostor-chip {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "emoji name"
    "emoji meta";
  width: auto;
  min-height: 72px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 4px solid #1fbf9f;
  border-radius: 6px;
  color: #fffaf2;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  transform: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.impostor-chip.is-current {
  border-top-color: #ffe34d;
  background: rgba(255, 227, 77, 0.14);
}

.impostor-chip.is-eliminated {
  border-top-color: #ff6b6b;
  opacity: 0.62;
  filter: grayscale(0.35);
}

.impostor-chip span {
  grid-area: emoji;
  align-self: center;
  font-size: 2rem;
}

.impostor-chip strong {
  grid-area: name;
  color: #fffaf2;
  font-size: 1rem;
}

.impostor-chip small {
  grid-area: meta;
  color: rgba(255, 250, 242, 0.68);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.impostor-game.is-impostor-flashing .impostor-chip {
  animation: impostor-card-pulse 760ms ease both;
}

.impostor-action-panel {
  grid-area: actions;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.85fr);
  gap: 14px;
  padding: 16px;
}

.impostor-action-panel h2 {
  margin: 0 0 10px;
  color: #ffe34d;
  font-size: 1rem;
}

.impostor-vote-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.impostor-vote-list button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 10px;
  border-radius: 4px;
}

.impostor-vote-list button strong {
  overflow-wrap: anywhere;
  text-align: left;
}

.impostor-vote-list p {
  margin: 0;
  color: rgba(255, 250, 242, 0.72);
}

.impostor-guess-form {
  display: grid;
  gap: 8px;
}

.impostor-guess-form input {
  min-width: 0;
}

.impostor-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.impostor-config-grid label {
  display: grid;
  gap: 6px;
  color: var(--psy-ink);
  font-weight: 800;
}

.impostor-toggle {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.impostor-toggle input {
  width: 22px;
  height: 22px;
}

@media (max-width: 760px) {
  .impostor-board {
    grid-template-columns: 1fr;
    grid-template-areas:
      "status"
      "role"
      "players"
      "actions";
    gap: 10px;
  }

  .impostor-circle {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
  }

  .impostor-chip {
    min-height: 64px;
    padding: 8px;
  }

  .impostor-chip span {
    font-size: 1.5rem;
  }

  .impostor-action-panel,
  .impostor-config-grid {
    grid-template-columns: 1fr;
  }

  .impostor-vote-list {
    grid-template-columns: 1fr;
  }
}

@keyframes impostor-card-pulse {
  0% {
    transform: translateY(0);
  }
  35% {
    transform: translateY(-6px);
    border-color: #ffe34d;
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes meter-shine {
  to {
    transform: translateX(100%);
  }
}

@keyframes meter-pulse {
  from {
    filter: saturate(1);
  }

  to {
    filter: saturate(1.25) brightness(1.08);
  }
}

@keyframes artwork-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes vinyl-east {
  from { transform: translateX(calc(0px - var(--vinyl-size) - 20px)) rotate(0deg); }
  to { transform: translateX(calc(100vw + var(--vinyl-size) + 20px)) rotate(540deg); }
}

@keyframes vinyl-west {
  from { transform: translateX(calc(100vw + var(--vinyl-size) + 20px)) rotate(0deg); }
  to { transform: translateX(calc(0px - var(--vinyl-size) - 20px)) rotate(-460deg); }
}

@keyframes vinyl-south {
  from { transform: translateY(calc(0px - var(--vinyl-size) - 20px)) rotate(0deg); }
  to { transform: translateY(calc(100vh + var(--vinyl-size) + 20px)) rotate(420deg); }
}

@keyframes vinyl-north {
  from { transform: translateY(calc(100vh + var(--vinyl-size) + 20px)) rotate(0deg); }
  to { transform: translateY(calc(0px - var(--vinyl-size) - 20px)) rotate(-520deg); }
}

@keyframes vinyl-southeast {
  from { transform: translate(-180px, -180px) rotate(0deg); }
  to { transform: translate(calc(100vw + 180px), calc(100vh + 180px)) rotate(560deg); }
}

@keyframes vinyl-northwest {
  from { transform: translate(calc(100vw + 150px), calc(100vh + 150px)) rotate(0deg); }
  to { transform: translate(-150px, -150px) rotate(-480deg); }
}

@keyframes vinyl-southwest {
  from { transform: translate(calc(100vw + 170px), -170px) rotate(0deg); }
  to { transform: translate(-170px, calc(100vh + 170px)) rotate(-540deg); }
}

@keyframes artwork-pulse {
  from {
    box-shadow: var(--shadow);
    transform: scale(1);
  }

  to {
    box-shadow: 0 22px 48px rgba(31, 122, 109, 0.24), 0 0 0 6px rgba(246, 183, 47, 0.14);
    transform: scale(1.012);
  }
}

@keyframes clip-wave {
  0% {
    height: var(--rest, 50%);
  }

  48% {
    height: var(--peak, 88%);
  }

  100% {
    height: var(--mid, 38%);
  }
}

@keyframes loading-breathe {
  from {
    filter: saturate(1);
  }

  to {
    filter: saturate(1.25) brightness(1.08);
  }
}

@keyframes item-pop {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popup-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes feedback-glow {
  50% {
    box-shadow: 0 0 0 6px rgba(246, 183, 47, 0.2), var(--shadow);
  }
}

@keyframes feedback-correct {
  50% {
    box-shadow: 0 0 0 6px rgba(31, 122, 109, 0.2), var(--shadow);
    transform: translateY(-2px);
  }
}

@keyframes feedback-wrong {
  25% {
    transform: translateX(-4px);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(240, 165, 26, 0.22), var(--shadow);
    transform: translateX(4px);
  }

  75% {
    transform: translateX(-2px);
  }
}

@keyframes feedback-nudge {
  50% {
    transform: translateY(-3px);
  }
}

@keyframes impostor-card-shake {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
  }

  12%, 36%, 60%, 84% {
    transform: translate(calc(-50% - 5px), -50%) rotate(-3deg) scale(1.08);
  }

  24%, 48%, 72% {
    transform: translate(calc(-50% + 5px), -50%) rotate(3deg) scale(1.08);
  }
}

@keyframes impostor-card-orbit {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
  }

  25% {
    transform: translate(-50%, -50%) rotate(7deg) scale(1.04);
  }

  50% {
    transform: translate(-50%, -50%) rotate(14deg) scale(1.02);
  }

  75% {
    transform: translate(-50%, -50%) rotate(7deg) scale(1.04);
  }

  100% {
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .arcade-vinyl {
    animation: none;
  }

  .arcade-vinyl:nth-child(n + 4) {
    display: none;
  }
}


/* Impostor requested layout and modal overlays */
.impostor-board {
  grid-template-columns: minmax(220px, 0.72fr) minmax(320px, 1.28fr);
  grid-template-areas: "players play";
  align-items: stretch;
}

.impostor-players-panel,
.impostor-play-panel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #fffaf2;
  background: rgba(16, 15, 32, 0.78);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

.impostor-players-panel {
  grid-area: players;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px;
}

.impostor-play-panel {
  grid-area: play;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  padding: 14px;
}

.impostor-room-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
}

.impostor-room-strip span,
.impostor-round-counter span {
  color: rgba(255, 250, 242, 0.68);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.impostor-room-strip strong {
  overflow: hidden;
  color: #ffe34d;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.impostor-round-counter {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.impostor-round-counter strong {
  color: #ffe34d;
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 0.95;
}

.impostor-play-panel .message {
  min-height: 46px;
  margin: 0;
  color: rgba(255, 250, 242, 0.86);
}

.impostor-play-panel .impostor-role-card,
.impostor-circle {
  grid-area: auto;
}

.impostor-chip {
  grid-template-areas:
    "emoji name"
    "emoji meta"
    "emoji vote";
}

.impostor-chip b {
  grid-area: vote;
  color: rgba(255, 250, 242, 0.62);
  font-size: 0.72rem;
  font-weight: 900;
}

.impostor-chip.has-voted b {
  color: #1fbf9f;
}

.impostor-popup {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(5, 7, 15, 0.72);
  backdrop-filter: blur(6px);
}

.impostor-popup[hidden] {
  display: none !important;
}

.impostor-popup-card {
  width: min(520px, 100%);
  max-height: min(680px, 92svh);
  overflow: auto;
  padding: 16px;
  border: 2px solid #1fbf9f;
  border-radius: 6px;
  color: #fffaf2;
  background: #151923;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
  animation: popup-in 160ms ease-out both;
}

.impostor-popup-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.impostor-popup-card h2 {
  color: #ffe34d;
}

.impostor-event-card p {
  color: rgba(255, 250, 242, 0.88);
  font-size: 1.05rem;
  line-height: 1.45;
}

.impostor-popup .impostor-vote-list {
  grid-template-columns: 1fr;
}

.impostor-popup .impostor-vote-list button {
  min-height: 54px;
}

@media (max-width: 760px) {
  .impostor-board {
    grid-template-columns: 1fr;
    grid-template-areas:
      "players"
      "play";
  }

  .impostor-play-panel {
    grid-template-rows: auto auto auto auto;
  }

  .impostor-room-strip {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .impostor-room-strip span {
    grid-column: 1 / -1;
  }

  .impostor-popup-card {
    width: 100%;
  }
}

/* Impostor premium visual refresh */
body.impostor-active {
  color: #f7f5ee;
  background:
    linear-gradient(135deg, rgba(7, 15, 24, 0.96), rgba(15, 32, 45, 0.94) 48%, rgba(31, 25, 36, 0.96)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 34px);
}

body.impostor-active::before {
  inset: 72px 0 auto;
  height: 52vh;
  width: auto;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(120deg, rgba(69, 187, 168, 0.11), transparent 34%, rgba(234, 81, 93, 0.12) 70%, transparent),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 22px);
  opacity: 1;
  transform: none;
}

body.impostor-active .title-bar {
  border-bottom: 1px solid rgba(247, 213, 126, 0.58);
  background: rgba(7, 15, 24, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.34);
}

.impostor-view {
  --imp-bg: rgba(9, 18, 29, 0.78);
  --imp-bg-strong: rgba(12, 24, 38, 0.92);
  --imp-line: rgba(255, 255, 255, 0.13);
  --imp-muted: rgba(247, 245, 238, 0.68);
  --imp-gold: #f7d57e;
  --imp-crew: #38d7a7;
  --imp-impostor: #ff5f73;
  --imp-blue: #76b7ff;
}

.impostor-lobby-title {
  width: min(880px, 100%);
  padding: 22px 0 4px;
}

.impostor-lobby-title h1 {
  color: var(--imp-gold);
  font-size: clamp(42px, 8vw, 92px);
  letter-spacing: 0;
}

.impostor-lobby-title p {
  max-width: 660px;
  margin: 12px auto 0;
  color: var(--imp-muted);
  font-size: 1.05rem;
}

.impostor-choice-button,
.impostor-form,
.impostor-players-panel,
.impostor-play-panel {
  border: 1px solid var(--imp-line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    var(--imp-bg);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
}

.impostor-choice-button {
  border-top: 4px solid var(--imp-gold);
}

.impostor-choice-button:nth-child(2) {
  border-top-color: var(--imp-blue);
}

.impostor-form h2,
.impostor-guess-form h2,
.impostor-popup-card h2 {
  color: var(--imp-gold);
}

.impostor-board {
  gap: 18px;
}

.impostor-players-panel,
.impostor-play-panel {
  padding: 16px;
}

.impostor-room-strip {
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  min-height: 48px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--imp-line);
}

.impostor-room-strip button,
.impostor-popup-card button.secondary,
.impostor-form-actions button.secondary {
  border-color: rgba(247, 213, 126, 0.22);
  color: #f7f5ee;
  background: rgba(255, 255, 255, 0.07);
}

.impostor-room-strip button:hover,
.impostor-popup-card button.secondary:hover,
.impostor-form-actions button.secondary:hover {
  background: rgba(247, 213, 126, 0.15);
}

#impostorRestartButton:not([hidden]) {
  border-color: rgba(56, 215, 167, 0.28);
  color: #dffcf3;
}

#impostorLeaveButton {
  border-color: rgba(255, 95, 115, 0.26);
  color: #ffe7ea;
}

.impostor-round-counter {
  min-height: 86px;
  border-color: rgba(247, 213, 126, 0.24);
  background:
    linear-gradient(135deg, rgba(247, 213, 126, 0.16), rgba(118, 183, 255, 0.08)),
    rgba(255, 255, 255, 0.05);
}

.impostor-role-card {
  border: 1px solid var(--imp-line);
  border-top: 5px solid var(--imp-crew);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.impostor-role-card.is-impostor {
  border-top-color: var(--imp-impostor);
}

.impostor-role-card strong {
  color: #fff;
  font-size: clamp(1.4rem, 3.6vw, 2.65rem);
}

.impostor-play-panel .message {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.impostor-circle {
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.impostor-chip {
  min-height: 86px;
  border: 1px solid var(--imp-line);
  border-left: 5px solid var(--imp-blue);
  border-top: 1px solid var(--imp-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.impostor-chip.is-current {
  border-left-color: var(--imp-gold);
  background: rgba(247, 213, 126, 0.12);
}

.impostor-chip.is-eliminated {
  border-left-color: var(--imp-impostor);
}

.impostor-chip.has-voted:not(.is-eliminated) {
  border-left-color: var(--imp-crew);
}

.impostor-chip span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
}

.impostor-chip small,
.impostor-chip b {
  color: var(--imp-muted);
}

.impostor-main-button {
  border: 1px solid rgba(56, 215, 167, 0.34);
  background: linear-gradient(135deg, #1ea782, #147d72);
  box-shadow: 0 14px 28px rgba(20, 125, 114, 0.28);
}

.impostor-guess-form {
  padding: 12px;
  border: 1px solid rgba(255, 95, 115, 0.2);
  border-radius: 8px;
  background: rgba(255, 95, 115, 0.07);
}

.impostor-popup {
  background: rgba(3, 8, 14, 0.78);
}

.impostor-popup-card {
  width: min(620px, 100%);
  border: 1px solid rgba(247, 213, 126, 0.22);
  border-top: 6px solid var(--imp-gold, #f7d57e);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    #0b1420;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.56);
}

.impostor-popup.is-crew .impostor-popup-card {
  border-top-color: var(--imp-crew, #38d7a7);
}

.impostor-popup.is-impostor .impostor-popup-card {
  border-top-color: var(--imp-impostor, #ff5f73);
}

.impostor-event-content {
  display: grid;
  gap: 14px;
}

.impostor-event-lead {
  margin: 0;
  color: rgba(247, 245, 238, 0.88);
  font-size: 1rem;
  line-height: 1.45;
}

.impostor-event-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.impostor-event-grid article {
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.impostor-event-grid article:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.impostor-event-grid article.is-emphasis {
  border-color: rgba(247, 213, 126, 0.24);
  background: rgba(247, 213, 126, 0.09);
}

.impostor-popup.is-crew .impostor-event-grid article.is-emphasis {
  border-color: rgba(56, 215, 167, 0.3);
  background: rgba(56, 215, 167, 0.09);
}

.impostor-popup.is-impostor .impostor-event-grid article.is-emphasis {
  border-color: rgba(255, 95, 115, 0.3);
  background: rgba(255, 95, 115, 0.09);
}

.impostor-event-grid span {
  color: rgba(247, 245, 238, 0.62);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.impostor-event-grid strong {
  color: #fff;
  font-size: clamp(1rem, 2.8vw, 1.45rem);
  line-height: 1.12;
}

.impostor-popup .impostor-vote-list button {
  border: 1px solid rgba(118, 183, 255, 0.22);
  background: rgba(118, 183, 255, 0.12);
}

.impostor-popup .impostor-vote-list button:hover:not(:disabled) {
  background: rgba(118, 183, 255, 0.22);
}

@media (max-width: 760px) {
  .impostor-room-strip {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .impostor-room-strip button {
    min-width: 0;
    padding-inline: 10px;
  }

  #impostorShareButton,
  #impostorRestartButton,
  #impostorLeaveButton {
    grid-column: auto;
  }

  .impostor-event-grid {
    grid-template-columns: 1fr;
  }
}

/* Impostor no-scroll fit pass */
body.impostor-active {
  overflow: hidden;
}

body.impostor-active .app-shell {
  min-height: calc(100svh - 62px);
}

body.impostor-active .content {
  width: min(100% - 12px, 1360px);
  height: calc(100svh - 62px);
  padding: 8px 0;
  overflow: hidden;
}

.impostor-view {
  height: 100%;
  min-height: 0;
  gap: 8px;
  overflow: hidden;
}

.impostor-view:has(#impostorGame:not([hidden])) {
  grid-template-rows: minmax(0, 1fr);
}

.impostor-view:has(#impostorGame:not([hidden])) .impostor-header {
  display: none;
}

.impostor-game,
.impostor-board,
.impostor-players-panel,
.impostor-play-panel {
  min-height: 0;
  overflow: hidden;
}

.impostor-game {
  height: 100%;
}

.impostor-board {
  height: 100%;
  grid-template-columns: minmax(170px, 32%) minmax(0, 1fr);
  gap: clamp(6px, 1.2vw, 14px);
}

.impostor-players-panel {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  padding: clamp(6px, 1.1vw, 12px);
}

.impostor-play-panel {
  grid-template-rows: auto auto minmax(42px, auto) auto minmax(0, auto);
  gap: clamp(6px, 1vh, 10px);
  padding: clamp(6px, 1.1vw, 12px);
}

.impostor-room-strip {
  min-height: 0;
  padding-bottom: 6px;
  gap: 5px;
}

.impostor-room-strip button {
  min-height: 30px;
  padding-inline: 8px;
  font-size: clamp(0.62rem, 1.2vw, 0.82rem);
}

.impostor-room-strip span,
.impostor-room-strip strong {
  font-size: clamp(0.62rem, 1.1vw, 0.82rem);
}

.impostor-circle {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--player-columns, 1), minmax(0, 1fr));
  grid-template-rows: repeat(var(--player-rows, 1), minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: clamp(3px, 0.7vh, 8px);
}

.impostor-chip {
  min-height: 0;
  height: 100%;
  padding: clamp(3px, 0.7vh, 8px);
  border-left-width: clamp(3px, 0.6vw, 5px);
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: clamp(4px, 0.8vw, 8px);
  align-content: center;
}

.impostor-chip span {
  width: calc(clamp(22px, 4.2vh, 44px) * var(--seat-scale, 1));
  height: calc(clamp(22px, 4.2vh, 44px) * var(--seat-scale, 1));
  font-size: calc(clamp(0.9rem, 2.8vh, 1.6rem) * var(--seat-scale, 1));
}

.impostor-chip strong {
  min-width: 0;
  overflow: hidden;
  font-size: calc(clamp(0.62rem, 1.55vh, 0.96rem) * var(--name-scale, 1));
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.impostor-chip small,
.impostor-chip b {
  min-width: 0;
  overflow: hidden;
  font-size: calc(clamp(0.52rem, 1.25vh, 0.78rem) * var(--name-scale, 1));
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.impostor-round-counter {
  min-height: clamp(48px, 10vh, 76px);
  padding: clamp(5px, 1vh, 9px);
}

.impostor-round-counter span {
  font-size: clamp(0.58rem, 1.3vh, 0.74rem);
}

.impostor-round-counter strong {
  font-size: clamp(1.6rem, 6vh, 3.1rem);
}

.impostor-role-card {
  gap: 4px;
  padding: clamp(8px, 1.4vh, 14px);
}

.impostor-role-card span {
  font-size: clamp(0.58rem, 1.3vh, 0.74rem);
}

.impostor-role-card strong {
  font-size: clamp(1rem, 3.4vh, 2rem);
}

.impostor-role-card p {
  font-size: clamp(0.68rem, 1.7vh, 0.95rem);
}

.impostor-play-panel .message {
  min-height: 0;
  padding: clamp(6px, 1.1vh, 10px);
  font-size: clamp(0.68rem, 1.65vh, 0.92rem);
  line-height: 1.2;
}

.impostor-main-button {
  min-height: clamp(34px, 6.3vh, 48px);
  font-size: clamp(0.72rem, 1.7vh, 0.95rem);
}

.impostor-guess-form {
  gap: 5px;
  padding: clamp(6px, 1.1vh, 10px);
}

.impostor-guess-form h2 {
  font-size: clamp(0.78rem, 1.8vh, 1rem);
}

.impostor-guess-form input,
.impostor-guess-form button {
  min-height: clamp(30px, 5.5vh, 42px);
  font-size: clamp(0.7rem, 1.65vh, 0.92rem);
}

@media (max-width: 760px) {
  body.impostor-active .title-bar {
    min-height: 54px;
  }

  body.impostor-active .content {
    width: calc(100% - 6px);
    height: calc(100svh - 54px);
    padding: 3px 0;
  }

  .impostor-board {
    grid-template-columns: minmax(104px, 38vw) minmax(0, 1fr);
    grid-template-areas: "players play";
    gap: 4px;
  }

  .impostor-players-panel,
  .impostor-play-panel {
    padding: 4px;
    border-radius: 6px;
  }

  .impostor-room-strip {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px;
    padding-bottom: 4px;
  }

  .impostor-room-strip span {
    grid-column: 1 / -1;
  }

  .impostor-room-strip strong {
    font-size: 0.68rem;
  }

  .impostor-room-strip button {
    min-height: 26px;
    padding-inline: 5px;
    font-size: 0.58rem;
  }

  #impostorShareButton,
  #impostorRestartButton,
  #impostorLeaveButton {
    grid-column: auto;
  }

  .impostor-circle {
    gap: 2px;
  }

  .impostor-chip {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 2px 3px;
    border-radius: 5px;
  }

  .impostor-chip span {
    width: calc(clamp(18px, 4vh, 30px) * var(--seat-scale, 1));
    height: calc(clamp(18px, 4vh, 30px) * var(--seat-scale, 1));
  }

  .impostor-play-panel {
    gap: 4px;
  }

  .impostor-round-counter {
    min-height: clamp(38px, 8vh, 56px);
  }

  .impostor-role-card,
  .impostor-play-panel .message,
  .impostor-guess-form {
    padding: 5px;
  }
}

@media (max-height: 620px) {
  .impostor-chip small {
    display: none;
  }

  .impostor-room-strip span,
  .impostor-role-card span,
  .impostor-guess-form h2 {
    display: none;
  }

  .impostor-round-counter {
    min-height: 34px;
  }

  .impostor-round-counter strong {
    font-size: clamp(1.25rem, 5vh, 2rem);
  }
}

/* Home menu visual refresh */
.home-view {
  min-height: calc(100svh - 142px);
  align-content: center;
  gap: clamp(18px, 4vh, 34px);
}

.home-header {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.home-header h1 {
  color: #263020;
  font-size: clamp(38px, 7vw, 86px);
  letter-spacing: 0;
}

.home-header p {
  color: #526056;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 800;
}

.home-menu-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(10px, 1.6vw, 18px);
  width: min(1180px, 100%);
  margin: 0 auto;
}

.home-menu-card {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: clamp(168px, 24vh, 230px);
  align-items: start;
  justify-items: start;
  overflow: hidden;
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid rgba(24, 26, 22, 0.1);
  border-radius: 8px;
  color: #fff;
  text-align: left;
  box-shadow: 0 18px 44px rgba(24, 26, 22, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.home-menu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 58px rgba(24, 26, 22, 0.24);
}

.home-menu-card::before,
.home-menu-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

.home-menu-card::before {
  inset: 0;
  opacity: 0.96;
}

.home-menu-card::after {
  right: -18px;
  bottom: -22px;
  width: 116px;
  aspect-ratio: 1;
  opacity: 0.34;
}

.home-menu-card > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 950;
}

.home-menu-card strong {
  align-self: end;
  max-width: 10ch;
  color: #fff;
  font-size: clamp(1.45rem, 2.4vw, 2.25rem);
  line-height: 0.96;
}

.home-menu-card small {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.25;
}

.home-menu-card[data-view-target="gameView"] {
  grid-column: span 3;
  border: 2px solid #20e8ff;
  background: #12072c;
  box-shadow: 5px 5px 0 #ff2cd6, 0 18px 44px rgba(18, 7, 44, 0.35);
  font-family: "Courier New", ui-monospace, monospace;
}

.home-menu-card[data-view-target="gameView"]::before {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 5px),
    radial-gradient(circle at 82% 22%, rgba(255, 227, 77, 0.28), transparent 24%),
    linear-gradient(135deg, #09051e, #28105c 58%, #4b116e);
}

.home-menu-card[data-view-target="gameView"]::after {
  border: 3px solid #20e8ff;
  border-radius: 50%;
  background:
    radial-gradient(circle, #ffe34d 0 12%, #ff2cd6 13% 24%, transparent 25%),
    repeating-radial-gradient(circle, rgba(32, 232, 255, 0.42) 0 1px, transparent 2px 8px);
}

.home-menu-card[data-view-target="gameView"] strong {
  color: #ffe34d;
  text-shadow: 2px 2px 0 #b217ad;
  text-transform: uppercase;
}

.home-menu-card[data-view-target="impostorView"] {
  grid-column: span 3;
  background: #09121d;
}

.home-menu-card[data-view-target="impostorView"]::before {
  background:
    linear-gradient(120deg, rgba(56, 215, 167, 0.17), transparent 38%, rgba(255, 95, 115, 0.18)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 22px),
    #09121d;
}

.home-menu-card[data-view-target="impostorView"]::after {
  border: 2px solid rgba(247, 213, 126, 0.55);
  border-radius: 10px;
  transform: rotate(-12deg);
  background: linear-gradient(135deg, rgba(247, 213, 126, 0.34), rgba(255, 95, 115, 0.18));
}

.home-menu-card[data-view-target="impostorView"] strong {
  color: #f7d57e;
}

.home-menu-card[data-view-target="generatorView"],
.home-menu-card[data-view-target="converterView"],
.home-menu-card[data-view-target="audioView"] {
  grid-column: span 2;
  min-height: clamp(142px, 20vh, 188px);
}

.home-menu-card[data-view-target="generatorView"]::before {
  background:
    linear-gradient(135deg, rgba(31, 122, 109, 0.94), rgba(21, 92, 84, 0.96)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 18px);
}

.home-menu-card[data-view-target="generatorView"]::after {
  width: 132px;
  border-radius: 8px;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.72) 0 8px, transparent 8px 16px);
}

.home-menu-card[data-view-target="converterView"]::before {
  background:
    radial-gradient(circle at 18% 22%, rgba(246, 183, 47, 0.42), transparent 25%),
    linear-gradient(135deg, #23395d, #1f7a6d);
}

.home-menu-card[data-view-target="converterView"]::after {
  border-radius: 999px;
  border: 16px solid rgba(255, 255, 255, 0.22);
  box-shadow: -54px -26px 0 rgba(246, 183, 47, 0.26);
}

.home-menu-card[data-view-target="audioView"]::before {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 4px, transparent 4px 11px),
    linear-gradient(135deg, #4b116e, #8e3153 54%, #e55f2a);
}

.home-menu-card[data-view-target="audioView"]::after {
  width: 150px;
  height: 72px;
  border-radius: 0;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.68) 0 6px, transparent 6px 14px);
  transform: skewX(-10deg);
}

@media (max-width: 820px) {
  .home-view {
    align-content: start;
    min-height: auto;
  }

  .home-menu-grid {
    grid-template-columns: 1fr;
  }

  .home-menu-card,
  .home-menu-card[data-view-target="gameView"],
  .home-menu-card[data-view-target="impostorView"],
  .home-menu-card[data-view-target="generatorView"],
  .home-menu-card[data-view-target="converterView"],
  .home-menu-card[data-view-target="audioView"] {
    grid-column: 1;
    min-height: 132px;
  }

  .home-menu-card strong {
    max-width: none;
  }
}

/* Impostor structured vote result popup */
.impostor-event-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(247, 213, 126, 0.22);
  border-radius: 10px;
  background: rgba(247, 213, 126, 0.08);
}

.impostor-event-hero > span {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 2rem;
}

.impostor-event-hero > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.impostor-event-hero strong {
  overflow: hidden;
  color: #fff;
  font-size: clamp(1.35rem, 4vw, 2.25rem);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.impostor-event-hero small {
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  color: #f7d57e;
  background: rgba(247, 213, 126, 0.12);
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.impostor-event-hero.is-crew {
  border-color: rgba(56, 215, 167, 0.32);
  background: rgba(56, 215, 167, 0.09);
}

.impostor-event-hero.is-crew small {
  color: #38d7a7;
  background: rgba(56, 215, 167, 0.13);
}

.impostor-event-hero.is-impostor {
  border-color: rgba(255, 95, 115, 0.34);
  background: rgba(255, 95, 115, 0.09);
}

.impostor-event-hero.is-impostor small {
  color: #ff5f73;
  background: rgba(255, 95, 115, 0.14);
}

.impostor-vote-results {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.impostor-vote-results > span {
  color: rgba(247, 245, 238, 0.62);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.impostor-vote-results ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.impostor-vote-results li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.impostor-vote-results li:first-child {
  border-color: rgba(247, 213, 126, 0.3);
  background: rgba(247, 213, 126, 0.1);
}

.impostor-vote-results li > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.impostor-vote-results li span {
  font-size: 1.25rem;
}

.impostor-vote-results li strong {
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.impostor-vote-results li b {
  display: grid;
  min-width: 34px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  color: #09121d;
  background: #f7d57e;
  font-weight: 950;
}

/* Impostor layout reorder + adaptive player-card content */
.impostor-players-panel {
  grid-template-rows: auto minmax(0, 1fr);
}

.impostor-players-panel .impostor-room-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  min-height: 0;
  padding: 4px 4px 8px;
  border-bottom: 1px solid rgba(247, 213, 126, 0.18);
}

.impostor-players-panel .impostor-room-strip strong {
  max-width: 100%;
  overflow: hidden;
  color: #f7d57e;
  font-size: clamp(0.72rem, 1.7vh, 1rem);
  font-weight: 950;
  letter-spacing: 0.02em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.impostor-control-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  justify-content: end;
  gap: 6px;
  min-height: 0;
}

.impostor-control-strip button {
  min-height: clamp(28px, 4.8vh, 38px);
  padding-inline: clamp(7px, 1vw, 12px);
  border-color: rgba(247, 213, 126, 0.22);
  color: #f7f5ee;
  background: rgba(255, 255, 255, 0.07);
  font-size: clamp(0.62rem, 1.45vh, 0.84rem);
}

#impostorRestartButton:not([hidden]) {
  color: #dffcf3;
  border-color: rgba(56, 215, 167, 0.32);
}

#impostorLeaveButton {
  color: #ffe7ea;
  border-color: rgba(255, 95, 115, 0.28);
}

.impostor-play-panel {
  grid-template-rows: auto auto auto minmax(36px, auto) auto auto;
}

.impostor-guess-button {
  min-height: clamp(32px, 5.6vh, 44px);
  color: #ffe7ea;
  border-color: rgba(255, 95, 115, 0.28);
  background: rgba(255, 95, 115, 0.09);
  font-size: clamp(0.7rem, 1.55vh, 0.95rem);
}

.impostor-chip {
  --card-font-scale: min(var(--seat-scale, 1), var(--name-scale, 1));
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "emoji name"
    "emoji meta"
    "emoji vote";
  align-content: center;
  gap: 1px clamp(4px, 0.7vw, 8px);
}

.impostor-chip span {
  width: calc(clamp(18px, 4.4vh, 42px) * var(--seat-scale, 1));
  height: calc(clamp(18px, 4.4vh, 42px) * var(--seat-scale, 1));
  font-size: calc(clamp(0.78rem, 2.5vh, 1.55rem) * var(--seat-scale, 1));
}

.impostor-chip strong {
  font-size: calc(clamp(0.52rem, 1.55vh, 0.92rem) * var(--card-font-scale));
  line-height: 1;
}

.impostor-chip small,
.impostor-chip b {
  font-size: calc(clamp(0.44rem, 1.22vh, 0.72rem) * var(--card-font-scale));
  line-height: 1;
}

@media (max-width: 760px) {
  body.impostor-active .title-bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 46px;
    padding: 3px 6px;
    gap: 6px;
  }

  body.impostor-active .title-logo {
    width: 34px;
    height: 26px;
  }

  body.impostor-active .mango {
    width: 19px;
    height: 25px;
  }

  body.impostor-active .title-name {
    font-size: clamp(17px, 5vw, 24px);
  }

  body.impostor-active .title-tagline {
    display: none;
  }

  body.impostor-active .nav-menu {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  body.impostor-active .nav-menu:not(.mobile-menu-open) .nav-link.active,
  body.impostor-active .nav-menu:not(.mobile-menu-open) .nav-link[data-view-target="impostorView"] {
    min-height: 34px;
    font-size: 0.74rem;
  }

  body.impostor-active .mobile-nav-more {
    min-height: 34px;
    font-size: 16px;
  }

  body.impostor-active .content {
    height: calc(100svh - 46px);
    padding: 2px 0;
  }

  .impostor-board {
    grid-template-columns: minmax(92px, 36vw) minmax(0, 1fr);
    gap: 3px;
  }

  .impostor-players-panel .impostor-room-strip {
    padding: 2px 2px 4px;
  }

  .impostor-players-panel .impostor-room-strip strong {
    font-size: clamp(0.56rem, 1.8vh, 0.76rem);
  }

  .impostor-control-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
  }

  .impostor-control-strip button {
    min-height: 24px;
    padding-inline: 3px;
    font-size: clamp(0.48rem, 1.45vh, 0.62rem);
  }

  .impostor-play-panel {
    grid-template-rows: auto auto auto minmax(28px, auto) auto auto;
    gap: 3px;
  }

  .impostor-round-counter {
    min-height: clamp(32px, 7vh, 48px);
    padding: 3px;
  }

  .impostor-round-counter strong {
    font-size: clamp(1.1rem, 5.2vh, 2rem);
  }

  .impostor-role-card strong {
    font-size: clamp(0.86rem, 3vh, 1.55rem);
  }

  .impostor-role-card p,
  .impostor-play-panel .message {
    font-size: clamp(0.54rem, 1.55vh, 0.74rem);
    line-height: 1.08;
  }

  .impostor-main-button,
  .impostor-guess-button {
    min-height: clamp(28px, 6vh, 40px);
    font-size: clamp(0.62rem, 1.8vh, 0.82rem);
  }

  .impostor-chip {
    padding: 2px;
    column-gap: 3px;
  }

  .impostor-chip span {
    width: calc(clamp(16px, 3.6vh, 27px) * var(--seat-scale, 1));
    height: calc(clamp(16px, 3.6vh, 27px) * var(--seat-scale, 1));
  }

  .impostor-chip strong {
    font-size: calc(clamp(0.46rem, 1.35vh, 0.72rem) * var(--card-font-scale));
  }

  .impostor-chip small,
  .impostor-chip b {
    font-size: calc(clamp(0.38rem, 1.08vh, 0.62rem) * var(--card-font-scale));
  }
}

@media (max-height: 620px), (max-width: 760px) and (max-height: 760px) {
  .impostor-chip small {
    display: block;
  }

  .impostor-chip b {
    display: block;
  }
}

.impostor-chip { --card-font-scale: inherit; }


/* Impostor requested polish: role card, mobile top, player-card content scale */
:root {
  --title-bar-height: 62px;
}

body.impostor-active .content {
  height: calc(100svh - var(--title-bar-height));
}

body.impostor-active .app-shell {
  min-height: calc(100svh - var(--title-bar-height));
}

.impostor-play-panel .message {
  display: none !important;
}

.impostor-play-panel {
  grid-template-rows: auto auto minmax(0, auto) auto auto;
}

.impostor-role-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-height: 0;
}

.impostor-role-card span {
  color: rgba(247, 245, 238, 0.68);
  font-size: clamp(0.68rem, 1.8vh, 0.95rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.impostor-role-card strong {
  align-self: center;
  color: #fff;
  font-size: clamp(1rem, 4.5vh, 2.35rem);
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.impostor-role-card p:empty {
  display: none;
}

.impostor-role-card .impostor-guess-button {
  justify-self: stretch;
  margin-top: 8px;
}

.impostor-chip {
  container-type: size;
  contain: layout style;
}

.impostor-chip span {
  width: clamp(18px, 32cqh, 58px);
  height: clamp(18px, 32cqh, 58px);
  font-size: clamp(0.85rem, 22cqh, 2rem);
}

.impostor-chip strong {
  font-size: clamp(0.54rem, 13cqh, 1.25rem);
  line-height: 1.04;
}

.impostor-chip small,
.impostor-chip b {
  font-size: clamp(0.45rem, 9.5cqh, 0.95rem);
  line-height: 1.03;
}

.impostor-lobby-title h1,
.impostor-lobby-title p,
.impostor-choice-button strong,
.impostor-choice-button small,
.impostor-form,
.impostor-form h2,
.impostor-form label,
.impostor-form .message {
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.impostor-choice-button strong,
.impostor-form h2 {
  color: #fff7d6;
}

.impostor-choice-button small,
.impostor-lobby-title p {
  color: rgba(255, 255, 255, 0.84);
}

.impostor-form label,
.impostor-form .impostor-toggle span,
.impostor-config-grid label {
  color: #fff7d6 !important;
}

.impostor-form input,
.impostor-form select {
  color: #101820;
  background: rgba(255, 255, 255, 0.94);
}

@media (max-width: 760px) {
  body.impostor-active .title-bar {
    position: relative;
  }

  body.impostor-active .content {
    height: calc(100svh - var(--title-bar-height));
    padding-top: max(3px, env(safe-area-inset-top));
  }

  .impostor-board {
    padding-top: 2px;
  }

  .impostor-play-panel {
    grid-template-rows: auto auto minmax(0, auto) auto auto;
  }

  .impostor-role-card strong {
    font-size: clamp(0.82rem, 3.3vh, 1.45rem);
  }

  .impostor-role-card span {
    font-size: clamp(0.5rem, 1.4vh, 0.7rem);
  }

  .impostor-chip span {
    width: clamp(16px, 30cqh, 38px);
    height: clamp(16px, 30cqh, 38px);
    font-size: clamp(0.72rem, 20cqh, 1.45rem);
  }

  .impostor-chip strong {
    font-size: clamp(0.45rem, 12cqh, 0.88rem);
  }

  .impostor-chip small,
  .impostor-chip b {
    font-size: clamp(0.36rem, 8.8cqh, 0.72rem);
  }
}

/* Impostor final control/button + measured player-card scaling */
.impostor-control-strip button {
  border-width: 1px;
  color: #fff8e8;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 10px 24px rgba(0,0,0,0.24);
}

#impostorShareButton:not([hidden]) {
  border-color: rgba(63, 211, 224, 0.82);
  background: linear-gradient(180deg, rgba(36, 151, 169, 0.96), rgba(19, 92, 116, 0.98));
}

#impostorRestartButton:not([hidden]) {
  color: #ecfff8;
  border-color: rgba(60, 220, 160, 0.82);
  background: linear-gradient(180deg, rgba(33, 174, 122, 0.98), rgba(21, 105, 82, 0.98));
}

#impostorLeaveButton {
  color: #fff1f3;
  border-color: rgba(255, 97, 120, 0.82);
  background: linear-gradient(180deg, rgba(174, 60, 84, 0.96), rgba(108, 35, 60, 0.98));
}

.impostor-control-strip button:hover,
.impostor-control-strip button:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.impostor-control-strip .button-icon {
  font-size: 1.08em;
  line-height: 1;
}

.impostor-chip {
  --chip-content-scale: 1;
  --chip-icon-size: 32px;
  align-items: center !important;
  align-content: center !important;
  overflow: hidden;
}

.impostor-chip span {
  width: var(--chip-icon-size) !important;
  height: var(--chip-icon-size) !important;
  min-width: var(--chip-icon-size);
  display: grid;
  place-items: center;
  border-radius: clamp(5px, calc(var(--chip-icon-size) * 0.24), 16px);
  font-size: calc(var(--chip-icon-size) * 0.66) !important;
  line-height: 1 !important;
}

.impostor-chip strong {
  max-width: 100%;
  overflow: hidden !important;
  font-size: clamp(8px, calc(18px * var(--chip-content-scale)), 38px) !important;
  line-height: 0.98 !important;
  text-overflow: ellipsis;
  white-space: nowrap !important;
}

.impostor-chip small,
.impostor-chip b {
  max-width: 100%;
  overflow: hidden !important;
  font-size: clamp(7px, calc(13px * var(--chip-content-scale)), 25px) !important;
  line-height: 0.98 !important;
  text-overflow: ellipsis;
  white-space: nowrap !important;
}

@media (max-width: 760px) {
  .impostor-control-strip button {
    min-height: 27px;
    padding-inline: 4px;
  }

  .impostor-chip strong {
    font-size: clamp(7px, calc(15px * var(--chip-content-scale)), 22px) !important;
  }

  .impostor-chip small,
  .impostor-chip b {
    font-size: clamp(6px, calc(11px * var(--chip-content-scale)), 17px) !important;
  }
}

/* Impostor lobby readability + real full-cell player cards */
.impostor-choice-button {
  border-color: rgba(247, 213, 126, 0.46) !important;
  color: #fffaf2 !important;
  background:
    linear-gradient(135deg, rgba(13, 30, 43, 0.96), rgba(21, 122, 110, 0.88)),
    #0d1b27 !important;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
}

.impostor-choice-button:nth-child(2) {
  background:
    linear-gradient(135deg, rgba(25, 20, 46, 0.97), rgba(149, 47, 97, 0.86)),
    #171429 !important;
}

.impostor-choice-button strong {
  color: #fff4c4 !important;
  font-size: clamp(1.25rem, 2.2vw, 2rem);
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.72) !important;
}

.impostor-choice-button small {
  color: #fffdf5 !important;
  font-size: clamp(0.88rem, 1.25vw, 1.08rem);
  font-weight: 800;
  line-height: 1.25;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.78) !important;
}

.impostor-choice-button span {
  color: #111827 !important;
  background: #f7d57e !important;
  border-color: rgba(255, 255, 255, 0.62) !important;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.impostor-circle {
  justify-items: stretch !important;
  align-items: stretch !important;
}

.impostor-chip {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  justify-self: stretch !important;
  align-self: stretch !important;
  box-sizing: border-box;
  padding: clamp(5px, 1.1vh, 16px) !important;
  column-gap: clamp(5px, 1.1vw, 18px) !important;
}

.impostor-chip span {
  width: var(--chip-icon-size) !important;
  height: var(--chip-icon-size) !important;
  min-width: var(--chip-icon-size) !important;
  font-size: calc(var(--chip-icon-size) * 0.7) !important;
}

.impostor-chip strong {
  font-size: clamp(8px, calc(19px * var(--chip-content-scale)), 56px) !important;
  letter-spacing: 0;
}

.impostor-chip small,
.impostor-chip b {
  font-size: clamp(7px, calc(13.5px * var(--chip-content-scale)), 36px) !important;
  letter-spacing: 0;
}

.impostor-room-strip strong {
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .impostor-choice-button {
    min-height: 148px;
  }

  .impostor-chip {
    padding: clamp(3px, 0.75vh, 8px) !important;
    column-gap: clamp(3px, 0.8vw, 8px) !important;
  }

  .impostor-chip strong {
    font-size: clamp(7px, calc(16px * var(--chip-content-scale)), 26px) !important;
  }

  .impostor-chip small,
  .impostor-chip b {
    font-size: clamp(6px, calc(11.5px * var(--chip-content-scale)), 20px) !important;
  }
}

/* Impostor GAME polish */
.impostor-players-panel .impostor-room-strip strong,
.impostor-room-strip strong {
  font-size: clamp(0.9rem, 2.7vh, 1.55rem) !important;
  line-height: 1.08;
}

.impostor-control-strip button {
  min-height: clamp(22px, 3.6vh, 30px) !important;
  padding-block: 2px !important;
  line-height: 1.05;
}

.impostor-chip small,
.impostor-chip b {
  line-height: 1.12 !important;
  padding-bottom: 1px;
}

@media (max-width: 760px) {
  .impostor-players-panel .impostor-room-strip strong,
  .impostor-room-strip strong {
    font-size: clamp(0.72rem, 2.15vh, 1.05rem) !important;
  }

  .impostor-control-strip button {
    min-height: 22px !important;
    padding-inline: 3px !important;
  }
}

/* Impostor word-set cards + compact controls + adaptive mobile cards */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.impostor-wordset-section {
  display: grid;
  gap: clamp(8px, 1.4vh, 14px);
}

.impostor-wordset-section .section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.impostor-wordset-section h3 {
  margin: 0;
  color: #fff4c4;
  font-size: clamp(0.9rem, 1.9vh, 1.15rem);
  font-weight: 950;
  text-transform: uppercase;
}

.impostor-wordset-section .section-heading span {
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(0.7rem, 1.45vh, 0.9rem);
  font-weight: 800;
}

.impostor-wordset-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 1.2vw, 14px);
}

.impostor-wordset-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon title"
    "icon count";
  align-items: center;
  gap: 2px 10px;
  min-height: clamp(64px, 12vh, 96px);
  padding: clamp(9px, 1.7vh, 16px);
  text-align: left;
  color: #fffaf2;
  border: 2px solid rgba(247, 213, 126, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(13, 30, 43, 0.96), rgba(21, 122, 110, 0.78)),
    #0d1b27;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255,255,255,0.12);
}

.impostor-wordset-card:nth-child(2) {
  background:
    linear-gradient(135deg, rgba(25, 20, 46, 0.97), rgba(149, 47, 97, 0.78)),
    #171429;
}

.impostor-wordset-card span {
  grid-area: icon;
  display: grid;
  width: clamp(32px, 6vh, 50px);
  height: clamp(32px, 6vh, 50px);
  place-items: center;
  border-radius: 10px;
  color: #111827;
  background: #f7d57e;
  font-size: clamp(1rem, 3vh, 1.55rem);
  font-weight: 950;
}

.impostor-wordset-card strong {
  grid-area: title;
  min-width: 0;
  overflow: hidden;
  color: #fff4c4;
  font-size: clamp(0.82rem, 1.9vh, 1.15rem);
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.impostor-wordset-card small {
  grid-area: count;
  color: rgba(255, 255, 255, 0.8);
  font-size: clamp(0.66rem, 1.45vh, 0.86rem);
  font-weight: 850;
}

.impostor-wordset-card.is-selected {
  border-color: #ffe34d;
  box-shadow: 0 0 0 2px rgba(255, 227, 77, 0.22), 0 18px 34px rgba(0, 0, 0, 0.34);
}

.impostor-control-strip button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: clamp(18px, 3vh, 25px) !important;
  padding: 1px clamp(6px, 0.8vw, 10px) !important;
  line-height: 1 !important;
}

.impostor-control-strip .button-icon {
  display: inline-grid;
  place-items: center;
  font-size: 1em;
  line-height: 1;
}

#impostorGuessButton[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .impostor-wordset-cards {
    grid-template-columns: 1fr;
  }

  .impostor-wordset-card {
    min-height: 58px;
  }

  .impostor-control-strip button {
    min-height: 19px !important;
    padding: 1px 3px !important;
    font-size: clamp(0.48rem, 1.25vh, 0.62rem) !important;
  }

  .impostor-chip span {
    width: var(--chip-icon-size) !important;
    height: var(--chip-icon-size) !important;
    font-size: calc(var(--chip-icon-size) * 0.76) !important;
  }

  .impostor-chip strong {
    font-size: clamp(9px, calc(22px * var(--chip-content-scale)), 34px) !important;
    line-height: 1 !important;
  }

  .impostor-chip small,
  .impostor-chip b {
    font-size: clamp(8px, calc(16px * var(--chip-content-scale)), 26px) !important;
    line-height: 1.06 !important;
  }
}

/* Impostor desktop split + final game-state polish */
@media (min-width: 900px) {
  .impostor-view:not(:has(#impostorGame:not([hidden]))) {
    grid-template-columns: minmax(280px, 38vw) minmax(520px, 1fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: center;
    gap: clamp(22px, 4vw, 64px);
  }

  .impostor-view:not(:has(#impostorGame:not([hidden]))) .impostor-header {
    align-self: center;
    min-width: 0;
    overflow: hidden;
  }

  .impostor-view:not(:has(#impostorGame:not([hidden]))) .impostor-lobby {
    align-self: center;
    min-width: 0;
  }

  .impostor-view:not(:has(#impostorGame:not([hidden]))) .impostor-lobby-title {
    width: 100%;
    padding-left: clamp(12px, 3vw, 40px);
    text-align: left;
  }

  .impostor-view:not(:has(#impostorGame:not([hidden]))) .impostor-lobby-title h1 {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: clamp(4rem, 8.8vw, 10rem);
  }

  .impostor-view:not(:has(#impostorGame:not([hidden]))) .impostor-lobby-title p {
    max-width: 34rem;
    margin-left: 0;
    margin-right: 0;
  }

  .impostor-view:not(:has(#impostorGame:not([hidden]))) .impostor-form {
    justify-self: stretch;
    width: min(100%, 760px);
    max-height: calc(100svh - var(--title-bar-height, 62px) - 22px);
    overflow: auto;
  }
}

.impostor-control-strip {
  align-items: start;
}

.impostor-control-strip button {
  min-height: 12px !important;
  height: 18px !important;
  padding: 0 4px !important;
  border-width: 1px !important;
  font-size: clamp(0.42rem, 0.95vh, 0.58rem) !important;
  line-height: 1 !important;
}

.impostor-round-counter {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.impostor-round-counter span {
  opacity: 0.72;
}

.impostor-round-counter strong {
  font-size: clamp(1.2rem, 4vh, 2.2rem) !important;
}

.impostor-chip {
  overflow: hidden;
}

.impostor-chip strong,
.impostor-chip small,
.impostor-chip b {
  min-height: 1.1em;
  line-height: 1.08 !important;
  padding-block: 1px;
}

.impostor-chip small,
.impostor-chip b {
  overflow: visible;
}

.impostor-chip.is-expelled-crew,
.impostor-chip.is-expelled-impostor {
  position: relative;
}

.impostor-chip.is-expelled-crew {
  border-color: #38d7a7 !important;
  border-left-color: #38d7a7 !important;
  box-shadow: inset 0 0 0 2px rgba(56, 215, 167, 0.42), 0 14px 26px rgba(0, 0, 0, 0.32) !important;
}

.impostor-chip.is-expelled-impostor {
  border-color: #ff5f73 !important;
  border-left-color: #ff5f73 !important;
  box-shadow: inset 0 0 0 2px rgba(255, 95, 115, 0.46), 0 14px 26px rgba(0, 0, 0, 0.32) !important;
}

.impostor-chip.is-expelled-crew::after,
.impostor-chip.is-expelled-impostor::after {
  content: "×";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ff254d;
  font-size: clamp(2rem, 9cqh, 6rem);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 3px 0 rgba(32, 8, 14, 0.8), 0 0 18px rgba(255, 37, 77, 0.55);
  pointer-events: none;
}

.impostor-tie-vote-choices {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.impostor-tie-vote-choices > span {
  color: #fff4c4;
  font-size: clamp(0.82rem, 1.8vh, 1rem);
  font-weight: 950;
  text-transform: uppercase;
}

.impostor-tie-vote-choices > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.impostor-tie-vote-choices button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 10px;
  border: 2px solid rgba(247, 213, 126, 0.4);
  border-radius: 8px;
  color: #fff8d8;
  background: rgba(13, 27, 39, 0.92);
  font-weight: 900;
}

.impostor-tie-vote-choices button span {
  font-size: 1.45rem;
}

.impostor-tie-vote-choices button strong {
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.impostor-tie-vote-choices button:disabled {
  opacity: 0.55;
}

@media (max-width: 760px) {
  .impostor-control-strip button {
    height: 16px !important;
    min-height: 10px !important;
    padding: 0 3px !important;
    font-size: clamp(0.4rem, 1vh, 0.54rem) !important;
  }

  .impostor-chip strong {
    font-size: clamp(8px, calc(20px * var(--chip-content-scale)), 30px) !important;
    line-height: 1.05 !important;
  }

  .impostor-chip small,
  .impostor-chip b {
    font-size: clamp(7px, calc(13.5px * var(--chip-content-scale)), 22px) !important;
    line-height: 1.08 !important;
  }

  .impostor-tie-vote-choices > div {
    grid-template-columns: 1fr;
  }
}

/* Impostor mobile correction pass */
@media (min-width: 900px) {
  .impostor-view:not(:has(#impostorGame:not([hidden]))) .impostor-lobby-title h1 {
    font-size: clamp(3.4rem, 7.2vw, 8.4rem) !important;
    white-space: nowrap;
  }
}

.impostor-control-strip button {
  height: auto !important;
  min-height: 30px !important;
  padding: 4px 8px !important;
  border-width: 1px !important;
  font-size: clamp(0.62rem, 1.35vh, 0.78rem) !important;
  line-height: 1.05 !important;
  white-space: normal;
}

.impostor-control-strip .button-icon {
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

@media (max-width: 760px) {
  body.impostor-active .title-bar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    min-height: 54px !important;
    padding: max(8px, env(safe-area-inset-top, 0px)) 6px 6px !important;
    overflow: visible;
  }

  body.impostor-active .title-logo,
  body.impostor-active .title-copy,
  body.impostor-active .language-selector {
    display: none !important;
  }

  body.impostor-active .nav-menu {
    order: 0;
    grid-template-columns: minmax(0, 1fr) 48px !important;
    width: 100%;
    gap: 6px;
  }

  body.impostor-active .nav-menu:not(.mobile-menu-open) .nav-link.active,
  body.impostor-active .nav-menu:not(.mobile-menu-open) .nav-link[data-view-target="impostorView"] {
    min-height: 38px !important;
    padding-block: 5px;
    line-height: 1.05;
  }

  body.impostor-active .mobile-nav-more {
    min-height: 38px !important;
  }

  body.impostor-active .app-shell {
    min-height: calc(100dvh - var(--title-bar-height, 54px)) !important;
  }

  body.impostor-active .content {
    height: calc(100dvh - var(--title-bar-height, 54px)) !important;
    padding-top: 4px !important;
  }

  .impostor-board {
    grid-template-columns: minmax(132px, 43vw) minmax(0, 1fr) !important;
    gap: 5px !important;
  }

  .impostor-players-panel {
    padding-inline: 5px !important;
  }

  .impostor-play-panel {
    padding-inline: 4px !important;
  }

  .impostor-control-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
  }

  .impostor-control-strip button {
    min-height: 30px !important;
    height: auto !important;
    padding: 3px 4px !important;
    font-size: clamp(0.54rem, 1.45vh, 0.68rem) !important;
    line-height: 1.05 !important;
  }

  .impostor-chip {
    grid-template-columns: auto minmax(0, 1fr) !important;
    padding: 4px !important;
    column-gap: 5px !important;
  }

  .impostor-chip strong {
    overflow: visible !important;
    font-size: clamp(8px, calc(18px * var(--chip-content-scale)), 28px) !important;
    line-height: 1.04 !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }

  .impostor-chip small,
  .impostor-chip b {
    overflow: visible !important;
    font-size: clamp(7px, calc(12px * var(--chip-content-scale)), 18px) !important;
    line-height: 1.08 !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }
}

/* Impostor title + mobile header/button correction */
@media (min-width: 900px) {
  .impostor-view:not(:has(#impostorGame:not([hidden]))) .impostor-lobby-title h1 {
    font-size: clamp(3.2rem, 7vw, 8rem) !important;
    line-height: 0.9 !important;
    white-space: normal !important;
  }

  .impostor-view:not(:has(#impostorGame:not([hidden]))) .impostor-title-break {
    display: block;
  }
}

.impostor-control-strip button {
  min-height: 36px !important;
  padding: 7px 10px !important;
  font-size: clamp(0.72rem, 1.55vh, 0.92rem) !important;
  line-height: 1.08 !important;
}

@media (max-width: 760px) {
  body.impostor-active .title-bar {
    position: relative !important;
    top: auto !important;
    min-height: 72px !important;
    padding: 14px 8px 8px !important;
    align-content: center;
  }

  body.impostor-active .nav-menu {
    grid-template-columns: minmax(0, 1fr) 52px !important;
    align-items: stretch;
  }

  body.impostor-active .nav-menu:not(.mobile-menu-open) .nav-link.active,
  body.impostor-active .nav-menu:not(.mobile-menu-open) .nav-link[data-view-target="impostorView"] {
    min-height: 46px !important;
    padding: 8px 10px !important;
    align-items: center;
  }

  body.impostor-active .mobile-nav-more {
    min-height: 46px !important;
  }

  body.impostor-active .app-shell {
    min-height: calc(100dvh - var(--title-bar-height, 72px)) !important;
  }

  body.impostor-active .content {
    height: calc(100dvh - var(--title-bar-height, 72px)) !important;
    padding-top: 5px !important;
  }

  .impostor-play-panel {
    grid-template-rows: auto auto auto minmax(28px, auto) auto auto !important;
  }

  .impostor-control-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 5px !important;
  }

  #impostorShareButton {
    grid-column: 1 / -1;
  }

  #impostorRestartButton[hidden] + #impostorLeaveButton {
    grid-column: 1 / -1;
  }

  .impostor-control-strip button {
    min-height: 36px !important;
    padding: 6px 7px !important;
    font-size: clamp(0.62rem, 1.7vh, 0.82rem) !important;
    line-height: 1.08 !important;
  }
}
