@import url("https://fonts.googleapis.com/css2?family=Inconsolata:wght@400;700&display=swap");

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #111625;
    font-family: "Inconsolata", monospace;
    font-size: 14px;
    color: white;
    user-select: none;
    -webkit-user-select: none;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

canvas#game {
    display: block;
    width: 100vw;
    height: 100vh;
}

button {
    cursor: pointer;
    border: none;
    color: white;
    background: rgba(255, 255, 255, 0.15);
    font-family: "Inconsolata", monospace;
    padding: 8px 14px;
    font-size: 1em;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    transition: background-color 0.2s;
}

button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

#info-left,
#info-right,
#settings {
    position: absolute;
    top: 15px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 14px;
    border-radius: 6px;
    backdrop-filter: blur(6px);
    opacity: 1 !important; /* Keep persistent for clear readability */
    pointer-events: auto;
}

#info-left h3, #info-right h3 {
    margin: 0 0 4px 0;
    font-size: 1.1em;
    color: #fad234;
}

#info-left p, #info-right p {
    margin: 2px 0;
}

#info-left {
    left: 15px;
}

#info-right {
    right: 15px;
    text-align: right;
}

#settings {
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    right: auto;
}

#wind-info {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.65);
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: bold;
    color: #00f0ff;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(0, 240, 255, 0.3);
    white-space: nowrap;
    width: auto !important;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#bomb-grab-area {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 210, 52, 0.3);
    border: 2px dashed #fad234;
    cursor: grab;
    z-index: 5;
}

#instructions,
#congratulations {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    text-align: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#instructions {
    background: rgba(0, 0, 0, 0.75);
    padding: 20px 40px;
    border-radius: 12px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
}

#instructions h1 {
    font-size: 1.8em;
    margin: 8px 0 0 0;
    color: #fad234;
}

#instructions h3 {
    margin: 0;
    color: #00f0ff;
}

#congratulations {
    background-color: rgba(17, 22, 37, 0.95);
    color: white;
    padding: 35px 50px;
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    max-width: 320px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

#congratulations h1 {
    margin-top: 0;
    color: #fad234;
}

/* Basic CSS for the dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn:after {
    content: " ▼";
    font-size: 0.8em;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #1a2235;
    min-width: 130px;
    border-radius: 6px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.4);
    z-index: 30;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-content a {
    color: white;
    padding: 10px 14px;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    font-size: 0.9em;
}

.dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Show dropdown content when hovering over the button */
.dropdown:hover .dropdown-content {
    display: block;
}

#windmill {
    position: absolute;
    right: 10px;
    bottom: 10px;
    fill: rgba(255, 255, 255, 0.4);
    transform-origin: bottom;
    pointer-events: none;
    z-index: 2;
}

#windmill-head {
    animation-name: rotate;
    animation-duration: 4s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

#fullscreen {
    all: unset;
    cursor: pointer;
    position: absolute;
    right: 15px;
    bottom: 15px;
    z-index: 20;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

@media (max-width: 600px) {
    #info-left, #info-right {
        font-size: 11px;
        padding: 4px 8px;
    }
    #settings {
        top: 60px;
    }
    #wind-info {
        top: 100px;
    }
}

/* Home Screen Overlay Styles */
#start-screen {
    position: absolute;
    inset: 0;
    z-index: 100;
    background: radial-gradient(circle at center, rgba(39, 80, 127, 0.95), rgba(17, 22, 37, 0.98));
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(12px);
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#start-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.start-card {
    background: rgba(17, 22, 37, 0.9);
    border: 2px solid rgba(255, 210, 52, 0.4);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 210, 52, 0.2);
    border-radius: 20px;
    padding: 40px 50px;
    text-align: center;
    max-width: 380px;
    width: 90%;
    transform: translateY(0);
    animation: floatCard 4s ease-in-out infinite;
}

@keyframes floatCard {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.gorilla-avatar-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.gorilla-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
    transition: transform 0.3s ease;
}

.left-gorilla {
    transform: scaleX(-1);
    animation: gorillaBounce 2s ease-in-out infinite alternate;
}

.right-gorilla {
    animation: gorillaBounce 2s ease-in-out 1s infinite alternate;
}

@keyframes gorillaBounce {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-10px) scale(1.05); }
}

.vs-badge {
    background: linear-gradient(135deg, #ff3355, #ffaa00);
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 6px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(255, 51, 85, 0.5);
    letter-spacing: 1px;
}

.start-card h1 {
    font-size: 3rem;
    margin: 0;
    color: #fad234;
    letter-spacing: 4px;
    text-shadow: 0 4px 10px rgba(250, 210, 52, 0.4), 0 2px 0 #b38600;
}

.start-card .subtitle {
    margin: 5px 0 25px 0;
    color: #00f0ff;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.play-btn {
    width: 100%;
    padding: 16px;
    font-size: 1.4rem;
    font-weight: bold;
    color: #111625;
    background: linear-gradient(135deg, #fad234, #ffaa00);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(250, 210, 52, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.play-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(250, 210, 52, 0.6);
    background: linear-gradient(135deg, #ffee66, #ffbb11);
}

.mode-select-row {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.mode-btn {
    flex: 1;
    padding: 10px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn.active, .mode-btn:hover {
    background: rgba(0, 240, 255, 0.25);
    border-color: #00f0ff;
    color: #00f0ff;
}