:root {
  color-scheme: dark;
  --bg: #020511;
  --surface: rgba(8, 12, 30, 0.9);
  --surface-strong: rgba(13, 18, 38, 0.95);
  --surface-muted: rgba(17, 24, 52, 0.75);
  --border: rgba(125, 90, 240, 0.25);
  --border-strong: rgba(125, 90, 240, 0.5);
  --text: #f4f7ff;
  --muted: #95a0cf;
  --accent: #7d5af0;
  --accent-cyan: #39cfda;
  --accent-rose: #ff6eab;
  --success: #44d9da;
  --warning: #f6c960;
  --danger: #ff6e6e;
  --radius-lg: 32px;
  --radius-md: 24px;
  --radius-sm: 16px;
  --shadow: 0 34px 80px rgba(2, 4, 12, 0.65);
  --font-display: "Space Grotesk", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;
  --font-sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
  

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 5% 15%, rgba(66, 104, 255, 0.35), transparent 50%),
    radial-gradient(circle at 90% 10%, rgba(255, 0, 132, 0.25), transparent 55%),
    linear-gradient(130deg, #050517, #090926 55%, #1b0b2b);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  padding: 3rem clamp(1rem, 4vw, 3rem) 4rem;
}

.page-enter {
  opacity: 0;
}

.page-enter-active {
  opacity: 1;
  transition: opacity 300ms ease-out;
}

.page-exit {
  opacity: 1;
}

.page-exit-active {
  opacity: 0;
  transition: opacity 220ms ease-out;
}

.page-slide {
  opacity: 0;
  transform: translateY(12px);
}

.page-slide-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 260ms ease-out, transform 260ms ease-out;
}

.panel-enter {
  opacity: 0;
  transform: translateY(10px) scale(0.97);
}

.panel-enter-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 220ms cubic-bezier(0.34, 1.56, 0.64, 1), transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-fly {
  opacity: 0;
  transform: translateY(-8px);
}

.btn-fly-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 240ms ease-out, transform 240ms ease-out;
}

.scoreboard-body {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
}

.scoreboard-body--setup {
  position: relative;
  min-height: 100vh;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: radial-gradient(circle at 20% 20%, rgba(47, 134, 236, 0.25), transparent 50%),
    radial-gradient(circle at 80% 10%, rgba(233, 27, 95, 0.18), transparent 55%),
    linear-gradient(160deg, #0b0f19 0%, #05070d 70%);
  overflow-x: hidden;
  overflow-y: auto;
}

.scoreboard-body--setup::before,
.scoreboard-body--setup::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scoreboard-body--setup::before {
  background: radial-gradient(circle at 50% 30%, rgba(69, 149, 255, 0.18), transparent 60%),
    radial-gradient(circle at 70% 65%, rgba(111, 41, 220, 0.25), transparent 55%);
  filter: blur(30px);
  animation: setupGlow 12s ease-in-out infinite alternate;
  opacity: 0.9;
  z-index: 0;
}

.scoreboard-body--setup::after {
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.08;
  mix-blend-mode: screen;
  z-index: 0;
}

@keyframes setupGlow {
  0% {
    transform: translate3d(-5%, 3%, 0) scale(1);
  }
  100% {
    transform: translate3d(4%, -4%, 0) scale(1.1);
  }
}

.is-hidden {
  display: none !important;
}


.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  transition: top 0.3s ease;
  z-index: 999;
}

.skip-link:focus {
  top: 1rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0;
}


.button {
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: var(--text);
  background: linear-gradient(130deg, var(--accent), var(--accent-cyan));
  box-shadow: 0 15px 40px rgba(68, 217, 218, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.button:hover:not(:disabled),
.button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 20px 45px rgba(68, 217, 218, 0.35);
}

.button--primary {
  font-size: 1.02rem;
  padding: 0.95rem 1.9rem;
  box-shadow: 0 20px 48px rgba(68, 217, 218, 0.35);
}

.button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.button--ghost {
  background: transparent;
  border: 1px solid var(--border);
  box-shadow: none;
  color: var(--text);
}

.button--reset {
  background: linear-gradient(130deg, var(--accent-rose), var(--accent));
}

.app-main {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  padding-bottom: 140px;
}

.app-main--sci-fi {
  position: relative;
  z-index: 1;
}

.color-section {
  margin: 2rem auto 0;
  width: min(1200px, 100%);
  padding: clamp(2rem, 4vw, 2.9rem);
  border-radius: clamp(24px, 4vw, 36px);
  background: rgba(6, 9, 20, 0.8);
  border: 1px solid rgba(139, 182, 255, 0.14);
  box-shadow: 0 35px 90px rgba(3, 8, 22, 0.75), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  position: relative;
  overflow: visible;
  backdrop-filter: blur(12px);
}

.color-section--sci-fi::before,
.color-section--sci-fi::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.color-section--sci-fi::before {
  background: linear-gradient(120deg, rgba(22, 122, 214, 0.12), rgba(126, 79, 237, 0.1));
  opacity: 0.8;
}

.color-section--sci-fi::after {
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.04) 1px,
    transparent 1px,
    transparent 120px
  );
  opacity: 0.18;
  mix-blend-mode: soft-light;
}

.color-section__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: clamp(1rem, 4vw, 2rem);
  padding-bottom: 2.8rem;
  position: relative;
}

.hud-panel {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

.hud-panel__copy {
  max-width: 640px;
}

.hud-label {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  color: rgba(153, 182, 255, 0.95);
}

.setup-stepper {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1.8rem;
  flex-wrap: wrap;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
}

.setup-step {
  flex: 1 1 140px;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.18s ease,
    filter 0.18s ease;
}

.setup-step.active {
  background: rgba(164, 124, 255, 0.2);
  border: 1px solid rgba(164, 124, 255, 0.8);
  color: #e8dcff;
  box-shadow: 0 0 18px rgba(164, 124, 255, 0.4);
  transform: translateY(-1px);
}

.setup-step.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    rgba(150, 110, 255, 0) 0%,
    rgba(150, 110, 255, 0.8) 50%,
    rgba(150, 110, 255, 0) 100%
  );
  animation: glowline 350ms ease-out forwards;
}


.setup-step:hover,
.setup-step:focus-visible {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
  color: #f5f5ff;
  box-shadow: 0 0 8px rgba(120, 80, 255, 0.25);
  filter: brightness(1.05);
  transform: scale(1.02);
}

