* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Noto Sans JP",sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    text-align: center;
}

.dashboard-box, .form-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

h2, h3 {
    margin-bottom: 20px;
    color: #333;
}

p {
    margin-bottom: 20px;
    color: #555;
}

.menu {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.menu button, .levels-list button, .game-buttons button, button {
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    background-color: #007bff;
    color: white;
    transition: background-color 0.3s, transform 0.1s;
}

.menu button:hover, .levels-list button:hover, .game-buttons button:hover, button:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

.levels-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.levels-list button {
    width: 120px;
}

.levels-list button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.game-buttons button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#game-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#game-title {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 10px;
}

#game-section p {
    font-size: 1em;
    color: #666;
    margin-bottom: 15px;
}

#current-vocab p {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 10px;
}

#current-romaji {
    font-size: 20px;
    color: #333;
    margin: 10px 0;
}

#replay-button {
    padding: 10px 20px;
    font-size: 0.9em;
    background-color: #ff6f61;
    color: #fff;
    border: 2px solid #ff6f61;
    border-radius: 20px;
    cursor: pointer;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#replay-button:hover {
    background-color: #fff;
    color: #0056b3;
    border-color: #ff6f61;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
}

#replay-button:focus {
    outline: none;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.game-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.game-buttons button {
    width: 70px;
    height: 70px;
    font-size: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    border-radius: 10px;
    background-color: #1e90ff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
    .game-buttons {
        flex-direction: row;
        max-width: 400px;
        margin: 0 auto;
    }
    .game-buttons button {
        flex: 0 0 calc(20% - 12px);
        max-width: 70px;
    }
}

@media (max-width: 767px) {
    .menu {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .menu button {
        width: 100%;
        max-width: 200px;
        padding: 12px;
    }
    .levels-list {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .levels-list button {
        width: 100%;
        max-width: 200px;
    }
    .game-buttons {
        display: grid;
        grid-template-columns: repeat(2, 70px);
        grid-template-rows: repeat(5, 70px);
        gap: 15px;
        justify-content: center;
    }
    .game-buttons button {
        width: 70px;
        height: 70px;
    }
    #game-title {
        font-size: 1.2em;
    }
    #current-vocab {
        font-size: 1em;
    }
    #current-romaji {
        font-size: 1.1em;
    }
}

.menu button, .levels-list button, .game-buttons button, button {
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    background-color: #007bff;
    color: white;
    transition: background-color 0.3s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.menu button:hover, .levels-list button:hover, .game-buttons button:hover, button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 5px 8px rgba(0, 0, 0, 0.3);
}

.menu button:active, .levels-list button:active, .game-buttons button:active, button:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
    background-color: #004494;
}

/* Add a subtle ripple effect */
.menu button::after, .levels-list button::after, .game-buttons button::after, button::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.4s, opacity 0.8s;
}

.menu button:active::after, .levels-list button:active::after, .game-buttons button:active::after, button:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* Timer display styling */
#timer-display {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin: 10px 0;
    padding: 8px 12px;
    border-radius: 5px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}

/* Active level button */
.active-level {
    background-color: #28a745;
}

.active-level:hover {
    background-color: #218838;
}

/* Additional game button styling for better feedback */
.game-buttons button {
    width: 70px;
    height: 70px;
    font-size: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    border-radius: 10px;
    background-color: #1e90ff;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    margin: 8px;
    user-select: none;
}

.game-buttons button:hover {
    background-color: #187bcd;
}

.game-buttons button:active {
    transform: scale(0.95);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.game-buttons button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


.dev-controls {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
    text-align: center;
}

.dev-buttons-container {
    display: flex;
    justify-content: center;
}

.retro-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 20px;
    background-color: #c0c0c0;
    color: #000;
    font-family: "MS Sans Serif", "Tahoma", sans-serif;
    font-size: 13px;
    font-weight: bold;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    cursor: pointer;
    outline: none;
    box-shadow: 1px 1px 0px #000;
    min-width: 160px;
}

.retro-btn:active {
    border-color: #808080 #ffffff #ffffff #808080;
    transform: translate(1px, 1px);
    box-shadow: none;
}

.btn-icon { font-size: 16px; margin-right: 8px; }