@font-face {
  font-family: 'F563';
  src: url('/fonts/F563-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'VCR OSD Mono';
  src: url('/fonts/VCR_OSD_MONO_1.001.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  touch-action: manipulation;
  font-family: 'VCR OSD Mono', monospace;
  background-color: #000;
  position: relative;
}

header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 10;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
  position: relative;
  z-index: 10;
}

footer {
  text-align: center;
}

h1 {
  font-size: clamp(24px, 4vw, 32px);
  color: #fff;
}

.logo-container {
  position: relative;
  display: inline-block;
}

.rainbow-logo {
  padding: 24px 0px 50px 50px;
  font-size: clamp(24px, 6vw, 80px);
  font-weight: normal;
  text-transform: none;
  background: linear-gradient(45deg, #ff0000, #ff9900, #33cc33, #00ccff, #0066ff, #cc00ff, #ff0000);
  background-size: 400%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbow 8s linear infinite, sway 3s ease-in-out infinite;
  margin: 0;
  font-family: 'F563', sans-serif;
  letter-spacing: 0.05em;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}





.canvas-container {
  position: relative;
  display: block;
  width: 100%;
  text-align: center;
}

.wallet-corner {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.wallet-btn-corner {
  background: #666;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: normal;
  font-family: 'VCR OSD Mono', monospace;
  transition: all 0.3s ease;
  text-transform: none;
  letter-spacing: 0.05em;
}

.wallet-btn-corner:hover {
  background: #777;
  transform: translateY(-1px);
}

.wallet-info-corner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.wallet-address-corner {
  font-weight: normal;
  color: #fff;
  font-family: 'VCR OSD Mono', monospace;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 4px 8px;
  border-radius: 8px;
}

.wallet-address-corner:hover {
  color: #ccc;
  background: rgba(255, 255, 255, 0.1);
}

.disconnect-btn {
  background: #ff6b6b;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 10px;
  font-family: 'VCR OSD Mono', monospace;
  font-weight: normal;
  float: right;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.disconnect-btn:hover {
  background: #ff5252;
  transform: scale(1.05);
}

.pixel-balance-corner {
  font-size: 11px;
  color: #666;
  font-weight: bold;
  margin-bottom: 8px;
}

#wallet-section {
  text-align: center;
  margin-bottom: 20px;
}

#connect-message {
  font-size: 20px;
  font-weight: bold;
  color: #333;
  margin-bottom: 20px;
}

.wallet-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  margin: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.wallet-btn:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.wallet-btn:active {
  transform: translateY(0);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

#wallet-info {
  margin-top: 15px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

#wallet-address {
  font-weight: bold;
  color: #333;
  font-family: monospace;
  font-size: 14px;
}

#pixel-balance {
  font-size: 14px;
  color: #666;
  font-weight: bold;
}

#disclaimer {
  margin-top: 15px;
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

canvas {
  border: 4px solid #333;
  cursor: default;
  background-color: rgba(255, 255, 255, 0.95);
  display: block;
  user-select: none;
  -webkit-user-select: none;
  width: 500px;
  height: 500px;
  max-width: 100%;
  margin: 0 auto;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

canvas.connected {
  cursor: crosshair;
}

.popup {
  display: none;
  position: absolute;
  width: max-content;
  font-size: 12px;
  top: 20px;
  left: 50%;
  transform: translate(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
  color: #ffffff;
}

.disconnect {
  background-color: #cc421d;
}

.connect {
  background-color: #1d70a2;
}

.disclaimer {
  background-color: #fbd755;
  color: black;
  top: 60px;
  width: 270px;
}

.zoom-controls {
  position: absolute;
  top: 10px;
  right: -60px;
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.zoom-controls.visible {
  display: flex;
}

.zoom-controls button {
  background-color: #fff;
  border: 2px solid black;
  height: 40px;
  width: 40px;
  cursor: pointer;
  font-size: 26px;
  color: black;
  border-radius: 6px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  padding-inline-start: 0;
  padding-inline-end: 0;
}

.draw-controls {
  position: absolute;
  top: 10px;
  left: -60px;
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.draw-controls.visible {
  display: flex;
}

.draw-controls button {
  background-color: rgba(255, 255, 255, 0.9);
  border: 2px solid #333;
  height: 36px;
  width: 36px;
  cursor: pointer;
  font-size: 16px;
  border-radius: 6px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
  padding: 0;
}

.draw-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.draw-controls button:hover {
  background-color: rgba(255, 255, 255, 1);
  transform: scale(1.05);
}

.draw-controls button.active {
  background-color: #74B63E;
  color: white;
  border-color: #74B63E;
}



.loading {
  display: none;
  justify-content: center;
  align-items: center;
  border: 4px solid #333;
  width: 500px;
  height: 500px;
  max-width: 100%;
  background-color: rgba(255, 255, 255, 0.95);
  margin: 0 auto;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}



.color-button-container {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 20px;
  margin-bottom: 10px;
}

.color-button-container.visible {
  display: flex;
}

.color-button {
  width: 40px;
  height: 40px;
  border: 2px solid #333;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: all 0.2s ease;
}

.color-button:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.selected {
  border: 4px dashed #edbb08;
}

.color-button[data-color="#FFFFFF"] {
  background-color: #ffffff;
}
.color-button[data-color="#74B63E"] {
  background-color: #74b63e;
}
.color-button[data-color="#FFCE33"] {
  background-color: #ffce33;
}
.color-button[data-color="#CC421D"] {
  background-color: #cc421d;
}
.color-button[data-color="#FF8533"] {
  background-color: #ff8533;
}
.color-button[data-color="#87308C"] {
  background-color: #87308c;
}
.color-button[data-color="#1D70A2"] {
  background-color: #1d70a2;
}
.color-button[data-color="#079D9D"] {
  background-color: #079d9d;
}
.color-button[data-color="#F05689"] {
  background-color: #f05689;
}
.color-button[data-color="#000000"] {
  background-color: #000000;
}

@media (max-width: 550px) {
  .color-button-container {
    width: 240px;
  }
}

/* Animation for notifications */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes sway {
  0% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(2deg);
  }
  100% {
    transform: rotate(-2deg);
  }
}

@keyframes rainbow {
  0% {
    background-position: 0%;
  }
  100% {
    background-position: 500%;
  }
}

/* Styles for insufficient pixels notification */
#insufficient-balance-notification .notification-content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

#insufficient-balance-notification .notification-icon {
  font-size: 20px;
  flex-shrink: 0;
}

#insufficient-balance-notification .notification-text h3 {
  margin: 0 0 5px 0;
  font-size: 16px;
  font-weight: normal;
  font-family: 'VCR OSD Mono', monospace;
}

#insufficient-balance-notification .notification-text p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  font-family: 'VCR OSD Mono', monospace;
  font-weight: normal;
}

#insufficient-balance-notification .notification-close {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  flex-shrink: 0;
}

