/**
 * Commutators - Game Styles
 * Modern, polished design with animations and effects
 */

/* ===== CSS Variables ===== */
:root {
  /* Default Theme (Classic Purple) */
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #252542;
  --text-primary: #f1f1f1;
  --text-secondary: #a0a0b0;

  --accent: #6c5ce7;
  --accent-rgb: 108, 92, 231;
  --accent-light: #a29bfe;
  --accent-dark: #5a4fcf;

  --success: #2ed573;
  --success-rgb: 46, 213, 115;

  --title-gradient-start: #6c5ce7;
  --title-gradient-mid: #a29bfe;
  --title-gradient-end: #74b9ff;

  --border-radius: 16px;
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--bg-primary);
  /* Simplified to allow active theme control rather than hardcoded gradient */
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-x: hidden;
}

/* ===== Header ===== */
.header {
  text-align: center;
  margin-bottom: 30px;
}

.title {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg,
      var(--title-gradient-start),
      var(--title-gradient-mid),
      var(--title-gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
  margin-bottom: 8px;
  text-shadow: 0 0 40px rgba(var(--accent-rgb), 0.5);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
}

/* ===== Main Layout ===== */
.main-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1000px;
}

/* ===== Side Panel ===== */
.side-panel {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 20px;
  width: 280px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.panel-section {
  margin-bottom: 24px;
}

.panel-section:last-child {
  margin-bottom: 0;
}

.panel-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Operations Info */
.ops-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.op-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.op-label-pair {
  display: flex;
  gap: 4px;
}

.op-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
}

.op-label-inverse {
  background: var(--accent-dark);
  font-size: 0.75rem;
}

.op-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex: 1;
}

/* History Panel */
#history-panel {
  max-height: 300px;
  overflow-y: auto;
}

.history-empty {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
  padding: 20px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  font-size: 0.8rem;
}

.history-initial {
  background: rgba(var(--success-rgb), 0.15);
  border: 1px solid rgba(var(--success-rgb), 0.3);
}

.history-arrow {
  color: var(--accent);
  font-weight: 600;
  min-width: 40px;
}

.history-label {
  color: var(--success);
  font-weight: 600;
  margin-left: auto;
}

.history-state {
  display: flex;
  gap: 4px;
}

.state-color {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  box-shadow: 0 0 6px currentColor;
}

/* ===== Game Container ===== */
#game-container {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 100px rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(255, 255, 255, 0.05);
  max-width: 600px;
  width: 100%;
}

/* ===== Top Bar ===== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
  gap: 12px;
}

#level-select {
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

#level-select:hover {
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.3);
}

#level-select:focus {
  outline: none;
  border-color: var(--accent);
}

#move-counter {
  background: var(--bg-tertiary);
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

#reset-btn {
  background: linear-gradient(135deg, var(--bg-tertiary), #2d2d4a);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

#reset-btn:hover {
  background: linear-gradient(135deg, #3d3d5a, #4d4d6a);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

/* ===== Level Info ===== */
#level-info {
  text-align: center;
  margin-bottom: 30px;
}

#level-info .level-name {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

#level-info .level-desc {
  display: block;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

#level-info .target-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
}

#level-info .target-color {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  box-shadow: 0 0 10px currentColor;
}

/* ===== Color Wheels Container ===== */
#squares-container {
  display: grid;
  grid-template-columns: repeat(var(--wheel-columns, 3), auto);
  justify-content: center;
  justify-items: center;
  gap: 30px;
  margin-bottom: 40px;
  position: relative;
}

.wheel-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
}

.color-wheel {
  position: relative;
  width: 140px;
  height: 140px;
  max-width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bg-tertiary);
  box-shadow:
    0 0 30px var(--glow-color, rgba(108, 92, 231, 0.3)),
    0 10px 40px rgba(0, 0, 0, 0.4),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.4s ease;
}

.color-wheel::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.2),
      rgba(255, 255, 255, 0));
  z-index: -1;
}

.color-wheel-svg {
  display: block;
}

