/**
 * Styles for The Goblin and The Lake game
 * All visual styling for the game interface
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: white;
}

.game-container {
    text-align: center;
    padding: 20px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

h1 {
    margin-bottom: 10px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.subtitle {
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.1em;
    opacity: 0.9;
    width: 800px; /* Match canvas width */
    max-width: 100%;
    box-sizing: border-box;
}

canvas {
    border: 4px solid #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: #87CEEB;
    cursor: crosshair;
    touch-action: none;
    max-width: 100%;
    height: auto;
}

@media (max-width: 900px) {
    canvas {
        width: 100%;
        height: auto;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 0.9em;
    }
    
    .game-container {
        padding: 10px;
    }
}

.info-panel {
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
    padding: 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 0;
    width: 800px; /* Match canvas width */
}

.info-item {
    text-align: center;
    padding: 0 8px;
    position: relative;
    flex: 0 0 calc(100% / 3); /* Each section spans exactly 1/3 */
    box-sizing: border-box;
}

.info-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background: rgba(255,255,255,0.3);
}

.info-label {
    font-size: 0.9em;
    opacity: 0.8;
    margin-bottom: 3px;
}

.info-value {
    font-size: 1.3em;
    font-weight: bold;
}

.controls {
    margin-top: 15px;
    font-size: 0.95em;
    opacity: 0.9;
}

.game-over {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    display: none;
    z-index: 1000;
    border: 3px solid #fff;
    max-width: 400px;
    width: 90%;
    pointer-events: auto;
}

.game-over.show {
    display: block;
    pointer-events: auto;
}

.game-over button {
    pointer-events: auto;
    position: relative;
    z-index: 1001;
}

.game-over.show {
    display: block;
}

.game-over h2 {
    font-size: 2em;
    margin-bottom: 15px;
}

.game-over p {
    font-size: 1em;
    margin-bottom: 15px;
}

button {
    padding: 12px 30px;
    font-size: 1.1em;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #45a049;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

button:disabled:hover {
    background: #4CAF50;
}

#solveBtn {
    background: #2196F3;
}

#solveBtn:hover {
    background: #1976D2;
}

#restartBtn {
    background: #4CAF50;
}

#restartBtn:hover {
    background: #45a049;
}

#shareButtons {
    display: flex;
}

.distance-bar {
    width: 200px;
    height: 20px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    overflow: hidden;
    margin: 5px auto;
}

.distance-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.1s;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
