* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Minecraft', sans-serif;
}

body {
    background: radial-gradient(circle at center, #222222 0%, #0a0a0a 100%);
    color: white;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Floating squares background */
#particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.03);
    /* Square shape */
    aspect-ratio: 1/1;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
    max-width: 600px;
    padding: 20px;
}

.hidden {
    display: none !important;
}

.title {
    font-size: 5rem;
    text-align: center;
    color: #ffffff;
    text-shadow: 
        4px 4px 0 #000,
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 2.5rem;
    text-shadow: 2px 2px 0 #000;
    text-align: center;
}

.blink {
    animation: blinker 1.5s linear infinite;
}

@keyframes blinker {
    50% { opacity: 0.3; }
}

input[type="text"] {
    background-color: #000000;
    color: #ffffff;
    border: 4px solid #555555;
    padding: 15px 20px;
    font-size: 1.5rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
    outline: none;
    box-shadow: inset 4px 4px 0px rgba(0, 0, 0, 0.5);
}

input[type="text"]::placeholder {
    color: #777777;
}

input[type="text"]:focus {
    border-color: #ffffff;
}

.buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 400px;
}

.mc-button {
    background-color: #c6c6c6;
    color: #000000;
    font-size: 1.2rem;
    padding: 15px 20px;
    border: none;
    border-top: 4px solid #ffffff;
    border-left: 4px solid #ffffff;
    border-bottom: 4px solid #555555;
    border-right: 4px solid #555555;
    cursor: pointer;
    text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.5);
    transition: all 0.1s;
    width: 100%;
}

.mc-button:hover {
    background-color: #d6d6d6;
}

.mc-button:active {
    border-top: 4px solid #555555;
    border-left: 4px solid #555555;
    border-bottom: 4px solid #ffffff;
    border-right: 4px solid #ffffff;
    background-color: #a6a6a6;
}

.mc-button.red {
    background-color: #ff5555;
    color: #ffffff;
    border-top: 4px solid #ffaaaa;
    border-left: 4px solid #ffaaaa;
    border-bottom: 4px solid #aa0000;
    border-right: 4px solid #aa0000;
    text-shadow: 2px 2px 0px #330000;
}

.mc-button.red:hover {
    background-color: #ff7777;
}

.mc-button.red:active {
    border-top: 4px solid #aa0000;
    border-left: 4px solid #aa0000;
    border-bottom: 4px solid #ffaaaa;
    border-right: 4px solid #ffaaaa;
    background-color: #dd3333;
}

/* Loading screen square */
.snake-loader {
    width: 64px;
    height: 64px;
    border: 4px solid #555555;
    position: relative;
    margin: 30px 0;
    background-color: #000;
}

.snake-block {
    width: 14px;
    height: 14px;
    background-color: #888888;
    position: absolute;
    animation: snake-move 1.5s infinite linear;
}

@keyframes snake-move {
    0%   { top: 0; left: 0; }
    25%  { top: 0; left: 42px; }
    50%  { top: 42px; left: 42px; }
    75%  { top: 42px; left: 0; }
    100% { top: 0; left: 0; }
}

/* Game Board */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
}

.player-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border: 4px solid #555;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.player-info.active-turn {
    opacity: 1;
    border-color: #55ff55;
}

.player-name {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.player-symbol {
    font-size: 2.5rem;
    text-shadow: 2px 2px 0 #000;
}

.vs-text {
    font-size: 2rem;
    color: #ffaa00;
    text-shadow: 2px 2px 0 #000;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background-color: #1a1a1a;
    padding: 8px;
    border: 6px solid #050505;
    margin-bottom: 20px;
}

.cell {
    width: 100px;
    height: 100px;
    background-color: #7a7a7a;
    border-top: 4px solid #aaaaaa;
    border-left: 4px solid #aaaaaa;
    border-bottom: 4px solid #333333;
    border-right: 4px solid #333333;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    cursor: pointer;
    color: #000;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.5);
}

.cell:hover {
    background-color: #8a8a8a;
}

.cell.x {
    color: #ff5555;
    text-shadow: 3px 3px 0px #330000;
}

.cell.o {
    color: #5555ff;
    text-shadow: 3px 3px 0px #000033;
}

.cell.winning {
    background-color: #55ff55;
    animation: flash 1s infinite;
}

@keyframes flash {
    0%, 100% { background-color: #55ff55; }
    50% { background-color: #ffffff; }
}

.status-message {
    font-size: 2rem;
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 20px;
    text-align: center;
    min-height: 2.5rem;
}

.game-controls {
    display: flex;
    gap: 15px;
    width: 100%;
}

#restart-btn {
    display: none;
}

@media (max-width: 500px) {
    .title {
        font-size: 3rem;
    }
    .cell {
        width: 80px;
        height: 80px;
        font-size: 3rem;
    }
    .player-name {
        font-size: 1rem;
    }
    .player-symbol {
        font-size: 2rem;
    }
}