.wheel-segments {
  transform-origin: 70px 70px;
  transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wheel-segment {
  stroke: rgba(0, 0, 0, 0.2);
  stroke-width: 1;
}

.wheel-pointer {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.wheel-label {
  font-family: "Inter", sans-serif;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Swap sliding animation */
.wheel-wrapper {
  position: relative;
  transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wheel-wrapper.swap-slide {
  animation: swapSlide 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes swapSlide {
  0% {
    transform: translate(0, 0) scale(1);
    z-index: 1;
  }

  50% {
    transform: translate(calc(var(--swap-dx) / 2), calc(var(--swap-dy) / 2 - 10px)) scale(1.1);
    z-index: 10;
  }

  100% {
    transform: translate(var(--swap-dx), var(--swap-dy)) scale(1);
    z-index: 1;
  }
}

/* Add glow during swap */
.wheel-wrapper.swap-slide .color-wheel {
  box-shadow:
    0 0 40px var(--glow-color, rgba(108, 92, 231, 0.6)),
    0 10px 50px rgba(0, 0, 0, 0.5),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Physical sliding cycle animation */
.wheel-wrapper.cycle-slide {
  animation: cycleSlide 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes cycleSlide {
  0% {
    transform: translate(0, 0) scale(1);
    z-index: 1;
  }

  50% {
    transform: translate(calc(var(--cycle-dx) / 2), calc(var(--cycle-dy) / 2 - 10px)) scale(1.1);
    z-index: 10;
  }

  100% {
    transform: translate(var(--cycle-dx), var(--cycle-dy)) scale(1);
    z-index: 1;
  }
}

/* Add glow during physical cycle slide */
.wheel-wrapper.cycle-slide .color-wheel {
  box-shadow:
    0 0 40px var(--glow-color, rgba(108, 92, 231, 0.6)),
    0 10px 50px rgba(0, 0, 0, 0.5),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
}

/* ===== Controls Container ===== */
#controls-container {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

/* Description header above each button pair */
.control-desc-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--bg-tertiary);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 10px;
  padding: 6px 12px;
  width: 100%;
  text-align: center;
}

.control-op-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.control-op-text {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.3;
  font-weight: 500;
}

/* Buttons side by side */
.control-btn-row {
  display: flex;
  gap: 8px;
}

.control-btn-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.btn-direction-label {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.15) 0%,
      transparent 50%);
  pointer-events: none;
}

.btn-icon {
  font-size: 1.3rem;
  margin-bottom: 2px;
}

.btn-label {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.btn-up {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.4);
}

.btn-up:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(var(--accent-rgb), 0.5);
}

.btn-up:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.3);
}

.btn-down {
  background: linear-gradient(135deg, var(--bg-tertiary), #3d3d5a);
  color: var(--text-primary);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-down:hover:not(.disabled) {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  background: linear-gradient(135deg, #3d3d5a, #4d4d6a);
}

.btn-down:active:not(.disabled) {
  transform: translateY(0);
}

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

/* ===== Win Overlay ===== */
#win-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all var(--transition-medium);
}

#win-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.win-content {
  text-align: center;
  animation: winPopIn 0.5s ease;
}

@keyframes winPopIn {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }

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

.win-icon {
  font-size: 5rem;
  margin-bottom: 20px;
  animation: winBounce 1s ease infinite;
}

@keyframes winBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

.win-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--success), #7bed9f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.win-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 30px;
}

.win-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.win-btn {
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.win-btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.4);
}

.win-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(var(--accent-rgb), 0.5);
}

.win-btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.win-btn-secondary:hover {
  background: #3d3d5a;
  transform: translateY(-3px);
}

.win-btn-share {
  background: linear-gradient(135deg, var(--success), #26de81);
  color: white;
  box-shadow: 0 6px 20px rgba(var(--success-rgb), 0.4);
}

.win-btn-share:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(var(--success-rgb), 0.5);
}

/* Share Preview */
#share-preview {
  margin: 16px 0;
  max-height: 200px;
  overflow-y: auto;
}

.share-preview-text {
  background: var(--bg-tertiary);
  padding: 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  line-height: 1.6;
  text-align: left;
  white-space: pre-wrap;
  margin: 0;
  color: var(--text-secondary);
}

.share-feedback {
  font-size: 0.9rem;
  margin-top: 12px;
  min-height: 24px;
  color: var(--success);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.share-feedback.show {
  opacity: 1;
}

/* ===== Confetti Animation ===== */
#win-overlay.show .win-content::before,
#win-overlay.show .win-content::after {
  content: "🎊";
  position: absolute;
  font-size: 3rem;
  animation: confetti 1s ease infinite;
}

#win-overlay.show .win-content::before {
  left: -80px;
  animation-delay: 0s;
}

#win-overlay.show .win-content::after {
  right: -80px;
  animation-delay: 0.5s;
}

@keyframes confetti {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-20px) rotate(15deg);
  }
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .title {
    font-size: 2rem;
  }

  #game-container {
    padding: 20px;
  }

  .color-wheel {
    width: 110px;
    height: 110px;
  }

  .color-wheel-svg {
    width: 110px;
    height: 110px;
  }

  .btn {
    width: 60px;
    height: 60px;
  }

  .top-bar {
    justify-content: center;
  }

  .side-panel {
    width: 100%;
    order: 1;
  }

  .main-layout {
    flex-direction: column;
    align-items: center;
  }
}

