/* ==========================================================================
   DERP - AI SKETCH-TO-MASTERPIECE STYLESHEET
   Cyber-Purple & Electric Magenta Theme for LANfactory Party Games
   ========================================================================== */

:root {
  --derp-purple: #a855f7;
  --derp-purple-glow: rgba(168, 85, 247, 0.4);
  --derp-magenta: #ec4899;
  --derp-cyan: #06b6d4;
  --derp-bg-dark: #0d0d14;
  --derp-card-bg: #141420;
  --derp-border: rgba(168, 85, 247, 0.3);
}

/* Host Launcher Card */
.derp-box {
  border-color: rgba(168, 85, 247, 0.35) !important;
  background: radial-gradient(circle at 85% 15%, rgba(168, 85, 247, 0.12) 0%, #12121c 70%) !important;
}
.derp-box:hover {
  border-color: var(--derp-purple) !important;
  box-shadow: 0 12px 35px var(--derp-purple-glow) !important;
}
.btn-launch-derp {
  background: linear-gradient(135deg, #a855f7, #ec4899) !important;
  color: #fff !important;
  font-family: var(--font-display) !important;
  font-weight: 900 !important;
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.4) !important;
}
.btn-launch-derp:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(236, 72, 153, 0.5) !important;
}

/* AI Dream Lab Screen */
.derp-lab-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 550px;
  padding: 2rem;
  text-align: center;
}
.derp-lab-core {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.derp-lab-core::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 3px dashed var(--derp-purple);
  animation: labSpin 10s linear infinite;
}
.derp-lab-core::after {
  content: '';
  position: absolute;
  inset: -24px;
  border-radius: 50%;
  border: 2px solid var(--derp-magenta);
  opacity: 0.5;
  animation: labPulse 2s ease-in-out infinite alternate;
}
.derp-lab-icon {
  font-size: 4rem;
  animation: labFloat 2.5s ease-in-out infinite alternate;
}

@keyframes labSpin {
  100% { transform: rotate(360deg); }
}
@keyframes labPulse {
  0% { transform: scale(0.95); opacity: 0.3; }
  100% { transform: scale(1.08); opacity: 0.8; }
}
@keyframes labFloat {
  0% { transform: translateY(-4px); }
  100% { transform: translateY(6px); }
}

.derp-lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 1100px;
  margin-top: 2rem;
}
.derp-lab-card {
  background: #161624;
  border: 1px solid var(--derp-border);
  border-radius: 14px;
  padding: 1.25rem;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}
.derp-lab-card.ready {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}
.derp-lab-card.generating {
  border-color: var(--derp-purple);
  box-shadow: 0 0 15px var(--derp-purple-glow);
}
.derp-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #201a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
  border: 2px solid var(--derp-border);
}

/* Showcase & Reveal Comparison Cards */
.derp-comparison-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 24px;
  width: 100%;
  max-width: 1300px;
  margin: 1.5rem auto;
}
.derp-card-showcase {
  background: #141420;
  border: 1px solid var(--derp-border);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  transition: transform 0.25s, box-shadow 0.25s;
}
.derp-card-showcase:hover {
  transform: translateY(-4px);
  border-color: var(--derp-purple);
  box-shadow: 0 16px 40px var(--derp-purple-glow);
}
.derp-showcase-header {
  padding: 1rem 1.25rem;
  background: rgba(20, 20, 32, 0.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.derp-showcase-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 1.25rem;
  background: #0d0d14;
}
.derp-split-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.derp-pane-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding: 3px 10px;
  border-radius: 9999px;
}
.label-sketch {
  background: rgba(255, 32, 46, 0.15);
  color: #ff4754;
  border: 1px solid rgba(255, 32, 46, 0.3);
}
.label-ai {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid var(--derp-border);
}
.derp-img-box {
  width: 100%;
  aspect-ratio: 1/1;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.derp-img-box img, .derp-img-box svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.derp-showcase-critique {
  padding: 1rem 1.25rem;
  background: #161626;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
  line-height: 1.45;
  color: #cbd5e1;
}
.derp-critique-tag {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--derp-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

/* Reveal Rank Badge */
.derp-rank-badge {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  padding: 4px 16px;
  border-radius: 8px;
  letter-spacing: 1px;
}
.rank-gold {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #000;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}
.rank-silver {
  background: linear-gradient(135deg, #e2e8f0, #94a3b8);
  color: #000;
}
.rank-bronze {
  background: linear-gradient(135deg, #f97316, #b45309);
  color: #fff;
}
.rank-other {
  background: #262638;
  color: #94a3b8;
}

/* Mobile Player Controller Styles */
.derp-player-card {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.derp-prompt-banner {
  background: radial-gradient(circle at 50% 0%, rgba(168, 85, 247, 0.25) 0%, #151522 80%);
  border: 1px solid var(--derp-border);
  border-radius: 14px;
  padding: 1.1rem;
  margin-bottom: 1rem;
  text-align: center;
}
.derp-prompt-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.3;
}

/* Mobile Canvas Surface */
.derp-canvas-wrapper {
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: none;
}
.derp-canvas-touch {
  display: block;
  background: #ffffff;
  cursor: crosshair;
  touch-action: none;
}

/* Canvas Toolbar */
.derp-canvas-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  background: #141420;
  border: 1px solid var(--derp-border);
  border-radius: 12px;
  flex-wrap: wrap;
}
.derp-palette {
  display: flex;
  gap: 6px;
  align-items: center;
}
.derp-color-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.derp-color-btn.active {
  transform: scale(1.15);
  border-color: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Mobile Ranking List */
.derp-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 1rem;
}
.derp-rank-item {
  background: #161626;
  border: 1px solid var(--derp-border);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
  cursor: grab;
}
.derp-rank-item:active {
  cursor: grabbing;
}
.derp-rank-item.rank-pos-1 {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.08);
}
.derp-rank-number {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #201a30;
  color: var(--derp-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--derp-border);
}
.derp-rank-item.rank-pos-1 .derp-rank-number {
  background: #ffd700;
  color: #000;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}
.derp-rank-thumb {
  width: 68px;
  height: 68px;
  border-radius: 10px;
  background: #000;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  transition: transform 0.15s, border-color 0.15s;
}
.derp-rank-thumb:hover {
  transform: scale(1.05);
  border-color: var(--derp-purple);
}
.derp-rank-details {
  flex: 1;
  min-width: 0;
}
.derp-rank-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.btn-rank-move {
  background: #252236;
  border: 1px solid var(--derp-border);
  color: #fff;
  border-radius: 6px;
  width: 32px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-rank-move:hover {
  background: var(--derp-purple);
}
.btn-rank-move:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}
