/* General styling for the page */
body {
    font-family: 'Flapstick', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    gap: 15px;
    background-image: url('./Assets/background-pattern (1).png');
    background-repeat: repeat;
    box-sizing: border-box;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Canvas Frame - Skeuomorphic Border */
#unity-canvas {
    border: 4px solid #493333;
    border-radius: 8px;
    box-shadow:
        0 4px 0 0 #493333,
        0 1.5px 1.5px rgba(0, 0, 0, 0.2),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.4);
}

/* --- 1. Base Button Styling (Skeuomorphic Look) --- */
.btn-skeuo {
    text-decoration: none;
    color: #493333;
    font-weight: 800;
    font-size: 36px;
    padding: 20px 40px;
    border-radius: 30px;
    cursor: pointer;
    outline: none;
    border: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    user-select: none;
    transition: all 0.1s ease;
    font-family: 'Flapstick', sans-serif;

    /* Main background color and gradient for the 'raised' effect */
    background-color: #b7e3b9;
    background-image: linear-gradient(180deg, #d3f3d4, #b7e3b9);

    /* The core skeuomorphic shadow effect */
    box-shadow:
        0 4px 0 0 #493333, /* Dark bottom border/shadow */
        0 1.5px 1.5px rgba(0, 0, 0, 0.2),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.4);
}

/* The .key-active class applies the visual "pressed" state */
.btn-skeuo.key-active, .btn-skeuo:active {
    transform: translateY(4px); /* Move down to look clicked */
    box-shadow:
        0 0 0 0 #493333, /* Remove bottom shadow */
        0 0.75px 0.75px rgba(0, 0, 0, 0.2),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.4);
    padding: 10px 20px;
}

/* --- 2. Layout Containers --- */
.top-row-container {
    display: flex;
    align-items: flex-end; /* Aligns all groups to the bottom */
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 960px;
}

/* Movement Buttons Grid (W A S D - W on top of ASD) */
.movement-container {
    display: grid;
    grid-template-areas:
        " . W . "
        " A S D ";
    grid-template-columns: repeat(3, 1fr); /* Ensure 3 equal columns */
    gap: 8px;
    width: 120px;
}

/* Flat Socials Container */
.socials-container {
    display: flex;
    gap: 20px; /* Reduced from 40px to fit more buttons */
    margin-top: 20px;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping if needed */
}

/* --- 3. Specific Button Styles --- */

/* Movement Buttons */
.btn-movement {
    width: 35px;
    height: 35px;
    font-size: 18px;
    padding: 0;
    border-radius: 6px;
    background-color: #f3d49b; /* Orange/Brown tone */
    background-image: linear-gradient(180deg, #f7e0bc, #f3d49b);
    box-shadow:
        0 3px 0 0 #a37f59,
        0 1.5px 1.5px rgba(0, 0, 0, 0.2),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.4);
}

.btn-movement.key-active, .btn-movement:active {
    transform: translateY(3px);
    box-shadow:
        0 0 0 0 #a37f59,
        0 0.75px 0.75px rgba(0, 0, 0, 0.2),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.4);
}

#W { grid-area: W; }
#A { grid-area: A; }
#S { grid-area: S; }
#D { grid-area: D; }

/* Shift Button */
.btn-shift {
    width: 60px;
    height: 35px;
    font-size: 12px;
    padding: 0;
    border-radius: 6px;
    background-color: #b3d9ff; /* Light blue tone */
    background-image: linear-gradient(180deg, #cce6ff, #b3d9ff);
    box-shadow:
        0 3px 0 0 #4d79ff,
        0 1.5px 1.5px rgba(0, 0, 0, 0.2),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.4);
}

.btn-shift.key-active, .btn-shift:active {
    transform: translateY(3px);
    box-shadow:
        0 0 0 0 #4d79ff,
        0 0.75px 0.75px rgba(0, 0, 0, 0.2),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.4);
}

/* Action Buttons (HUGs and Music) */
.btn-action {
    font-size: 14px;
    padding: 12px 24px;
    height: fit-content;
}

/* HUGS Button Colors (Pink/Rose tone) */
#HUGS_ACTION {
    background-color: #e6b9c9;
    background-image: linear-gradient(180deg, #f0cad8, #e6b9c9);
    box-shadow:
        0 4px 0 0 #a1647e,
        0 1.5px 1.5px rgba(0, 0, 0, 0.2),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.4);
}

/* Tab Mute Button Colors (Blue tone) */
#tab_mute_toggle {
    background-color: #4a90e2;
    background-image: linear-gradient(180deg, #6bb6ff, #4a90e2);
    box-shadow:
        0 4px 0 0 #2c5aa0,
        0 1.5px 1.5px rgba(0, 0, 0, 0.2),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    padding: 0;
    font-size: 20px;
    color: black;
}

/* Bug Bounty Button Colors (Gold/Reward tone) */
.btn-bounty {
    background-color: #ffd700;
    background-image: linear-gradient(180deg, #ffed4e, #ffd700);
    box-shadow:
        0 4px 0 0 #b8860b,
        0 1.5px 1.5px rgba(0, 0, 0, 0.2),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.4);
    font-size: 14px;
    padding: 12px 24px;
    height: fit-content;
}

.btn-bounty.key-active, .btn-bounty:active {
    transform: translateY(4px);
    box-shadow:
        0 0 0 0 #b8860b,
        0 0.75px 0.75px rgba(0, 0, 0, 0.2),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.4);
}

/* --- FLAT SOCIAL STYLING --- */
.btn-social {
    /* Removed all skeuomorphic effects */
    display: block;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    box-shadow: none;
    cursor: pointer;
    line-height: 0; /* Important for preventing extra space below images */
    transition: transform 0.1s ease;
}

.btn-social:hover {
    transform: scale(1.05); /* Add a slight hover effect for visual feedback */
}

.btn-social:active {
    transform: scale(0.98); /* Add a slight press effect for visual feedback */
}

/* Styling for the custom image assets inside the button */
.social-asset {
    /* Let the image size define the button size */
    width: 64px;
    height: 64px;
    max-width: 100%;
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@font-face {
    font-family: 'Flapstick';
    src: url('Assets/font/flapstick.otf') format('opentype');
}

.audio-panel {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.audio-panel.open {
    display: block;
}

.bug-report-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.bug-report-modal.open {
    display: block;
}

.faq-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.faq-modal.open {
    display: block;
}