/* styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    touch-action: none; /* Importante para touch en móviles */
}

body {
    background: #1a1a1a;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    overflow: hidden;
    color: #ecf0f1;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

h1 {
    font-size: 1.8rem;
    background: linear-gradient(to right, #3498db, #2ecc71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
    margin-right: 20px;
}
#countdown {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    margin: 0 15px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}
.expanding {
    animation: expandAnimation 1.5s ease;
}



@keyframes expandAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 10px;
    }
    
    #countdown {
        order: 3;
        width: 100%;
        text-align: center;
        margin: 10px 0;
    }
}
.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    background: linear-gradient(to bottom, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

button:hover {
    background: linear-gradient(to bottom, #3ca0db, #2c8ac9);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

button:active {
    transform: translateY(1px);
}

.canvas-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #333;
    overflow: hidden;
    cursor: grab;
}

.canvas-container:active {
    cursor: grabbing;
}

#pixel-canvas, #pixel-grid {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    image-rendering: pixelated; /* Para mantener píxeles nítidos */
    background-color: white;
}
#pixel-canvas {
    z-index: 2; /* Mayor que la cuadrícula */
}
#pixel-grid {
    z-index: 1; /* Menor que el canvas principal */
    background: transparent !important; /* Fondo transparente */
    pointer-events: none; /* Permitir clics a través de la cuadrícula */
}

#pixel-canvas {
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}
.coordinates-display {
    position: fixed;
    top: 80px; /* Debajo del header */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 25px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 110; /* Mayor que el header (100) */
    pointer-events: none;
}

.pixel-frame {
    position: absolute;
    width: 20px; /* Tamaño base sin zoom */
    height: 20px;
    pointer-events: none;
    background-image: url('pictures/borde2.png');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    z-index: 10;
    transition: opacity 0.3s ease;
    transform-origin: top left;
    image-rendering: crisp-edges; /* Para mantener bordes nítidos */
}

.color-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgb(255, 255, 255);
    border-top: 1px solid rgba(0, 0, 0, 0.5);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 100;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.3);
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.color-panel.active {
    transform: translateY(0);
}

.panel-title {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #000000;
    text-align: center;
}

.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
    justify-content: center;
    max-width: 100%;
}

.color-option {
    width: 60px;
    height: 40px;
    border-radius: 0px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #ddd; /* Borde para que se vean mejor los colores claros */
}

.color-option:hover {
    transform: scale(1.1);
    border-color: rgb(0, 0, 0);
}

.color-option.selected {
    transform: scale(1.15);
    border: 3px solid white;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.panel-actions {
    display: flex;
    gap: 20px;
}

.panel-btn {
    padding: 10px 25px;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.panel-btn:active {
    transform: translateY(1px);
}

.cancel-btn {
    background: linear-gradient(to bottom, #ffffff, #ffffff);
    color: rgb(0, 0, 0);
}

.confirm-btn {
    background: linear-gradient(to bottom, #ffffff, #ffffff);
    color: rgb(0, 0, 0);
}

.footer {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 20px;
    border-radius: 20px;
    z-index: 50;
    text-align: center;
    max-width: 90%;
}

/* Media queries para responsividad */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 10px;
    }
    
    .controls {
        width: 100%;
        justify-content: center;
    }
    
    .color-panel {
        width: 100%;
    }
    
    .color-palette {
        max-width: 100%;
        gap: 4px;
    }
    
    .color-option {
        width: 40px;
        height: 30px;
    }
}

/* Animaciones */
@keyframes pulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.7; }
}

.pulse {
    animation: pulse 2s infinite;
}

.cooldown-button {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: white;
  color: black;
  border: 2px solid #f44336;
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: bold;
  cursor: not-allowed;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 1000;
}

/* Nuevos estilos para info del token */
.token-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    margin-left: 15px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.token-price, .token-marketcap, .next-goal {
    white-space: nowrap;
}

.progress-container {
    width: 150px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, #3498db, #2ecc71);
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s ease;
}

/* Media queries para responsividad */
@media (max-width: 1200px) {
    .token-info {
        order: 3;
        width: 100%;
        margin-top: 10px;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .token-info {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .progress-container {
        width: 100%;
    }
}