* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    background: #080c18;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

#gameArea {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100dvh;
    position: relative;
}

#canvasContainer {
    position: relative;
    /* Ratio exact 704:1498 conservé sans déformation */
    width: min(100vw, calc(100dvh * 704 / 1498));
    height: min(100dvh, calc(100vw * 1498 / 704));
    aspect-ratio: 704 / 1498;
    overflow: hidden;
    border-radius: 16px;
}

@media (max-width: 600px) {
    #canvasContainer {
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
    }
}

canvas {
    touch-action: none;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 120px rgba(16, 185, 129, 0.12);
}

@media (max-width: 600px) {
    canvas {
        border-radius: 0;
        box-shadow: none;
    }
}

/* Feedback Modal Styles */
#feedbackModal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.72);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.feedback-card {
    position: relative;
    width: 90%;
    max-width: 90%;
    max-height: 80%;
    min-height: 0;
    overflow-y: auto;
    background: #111111;
    border: none;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}
.feedback-inner-border {
    display: none;
}
.feedback-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background: #ef4444;
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.feedback-title {
    margin: 5px 0 12px;
    color: #fbbf24;
    font-size: 16px;
    font-weight: bold;
    -webkit-text-stroke: none;
    paint-order: stroke fill;
    text-align: center;
    text-transform: uppercase;
    padding: 0 25px;
    box-sizing: border-box;
    flex-shrink: 0;
}
.feedback-text {
    color: #e5e7eb;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.45;
    text-align: center;
    margin-bottom: 12px;
}
.feedback-email-link {
    color: #fbbf24;
    font-size: 13px;
    font-weight: bold;
    margin-top: 5px;
    z-index: 5;
    text-decoration: underline;
    cursor: pointer;
    word-break: break-all;
    text-align: center;
}
.feedback-textarea {
    width: 100%;
    height: 180px;
    border: 3px solid #78350f;
    border-radius: 12px;
    padding: 12px;
    font-size: 17px;
    color: #451a03;
    background: #fffdf5;
    resize: none;
    margin-bottom: 24px;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
    font-family: inherit;
    z-index: 5;
}
.feedback-submit {
    position: relative;
    width: 180px;
    height: 48px;
    border: none;
    border-radius: 22px;
    font-size: 19px;
    font-weight: bold;
    color: #ffffff;
    background: linear-gradient(to bottom, #86efac, #4ade80, #22c55e, #15803d);
    border-bottom: 6px solid #0d4021;
    cursor: pointer;
    text-shadow: 0 1px 2px #083b1e;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.05s, border-bottom-width 0.05s;
    z-index: 5;
    font-family: inherit;
}
.feedback-submit:active {
    transform: translateY(3px);
    border-bottom-width: 3px;
}

/* --- Menu Burger & Slide Drawer --- */
.menu-btn {
    position: absolute;
    top: 2.0%;
    left: 2.5%;
    width: 8.3%;
    aspect-ratio: 1 / 1;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12%;
    z-index: 2000;
    padding: 0;
    transition: transform 0.2s ease;
}

.menu-btn:hover {
    transform: scale(1.1);
}

.menu-btn:active {
    transform: scale(0.9);
}

.menu-btn span {
    display: block;
    width: 55%;
    height: 7%;
    background-color: #000000;
    border-radius: 99px;
    transition: transform 0.3s cubic-bezier(0.77, 0.2, 0.05, 1.0), opacity 0.3s ease;
}

/* 3-line Hamburger Open Transitions */
.menu-btn.open span:nth-child(1) {
    transform: translateY(271.4%) rotate(45deg);
}

.menu-btn.open span:nth-child(2) {
    opacity: 0;
}

.menu-btn.open span:nth-child(3) {
    transform: translateY(-271.4%) rotate(-45deg);
}

/* Darkening backdrop */
.side-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    z-index: 1800;
    pointer-events: none;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
    border-radius: 16px;
}

@media (max-width: 600px) {
    .side-menu-overlay {
        border-radius: 0;
    }
}

.side-menu-overlay.open {
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(1.5px);
    pointer-events: auto;
}

/* Side Menu Container (Compact Black Dropdown) */
.side-menu {
    position: absolute;
    top: 7.5%;
    left: 2.5%;
    width: 140px;
    height: auto;
    background: #111111;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.75);
    z-index: 1900;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9) translateY(-10px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, visibility 0.2s ease;
    display: flex;
    flex-direction: column;
    padding: 6px 0;
    box-sizing: border-box;
}

.side-menu.open {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.side-menu-title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #d97706;
    font-size: 15px;
    font-weight: 700;
    text-align: left;
    margin: 0 16px 12px 16px;
    padding-bottom: 8px;
    border-bottom: 1.5px solid #2d3748;
    z-index: 5;
}

.side-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    z-index: 5;
}

.side-menu-item-btn {
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: block;
    padding: 8px 12px;
    color: #f3f4f6;
    font-size: 14px;
    font-weight: 600;
    background: none;
    border: none;
    border-bottom: 1px solid #1e293b;
    text-align: center;
    cursor: pointer;
    outline: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.side-menu-list li:last-child .side-menu-item-btn {
    border-bottom: none;
}

.side-menu-item-btn:hover {
    background-color: #24140a;
    color: #fbbf24;
}

.side-menu-item-btn:active {
    background-color: #3d2110;
}

/* Responsive Table Styles */
.responsive-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-size: 11px;
    color: #e5e7eb;
}
.responsive-table th {
    padding: 4px 2px;
    border-right: 1.5px solid #2d3748;
    font-weight: bold;
    background: #1e1e1e;
    color: #fbbf24;
}
.responsive-table th:last-child {
    border-right: none;
}
.responsive-table td {
    padding: 4px 2px;
    border-right: 1px solid #2d3748;
    border-bottom: 1px solid #2d3748;
}
.responsive-table td:last-child {
    border-right: none;
}

/* Responsive Table Wrapper Styles */
.table-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    min-height: 0;
    z-index: 5;
    margin-bottom: 8px;
    border: 2px solid #2d3748;
    border-radius: 8px;
    background: #151515;
    padding: 4px;
    box-sizing: border-box;
    width: 100%;
}
