body {
    margin: 0;
    height: 100vh;
    width: 100%;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-image: url('../assets/7.Website_Background/Sharky-BGPN2.jpg');
    background-position: center;
    background-size: cover;
}

@font-face {
    font-family: 'Luckiest_Guy';
    src: url('../assets/5.Font/LuckiestGuy-Regular.ttf');
}

canvas {
    display: block;
    width: 100%;
    max-width: 720px;
}

#canvas-container {
    position: relative;
    width: 100%;
    max-width: 720px;
    display: inline-block;
}

#hud {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    padding: 0 24px 10px 24px;
    max-width: 720px;
    width: 100%;
}

.dpad {
    display: grid;
    grid-template-columns: repeat(3, 30px);
    grid-template-rows: repeat(3, 30px);
    gap: 4px;
}

.dpad button {
    width: 30px;
    height: 30px;
    border-radius: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    font-size: 20px;
}

.panel {
    display: flex;
    gap: 24px;
}

.panel button {
    width: 30px;
    height: 30px;
    border-radius: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    font-size: 20px;
}

h1 {
    color: white;
    font-family: 'Luckiest_Guy';
    font-size: 48px;
    font-weight: 600;
    text-shadow: 4px 4px 6px black;
}

h2 {
    color: white;
    font-family: 'Luckiest_Guy';
    font-size: 32px;
    font-weight: 400;
    margin-top: 0;
}

h3 {
    color: white;
    font-family: 'Luckiest_Guy';
    font-size: 26px;
    font-weight: 200;
    margin-top: 10px;
    margin-bottom: 0;
    letter-spacing: 1px;
}

#controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    max-width: 720px;
    box-sizing: border-box;
    padding-top: 20px;
}

.arrows {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 160px;
}

.shoot-attack {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.slap-attack {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.controls-image {
    height: 100px;
}

#canvasButtons {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
}

#muteBtn {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    color: white;
}

#rotate-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    color: white;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 9999;
    font-family: 'Luckiest_Guy';
}

/*Intro Overlay*/
#introOverlay {
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

#introOverlay.visible {
    display: flex;
}

#introContent {
    background: rgba(0, 50, 100, 0.95);
    border-radius: 16px;
    padding: 40px;
    max-width: 650px;
    width: 100%;
    max-height: 700px;
    height: 100%;
    color: white;
    font-family: 'Luckiest_Guy';
    font-size: 18px;
    font-weight: 100;
    letter-spacing: 1px;
    position: relative;
    overflow-y: auto;
}

#introContent::-webkit-scrollbar {
    width: 12px;
}

#introContent::-webkit-scrollbar-track {
    box-shadow: inset 0 0 5px white;
    border-radius: 12px;
}

#introContent::-webkit-scrollbar-thumb {
    background: rgb(211, 211, 211, 0.6);
    border-radius: 12px;
}

/*Poilicy Overlay*/
#policyOverlay {
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

#policyOverlay.visible {
    display: flex;
}

#policyContent {
    background: rgba(0, 50, 100, 0.95);
    border-radius: 16px;
    padding: 40px;
    max-width: 650px;
    width: 100%;
    max-height: 700px;
    height: 100%;
    color: white;
    font-family: 'Luckiest_Guy';
    font-size: 18px;
    font-weight: 100;
    letter-spacing: 1px;
    position: relative;
    overflow-y: auto;
}

#policyContent a {
    color: lightblue;
    text-decoration: none;
    word-wrap: break-word;
}

#policyContent h1 {
    word-break: break-word;
}

#policyContent::-webkit-scrollbar {
    width: 12px;
}

#policyContent::-webkit-scrollbar-track {
    box-shadow: inset 0 0 5px white;
    border-radius: 12px;
}

#policyContent::-webkit-scrollbar-thumb {
    background: rgb(211, 211, 211, 0.6);
    border-radius: 12px;
}

#closeOverlayBtn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

@media (max-width: 800px) {
    #introContent {
        max-width: 450px;
    }

    #policyContent {
        max-width: 450px;
    }
}

@media (orientation: portrait) and (hover: none) {
    #rotate-overlay {
        display: flex;
    }
}

@media (max-width: 720px) {
    canvas {
        width: 100%;
    }

    .controls-image {
        height: 80px;
    }
}

@media (max-width: 550px) {
    .controls-image {
        height: 60px;
    }

    #introContent {
        max-width: 300px;
    }

    #policyContent {
        max-width: 300px;
    }
}

@media (max-width: 400px) {
    .controls-image {
        height: 40px;
    }

    h3 {
        font-size: 18px;
    }
}

@media (max-height: 800px) {
    #introContent {
        max-height: 500px;
    }

    #policyContent {
        max-height: 500px;
    }
}

@media (max-height: 760px) {
    h1 {
        margin-bottom: 4px;
        margin-top: 4px;
    }
}

@media (max-height: 700px) {
    #pageTitle {
        display: none;
    }

    #controls {
        display: none;
    }
}

@media (max-height: 600px) {
    #introContent {
        max-height: 350px;
    }

    #policyContent {
        max-height: 350px;
    }
}

@media (max-height: 480px) {
    canvas {
        height: 100vh;
        width: 100%;
        max-width: 720px;
    }

    #pageTitle {
        display: none;
    }

    #controls {
        display: none;
    }

    #introContent {
        max-height: 250px;
    }

    #policyContent {
        max-height: 250px;
    }
}

@media (hover: none) and (orientation: landscape) and (max-height: 1025px) {
    #hud {
        display: flex;
    }

    #controls {
        display: none;
    }
}