@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&family=Roboto:wght@400;700&display=swap');



:root {
    --bg-ocean-deep: #0a1929;
    --bg-ocean: #0d2137;
    --bg-ocean-light: #1565c0;
    --bg-ocean-surface: #1976d2;
    --color-ice: #b3e5fc;
    --color-ice-glow: rgba(179, 229, 252, 0.4);
    --text-main: #e3f2fd;
    --text-muted: #90a4ae;
    --ui-glass: rgba(10, 25, 41, 0.85);
    --ui-border: rgba(179, 229, 252, 0.2);
    --container-blue: #4fc3f7;
    --container-red: #ff8a80;
    --container-yellow: #ffd54f;
    --color-primary: #4fc3f7;
    --color-accent: #ffb74d;
    --color-danger: #ff5252;
    --color-success: #69f0ae;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(180deg,
            var(--bg-ocean-deep) 0%,
            var(--bg-ocean) 30%,
            var(--bg-ocean-light) 70%,
            var(--bg-ocean-surface) 100%);
    font-family: 'Roboto', sans-serif;
    user-select: none;
}

#score-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 240px;
    padding: 15px;
    background: var(--ui-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--ui-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px var(--color-ice-glow);
    color: var(--text-main);
    z-index: 100;
}


.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ui-border);
}

.hud-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-ice);
    letter-spacing: 1px;
}

.captain-badge {
    font-size: 0.75rem;
    color: var(--color-accent);
    background: rgba(255, 183, 77, 0.15);
    padding: 3px 8px;
    border-radius: 10px;
}

.score-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.score-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    transition: background 0.2s ease;
}

.score-box.highlight {
    background: rgba(79, 195, 247, 0.1);
    border: 1px solid rgba(79, 195, 247, 0.3);
}

.score-icon {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.score-info {
    display: flex;
    flex-direction: column;
}

.score-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
}

.score-box.highlight .score-value {
    color: var(--color-primary);
    font-size: 1.3rem;
}

.game-audio-panel {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--ui-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--ui-border);
    border-radius: 25px;
    z-index: 100;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.game-audio-panel:hover {
    opacity: 1;
}

.audio-btn-game {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.audio-btn-game:hover {
    background: rgba(79, 195, 247, 0.2);
}

.audio-icon {
    font-size: 1.2rem;
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
}

#game-world {
    position: relative;
    width: 100%;
    height: 100%;
    transform: translateZ(0);
    will-change: contents;
}

#iceberg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    transform: translateZ(0);
    contain: layout style;
}

.iceberg {
    position: absolute;
    top: -150px;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.boat {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 50px;
    height: auto;
    z-index: 10;
    transform-origin: center bottom;
    will-change: transform, bottom;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.boat img {
    width: 100%;
    display: block;
    pointer-events: none;
}

.boat .overlay {
    position: absolute;
    top: 13%;
    left: 7%;
    width: 84%;
    height: 73%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.container-row {
    display: flex;
    justify-content: space-between;
    height: 18%;
}

.container {
    width: 22%;
    height: 100%;
    border-radius: 2px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
    position: relative;
    will-change: transform, opacity;
    transform: translateZ(0);
}

.container.dropped-left {
    animation: dropLeft 1s ease-in forwards;
    z-index: 100;
}

.container.dropped-right {
    animation: dropRight 1s ease-in forwards;
    z-index: 100;
}

@keyframes dropLeft {
    0% {
        transform: translate3d(0, 0, 0) rotate(0);
        opacity: 1;
    }

    100% {
        transform: translate3d(-150px, 200px, 0) rotate(-90deg);
        opacity: 0;
    }
}

@keyframes dropRight {
    0% {
        transform: translate3d(0, 0, 0) rotate(0);
        opacity: 1;
    }

    100% {
        transform: translate3d(150px, 200px, 0) rotate(90deg);
        opacity: 0;
    }
}

.hint {
    position: fixed;
    bottom: 15px;
    width: 100%;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    z-index: 200;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.hint:hover {
    opacity: 1;
}

.hint-keys {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 25, 41, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.modal-content {
    background: var(--ui-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--ui-border);
    border-radius: 20px;
    padding: 40px;
    width: 90%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px var(--color-ice-glow);
    color: var(--text-main);
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.modal-content h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    margin: 0 0 15px 0;
    color: var(--color-ice);
}

.modal-content p {
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 25px 0;
}




.modal-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 25px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #29b6f6 100%);
    color: var(--bg-ocean-deep);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    transition: all 0.2s ease;
}

.modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 195, 247, 0.4);
}

.btn-wave {
    animation: wave-icon 1s ease-in-out infinite;
}

@keyframes wave-icon {

    0%,
    100% {
        transform: rotate(-10deg);
    }

    50% {
        transform: rotate(10deg);
    }
}

.modal-button-secondary {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.modal-button-secondary:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.3);
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.gameover-content {
    animation: gameoverAppear 0.5s ease-out;
}

@keyframes gameoverAppear {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.gameover-icon {
    font-size: 4rem;
    margin-bottom: 10px;
    animation: shake 0.6s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.gameover-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-danger);
    letter-spacing: 3px;
    margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(255, 82, 82, 0.5);
}

.gameover-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0 0 25px 0;
}

.gameover-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--ui-border);
}

.gameover-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.stat-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.stat-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-main);
}

.gameover-btn {
    background: linear-gradient(135deg, var(--color-danger) 0%, #ff1744 100%) !important;
    box-shadow: 0 4px 15px rgba(255, 82, 82, 0.3);
}

.gameover-btn:hover {
    box-shadow: 0 8px 25px rgba(255, 82, 82, 0.5) !important;
}

@media (max-width: 600px) {
    #score-panel {
        width: calc(100% - 40px);
        top: auto;
        bottom: 60px;
        right: 20px;
    }

    .score-grid {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .score-box {
        flex: 1;
        min-width: 80px;
    }

    .game-audio-panel {
        top: 10px;
        left: 10px;
    }

    .volume-slider {
        width: 60px;
    }

    .gameover-title {
        font-size: 1.5rem;
    }

    .gameover-stats {
        padding: 10px;
    }

    .stat-icon {
        font-size: 1.2rem;
        width: 30px;
    }

    .stat-value {
        font-size: 1rem;
    }
}