/* style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    background-attachment: fixed;
    color: white;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #ff8a00, #e52e71);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.hint-container {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hint-container.hidden {
    display: none;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 20px auto;
    max-width: 600px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    position: relative;
}

.crystal {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

.crystal::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    z-index: -1;
    opacity: 0.7;
}

.crystal.red {
    background: radial-gradient(circle at 30% 30%, #ff416c, #b21f1f);
}
.crystal.red::after {
    background: radial-gradient(circle at 30% 30%, #ff416c, #b21f1f);
    filter: blur(8px);
}

.crystal.blue {
    background: radial-gradient(circle at 30% 30%, #4facfe, #00a1ff);
}
.crystal.blue::after {
    background: radial-gradient(circle at 30% 30%, #4facfe, #00a1ff);
    filter: blur(8px);
}

.crystal.green {
    background: radial-gradient(circle at 30% 30%, #43e97b, #0e8a3a);
}
.crystal.green::after {
    background: radial-gradient(circle at 30% 30%, #43e97b, #0e8a3a);
    filter: blur(8px);
}

.crystal.purple {
    background: radial-gradient(circle at 30% 30%, #9b59b6, #6c3483);
}
.crystal.purple::after {
    background: radial-gradient(circle at 30% 30%, #9b59b6, #6c3483);
    filter: blur(8px);
}

.crystal.connected {
    opacity: 0.7;
    transform: scale(0.9);
}

.crystal.selected {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.line {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    transition: stroke 0.3s ease;
}

.status-message {
    text-align: center;
    padding: 10px;
    font-weight: bold;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.win-message {
    font-size: 1.5rem;
    color: #43e97b;
    text-shadow: 0 0 10px rgba(67, 233, 123, 0.5);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

@media (max-width: 600px) {
    .game-board {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .crystal {
        width: 70px;
        height: 70px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
}