body, h1, canvas, button, input, div {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
    font-family: Arial, sans-serif;
}

#gameInfo {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 18px;
    color: #FF69B4;
}

#lives, #speed {
    display: block;
    margin-bottom: 5px;
}

#gameContainer {
    position: relative;
}

#gameCanvas {
    border: 2px solid #333;
}

#continueButton {
    display: none;
    position: absolute;
    z-index: 1000;
    padding: 10px 20px;
    font-size: 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

h1 {
    font-size: 36px;
    color: #FF69B4;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 20px;
    text-align: center;
}

#kbrd {
    display: flex;
    flex-wrap: wrap;
    width: 330px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    gap: 2px;
    justify-content: center;
}

.key {
    width: 30px;
    height: 30px;
    margin: 2px;
    font-size: 18px;
    background-color: #FF69B4;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

.key.numeric-key {
    width: 30px;
    height: 30px;
}

.key.delete-key {
    width: 64px;
}
#ninput {
    font-size: 24px;
    text-align: center;
    width: 250px;
    margin-bottom: 10px;
    display: none;
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#sname {
    font-size: 18px;
    padding: 5px 10px;
    background-color: #FF69B4;
    color: white;
    border: none;
    cursor: pointer;
    display: none;
    margin-top: 10px;
    position: absolute;
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#pinInput {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    text-align: center;
    border: 2px solid #FF69B4;
    border-radius: 5px;
    background-color: white;
    font-size: 24px;
    letter-spacing: 5px;
}

#submitPin {
    position: absolute;
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #FF69B4;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 18px;
    cursor: pointer;
}

#ninput:focus, #pinInput:focus {
    outline: none;
    border-color: #FF1493;
    box-shadow: 0 0 5px rgba(255, 105, 180, 0.5);
}

/* Disable text selection */
#ninput, #pinInput {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Style for disabled state */
#ninput[readonly], #pinInput[readonly] {
    background-color: #fff;
    opacity: 1;
}

#ldr_brd {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    display: none;
    flex-direction: column;
}

#ldr_brd table {
    width: 300px;
    border-collapse: collapse;
}

#ldr_brd th, #ldr_brd td {
    border: 1px solid #FF69B4;
    padding: 5px;
}

#ldr_brd th {
    background-color: #FF69B4;
    color: white;
}

#RSbtn {
    font-size: 20px;
    padding: 10px 20px;
    background-color: #FF69B4;
    color: white;
    border: none;
    cursor: pointer;
    margin-top: 20px;
}

#RNGtxt {
    font-size: 24px;
    color: gold;
    text-shadow: 1px 1px 2px red;
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.1); }
    100% { transform: translateX(-50%) scale(1); }
}

@keyframes flash {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

.flash {
    animation: flash 0.5s linear 3;
}

#ringTimer {
    position: absolute;
    top: 60px;
    width: 100%;
    text-align: center;
    color: yellow;
    font-weight: bold;
    display: none;
    font-size: 30px;
}

.replay-button {
    border: none;
    color: white;
    padding: 0px 0px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    margin: 2px 2px;
    cursor: pointer;
}

.replay-button:hover {
    background-color: #45a049;
}