@keyframes glowline {
  from {
    transform: translateX(-60%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
.setup-step-panel {
  border-radius: 28px;
  padding: 0.8rem 1rem 1.1rem;
  background: rgba(6, 11, 26, 0.65);
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.setup-step-panel__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.setup-step-panel__label {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.step-arrow {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(159, 107, 255, 0.45);
  background: rgba(9, 9, 22, 0.8);
  color: #fff;
  font-size: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.step-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.step-arrow:not(:disabled):hover,
.step-arrow:not(:disabled):focus-visible {
  transform: translateY(-2px);
  border-color: rgba(159, 107, 255, 0.9);
  box-shadow: 0 8px 25px rgba(159, 107, 255, 0.4);
}

.setup-step-panel.active {
  background: rgba(24, 12, 48, 0.9);
  box-shadow: 0 15px 40px rgba(164, 124, 255, 0.35);
  transform: translateY(-4px);
}

.setup-step-panel.completed {
  background: rgba(89, 56, 132, 0.6);
}

.setup-step-panel.completed .setup-panel {
  opacity: 0.95;
}

.setup-step-panel--final-ready .setup-panel--final {
  animation: finalPulse 1.6s ease-in-out infinite;
}

@keyframes finalPulse {
  0% {
    box-shadow: 0 0 12px rgba(159, 107, 255, 0.4);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 0 30px rgba(159, 107, 255, 0.6);
    transform: translateY(-4px);
  }
  100% {
    box-shadow: 0 0 12px rgba(159, 107, 255, 0.4);
    transform: translateY(0);
  }
}

.setup-flow {
  display: flex;
  flex-direction: column;
  gap: clamp(1.4rem, 3vw, 1.8rem);
  position: relative;
}

.setup-flow::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 20%, rgba(120, 90, 255, 0.12), transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(80, 200, 255, 0.12), transparent 45%);
  pointer-events: none;
  filter: blur(18px);
  z-index: 0;
}

.setup-section {
  display: none;
  position: relative;
  z-index: 1;
}

.setup-section.is-visible {
  display: block;
}

.setup-hint {
  margin: 0 0 0.8rem;
  font-size: 0.95rem;
  color: rgba(164, 124, 255, 0.95);
  letter-spacing: 0.05em;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 300ms ease-out, transform 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.setup-hint.enter {
  opacity: 1;
  transform: scale(1);
}

.section-title {
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 300ms ease-out, transform 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section-title.enter {
  opacity: 1;
  transform: scale(1);
}

.setup-panel {
  border: 1px solid rgba(118, 196, 255, 0.25);
  border-radius: 26px;
  padding: clamp(1.3rem, 3vw, 1.9rem);
  background: rgba(6, 11, 26, 0.85);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 30px 70px rgba(3, 8, 20, 0.55);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  transition: opacity 0.25s ease, filter 0.25s ease;
  position: relative;
  overflow: hidden;
}

.setup-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: -40px;
  width: calc(100% + 80px);
  height: 100%;
  background:
    radial-gradient(circle at 20% 50%, rgba(140, 90, 255, 0.12), transparent 60%),
    radial-gradient(circle at 80% 50%, rgba(90, 150, 255, 0.12), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

.setup-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid transparent;
  background: linear-gradient(135deg, rgba(120, 90, 255, 0.35), rgba(80, 180, 255, 0.25)) border-box;
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.35;
  pointer-events: none;
}

.pro-panel {
  background: rgba(15, 15, 25, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.35),
    0 8px 16px rgba(0, 0, 0, 0.45),
    inset 0 0 22px rgba(80, 60, 140, 0.15);
}

.pro-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  pointer-events: none;
  border-radius: inherit;
}

.pro-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 22px rgba(80, 60, 140, 0.15);
  pointer-events: none;
  border-radius: inherit;
}

.pro-panel-light {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(100, 60, 200, 0.06),
    rgba(40, 120, 255, 0.04),
    rgba(100, 60, 200, 0.06)
  );
  pointer-events: none;
  z-index: -1;
}

.setup-panel__cta {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.setup-hint--muted {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.8rem;
}

.setup-panel__step {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.7rem;
  color: rgba(153, 182, 255, 0.85);
}

.setup-panel h3 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.06em;
}

.setup-panel.is-disabled {
  opacity: 0.45;
  filter: grayscale(25%);
  pointer-events: none;
}

.player-count-buttons {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 0.8rem;
}

.player-count-button {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.7rem 0.85rem;
  background: rgba(8, 12, 28, 0.7);
  color: #f2f6ff;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  cursor: pointer;
  overflow: hidden;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
  box-shadow:
    inset 0 0 8px rgba(0, 0, 0, 0.4),
    inset 0 0 3px rgba(80, 40, 150, 0.3);
}

.player-count-button:hover,
.player-count-button:focus-visible {
  transform: scale(1.02);
  border-color: rgba(118, 196, 255, 0.8);
  box-shadow:
    0 0 12px rgba(150, 110, 255, 0.35),
    inset 0 0 8px rgba(0, 0, 0, 0.4);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
  filter: brightness(1.05);
}

.player-count-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(150, 110, 255, 0.5), rgba(80, 120, 255, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}

.player-count-button.is-active {
  border-color: rgba(99, 206, 255, 0.9);
  background: linear-gradient(120deg, rgba(18, 64, 131, 0.9), rgba(85, 152, 255, 0.85));
  box-shadow: 0 20px 40px rgba(51, 141, 255, 0.35), 0 0 16px rgba(150, 110, 255, 0.55);
  filter: brightness(1.12);
}

.player-names-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.player-names-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 0.9rem;
}

.player-names-row:empty {
  display: none;
}

.player-name-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(153, 182, 255, 0.8);
}

.player-name-field input {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(8, 12, 26, 0.85);
  padding: 0.6rem 0.8rem;
  color: #f7f9ff;
  font-size: 1rem;
  font-family: var(--font-sans);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.player-name-field input:focus {
  outline: none;
  border-color: rgba(118, 196, 255, 0.9);
  box-shadow: 0 0 0 2px rgba(118, 196, 255, 0.25);
}

.player-name-field .error-msg {
  margin-top: 4px;
  font-size: 0.8rem;
  color: #ff8585;
  min-height: 1em;
}

.input-invalid {
  border-color: #ff6b6b !important;
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.25);
}

@media (max-width: 960px) {
  .player-names-row {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

@media (max-width: 640px) {
  .player-count-buttons {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

.setup-action-btn {
  align-self: flex-start;
  border: 1px solid rgba(118, 196, 255, 0.5);
  border-radius: 24px;
  padding: 0.7rem 1.6rem;
  background: linear-gradient(120deg, rgba(35, 49, 89, 0.95), rgba(32, 98, 180, 0.8));
  color: #f5fbff;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.78rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  position: relative;
  overflow: hidden;
}

.setup-action-btn--ghost {
  background: transparent;
  border-color: rgba(118, 196, 255, 0.35);
  box-shadow: inset 0 0 0 1px rgba(118, 196, 255, 0.15);
}

.setup-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.setup-action-btn:not(:disabled):hover,
.setup-action-btn:not(:disabled):focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 22px 40px rgba(25, 83, 160, 0.45);
}

.setup-action-btn::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -3px;
  height: 2px;
  background: linear-gradient(90deg, rgba(120, 90, 255, 0), rgba(120, 90, 255, 0.8), rgba(80, 200, 255, 0));
  filter: blur(0.6px);
  opacity: 0.55;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.setup-action-btn:not(:disabled):hover::after,
.setup-action-btn:not(:disabled):focus-visible::after {
  opacity: 0.9;
  transform: translateY(-2px);
}

.btn-animated {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 300ms ease-out, transform 350ms ease-out;
}

.btn-animated.enter {
  opacity: 1;
  transform: translateY(0);
}

.start-player-display {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: rgba(229, 236, 255, 0.85);
}

.startplayer-next-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.startplayer-next-btn {
  letter-spacing: 0.3em;
  font-size: 0.95rem;
  padding: 0.9rem 2.4rem;
  border-radius: 28px;
}
.continue-button {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.continue-button.active {
  opacity: 1;
  cursor: pointer;
  background: linear-gradient(90deg, #325bff, #7a2eff, #325bff);
  background-size: 200% 200%;
  color: #fff;
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.25),
    0 0 18px rgba(120, 80, 255, 0.35),
    0 0 4px rgba(120, 80, 255, 0.45) inset;
  transition:
    transform 180ms ease-out,
    box-shadow 200ms ease-out,
    background 300ms ease-out,
    filter 200ms ease-out;
}

.continue-button.active:hover,
.continue-button.active:focus-visible {
  animation: btnGradient 3s ease infinite;
  transform: scale(1.02);
  filter: brightness(1.05);
}

.continue-button.active:active {
  animation: btnPulse 200ms ease-out;
}

@keyframes btnGradient {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

@keyframes btnPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.start-player-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.rank-order-status {
  font-size: 0.9rem;
  color: rgba(200, 200, 255, 0.9);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.35rem;
  text-align: center;
}

.order-panel-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
}

.order-panel {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 16px 22px;
  background: rgba(20, 20, 30, 0.45);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  width: fit-content;
  margin: 0.6rem auto 0;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 300ms ease-out, transform 300ms ease-out, transform 140ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.order-panel.enter {
  opacity: 1;
  transform: translateY(0);
}

.order-panel.pop {
  transform: scale(1.03);
}

.order-tag {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  border: 2px solid rgba(150, 110, 255, 0.35);
  backdrop-filter: blur(6px);
  font-size: 14px;
  letter-spacing: 0.5px;
  color: rgba(200, 200, 255, 0.9);
  box-shadow:
    0 0 10px rgba(140, 90, 255, 0.2),
    inset 0 0 10px rgba(20, 20, 40, 0.6);
  opacity: 0;
  transform: translateY(6px);
}

.order-tag.active-player {
  background-color: #6d5ba6 !important;
  color: #fff !important;
  font-weight: 700;
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(109, 91, 166, 0.8);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.order-tag.enter {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 280ms ease-out, transform 280ms ease-out;
}

.order-tag:hover {
  transform: scale(1.03);
  box-shadow: 0 0 14px rgba(150, 110, 255, 0.45);
  transition: 180ms ease-out;
}

.order-tag .pos {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.order-tag .name {
  color: rgba(200, 200, 255, 0.9);
}


.slot-value {
  display: inline-block;
  transition: opacity 150ms ease-out, transform 150ms ease-out;
}

.fade-out {
  opacity: 0;
  transform: scale(0.95);
}

.fade-in {
  opacity: 1;
  transform: scale(1);
}

.slot-jitter {
  animation: slotJitter 120ms ease-out;
}

.slot-glow {
  box-shadow: 0 0 12px rgba(150, 110, 255, 0.45);
  transition: box-shadow 180ms ease-out;
}

@keyframes slotJitter {
  0% { transform: translateX(0); }
  35% { transform: translateX(-2px); }
  70% { transform: translateX(2px); }
  100% { transform: translateX(0); }
}

.order-tag.flash {
  box-shadow: 0 0 18px rgba(150, 110, 255, 0.55);
  transition: box-shadow 200ms ease-out;
}

.title-pulse {
  animation: titlePulse 500ms ease-out;
}

@keyframes titlePulse {
  0% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(1); opacity: 0.95; }
}

.holo-title {
  animation: holoFlicker 700ms ease-out forwards;
}

@keyframes holoFlicker {
  0%, 9% { opacity: 0; }
  10% { opacity: 0.4; }
  12% { opacity: 0.1; }
  16% { opacity: 0.7; }
  20% { opacity: 0.3; }
  28% { opacity: 1; }
  100% { opacity: 1; }
}

.rank-order-panel {
  margin-top: 0.75rem;
  background: rgba(5, 6, 16, 0.8);
  border: 1px solid rgba(159, 107, 255, 0.35);
  border-radius: 14px;
  padding: 0.75rem;
  display: none;
  flex-direction: column;
  gap: 0.55rem;
  box-shadow: 0 15px 40px rgba(10, 6, 30, 0.8);
}

.rank-order-panel.is-expanded {
  display: flex;
}

.rank-order-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.rank-order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.rank-order-item span {
  flex: 1;
  text-align: left;
}

.rank-order-controls {
  display: flex;
  gap: 0.35rem;
}

.rank-order-controls button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(11, 9, 24, 0.8);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.rank-order-controls button:hover {
  border-color: rgba(191, 164, 255, 0.9);
}


.setup-panel--jobs {
  gap: 1.4rem;
}

.setup-panel--final {
  align-items: center;
  text-align: center;
}

.career-panel {
  background: rgba(15, 15, 25, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35), 0 8px 16px rgba(0, 0, 0, 0.45), inset 0 0 18px rgba(80, 60, 140, 0.12);
  padding: clamp(1.6rem, 3vw, 2rem);
  position: relative;
  overflow: hidden;
  animation: panelEnter 260ms ease forwards;
}

.career-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
  border-radius: inherit;
}

.career-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(120, 80, 255, 0.06), rgba(40, 120, 255, 0.04), rgba(120, 80, 255, 0.06));
  pointer-events: none;
  border-radius: inherit;
}

.career-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.career-header__left .section-title {
  margin: 0;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: rgba(200, 210, 255, 0.92);
}

.career-header__left .current-player {
  margin: 0.2rem 0 0;
  color: #fff;
  font-size: 1rem;
  letter-spacing: 0.04em;
  background: rgba(109, 91, 166, 0.3);
  border: 1px solid rgba(109, 91, 166, 0.6);
  box-shadow: 0 0 12px rgba(109, 91, 166, 0.65);
  padding: 0.4rem 0.75rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transform: scale(1.02);
}

.career-header__left .current-player #active-player-display {
  font-weight: 700;
}

.pulse-attention {
  display: inline-block;
  animation: pulseText 1.6s ease-in-out infinite;
  transform-origin: center;
}

@keyframes pulseText {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.career-header__right {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.header-btn {
  border: 1px solid rgba(76, 92, 255, 0.6);
  background: linear-gradient(90deg, #4c5cff, #a855f7);
  color: #f5fbff;
  padding: 0.85rem 1.4rem;
  min-height: 54px;
  border-radius: 28px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.86rem;
  box-shadow: 0 0 12px rgba(120, 90, 255, 0.65);
  transition: transform 0.18s ease, box-shadow 0.2s ease, filter 0.2s ease, background 0.3s ease;
}

.header-btn:hover,
.header-btn:focus-visible {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 0 16px rgba(120, 90, 255, 0.75);
  filter: brightness(1.08);
}

.career-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 0.5rem;
}

.big-btn {
  padding: 16px 36px;
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  background: #111423;
  border-radius: 20px;
  border: 1px solid rgba(130, 140, 255, 0.35);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  color: #fdfdff;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.big-btn:hover,
.big-btn:focus-visible {
  transform: translateY(-1px) scale(1.02);
  filter: brightness(1.06);
}

.big-btn:active {
  transform: scale(0.97);
}

.career-info {
  margin: 1.5rem 0 0.5rem;
  color: #d0d5e7;
  font-size: 0.94rem;
  line-height: 1.6;
  max-width: 100%;
}

@keyframes panelEnter {
  0% { opacity: 0; transform: scale(0.97); }
  100% { opacity: 1; transform: scale(1); }
}
.job-selection-header {
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  align-items: flex-start;
}

.job-selection-actions {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: center;
}

.job-panel-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.job-panel-actions .setup-action-btn {
  flex: 1 1 220px;
}

.random-job-btn {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 18px;
  padding: 0.65rem 1.6rem;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.15), rgba(34, 54, 110, 0.85));
  color: #f6f9ff;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.75rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.random-job-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.random-job-btn:not(:disabled):hover,
.random-job-btn:not(:disabled):focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(42, 101, 197, 0.45);
}

.lock-in-btn {
  border: 1px solid rgba(123, 200, 255, 0.5);
  border-radius: 20px;
  padding: 0.65rem 1.6rem;
  background: radial-gradient(circle at 20% 20%, rgba(82, 222, 255, 0.25), rgba(61, 71, 138, 0.45));
  color: #f2f7ff;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.75rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.lock-in-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.lock-in-btn:not(:disabled):hover,
.lock-in-btn:not(:disabled):focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 22px 45px rgba(51, 141, 255, 0.4);
}

@media (max-width: 640px) {
  .job-selection-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .job-selection-actions button {
    width: 100%;
  }
}

.start-round-btn {
  margin-top: 1.8rem;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 1rem 1.6rem;
  background: linear-gradient(90deg, rgba(16, 92, 176, 0.9), rgba(140, 67, 255, 0.9));
  color: #f9fbff;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.start-round-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.start-round-btn.is-ready:not(:disabled) {
  animation: startPulse 1.8s ease-in-out infinite;
  box-shadow: 0 30px 70px rgba(83, 150, 255, 0.45);
}

@keyframes startPulse {
  0% {
    transform: translateY(0);
    box-shadow: 0 25px 60px rgba(83, 150, 255, 0.35);
  }
  50% {
    transform: translateY(-4px);
    box-shadow: 0 35px 80px rgba(140, 67, 255, 0.55);
  }
  100% {
    transform: translateY(0);
    box-shadow: 0 25px 60px rgba(83, 150, 255, 0.35);
  }
}

.hud-badge {
  font-size: 0.75rem;
  letter-spacing: 0.28em;
}

.hud-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.2em;
  margin: 0.6rem 0 0;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  animation: hologramFlicker 600ms ease-out forwards;
}

.hud-title::after {
  content: "";
  position: absolute;
  top: 0;
  left: -140%;
  width: 140%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.16) 50%, transparent 100%);
  animation: sweep 4s linear infinite;
}

.hud-subtitle {
  margin-top: 0.8rem;
  color: rgba(229, 236, 255, 0.8);
  max-width: 52ch;
  line-height: 1.7;
}

.color-section__laser {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1.2rem;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(122, 198, 255, 0.9), transparent);
  opacity: 0.65;
  filter: blur(0.5px);
  animation: laserPulse 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes laserPulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.85;
  }
}