/* ===== Hover Preview ===== */
.preview-highlight .color-wheel {
  box-shadow:
    0 0 0 4px var(--accent),
    0 0 20px var(--accent),
    inset 0 0 20px rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
  z-index: 10;
}

.op-tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  min-width: 180px;
  backdrop-filter: blur(10px);
  animation: tooltipFade 0.2s ease;
}

.op-tooltip .step {
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.op-tooltip .step:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

@keyframes tooltipFade {
  from {
    opacity: 0;
    transform: translate(-50%, -95%);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -100%);
  }
}

/* Star Rating */
.star-rating {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0 10px;
  font-size: 3rem;
  /* Larger */
}

.star {
  color: #2d2d4a;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-block;
}

.star.filled {
  color: #ffd700;
  /* Gold */
  filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
  animation: starPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

/* Staggered animation delays will be added via JS or nth-child if static */
.star.filled:nth-child(1) {
  animation-delay: 0.1s;
}

.star.filled:nth-child(2) {
  animation-delay: 0.2s;
}

.star.filled:nth-child(3) {
  animation-delay: 0.3s;
}

.star.filled:nth-child(4) {
  animation-delay: 0.4s;
}

.star.filled:nth-child(5) {
  animation-delay: 0.5s;
}

@keyframes starPop {
  0% {
    transform: scale(0) rotate(-30deg);
    opacity: 0;
  }

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

.star.half {
  position: relative;
  color: #2d2d4a;
}

.star.half::after {
  content: "★";
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  overflow: hidden;
  color: #ffd700;
  filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
  animation: starPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
  animation-delay: 0.6s;
  /* Approximate */
}

.win-remark {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 20px;
  min-height: 1.5em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 0.5s ease 0.6s backwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ad Overlay */
#ad-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s ease;
}

#ad-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ad-content {
  background: #fff;
  color: #333;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.ad-placeholder h3 {
  margin-bottom: 10px;
  color: #333;
}

.ad-box {
  margin: 20px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px dashed #ccc;
  background: #f9f9f9;
  padding: 10px;
}

.ad-timer {
  margin: 15px 0;
  font-size: 0.9rem;
  color: #666;
}

#close-ad-btn {
  margin-top: 10px;
  width: 100%;
}

#close-ad-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* Banner Ad (Bottom) */
#banner-ad {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 90px;
  background: #f0f0f0;
  border-top: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.banner-content {
  width: 728px;
  height: 90px;
  background: #e0e0e0;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #aaa;
}

/* Adjust main layout to not be covered by banner */
.main-layout {
  padding-bottom: 100px;
}

/* ===== Multiplayer Styles ===== */

/* Multiplayer Bar */
#multiplayer-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Invite Button */
.mp-invite-btn {
  width: auto !important;
  height: auto !important;
  padding: 10px 24px !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #00b894, #00cec9) !important;
  color: white !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3) !important;
  flex-direction: row !important;
  gap: 6px;
}

.mp-invite-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(0, 184, 148, 0.4) !important;
}

/* Status Indicator */
.mp-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.mp-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.mp-dot-connected {
  background: var(--success);
  box-shadow: 0 0 8px rgba(var(--success-rgb), 0.6);
}

.mp-dot-reconnecting {
  background: #ffa502;
  box-shadow: 0 0 8px rgba(255, 165, 2, 0.6);
  animation: mpPulse 1.2s ease-in-out infinite;
}

.mp-dot-disconnected {
  background: #ff4757;
  box-shadow: 0 0 8px rgba(255, 71, 87, 0.6);
}

@keyframes mpPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

/* Invite Link */
.mp-invite-link {
  display: flex;
  gap: 8px;
  width: 100%;
}

.mp-invite-link input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: monospace;
  outline: none;
}

.mp-invite-link input:focus {
  border-color: var(--accent);
}

.mp-copy-btn {
  width: auto !important;
  height: auto !important;
  padding: 8px 16px !important;
  border-radius: 8px !important;
  font-size: 0.85rem !important;
  flex-direction: row !important;
  background: var(--accent) !important;
  color: white !important;
}

/* Disabled Operations (opponent's buttons) */
.control-group.mp-disabled .control-desc-header {
  opacity: 0.4;
  border-color: rgba(255, 255, 255, 0.05);
}

.btn.mp-disabled {
  opacity: 0.3;
  cursor: not-allowed;
  filter: grayscale(0.8);
  pointer-events: none;
}

.btn.mp-disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Win Overlay — Multiplayer Waiting */
.mp-win-waiting {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 12px;
  animation: mpPulse 1.5s ease-in-out infinite;
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Hide operations side panel in multiplayer */
body.multiplayer-active .side-panel .panel-section:first-child {
  display: none;
}