* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

header h1 {
  margin-bottom: 10px;
  color: #2c3e50;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

header p {
  color: #7f8c8d;
  font-size: 1.1rem;
}

.input-wrapper {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.category-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  justify-content: center;
}

.category-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px;
  border: none;
  background-color: #f8f9fa;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  color: #555;
}

.category-btn i {
  font-size: 1.2rem;
  margin-bottom: 5px;
}

.category-btn.active {
  background-color: #4a6eff;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 110, 255, 0.2);
}

.category-btn:hover:not(.active) {
  background-color: #eff1fe;
}

.input-area {
  display: flex;
  justify-content: center;
  gap: 10px;
  position: relative;
}

#videoUploadLabel {
  display: none;
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  background-color: #4a6eff;
  color: white;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(74, 110, 255, 0.2);
  transition: all 0.2s ease;
}

#videoUploadLabel:hover {
  background-color: #3a5eff;
  transform: translateX(-50%) translateY(-2px);
}

#videoUploadLabel i {
  margin-right: 5px;
}

#videoUpload {
  display: none;
}

#objectPrompt {
  padding: 14px 20px;
  width: 70%;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

#objectPrompt:focus {
  outline: none;
  border-color: #4a6eff;
  box-shadow: 0 0 0 3px rgba(74, 110, 255, 0.15);
}

#generateBtn {
  padding: 14px 24px;
  background: linear-gradient(135deg, #4a6eff 0%, #5e81ff 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(74, 110, 255, 0.15);
}

#generateBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(74, 110, 255, 0.25);
}

#canvas-container {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.07);
}

#canvas {
  height: 60vh;
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid #eaeaea;
}

.background-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 100;
}

.bg-control-btn {
  padding: 8px 12px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.bg-control-btn:hover {
  background: #f5f5f5;
  transform: translateY(-2px);
}

.bg-color-panel {
  position: absolute;
  top: 42px;
  right: 0;
  background: white;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
  width: 200px;
  z-index: 101;
  transition: all 0.3s ease;
}

.bg-color-panel.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
}

.cooldown-status {
  margin-top: 12px;
  border-top: 1px solid #eee;
  padding-top: 10px;
}

.cooldown-progress {
  height: 6px;
  background: linear-gradient(to right, #4a6eff, #2ecc71);
  border-radius: 3px;
  width: 0%;
  transition: width 0.5s linear;
}

#bg-cooldown-text {
  text-align: center;
  font-size: 12px;
  margin-top: 5px;
  color: #555;
  font-weight: bold;
}

.color-palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.color-palette button {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.color-palette button:hover {
  transform: scale(1.1);
}

.custom-color {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
}

.custom-color label {
  font-size: 12px;
}

.custom-color input {
  width: 30px;
  height: 30px;
  border: none;
  cursor: pointer;
}

#apply-custom-btn {
  padding: 4px 8px;
  background: #4a6eff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

#apply-custom-btn:hover {
  background: #3a5eff;
}

/* Enhanced chat styles */
#chat-container {
  margin-top: 25px;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  height: 300px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(74, 110, 255, 0.2);
}

#chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  margin-bottom: 15px;
  padding: 15px;
  border-radius: 12px;
  background-color: rgba(249, 250, 255, 0.7);
  border: 1px solid rgba(74, 110, 255, 0.1);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02);
}

.chat-message {
  margin-bottom: 15px;
  padding: 12px 15px;
  border-radius: 18px;
  max-width: 85%;
  word-wrap: break-word;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  animation: fadeIn 0.3s ease;
  position: relative;
  line-height: 1.4;
}

.chat-message.sent {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  margin-left: auto;
  border-bottom-right-radius: 4px;
  border: 1px solid rgba(33, 150, 243, 0.1);
}

.chat-message.received {
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  margin-right: auto;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.message-author {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: #444;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
}

.message-text {
  font-size: 1rem;
  line-height: 1.4;
}

.message-time {
  text-align: right;
  font-size: 0.75rem;
  margin-top: 6px;
  color: rgba(0, 0, 0, 0.5);
  font-style: italic;
}

.system-message {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  font-size: 0.85rem;
  margin: 15px auto;
  padding: 8px 16px;
  background-color: rgba(0, 0, 0, 0.03);
  border-radius: 20px;
  max-width: 80%;
  border: 1px dashed rgba(0, 0, 0, 0.1);
}

#chat-input-container {
  display: flex;
  gap: 10px;
  background: rgba(249, 250, 255, 0.9);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(74, 110, 255, 0.15);
}

#chat-input {
  flex-grow: 1;
  padding: 12px 16px;
  border: 1px solid rgba(74, 110, 255, 0.3);
  border-radius: 20px;
  font-size: 14px;
  transition: all 0.3s ease;
}

#chat-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 110, 255, 0.2);
  border-color: rgba(74, 110, 255, 0.5);
}

#send-message-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, #4a6eff 0%, #5e81ff 100%);
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(74, 110, 255, 0.3);
}

#send-message-btn:hover {
  background: linear-gradient(135deg, #3a5eff 0%, #4e71ff 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(74, 110, 255, 0.4);
}

#users-container {
  margin-top: 25px;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

#users-container h3 {
  margin-bottom: 15px;
  font-weight: 600;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 8px;
}

#users-container h3 i {
  color: #4a6eff;
}

#users-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8f9fa;
  padding: 8px 14px;
  border-radius: 25px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  position: relative;
}