.color-section__intro {
  margin: 0.65rem 0 0;
  color: rgba(244, 247, 255, 0.78);
}

.color-badge {
  position: relative;
  z-index: 1;
}

.color-section__badge {
  align-self: flex-start;
  padding: 0.5rem 1.6rem;
  border-radius: 999px;
  border: 1px solid rgba(118, 196, 255, 0.5);
  font-size: 0.92rem;
  background: radial-gradient(circle at 20% 20%, rgba(82, 222, 255, 0.25), rgba(61, 71, 138, 0.45));
  cursor: pointer;
  color: #f5fbff;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 15px 30px rgba(35, 110, 200, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.color-section__badge::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  transform: translateX(-100%);
  animation: badgeSweep 6s linear infinite;
  opacity: 0.4;
}

@keyframes badgeSweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.color-section__badge:hover,
.color-section__badge:focus-visible {
  transform: translateY(-2px) scale(1.03);
  border-color: rgba(118, 196, 255, 0.9);
  box-shadow: 0 25px 55px rgba(35, 110, 200, 0.55), 0 0 30px rgba(118, 196, 255, 0.4);
}

.color-section__badge:focus-visible {
  outline: 2px solid rgba(118, 196, 255, 0.6);
  outline-offset: 4px;
}

.color-badge-dropdown {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  width: min(260px, 70vw);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 26, 0.95);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  padding: 0.9rem;
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 10;
}