#insufficient-balance-notification .notification-close:hover {
  opacity: 0.8;
}

/* Styles for available pixels display */
.available-pixels {
  display: none;
  text-align: center;
  font-family: 'VCR OSD Mono', monospace;
  font-size: 14px;
  font-weight: normal;
  color: #fff;
  margin-top: 5px;
  margin-bottom: 10px;
  transition: color 0.3s ease;
}

.available-pixels.visible {
  display: block;
}

.available-pixels.insufficient {
  color: #ff6b6b;
}

.purchase-btn {
  background: #74B63E;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-family: 'VCR OSD Mono', monospace;
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  margin: 0 auto 20px auto;
  display: none;
}

.purchase-btn:hover {
  background: #5a9a2e;
  transform: translateY(-1px);
}

/* Animated background */
.animated-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: transparent;
  overflow: hidden;
}

.falling-object {
  position: absolute;
  width: 50px;
  height: 50px;
  pointer-events: none;
  z-index: 5;
  user-select: none;
  -webkit-user-select: none;
}

/* Styles for universal countdown timer */
.countdown {
  position: fixed;
  top: 20px;
  left: 20px;
  background: #e8f5e8;
  border: 2px solid #2196F3;
  border-radius: 12px;
  padding: 15px 20px;
  font-family: 'VCR OSD Mono', monospace;
  font-size: 14px;
  color: #333;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  max-width: 200px;
  text-align: center;
}