.user-badge.creator {
  background: linear-gradient(to right, #fef9e7, #fcf3cf);
  border: 1px solid rgba(241, 196, 15, 0.3);
}

.user-badge.markiplier {
  background: linear-gradient(to right, #ffebee, #ffcdd2);
  border: 1px solid rgba(229, 57, 53, 0.3);
}

.creator-tooltip {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #f1c40f;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.markiplier-tooltip {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #e53935;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.user-badge.creator:hover .creator-tooltip,
.user-badge.markiplier:hover .markiplier-tooltip {
  opacity: 1;
}

.user-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid white;
}

.object {
  position: absolute;
  cursor: grab;
  user-select: none;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.1));
  transition: transform 0.1s ease;
}

.object img {
  max-width: 150px;
  max-height: 150px;
  border-radius: 4px;
}

.object.text {
  padding: 10px 15px;
  background: transparent;
  border-radius: 8px;
  font-size: 18px;
  max-width: 300px;
  word-wrap: break-word;
}

.object.button {
  padding: 10px 20px;
  background: #4a6eff;
  color: white;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 3px 10px rgba(74, 110, 255, 0.2);
}

.object.video {
  background: white;
  padding: 5px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.object.dragging {
  cursor: grabbing;
  z-index: 1000;
  transform: scale(1.05);
}

.cursor {
  position: absolute;
  width: 30px;
  height: 30px;
  pointer-events: none;
  z-index: 1001;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.cursor-pointer {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  animation: pulse 2s infinite;
}

.cursor-trail {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  opacity: 0.4;
  filter: blur(1px);
}

.cursor-username {
  position: absolute;
  top: 15px;
  left: 15px;
  font-size: 12px;
  white-space: nowrap;
  background-color: white;
  color: #333;
  padding: 4px 8px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  border-left: 3px solid;
  transform: translateY(-50%);
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0.3;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
  }
}

.admin-actions {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.admin-action-btn {
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
}

.admin-action-btn:hover {
  background-color: #c0392b;
  transform: translateY(-2px);
}

#admin-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  z-index: 2000;
  width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  display: none;
}

.admin-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.admin-panel-header h3 {
  margin: 0;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-panel-header h3 i {
  color: #8e44ad;
}

.close-panel-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #777;
  transition: color 0.2s ease;
}

.close-panel-btn:hover {
  color: #e74c3c;
}

.admin-panel-content h4 {
  margin: 15px 0 10px;
  color: #34495e;
}

.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: #f8f9fa;
  transition: all 0.2s ease;
}

.admin-user-item:hover {
  background: #f1f1f1;
}

.admin-user-item.banned {
  background: #ffebee;
  border-left: 3px solid #e74c3c;
}

.admin-username {
  font-weight: bold;
  display: block;
}

.admin-user-id {
  font-size: 0.8rem;
  color: #777;
  display: block;
}

.admin-user-actions {
  display: flex;
  gap: 8px;
}

.admin-user-actions button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ban-btn {
  background: #e74c3c;
  color: white;
}

.ban-btn:hover {
  background: #c0392b;
}

.ban-btn.unbanned {
  background: #3498db;
}

.ban-btn.unbanned:hover {
  background: #2980b9;
}

.kick-btn {
  background: #f39c12;
  color: white;
}

.kick-btn:hover {
  background: #d35400;
}

.kick-countdown {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(231, 76, 60, 0.9);
  color: white;
  padding: 20px 40px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  z-index: 9999;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

/* Vote system styles */
#vote-container {
  margin-top: 25px;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.vote-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.vote-header h3 {
  margin: 0;
  font-weight: 600;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vote-header h3 i {
  color: #e74c3c;
}

#vote-count {
  font-weight: bold;
  font-size: 1.1rem;
  color: #555;
}

.vote-progress-container {
  height: 10px;
  background-color: #f1f1f1;
  border-radius: 5px;
  margin-bottom: 15px;
  overflow: hidden;
}

.vote-progress {
  height: 100%;
  background: linear-gradient(to right, #f39c12, #e74c3c);
  width: 0%;
  transition: width 0.3s ease;
}

#vote-clear-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #e74c3c 0%, #f39c12 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

#vote-clear-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2);
}

#vote-clear-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
}

.object .delete-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 22px;
  height: 22px;
  background: rgba(255, 50, 50, 0.8);
  color: white;
  border-radius: 50%;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.object:hover .delete-btn {
  opacity: 1;
}

/* Text customization toolbar styles */
.text-toolbar,
.button-toolbar {
  display: flex;
  background: white;
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  margin-bottom: 5px;
  gap: 5px;
}

.toolbar-group {
  display: flex;
  gap: 3px;
  border-right: 1px solid #eee;
  padding-right: 5px;
  margin-right: 5px;
}

.toolbar-group:last-child {
  border-right: none;
  padding-right: 0;
  margin-right: 0;
}

.toolbar-btn {
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  position: relative;
}

.toolbar-btn:hover {
  background-color: #f0f0f0;
}

.toolbar-btn.active {
  background-color: #e0e0ff;
  color: #4a6eff;
}

.font-select,
.size-select {
  position: absolute;
  top: 100%;
  left: 0;
  padding: 3px;
  border-radius: 4px;
  border: 1px solid #ddd;
  z-index: 1;
  display: none;
  background: white;
  font-size: 12px;
}

.toolbar-btn:hover .font-select,
.toolbar-btn:hover .size-select {
  display: block;
}

.color-picker,
.bg-color-picker {
  position: absolute;
  top: 100%;
  left: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  opacity: 0;
  cursor: pointer;
}

.toolbar-btn:hover .color-picker,
.toolbar-btn:hover .bg-color-picker {
  opacity: 1;
}

.hidden {
  display: none;
}

/* Admin panel styles */
.admin-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: linear-gradient(to right, #4a6eff, #8e44ad);
  color: white;
  border: none;
  padding: 12px 15px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}

.admin-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.25);
}

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Lato&family=Montserrat&family=Oswald&family=Pacifico&family=Press+Start+2P&family=Roboto&display=swap');