.color-badge-dropdown.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.color-badge-dropdown__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-start;
}

.color-badge-dropdown__bubble {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bubble-color, rgba(255, 255, 255, 0.5));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: default;
  position: relative;
}

.color-badge-dropdown__bubble::after {
  content: attr(data-name);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translate(-50%, 10px);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.color-badge-dropdown__bubble[data-name=""]::after {
  display: none;
}

.color-badge-dropdown__bubble:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.color-badge-dropdown__empty {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  width: 100%;
}

.sticky-setup-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.1rem clamp(1rem, 4vw, 3rem);
  background: rgba(5, 9, 20, 0.82);
  backdrop-filter: blur(14px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  z-index: 20;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -12px 35px rgba(0, 0, 0, 0.4);
  animation: stickyBarFadeIn 0.4s ease forwards;
}

.sticky-setup-bar__status {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(244, 247, 255, 0.85);
  font-weight: 500;
}

.sticky-setup-bar__cta {
  position: relative;
  padding: 0.95rem 2.6rem 0.95rem 2rem;
  border-radius: 999px;
  border: 1px solid rgba(100, 168, 255, 0.6);
  background: linear-gradient(120deg, rgba(35, 49, 89, 0.9), rgba(40, 86, 171, 0.8));
  color: #f5fbff;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  box-shadow: 0 25px 60px rgba(15, 94, 173, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.sticky-setup-bar__cta--sci-fi::before {
  content: "";
  position: absolute;
  inset: -20% -10%;
  background: linear-gradient(120deg, rgba(102, 189, 255, 0.4), rgba(82, 121, 255, 0.4));
  opacity: 0;
  transform: translateX(-30%);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.sticky-setup-bar__cta--sci-fi::after {
  content: "⟶";
  position: absolute;
  right: 1.4rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: #9fcdff;
  letter-spacing: normal;
}

.sticky-setup-bar__cta--sci-fi:hover:not(:disabled),
.sticky-setup-bar__cta--sci-fi:focus-visible:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 35px 85px rgba(15, 94, 173, 0.55), 0 0 35px rgba(111, 184, 255, 0.5);
}

.sticky-setup-bar__cta--sci-fi:hover::before,
.sticky-setup-bar__cta--sci-fi:focus-visible::before {
  opacity: 0.6;
  transform: translateX(40%);
}

.sticky-setup-bar__cta:focus-visible {
  outline: 2px solid rgba(111, 184, 255, 0.6);
  outline-offset: 6px;
}

.sticky-setup-bar__cta:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(40, 50, 78, 0.6);
}