.countdown:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

/* Styles for "before launch" state */
.countdown.launch-mode {
  background: #fff3e0;
  border-color: #FF6B35;
}

/* Styles for "after launch" state */
.countdown.drawing-mode {
  background: #e8f5e8;
  border-color: #2196F3;
}

/* Styles for "completed" state */
.countdown.ended {
  background: #ffebee;
  border-color: #f44336;
}

/* Styles for drawing status indicator */
.drawing-status {
  position: fixed;
  top: 100px;
  left: 20px;
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #666;
  border-radius: 12px;
  padding: 15px 20px;
  font-family: 'VCR OSD Mono', monospace;
  font-size: 14px;
  color: #fff;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  max-width: 250px;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.drawing-status.show {
  display: block !important;
  animation: slideIn 0.3s ease;
}

.drawing-status.hide {
  animation: slideOut 0.3s ease;
}

/* Development override button styles */
.dev-override {
  position: fixed;
  top: 150px;
  left: 20px;
  z-index: 998;
}

.dev-override-btn {
  background: #ff6b35;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 15px;
  font-family: 'VCR OSD Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.dev-override-btn:hover {
  background: #e55a2b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.dev-override-btn.active {
  background: #4CAF50;
}

.dev-override-btn.active:hover {
  background: #45a049;
}

/* Animations for notifications */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

/* Styles for social links */
.social-links {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #333;
  border-radius: 50%;
  color: #ffffff;
  text-decoration: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.social-links a:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: #1DA1F2;
  color: #1DA1F2;
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 6px 16px rgba(29, 161, 242, 0.3);
}

.social-links svg {
  width: 20px;
  height: 20px;
  transition: all 0.3s ease;
}

.social-links a:hover svg {
  transform: rotate(5deg);
}

/* Styles for How To button */
.how-to-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #333;
  border-radius: 50%;
  color: #ffffff;
  text-decoration: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  font-family: 'VCR OSD Mono', monospace;
  font-size: 10px;
  position: relative;
}

.how-to-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: #FF6B35;
  color: #FF6B35;
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.3);
}

.how-to-btn svg {
  width: 20px;
  height: 20px;
  transition: all 0.3s ease;
}

.how-to-btn:hover svg {
  transform: rotate(5deg);
}

/* Styles for modal window */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal-content {
  background-color: #1a1a1a;
  margin: 5% auto;
  padding: 0;
  border: 2px solid #333;
  border-radius: 15px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-header {
  background: linear-gradient(45deg, #FF6B35, #FF8533);
  padding: 20px;
  border-radius: 13px 13px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  color: #fff;
  font-family: 'F563', sans-serif;
  font-size: 24px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.modal-title {
  font-family: 'VCR OSD Mono', monospace !important;
  font-size: 20px;
  font-weight: normal;
  letter-spacing: 0.05em;
}

.close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.modal-body {
  padding: 30px;
  color: #fff;
  font-family: 'VCR OSD Mono', monospace;
  line-height: 1.6;
}

.instruction-section {
  margin-bottom: 25px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border-left: 4px solid #FF6B35;
}

.instruction-section h3 {
  margin: 0 0 15px 0;
  color: #FF6B35;
  font-size: 18px;
  font-weight: bold;
}

.instruction-section p {
  margin: 0 0 15px 0;
  color: #ccc;
  font-size: 14px;
}

.instruction-section ul {
  margin: 0;
  padding-left: 20px;
  color: #ccc;
  font-size: 14px;
}

.instruction-section li {
  margin-bottom: 8px;
  color: #ccc;
}

.instruction-section strong {
  color: #FF6B35;
}

.instruction-section em {
  color: #999;
  font-style: italic;
}

/* Modal window appearance animation */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-50px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal.show {
  display: block;
}

.modal.show .modal-content {
  animation: modalFadeIn 0.3s ease-out;
}
