:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #333;
}

.game-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 20px;
    max-width: 800px;
    width: 100%;
}

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

h1 {
    color: var(--dark-color);
    text-align: center;
    margin: 0;
    font-size: 1.8rem;
}

.score-time {
    display: flex;
    gap: 15px;
    font-weight: bold;
    color: var(--dark-color);
}

.game-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.level-info {
    display: flex;
    gap: 15px;
}

.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

button#hint {
    background-color: var(--secondary-color);
}

button#hint:hover {
    background-color: #27ae60;
}

button#undo {
    background-color: #f39c12;
}

button#undo:hover {
    background-color: #d35400;
}

button#level-creator {
    background-color: #9b59b6;
}

button#level-creator:hover {
    background-color: #8e44ad;
}

#game-board {
    background-color: var(--light-color);
    margin: 0 auto;
    position: relative;
    touch-action: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.island {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--danger-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    z-index: 10;
    box-shadow: var(--shadow);
    transition: transform 0.1s;
}

.island:hover {
    transform: scale(1.1);
}

.island.selected {
    box-shadow: 0 0 10px 5px rgba(52, 152, 219, 0.7);
}

.island.hint {
    box-shadow: 0 0 10px 5px rgba(46, 204, 113, 0.7);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.bridge {
    position: absolute;
    background-color: var(--dark-color);
    z-index: 5;
    transition: all 0.3s;
}

.bridge.horizontal {
    height: 6px;
    transform: translateY(-3px);
}

.bridge.vertical {
    width: 6px;
    transform: translateX(-3px);
}

.bridge.double {
    background-color: #1a252f;
}

.bridge.double.horizontal {
    height: 12px;
    transform: translateY(-6px);
}

.bridge.double.vertical {
    width: 12px;
    transform: translateX(-6px);
}

.bridge.highlight {
    background-color: var(--secondary-color);
    z-index: 8;
}

.instructions {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    box-shadow: var(--shadow);
}

.creator-panel {
    margin-top: 20px;
    padding: 15px;
    background-color: #e8f4f8;
    border-radius: 5px;
    box-shadow: var(--shadow);
}

.creator-panel h3 {
    margin-top: 0;
    color: var(--dark-color);
}

.creator-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.creator-controls input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 80px;
}

.creator-instructions {
    font-size: 0.9rem;
    color: #666;
}

.hidden {
    display: none;
}

/* Modal de vitória */
.win-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.win-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.win-content h2 {
    color: var(--secondary-color);
    margin-top: 0;
}

.win-stats {
    margin: 20px 0;
    font-size: 1.1rem;
}

.win-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Responsividade */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        gap: 10px;
    }
    
    .game-controls {
        flex-direction: column;
    }
    
    .level-info, .buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    #game-board {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1;
    }
    
    .island {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .creator-controls {
        flex-direction: column;
    }
    
    .creator-controls input, .creator-controls button {
        width: 100%;
    }
}