@font-face {
    font-family: 'SuperDario';
    src: url('SuperDario-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* Snake Game Styles */
.snake-game-wrapper {
    font-family: 'SuperDario', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.snake-game-wrapper * {
    box-sizing: border-box;
}

.snake-game-container {
    background: #DEFFD9;
    padding: 2rem;
}

.game-wrapper {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.game-board {
    width: 500px;
    height: 585px;
    background: #31654A;
    position: relative;
    overflow: hidden;
}

.snake-game {
    position: relative;
    height: 100%;
    width: 100%;
}

.snake-segment {
    position: absolute;
    width: 1%;
    height: 1%;
    background: white;
    z-index: 20;
}

.food {
    position: absolute;
    width: 0.7%;
    height: 0.7%;
    background: white;
    border: 1px solid white;
    z-index: 10;
    border-radius: 50%;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.5),
        0 0 0 2px rgba(255, 255, 255, 0.25);
}

.game-over {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 26, 0.84);
    padding: 0.75rem;
    text-align: center;
    z-index: 30;
}

.game-over-text {
    text-transform: uppercase;
    font-size: 1.125rem;
    font-weight: 600;
    align-self: center;
}

.hidden {
    display: none !important;
}

.restart-button-container {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, 0%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem;
    z-index: 25;
}

.restart-btn {
    background: white;
    color: #1a1a1a;
    border: none;
    padding: 0.5rem 1rem;
    font-weight: 600;
    height: 40px;
    width: 200px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.restart-btn:hover {
    transform: scale(1.01);
}

.restart-btn:active{
    transform: scale(0.99);
}

.controls-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 0 1.25rem;
    z-index: 10000000000;
    transition: opacity 0.5s ease-out;
}

.controls-panel.faded {
    opacity: 0;
    pointer-events: none;
}

.keypad-container {
    display: flex;
    height: fit-content;
    align-items: flex-end;
    margin-left: 0.75rem;
    margin-top: 1.25rem;
    width: 5rem;
    gap: 0.25rem;
}

.keypad-center {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.keypad-btn {
    background: #000;
    color: white;
    border: none;
    padding: 0.25rem 1rem;
    height: fit-content;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.075s ease-linear;
    display: flex;
    align-items: center;
    justify-content: center;
}

.keypad-btn:hover {
    transform: scale(1.05);
}

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

.score-panel-container {
    display: flex;
    font-size: 0.75rem;
    color: white;
    margin-bottom: 0.25rem;
    justify-content: space-between;
    margin-top: 1.25rem;
}

.score-panel {
    display: flex;
    height: fit-content;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
}

.score-text {
    color: white;
    font-size: 0.75rem;
    margin: 0rem !important;
}

.food-remaining-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.food-remaining-text {
    color: white;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.food-items-container{
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.25rem;
}

.food-item{
    width: 8px;
    height: 8px;
    background: white;
    border: 1px solid white;
    border-radius: 50%;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.5),
        0 0 0 2px rgba(255, 255, 255, 0.25);
}

.instructions{
    color: white;
    font-size: 0.75rem;
    display: flex;
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translate(-50%, 0%);
    width: 60%;
    justify-content: space-between;
}

/* Responsive design */
@media (max-width: 768px) {
    .game-wrapper {
        flex-direction: column;
        gap: 1rem;
    }
    
    .snake-game-container {
        padding: 1rem;
        margin: 1rem;
    }
    
    .game-board,
    .controls-panel {
        width: 280px;
        height: 280px;
    }
}

@media (max-width: 480px) {
    .game-board,
    .controls-panel {
        width: 250px;
        height: 250px;
    }
    
    .controls-panel {
        padding: 0 0.5rem;
    }
}

/* Completion styles */
.completion-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 500px;
    height: 585px;
    background: #DEFFD9;
    padding: 2rem;
    text-align: center;
}

.completion-image {
    margin-bottom: 2rem;
}

.completion-image img {
    width: 300px;
    height: 300px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.completion-text h2 {
    color: #31654A;
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.completion-text p {
    color: #31654A;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.completion-text .restart-btn {
    background: #31654A;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
    height: auto;
}

.completion-text .restart-btn:hover {
    background: #2a5a3f;
    transform: scale(1.05);
}

.completion-text .restart-btn:active {
    transform: scale(0.95);
}

.completion-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.completion-text .reset-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
    height: auto;
}

.completion-text .reset-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

.completion-text .reset-btn:active {
    transform: scale(0.95);
}

/* Responsive completion styles */
@media (max-width: 768px) {
    .completion-container {
        width: 280px;
        height: 280px;
        padding: 1rem;
    }
    
    .completion-image img {
        width: 200px;
        height: 200px;
    }
    
    .completion-text h2 {
        font-size: 1.5rem;
    }
    
    .completion-text p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .completion-container {
        width: 250px;
        height: 250px;
        padding: 0.5rem;
    }
    
    .completion-image img {
        width: 150px;
        height: 150px;
    }
    
    .completion-text h2 {
        font-size: 1.2rem;
    }
    
    .completion-text p {
        font-size: 0.9rem;
    }
}