@media (max-width: 640px) {
  .sticky-setup-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .sticky-setup-bar__cta {
    width: 100%;
  }
}

@keyframes stickyBarFadeIn {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.round-counter {
  margin: 1.6rem auto 0;
  width: min(1100px, 100%);
  padding: 1.4rem 1.8rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(140deg, rgba(10, 14, 32, 0.9), rgba(22, 26, 48, 0.78));
  box-shadow: 0 30px 60px rgba(2, 5, 15, 0.55);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.round-counter__meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.round-counter__label {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(244, 247, 255, 0.7);
}

.round-counter__meta h3 {
  margin: 0;
  font-size: 1.8rem;
  font-family: var(--font-display);
}

.round-counter__note {
  font-size: 0.9rem;
  color: rgba(244, 247, 255, 0.7);
}

.round-counter__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: flex-end;
}

.round-counter__reset {
  min-width: 180px;
}

.app-board {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(460px, 1.1fr);
  gap: 1.6rem;
  align-items: stretch;
}

.app-board.is-hidden {
  display: none;
}

.app-board.app-board--expanded {
  grid-template-columns: minmax(320px, 0.85fr) minmax(520px, 1.15fr);
}

.panel--scores {
  padding: 2rem;
}

.panel--chart {
  padding: 1.8rem;
  min-height: 520px;
  display: flex;
  flex-direction: column;
}
.panel {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 1.8rem;
  box-shadow: 0 25px 60px rgba(1, 3, 12, 0.55);
  min-height: 320px;
}

.scores-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(380px, 1fr);
  gap: 1.4rem;
}

.scores-panel {
  padding: 1.6rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(140deg, rgba(15, 20, 40, 0.95), rgba(20, 26, 50, 0.85));
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}

.scores-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(125, 90, 240, 0.12), transparent 55%);
  opacity: 0.6;
  pointer-events: none;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  align-items: flex-start;
}

.panel__description {
  color: var(--muted);
  margin: 0.4rem 0 0;
}

.panel__actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.panel__actions--wide {
  justify-content: space-between;
}

.shortcut-hint {
  display: flex;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.5rem 0.8rem;
  align-items: center;
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.04);
}

.shortcut-hint__item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 90px;
}

.shortcut-hint__key {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: rgba(244, 247, 255, 0.9);
}

