root { 
    display: block;
}

body{
    background-color: #9a6600;
    background-repeat: repeat-x;
    background-position: top;   
    font-family: 'Chewy', cursive;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevent scrolling */
}

*, *:before, *:after {
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
     
input, input:before, input:after {
    -webkit-user-select: initial;
    -khtml-user-select: initial;
    -moz-user-select: initial;
    -ms-user-select: initial;
    user-select: initial;
}

::selection { background: transparent;color:inherit; }
::-moz-selection { background: transparent;color:inherit; }

#canvas{
    position: fixed;  
    top: 0;
    left: 0;
}

canvas {
    image-rendering: optimizeSpeed;
    image-rendering:-o-crisp-edges;
    image-rendering:-webkit-optimize-contrast;
    -ms-interpolation-mode: nearest-neighbor;
    -ms-touch-action: none;
}

.ani_hack{
    -webkit-perspective: 1000;
    -webkit-backface-visibility: hidden;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    outline: none;
    -webkit-tap-highlight-color: transparent; /* mobile webkit */
}

/***************FONTS*******************/
.check-fonts{
    position: fixed;
    opacity:0;
}

.check-font-1{
    font-family: 'obelixproitalic';
}
                
@font-face {
    font-family: 'obelixproitalic';
    src: url('css/obelixproit-cyr-webfont.woff2') format('woff2'),
         url('css/obelixproit-cyr-webfont.woff') format('woff'),
         url('css/obelixproit-cyr-webfont.svg#obelixproitalic') format('svg');
    font-weight: normal;
    font-style: normal;
}

/* ================================================================= */
/* === FROGTASTIC HIGH SCORE & OVERLAY STYLES === */
/* ================================================================= */

.overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    /* Dark Green semi-transparent background */
    background: rgba(12, 43, 12, 0.95); 
    display: flex; 
    justify-content: flex-start; 
    align-items: center;
    z-index: 10000;
    flex-direction: column;
    padding-top: 5vh;
    font-family: 'Chewy', cursive; 
    color: white;
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

/* --- Title Section --- */
.title-box { 
    text-align: center; 
    margin-bottom: 20px; 
}

.title-box h1 { 
    color: #82c431; 
    margin: 0; 
    font-size: 4rem; 
    text-shadow: 3px 3px 0 #000; 
    -webkit-text-stroke: 1px black;
    font-family: 'obelixproitalic', sans-serif;
}

.title-box p { 
    color: #f1c40f; 
    margin: 0; 
    font-size: 1.5rem; 
    letter-spacing: 2px;
    text-shadow: 2px 2px 0 #000;
}

/* --- Input Section --- */
.input-group { 
    margin-bottom: 20px; 
    text-align: center; 
    position: relative;
}

.name-input {
    background: rgba(0,0,0,0.5);
    border: 3px solid #82c431;
    border-radius: 10px;
    color: #fff;
    font-family: 'obelixproitalic', sans-serif;
    font-size: 2rem;
    text-align: center;
    width: 280px;
    padding: 10px;
    outline: none;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(130, 196, 49, 0.3);
    transition: border-color 0.3s;
}

.name-input::placeholder { 
    color: #666; 
}

.name-input:focus {
    border-color: #f1c40f;
}

/* Validation Error Style */
.input-error-msg {
    color: #e74c3c;
    font-family: 'Chewy', cursive;
    font-size: 1.2rem;
    margin-top: 10px;
    text-shadow: 1px 1px 0 #000;
    display: none; /* Hidden by default */
}

/* Shake Animation for Error */
.shake {
    animation: shake 0.5s;
    border-color: #e74c3c !important;
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

/* --- Buttons --- */
.btn-row { 
    display: flex; 
    gap: 20px; 
    justify-content: center;
    flex-wrap: wrap;
}

.start-btn {
    background: linear-gradient(to bottom, #82c431 0%, #4a7c10 100%);
    color: white;
    padding: 15px 40px; 
    border: 3px solid #fff;
    font-size: 1.5rem; 
    font-family: 'obelixproitalic', sans-serif;
    border-radius: 50px; 
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    transition: transform 0.1s, filter 0.1s;
    text-shadow: 2px 2px 0 #000;
    min-width: 150px;
    text-transform: uppercase;
}

.start-btn:active { 
    transform: scale(0.95); 
}

.start-btn:hover { 
    filter: brightness(1.15); 
}

/* --- Game Over Specifics --- */
#gameOverSummary { 
    display: none; 
    text-align: center; 
    width: 100%; 
    margin-bottom: 20px;
}

#loginSection { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}

/* --- Leaderboard Table --- */
.leaderboard {
    width: 90%; 
    max-width: 500px;
    background: rgba(0,0,0,0.6);
    border-radius: 15px;
    padding: 20px;
    border: 3px solid #82c431;
    min-height: 200px;
    margin-top: 20px;
    margin-bottom: 50px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.lb-header {
    display: flex; 
    justify-content: space-between;
    border-bottom: 2px solid #fff;
    padding-bottom: 10px; 
    margin-bottom: 10px;
    color: #82c431; 
    font-size: 1.3rem;
    font-family: 'obelixproitalic', sans-serif;
    text-shadow: 1px 1px 0 #000;
}

.lb-row {
    display: flex; 
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 1.2rem;
    font-family: Arial, sans-serif;
    font-weight: bold;
}

.lb-row:nth-child(1) { color: #f1c40f; text-shadow: 0 0 10px rgba(241, 196, 15, 0.5); } /* Gold */
.lb-row:nth-child(2) { color: #bdc3c7; } /* Silver */
.lb-row:nth-child(3) { color: #cd7f32; } /* Bronze */

/* Responsive adjustments */
@media (max-width: 600px) {
    .title-box h1 { font-size: 3rem; }
    .leaderboard { width: 95%; }
    .start-btn { padding: 10px 30px; font-size: 1.2rem; }
}