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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #000000 0%, #1c1c1c 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #f5f5f5;
}

.container {
  background: rgba(34, 34, 34, 0.95);
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  width: 90%;
  max-width: 700px;
  backdrop-filter: blur(10px);
}

h1 {
  text-align: center;
  color: #90caf9;
  margin-bottom: 2rem;
  font-size: 2rem;
}

h2 {
  color: #e0e0e0;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

/* Status Section */
.status-section {
  background: #2a2a2a;
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 2rem;
}

.status-indicators {
  display: flex;
  justify-content: space-around;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-label {
  font-weight: 600;
}

.status-indicator {
  padding: 0.25rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.status-indicator.connected {
  background: #4caf50;
  color: white;
}

.status-indicator:not(.connected) {
  background: #f44336;
  color: white;
}

/* Swap Button */
.swap-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.8rem;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
  padding: 0 0.5rem;
  display: flex;
  align-items: center;
}

.swap-btn:hover {
  color: #90caf9;
}

/* Swap animation */
@keyframes swapPulse {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.swap-animate {
  animation: swapPulse 0.35s ease-in-out;
}

/* Control Sections */
.control-section {
  margin-bottom: 2rem;
}

/* Switch Styles */
.switch-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.switch-option {
  font-weight: 600;
  color: #ccc;
  min-width: 100px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #555;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: '';
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #555;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Chip Container */
.chip-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.chip {
  background: #2a2a2a;
  border: 3px solid transparent;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chip img {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.chip.selected {
  border: 3px solid #2196f3;
}

/* Side Container */
.side-container {
  display: flex;
  justify-content: space-around;
  gap: 1rem;
}

.side-btn {
  flex: 1;
  padding: 1rem;
  border: none;
  border-radius: 10px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  opacity: 0.6;
}

.side-btn.player {
  background: #1e88e5;
  color: #ffffff;
}

.side-btn.banker {
  background: #c62828;
  color: #ffffff;
}

.side-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.side-btn.selected {
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.side-btn.player.selected,
.side-btn.banker.selected {
  opacity: 0.9;
}

/* Bet Button */
.bet-btn {
  width: 100%;
  padding: 1.2rem;
  background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.bet-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.bet-btn:active {
  transform: translateY(0);
}

.bet-btn:disabled {
  background: #555;
  cursor: not-allowed;
  transform: none;
}

/* Log Section */
.log-section {
  margin-top: 2rem;
  background: #2a2a2a;
  padding: 1.5rem;
  border-radius: 10px;
}

.log-container {
  max-height: 200px;
  overflow-y: auto;
  background: #1e1e1e;
  border-radius: 5px;
  padding: 1rem;
  border: 1px solid #333;
}

.log-entry {
  padding: 0.5rem;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

.log-entry:last-child {
  border-bottom: none;
}

.log-entry.success {
  color: #4caf50;
}

.log-entry.error {
  color: #f44336;
}

.log-entry.info {
  color: #2196f3;
}

/* Responsive */
@media (max-width: 768px) {
  .chip-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }
}

@media (max-width: 600px) {
  .container {
    width: 95%;
    padding: 1.5rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .chip-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .chip {
    padding: 0.8rem;
    font-size: 0.9rem;
  }

  .switch-wrapper {
    gap: 0.5rem;
  }

  .switch-option {
    font-size: 0.9rem;
    min-width: 60px;
  }
}

/* Logo sizes for platform switch */
.switch-logo {
  width: 90px;
  height: auto;
}

/* Chip hover effect */
.chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.evolution-logo {
  filter: brightness(0) invert(1);
}

/* Selected Amount Display */
.amount-display {
  display: block;
  width: max-content;
  padding: 0.5rem 1.25rem;
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1rem;
  margin-left: auto;
  margin-right: auto;
  border: 2px solid #2196f3;
  background: rgba(33, 150, 243, 0.25);
  border-radius: 8px;
}

/* Chip actions */
.chip-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.chip-config-btn {
  background: #2196f3;
  color: #fff;
  border: none;
  padding: 0.4rem 0.75rem;
  border-radius: 5px;
  cursor: pointer;
}

.chip-config-btn:hover {
  background: #42a5f5;
}

/* Chip summary */
.chip-summary {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #ccc;
  text-align: center;
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: #2a2a2a;
  padding: 1.5rem;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
}

.chip-checkbox-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
}

.chip-checkbox-label {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  color: #eee;
  font-size: 0.9rem;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.modal-save-btn,
.modal-cancel-btn {
  background: #2196f3;
  color: #fff;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 5px;
  cursor: pointer;
}

.modal-cancel-btn {
  background: #555;
}

.modal-save-btn:hover {
  background: #42a5f5;
}

.modal-cancel-btn:hover {
  background: #777;
}

/* Chip text fallback */
.chip-text {
  font-size: 0.8rem;
  color: #fff;
  pointer-events: none;
}

.chip-mini {
  width: 24px;
  height: 24px;
  pointer-events: none;
}

/* Cancel All Button */
.cancel-all-btn {
  margin-top: 0.75rem;
  width: 100%;
  padding: 0.9rem;
  background: #d32f2f;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.cancel-all-btn:hover {
  background: #f44336;
}

.cancel-all-btn:disabled {
  background: #555;
  cursor: not-allowed;
  opacity: 0.6;
}

.bet-btn-row {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

/* Custom buttons */
.btn-admin {
  background: #1e88e5;
  color: #ffffff;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}
.btn-admin:hover {
  background: #42a5f5;
}
.btn-danger {
  background: #d32f2f;
  color: #ffffff;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}
.btn-danger:hover {
  background: #f44336;
}

/* Error notification styles */
.error-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #f44336;
  color: white;
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  max-width: 400px;
  animation: slideInRight 0.3s ease-out;
}

.error-notification-content {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 8px;
}

.error-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.error-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
}

.error-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.error-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

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

/* Success notification styles */
.success-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #4caf50;
  color: white;
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  max-width: 400px;
  animation: slideInRight 0.3s ease-out;
}

.success-notification-content {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 8px;
}

.success-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.success-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
}

.success-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.success-close:hover {
  background: rgba(255, 255, 255, 0.2);
}
