*,
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
div,
a,
li,
button,
input,
label,
.btn {
    font-family: 'Press Start 2P', cursive !important;
}

body {
    background-color: #1a1a1a;
    background-image: radial-gradient(#2a2a2a 1px, transparent 1px);
    background-size: 20px 20px;
    color: #eee;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

h1 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #fefefe;
    text-shadow: 2px 2px #000;
}

.container {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.simon-board {
    position: relative;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background-color: #333;
    padding: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0, 0, 0, 0.5);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 15px;
    box-sizing: border-box;
    border: 5px solid #111;
}

.btn {
    width: 100%;
    height: 100%;
    border: 8px solid #222;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.1s;
    filter: brightness(0.8);
}

.btn:active,
.btn.pressed {
    filter: brightness(1.3);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.4);
    border-color: #111;
}

.green {
    background-color: #00a74a;
    border-top-left-radius: 100%;
}

.red {
    background-color: #9f0f17;
    border-top-right-radius: 100%;
}

.yellow {
    background-color: #cca707;
    border-bottom-left-radius: 100%;
}

.blue {
    background-color: #094a8f;
    border-bottom-right-radius: 100%;
}

/* Control Panel */
.control-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    background-color: #e0e0e0;
    border-radius: 50%;
    border: 15px solid #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.brand {
    font-family: 'Press Start 2P', cursive;
    color: #333;
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.display-container {
    background-color: #32050c;
    border: 4px solid #222;
    border-radius: 10px;
    padding: 5px 10px;
    margin-bottom: 10px;
    width: 80px;
}

.led-display {
    font-family: 'Press Start 2P', cursive;
    color: #dc0d29;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 0 5px #ff0000;
}

.btn-group {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.control-btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.round-btn {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 4px solid #444;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: transform 0.1s;
}

.round-btn:active {
    transform: scale(0.9);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

#start-btn {
    background-color: #c0392b;
}

#strict-btn {
    background-color: #f1c40f;
}

.label {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: #333;
    font-weight: bold;
    text-transform: uppercase;
}

.led-indicator {
    width: 8px;
    height: 8px;
    background-color: #32050c;
    border-radius: 50%;
    margin-top: -3px;
    margin-bottom: 2px;
    border: 1px solid #444;
}

.led-indicator.active {
    background-color: #dc0d29;
    box-shadow: 0 0 5px #ff0000;
}

/* Animations */
.game-over {
    background-color: #4a0f12;
    background-image: none;
}

.pressed {
    box-shadow: 0 0 20px white;
    background-color: grey;
}

@media (max-width: 500px) {
    .simon-board {
        width: 320px;
        height: 320px;
        border-width: 10px;
    }

    .control-panel {
        width: 140px;
        height: 140px;
    }

    .brand {
        font-size: 1rem;
    }

    .display-container {
        width: 50px;
        padding: 3px 5px;
    }

    .led-display {
        font-size: 1rem;
    }

    .btn-group {
        gap: 15px;
    }
}

/* Header & Nav */
header {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.nav-btn {
    background-color: white;
    color: #011F3F;
    font-family: 'Press Start 2P', cursive;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    border: 2px solid #011F3F;
    transition: all 0.2s;
    font-size: 0.8rem;
}

.nav-btn:hover {
    background-color: #011F3F;
    color: white;
    border-color: white;
}

/* Instructions Page */
.instructions-container {
    max-width: 800px;
    margin: 50px auto;
    text-align: left;
}

.instructions-container h1 {
    text-align: center;
    margin-bottom: 30px;
}

.instructions-container .card {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 20px;
    border: 2px solid #011F3F;
}

.instructions-container h2 {
    color: #FEF2BF;
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    margin-top: 30px;
    margin-bottom: 15px;
}

.instructions-container p,
.instructions-container li {
    color: #FEF2BF;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    line-height: 2;
    margin-bottom: 10px;
}

.instructions-container ul {
    padding-left: 20px;
}

/* Ranking Side Panel */
.ranking-container {
    position: absolute;
    top: 80px;
    left: 20px;
    right: auto;
    background-color: #222;
    border: 2px solid #444;
    padding: 15px;
    border-radius: 10px;
    width: 180px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.ranking-container h3 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    color: #f1c40f;
    text-shadow: 2px 2px #000;
    border-bottom: 2px solid #444;
    padding-bottom: 5px;
}

#ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

#ranking-list li {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    padding: 5px 0;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
}

#ranking-list li:last-child {
    border-bottom: none;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: #333;
    padding: 30px;
    border: 5px solid #00a74a;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 167, 74, 0.5);
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content h2 {
    color: #f1c40f;
    margin-top: 0;
    text-shadow: 2px 2px #000;
}

.modal-content input {
    background-color: #111;
    border: 2px solid #555;
    color: #fff;
    padding: 10px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    margin-bottom: 20px;
    width: 80%;
    text-align: center;
}

.modal-content button {
    background-color: #00a74a;
    color: white;
    font-family: 'Press Start 2P', cursive;
    border: none;
    padding: 15px 30px;
    cursor: pointer;
    border-radius: 5px;
    transition: transform 0.1s;
}

.modal-content button:active {
    transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 850px) {
    .ranking-container {
        position: static;
        width: 90%;
        max-width: 400px;
        margin: 20px auto;
        order: 2;
    }

    header {
        position: static;
        margin-top: 20px;
        margin-bottom: 10px;
        align-self: flex-end;
        padding-right: 20px;
    }
}

@media (max-width: 500px) {
    h1 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    header {
        align-self: center;
        padding-right: 0;
        margin-bottom: 15px;
    }

    .simon-board {
        width: 90vw;
        height: 90vw;
        max-width: 320px;
        max-height: 320px;
        border-width: 8px;
    }

    .control-panel {
        width: 45%;
        height: 45%;
        border-width: 10px;
    }

    .brand {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }

    .display-container {
        width: 40px;
        padding: 2px 4px;
        margin-bottom: 5px;
    }

    .led-display {
        font-size: 0.9rem;
    }

    .round-btn {
        width: 22px;
        height: 22px;
        border-width: 3px;
    }

    .label {
        font-size: 0.5rem;
    }

    .btn-group {
        margin-top: 5px;
    }
}

/* Language Toggle */
.lang-toggle {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
    display: flex;
    gap: 10px;
}

.lang-btn {
    background: none;
    border: 2px solid transparent;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
    padding: 5px;
    border-radius: 5px;
}

.lang-btn.active,
.lang-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 850px) {
    .lang-toggle {
        position: static;
        margin-top: 10px;
        order: 1;
    }
}