@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #D59B6B;
    font-family: 'Press Start 2P', cursive;
    margin: 0;
    flex-direction: column;
    color: #fff;
}
h1 {
    font-size: 3rem;
    margin-bottom: 57px;
    text-shadow: 2px 2px 4px #000;
}
.home-link {
    position: absolute;
    top: 20px;
    left: 20px;
    text-decoration: none;
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px #000;
}
.home-link:hover {
    color: #ffcc00;
    text-shadow: 4px 4px 8px #000;
    transform: scale(1.1);
    cursor: pointer;
}
#status{
    font-size: 1.5rem;
    margin-bottom: 100px;
}
#animation_status {
    position: absolute;
    font-size: 1.5rem;
    margin-bottom: 30px;
    top: 52%;
    left: 33%;
}
.setup-box, .container {
    padding: 20px;
    background-color: #6C584C;
    border-radius: 10px;
    display: none;
}
.setup-box {
    position: relative;
    top: -50px;
}
.container {
    display: flex;
    justify-content: space-around;
    gap: 60px;
    padding: 30px;
    background-color: #6C584C;
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    width: 80%;
}
.player-box {
    padding: 20px;
    background-color: #8B5E34;
    border-radius: 10px;
    width: 45%;
}
.header, .input-group {
    display: grid;
    grid-template-columns: 1fr 4fr 2fr 2fr;
    gap: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 20px;
}
input[type="text"] {
    padding: 8px;
    font-size: 1rem;
    left: auto;
    text-align: center;
    background-color: #D59B6B;
    border: none;
    border-radius: 5px;
    color: #fff;
    width: 80%;
}
button {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 1.2rem;
    cursor: pointer;
    background-color: #A3B18A;
    border: none;
    border-radius: 5px;
    color: #fff;
}
#popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    padding-left: 35px;
    background: #6C584C;
    color: #fff;
    font-size: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 0 20px #000;
    z-index: 10;
}
.close-btn {
    position: fixed;
    top: -18px;
    right: -1px;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}
#result-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #6C584C;
    color: #fff;
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 10px #000;
}
#confirm-popup {
    display: none;
    position: fixed;
    bottom: 60px;
    left: 20px;
    padding: 15px;
    background: #6C584C;
    color: #fff;
    font-size: 1rem;
    border-radius: 10px;
    box-shadow: 0 0 10px #000;
    z-index: 10;
}
#confirm-popup button {
    margin: 5px;
    padding: 8px 15px;
    font-size: 0.8rem;
}
#draw-offer {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    padding: 15px;
    background: #6C584C;
    color: #fff;
    font-size: 1rem;
    border-radius: 10px;
    box-shadow: 0 0 10px #000;
    z-index: 10;
}
#draw-offer button {
    margin: 5px;
    padding: 8px 15px;
    font-size: 0.8rem;
}
.game-actions {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
}
.game-actions button {
    margin-right: 10px;
    background-color: #e76f51;
}
.profile {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #6C584C;
    padding: 10px 20px;
    border-radius: 8px;
    color: #264653;
    font-weight: bold;
    flex-direction: column;
}
.profile-icon {
    width: 40px;
    height: 40px;
    background-color: #2a9d8f;
    border-radius: 50%;
}
@keyframes dot-blink {
    0% { content: 'Searching for opponent'; }
    25% { content: 'Searching for opponent.'; }
    50% { content: 'Searching for opponent..'; }
    75% { content: 'Searching for opponent...'; }
    100% { content: 'Searching for opponent'; }
}
#animation_status::after {
    content: 'Searching for opponent';
    animation: dot-blink 3s steps(1, end) infinite;
}
.reconnect-warning {
    display: none;
    position: fixed;
    top: 22%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    background-color: rgba(231, 111, 81, 0.9);
    color: white;
    border-radius: 10px;
    font-size: 1.2rem;
    text-align: center;
    z-index: 20;
}
#countdown {
    font-size: 2rem;
    font-weight: bold;
}