body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    padding-top: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #333;
    padding: 1rem 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    margin: 0 15px;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background-color: #ff69b4;
}

main {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.view-section {
    background-color: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 90%;
    max-width: 700px;
    margin-bottom: 2rem;
    display: none;
}

.view-section.active {
    display: block;
}

h1 {
    color: #ff69b4;
    margin-bottom: 1.5rem;
}

p {
    color: #666;
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

select {
    width: 100%;
    padding: 0.5rem;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 1rem;
}

button {
    background-color: #ff69b4;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
}

button:hover {
    background-color: #ff85c1;
}

.image-container {
    margin-top: 2rem;
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fafafa;
    border-radius: 5px;
    border: 1px dashed #ddd;
    position: relative;
    overflow: hidden;
}

img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 5px;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff69b4;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.image-container.loading .loader {
    display: block;
}

.image-container.loading img {
    opacity: 0;
}

.image-container.loaded img {
    opacity: 1;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Waifu image transitions and status */
#waifu-image {
    opacity: 0;
    transition: opacity 0.35s ease;
}

#waifu-image.visible {
    opacity: 1;
}

.waifu-status {
    padding: 1rem;
    color: #f65e3b;
    font-weight: 600;
    display: none;
    text-align: center;
}

/* 2048 */
#score-container {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #776e65;
}

#score {
    color: #ff69b4;
}

#game-container-2048 {
    margin: 20px auto 0;
    width: 480px;
    height: 480px;
    background: #bbada0;
    border-radius: 6px;
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    padding: 10px;
    box-sizing: border-box;
}

.grid-cell {
    width: 100%;
    height: 100%;
    background: rgba(238, 228, 218, 0.35);
    border-radius: 3px;
}

.tile {
    position: absolute;
    width: 108px;
    height: 108px;
    line-height: 108px;
    border-radius: 3px;
    background: #eee4da;
    text-align: center;
    font-size: 55px;
    font-weight: bold;
    color: #776e65;
    transition: 100ms ease-in-out;
    top: 10px;
    left: 10px;
    transform: translate(0, 0);
}

.tile.new-tile {
    animation: pop 150ms ease-in-out;
}

@keyframes pop {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

.tile-2 {
    background: #eee4da;
    color: #776e65;
    font-size: 55px;
}
.tile-4 {
    background: #ede0c8;
    color: #776e65;
    font-size: 55px;
}
.tile-8 {
    background: #f2b179;
    color: #f9f6f2;
    font-size: 55px;
}
.tile-16 {
    background: #f59563;
    color: #f9f6f2;
    font-size: 45px;
}
.tile-32 {
    background: #f67c5f;
    color: #f9f6f2;
    font-size: 45px;
}
.tile-64 {
    background: #f65e3b;
    color: #f9f6f2;
    font-size: 45px;
}
.tile-128 {
    background: #edcf72;
    color: #f9f6f2;
    font-size: 35px;
}
.tile-256 {
    background: #edcc61;
    color: #f9f6f2;
    font-size: 35px;
}
.tile-512 {
    background: #edc850;
    color: #f9f6f2;
    font-size: 35px;
}
.tile-1024 {
    background: #edc53f;
    color: #f9f6f2;
    font-size: 25px;
}
.tile-2048 {
    background: #edc22e;
    color: #f9f6f2;
    font-size: 25px;
}
.tile-super {
    background: #3c3a32;
    color: #f9f6f2;
    font-size: 25px;
}

#game-over-message {
    font-size: 2rem;
    font-weight: bold;
    color: #f65e3b;
    margin-top: 1rem;
    display: none;
}

#new-game-btn {
    background-color: #8f7a66;
    margin-top: 1rem;
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

#new-game-btn:hover {
    background-color: #9f8b76;
}

/* Minesweeper */
.minesweeper-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.minesweeper-grid {
    display: grid;
    grid-template-columns: repeat(10, 32px);
    gap: 6px;
    justify-content: center;
}

.minesweeper-cell {
    width: 32px;
    height: 32px;
    background-color: #c0c0c0;
    border-radius: 4px;
    border: 1px solid #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

.minesweeper-cell.revealed {
    background-color: #e6e6e6;
    border-color: #bbb;
    cursor: default;
}

.minesweeper-cell.flag::after {
    content: "🚩";
}

.minesweeper-cell.mine {
    background-color: #f65e3b;
    color: #fff;
}

.minesweeper-status {
    margin-top: 1rem;
    font-weight: bold;
}

/* Sudoku */
.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 40px);
    justify-content: center;
    margin: 20px auto;
    border: 2px solid #333;
}

.sudoku-cell {
    border: 1px solid #ccc;
    width: 40px;
    height: 40px;
    position: relative;
}

.sudoku-cell.border-top {
    border-top: 2px solid #333;
}

.sudoku-cell.border-bottom {
    border-bottom: 2px solid #333;
}

.sudoku-cell.border-left {
    border-left: 2px solid #333;
}

.sudoku-cell.border-right {
    border-right: 2px solid #333;
}

.sudoku-cell input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    background: transparent;
}

.sudoku-cell input:disabled {
    background-color: #f0f0f0;
    color: #333;
    font-weight: bold;
}

.sudoku-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.sudoku-status {
    margin-top: 1rem;
    font-weight: bold;
    color: #333;
}

.sudoku-cell input.error {
    color: #f65e3b;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