.shortcut-hint__label {
  font-size: 0.72rem;
  color: rgba(244, 247, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
 
.panel__badge {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.panel__placeholder {
  margin: 1.8rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.player-list-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem;
  margin: 1.4rem 0 0;
}

.player-input {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(6, 8, 20, 0.6);
}

.player-input__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-input__swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

.player-input__label {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.player-input__field {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: rgba(6, 8, 20, 0.85);
  color: var(--text);
  padding: 0.5rem 0.9rem;
  font-family: inherit;
}

.player-input__field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(125, 90, 240, 0.35);
}

.score-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: rgba(4, 7, 18, 0.85);
  border-radius: 22px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.score-input {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(8, 13, 28, 0.95);
  color: #fff;
  border-radius: 18px;
  padding: 0.75rem 1.6rem;
  font-size: 1.25rem;
  text-align: center;
  font-weight: 600;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  width: 100%;
}

.score-input:focus {
  outline: none;
  border-color: rgba(125, 90, 240, 0.95);
  box-shadow: 0 0 0 2px rgba(125, 90, 240, 0.4), 0 0 25px rgba(125, 90, 240, 0.35);
  transform: translateY(-1px);
}

.score-input.is-pulsed {
  box-shadow: 0 0 22px rgba(57, 207, 218, 0.55);
}

.score-quick-actions {
  display: flex;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.score-quick-action {
  flex: 1;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(125, 90, 240, 0.08);
  color: rgba(244, 247, 255, 0.95);
  font-size: 0.92rem;
  padding: 0.45rem 0.5rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.score-quick-action:hover,
.score-quick-action:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(57, 207, 218, 0.9);
  box-shadow: 0 10px 24px rgba(57, 207, 218, 0.35);
  background: rgba(57, 207, 218, 0.12);
  outline: none;
}

.score-quick-action.is-active {
  transform: scale(1.03);
  border-color: rgba(125, 90, 240, 0.95);
  box-shadow: 0 14px 30px rgba(125, 90, 240, 0.45);
  background: rgba(125, 90, 240, 0.18);
}

tbody tr.score-row {
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.score-row.is-maxed {
  box-shadow: 0 0 20px rgba(57, 207, 218, 0.45);
  animation: rowGlow 1.8s ease infinite;
}

@keyframes rowGlow {
  0% {
    box-shadow: 0 0 16px rgba(57, 207, 218, 0.25);
  }
  50% {
    box-shadow: 0 0 28px rgba(125, 90, 240, 0.55);
  }
  100% {
    box-shadow: 0 0 16px rgba(57, 207, 218, 0.25);
  }
}

.player-setup-list {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  position: relative;
}

.player-setup-placeholder {
  margin: 0;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: rgba(244, 247, 255, 0.75);
  text-align: center;
  width: 100%;
}

.player-row {
  width: 100%;
  display: block;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  cursor: grab;
  position: relative;
}

.player-row.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.player-row.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
}

.player-row.is-dragging {
  opacity: 0.95;
  cursor: grabbing;
  z-index: 2;
}

.player-row.is-dragging .player-setup-item {
  transform: scale(1.02);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.45), 0 0 24px rgba(125, 90, 240, 0.25);
}

.player-row.is-drop-target .player-setup-item {
  border-color: rgba(125, 90, 240, 0.85);
  box-shadow: 0 0 0 1px rgba(125, 90, 240, 0.3), 0 12px 26px rgba(125, 90, 240, 0.25);
}

.player-setup-list.is-sorting .player-row {
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.player-setup-list.is-drop-target-end::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 3px;
  border-radius: 999px;
  background: rgba(125, 90, 240, 0.7);
  box-shadow: 0 6px 20px rgba(125, 90, 240, 0.35);
  pointer-events: none;
}

.player-setup-item {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 7, 18, 0.75);
  padding: 0.9rem 1rem;
  min-height: 64px;
  width: 100%;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  will-change: transform;
}

.player-setup-item__input-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.player-setup-item__swatch {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--player-color, #fff);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.player-setup-item__input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: rgba(6, 8, 20, 0.85);
  color: var(--text);
  padding: 0.55rem 0.9rem;
  font-family: inherit;
  min-width: 140px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.player-setup-item__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(125, 90, 240, 0.35);
}

.player-setup-item__remove {
  border: none;
  background: transparent;
  padding: 0.35rem;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
  align-self: center;
}

.player-setup-item__remove img {
  width: 30px;
  height: 30px;
  filter: brightness(1.2);
}

.player-setup-item__remove:hover {
  transform: scale(1.08);
  opacity: 0.85;
}

.player-setup-item__input.is-invalid {
  border-color: rgba(248, 113, 113, 0.9);
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.35), 0 0 16px rgba(248, 113, 113, 0.25);
}

.player-setup-item__input.is-valid {
  border-color: rgba(45, 212, 191, 0.8);
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.28), 0 0 16px rgba(45, 212, 191, 0.2);
}

.player-setup-item__error {
  font-size: 0.78rem;
  color: rgba(255, 165, 196, 0.95);
  text-shadow: 0 0 6px rgba(255, 165, 196, 0.4);
  margin: 0;
  min-height: 0.85rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.player-setup-item__error.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.timer-panel {
  margin-bottom: 0;
  padding: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: linear-gradient(130deg, rgba(255, 107, 125, 0.1), rgba(52, 82, 255, 0.12));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.timer-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem;
}

.timer-panel__description {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.timer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.timer-toggle input {
  width: 1.1rem;
  height: 1.1rem;
}

.timer-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  gap: 1rem;
}

.timer-display {
  font-size: 2rem;
  font-weight: 700;
  transition: transform 140ms ease-out, color 200ms ease-out, text-shadow 200ms ease-out;
}

.timer-display.pulse {
  transform: scale(1.05);
}

.timer-display.shake {
  animation: shakeX 140ms ease-out;
}

.timer-display.timer-warning {
  color: #f6c960;
}

.timer-display.timer-danger {
  color: #ff6e6e;
  text-shadow: 0 0 12px rgba(255, 110, 110, 0.55);
}

@keyframes shakeX {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  50% {
    transform: translateX(3px);
  }
  75% {
    transform: translateX(-2px);
  }
  100% {
    transform: translateX(0);
  }
}

.timer-buttons {
  display: flex;
  gap: 0.6rem;
}

.board-pulse {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.pulse-card {
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(125, 90, 240, 0.2), rgba(68, 217, 218, 0.12));
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
}

.pulse-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pulse-card header strong {
  font-size: 1.4rem;
  text-transform: uppercase;
}

.pulse-card p {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.color-grid {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: clamp(1rem, 2vw, 1.6rem);
  align-content: start;
  padding: clamp(0.8rem, 3vw, 1.6rem);
}

.color-grid--sci-fi {
  position: relative;
  border-radius: 26px;
  overflow: visible;
  z-index: 1;
}

.color-grid--sci-fi::before,
.color-grid--sci-fi::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.color-grid--sci-fi::before {
  border: 1px solid rgba(118, 196, 255, 0.16);
  border-radius: 26px;
  opacity: 0.7;
  z-index: 0;
}

.color-grid--sci-fi::after {
  background: linear-gradient(180deg, rgba(118, 196, 255, 0.12), transparent 55%);
  border-radius: 26px;
  opacity: 0.35;
  filter: blur(2px);
  z-index: 0;
}

.color-card {
  --card-raise: 0px;
  --card-scale: 1;
  --card-outline-color: var(--card-color, rgba(255, 255, 255, 0.8));
  --card-glow-rgb: 255 255 255;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 30px;
  min-height: 230px;
  width: 100%;
  background: linear-gradient(165deg, rgba(4, 7, 18, 0.82), rgba(7, 13, 30, 0.65));
  position: relative;
  cursor: pointer;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.9rem;
  text-align: center;
  padding: 1.3rem;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, filter 0.22s ease;
  overflow: hidden;
  box-shadow: 0 30px 50px rgba(5, 7, 20, 0.55), 0 0 22px rgba(var(--card-glow-rgb), 0.15);
  transform: translateY(var(--card-raise)) scale(var(--card-scale));
  opacity: 0;
  transform-origin: center;
  animation: cardFadeIn 0.4s var(--card-ease, cubic-bezier(0.22, 1, 0.36, 1)) forwards;
  z-index: 1;
}

.color-card:nth-child(1) {
  animation-delay: 0.04s;
}
.color-card:nth-child(2) {
  animation-delay: 0.08s;
}
.color-card:nth-child(3) {
  animation-delay: 0.12s;
}
.color-card:nth-child(4) {
  animation-delay: 0.16s;
}
.color-card:nth-child(5) {
  animation-delay: 0.2s;
}
.color-card:nth-child(6) {
  animation-delay: 0.24s;
}
.color-card:nth-child(7) {
  animation-delay: 0.28s;
}
.color-card:nth-child(8) {
  animation-delay: 0.32s;
}
.color-card:nth-child(9) {
  animation-delay: 0.36s;
}
.color-card:nth-child(10) {
  animation-delay: 0.4s;
}
.color-card:nth-child(11) {
  animation-delay: 0.44s;
}
.color-card:nth-child(12) {
  animation-delay: 0.48s;
}

.color-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(150px, 70%);
  aspect-ratio: 1 / 1;
}

.color-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.color-card__label {
  display: block;
  margin: 0 0 0.35rem;
  text-align: center;
}

.color-card__strategy {
  margin: 0.45rem 0 0.35rem;
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: center;
  color: rgba(245, 247, 255, 0.88);
  width: 100%;
  padding: 0 0.4rem;
}

.job-info-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.job-info-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.job-info-card {
  position: relative;
  background: #121212;
  padding: 28px;
  border-radius: 14px;
  width: min(400px, 92%);
  color: white;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.4);
  font-family: "Space Grotesk", sans-serif;
}

