/* Main styles for Snake Game */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

canvas {
    display: block;
    touch-action: none;
}

#score {
    display: none;
}

/* Menu Button - triangular corner */
#menuButton {
    position: fixed;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0px 30px 50px 0;
    border-color: transparent rgba(0, 0, 0, 0.0) transparent transparent;
    cursor: pointer;
    z-index: 100;
    transition: border-color 0.2s;
}

#menuButton:hover {
    border-color: transparent rgba(0, 0, 0, 0.1) transparent transparent;
}

#menuButton span {
    position: absolute;
    top: 8px;
    right: -20px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    pointer-events: none;
}

/* Menu Panel */
#menuPanel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    transition: opacity 0.3s;
}

#menuPanel.hidden {
    display: none;
}

.menu-content {
    background: white;
    padding: 30px 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    min-width: 250px;
}

.menu-content h2 {
    margin: 0 0 25px 0;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 28px;
}

.menu-content button {
    display: block;
    width: 100%;
    padding: 15px 25px;
    margin: 10px 0;
    font-size: 18px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
}

.menu-content button:first-of-type {
    background: #4CAF50;
    color: white;
}

.menu-content button:first-of-type:hover {
    background: #45a049;
}

.menu-content button:last-of-type {
    background: #f0f0f0;
    color: #333;
}

.menu-content button:last-of-type:hover {
    background: #e0e0e0;
}

.menu-content button:active {
    transform: scale(0.98);
}

/* Input group for set length */
.menu-input-group {
    display: flex;
    gap: 8px;
    margin: 15px 0;
}

.menu-input-group input {
    flex: 1;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-width: 0;
}

.menu-input-group input:focus {
    outline: none;
    border-color: #4CAF50;
}

.menu-input-group button {
    width: auto !important;
    padding: 12px 20px !important;
    margin: 0 !important;
    background: #2196F3 !important;
    color: white !important;
}

.menu-input-group button:hover {
    background: #1976D2 !important;
}

/* Rotation lock button */
#rotationLockBtn {
    background: #9E9E9E !important;
    color: white !important;
}

#rotationLockBtn:hover {
    background: #757575 !important;
}

#rotationLockBtn.locked {
    background: #FF9800 !important;
}

#rotationLockBtn.locked:hover {
    background: #F57C00 !important;
}