.job-info-close {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 26px;
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  opacity: 0.7;
}

.job-info-close:hover {
  opacity: 1;
}

.job-info-title {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.job-info-body {
  margin: 0;
  white-space: pre-line;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.86);
}

.job-info-btn {
  margin-top: 0.75rem;
  align-self: center;
  padding: 0.35rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.job-info-btn:hover,
.job-info-btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
}


.job-info-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  z-index: 9999;
  transition: opacity 0.2s ease;
}

.job-info-overlay.hidden {
  display: none;
}

.job-info-card {
  position: absolute;
  min-width: 320px;
  max-width: min(520px, 90vw);
  padding: 1.2rem 1.4rem 1.1rem;
  border-radius: 14px;
  background: rgba(8, 10, 22, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.05);
  color: #fff;
}

.job-info-title {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.job-info-body {
  margin: 0;
  white-space: pre-line;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.86);
}

.job-info-close {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
}

.job-info-close:hover,
.job-info-close:focus-visible {
  border-color: rgba(255, 255, 255, 0.5);
}

.color-card__label {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f5f7ff;
  text-shadow: 0 10px 20px rgba(3, 6, 15, 0.8);
}

.assignment-badge {
  position: absolute;
  top: 0.6rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.2s ease;
  color: rgba(246, 250, 255, 0.9);
  pointer-events: none;
}

.color-card::before {
  content: "✓";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(-4px) scale(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.color-card::after {
  content: "";
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle, rgba(var(--card-glow-rgb, 255 255 255), 0.18), transparent 55%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.color-card.profession-selected {
  background: rgba(191, 164, 255, 0.28);
  border-color: #bfa4ff;
  box-shadow: 0 20px 60px rgba(191, 164, 255, 0.4);
}

.color-card.profession-selected::after {
  opacity: 0.65;
}

.assigned-player {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-align: center;
  min-height: 1.2rem;
}

.color-card:not(.is-disabled):hover,
.color-card:not(.is-disabled):focus-visible {
  --card-raise: -6px;
  --card-scale: 1.02;
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 35px 70px rgba(6, 12, 32, 0.65), 0 15px 45px rgba(var(--card-glow-rgb, 255 255 255), 0.35),
    0 0 46px rgba(var(--card-glow-rgb, 255 255 255), 0.4);
  filter: brightness(1.05);
}

.color-card:not(.is-disabled):hover::after,
.color-card:not(.is-disabled):focus-visible::after {
  opacity: 0.5;
}

.color-card:not(.is-disabled):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.color-card.is-selected {
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow: 0 35px 80px rgba(6, 12, 32, 0.75), 0 0 40px rgba(var(--card-glow-rgb, 255 255 255), 0.65),
    0 0 0 4px var(--card-outline-color, rgba(255, 255, 255, 0.8));
  animation: glowPulse 2.8s ease-in-out infinite;
}

.color-card.is-selected::after,
.color-card:not(.is-disabled):hover::after,
.color-card:not(.is-disabled):focus-visible::after {
  opacity: 0.7;
  transform: translateY(-4px);
}

.color-card.is-selected::before {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.color-card.is-taken {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(40%);
}

.color-card.is-taken.is-owned {
  opacity: 0.9;
  cursor: pointer;
  filter: none;
}

.color-card.is-final {
  box-shadow: 0 45px 90px rgba(6, 12, 32, 0.85), 0 0 50px rgba(var(--card-glow-rgb, 255 255 255), 0.75),
    0 0 0 4px rgba(var(--card-glow-rgb, 255 255 255), 0.85);
  border-color: rgba(255, 255, 255, 0.85);
}

.color-card.is-taken .assignment-badge {
  opacity: 1;
}

.color-card.is-disabled,
.color-card:disabled {
  --card-raise: 0px;
  --card-scale: 1;
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.08);
  outline: none;
}

.color-card.is-disabled::after,
.color-card:disabled::after {
  opacity: 0.15;
}

.color-card.is-shaking {
  animation: color-card-shake 0.28s ease;
}

.player-setup-list--sci-fi {
  background: rgba(5, 8, 18, 0.65);
  border-radius: 28px;
  border: 1px solid rgba(111, 115, 179, 0.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 20px 60px rgba(0, 0, 0, 0.35);
  padding: 1.6rem;
}

@keyframes color-card-shake {
  0% {
    transform: translateY(var(--card-raise)) scale(var(--card-scale)) translateX(0);
  }
  25% {
    transform: translateY(var(--card-raise)) scale(var(--card-scale)) translateX(-6px);
  }
  50% {
    transform: translateY(var(--card-raise)) scale(var(--card-scale)) translateX(6px);
  }
  75% {
    transform: translateY(var(--card-raise)) scale(var(--card-scale)) translateX(-3px);
  }
  100% {
    transform: translateY(var(--card-raise)) scale(var(--card-scale)) translateX(0);
  }
}

@keyframes cardFadeIn {
  0% {
    opacity: 0;
    transform: translateY(15px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(var(--card-raise)) scale(1);
  }
}

@keyframes glowPulse {
  0%,
  100% {
    box-shadow: 0 35px 80px rgba(6, 12, 32, 0.75), 0 0 40px rgba(var(--card-glow-rgb, 255 255 255), 0.35),
      0 0 0 4px rgba(var(--card-glow-rgb, 255 255 255), 0.3);
  }
  50% {
    box-shadow: 0 40px 90px rgba(6, 12, 32, 0.85), 0 0 70px rgba(var(--card-glow-rgb, 255 255 255), 0.65),
      0 0 0 4px rgba(var(--card-glow-rgb, 255 255 255), 0.6);
  }
}

.score-table-wrapper {
  margin-top: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.5rem 1rem;
  background: rgba(4, 8, 20, 0.65);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.75rem;
  font-size: 0.98rem;
}

thead {
  background: transparent;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

th {
  padding: 0.2rem 1rem;
  color: rgba(244, 247, 255, 0.7);
}

td {
  padding: 1rem;
  border: none;
}

tbody tr {
  background: rgba(4, 7, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.score-row.is-leading {
  border-color: rgba(57, 207, 218, 0.6);
  box-shadow: 0 20px 40px rgba(57, 207, 218, 0.25);
}

.score-row.is-starter {
  position: relative;
  box-shadow: inset 0 0 0 2px rgba(125, 90, 240, 0.4);
  background: rgba(125, 90, 240, 0.06);
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.player-cell__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  position: relative;
  --progress: 0;
  --player-color: rgba(125, 90, 240, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.55));
}

.player-cell__icon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: conic-gradient(var(--player-color) calc(var(--progress) * 1turn), rgba(255, 255, 255, 0.08) 0deg);
  opacity: 0.9;
}

.player-cell__icon::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4), transparent 55%), var(--player-color);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.35);
}

.player-cell__meta span {
  display: block;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.player-cell__name {
  font-weight: 600;
  font-size: 1.05rem;
}

.player-cell__color {
  color: var(--muted);
  font-size: 0.8rem;
}

.score-total {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.score-total__max {
  font-size: 0.85rem;
  color: var(--muted);
}

.score-progress {
  margin-top: 0.45rem;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.score-progress__bar {
  display: block;
  height: 100%;
  background: linear-gradient(120deg, var(--accent), var(--accent-cyan));
  width: 0;
  transition: width 0.35s ease;
}

.viz-panel {
  width: 100%;
  margin: 0;
  padding: 2.5rem 3rem;
  border-radius: 32px;
  background: radial-gradient(circle at top, rgba(32, 41, 78, 0.45), rgba(6, 8, 20, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 45px 90px rgba(3, 5, 15, 0.65);
  font-family: var(--font-display);
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  height: 100%;
}

.viz-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.viz-panel__description {
  margin-top: 0.5rem;
  color: var(--muted);
  max-width: 520px;
  font-size: 0.96rem;
}

.visualization-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(420px, 1fr));
  gap: 2rem;
  width: 100%;
}

.viz-card {
  position: relative;
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(8, 11, 24, 0.92), rgba(15, 20, 42, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 45px rgba(4, 8, 20, 0.65);
  padding: 2rem;
  backdrop-filter: blur(18px);
  animation: fadeInCard 0.9s ease forwards;
  opacity: 0;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.viz-card--total {
  background: linear-gradient(145deg, rgba(12, 9, 24, 0.95), rgba(40, 15, 50, 0.75));
  border-color: rgba(255, 107, 153, 0.25);
}

.viz-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 30px 60px rgba(7, 12, 32, 0.75);
}

.viz-card:nth-child(2) {
  animation-delay: 0.1s;
}

.viz-card__header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.viz-card__eyebrow {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.viz-card__header h3 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.viz-card__header p:not(.viz-card__eyebrow) {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.viz-card__chart {
  position: relative;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(3, 5, 12, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.03);
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.viz-card__chart canvas {
  width: 100% !important;
  height: 100% !important;
}

.app-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  background: rgba(5, 7, 15, 0.9);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  body {
    padding: 1.5rem;
  }

  .panel__header {
    flex-direction: column;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .color-section__header {
    flex-direction: column;
  }

  .hud-panel__controls {
    width: 100%;
    align-items: stretch;
  }

  .color-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    grid-auto-rows: 160px;
  }

  .scores-grid {
    grid-template-columns: 1fr;
  }

  .shortcut-hint {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .shortcut-hint__item {
    min-width: 100%;
  }

  .scoreboard-deck {
    grid-template-columns: 1fr;
  }

  .viz-panel {
    padding: 1.5rem;
  }

  .visualization-grid {
    grid-template-columns: 1fr;
  }

  .round-counter {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .round-counter__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .round-counter__reset {
    width: 100%;
  }

}

@media (max-width: 600px) {
  body {
    padding-bottom: 6rem;
  }

  .app-toast {
    left: 1rem;
    right: 1rem;
    bottom: 1.5rem;
    text-align: center;
  }

  .viz-card {
    padding: 1.5rem;
  }

  .viz-card__chart {
    min-height: 280px;
  }

  .color-section,
  .round-counter {
    padding: 1.3rem;
  }
}
.data-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, 1.3fr);
  gap: 1.4rem;
  align-items: stretch;
}

.scoreboard-deck {
  width: min(1300px, 96vw);
  margin: 0 auto;
  grid-template-columns: minmax(320px, 420px) minmax(520px, 1fr);
  gap: 2.2rem;
}

.data-card {
  background: linear-gradient(160deg, rgba(15, 20, 40, 0.95), rgba(8, 11, 24, 0.85));
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}

.panel--chart .visualization-grid {
  width: 100%;
}

@keyframes fadeInCard {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sweep {
  0% { transform: translateX(0); }
  100% { transform: translateX(240%); }
}

@keyframes hologramFlicker {
  0% { opacity: 0; filter: brightness(1); }
  8% { opacity: 0.4; filter: brightness(1.05); }
  12% { opacity: 0.1; filter: brightness(1.1); }
  16% { opacity: 0.6; filter: brightness(1.02); }
  20% { opacity: 0.2; filter: brightness(1.08); }
  26% { opacity: 1; filter: brightness(1.04); }
  100% { opacity: 1; filter: brightness(1); }
}


  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}


  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}


.highlight-startplayer {
  animation: burstGlow 1.5s ease-out;
  transform-origin: center;
}

@keyframes burstGlow {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(130, 90, 255, 0); }
  40% { transform: scale(1.05); box-shadow: 0 0 24px rgba(130, 90, 255, 0.85); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(130, 90, 255, 0); }
}
