/* Win celebration message style */
.gameover-msg {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 32px;
    color: #ffd200;
    text-shadow: 0 2px 16px #f7971eaa;
    letter-spacing: 1px;
    text-align: center;
    width: 100%;
    word-break: break-word;
}
/* Header Bar and Back Button */
.header-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 8px;
}
.game-title {
    flex: 1;
    text-align: center;
    margin: 0;
    font-size: 2.1rem;
    font-weight: bold;
    letter-spacing: 1px;
    color: #ff5e62;
    text-shadow: 0 2px 8px #ffb88c44;
}
.back-btn {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #ff5e62;
    box-shadow: 0 2px 8px #a8edea44;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    margin-right: 8px;
}
.back-btn:hover {
    background: linear-gradient(135deg, #fed6e3 0%, #a8edea 100%);
    transform: scale(1.08);
}
/* Sound Toggle Button */
.sound-toggle {
    background: linear-gradient(90deg, #a1c4fd 0%, #c2e9fb 100%);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
    cursor: pointer;
    margin-left: 18px;
    box-shadow: 0 2px 8px #a1c4fd44;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sound-toggle:hover {
    background: linear-gradient(90deg, #c2e9fb 0%, #a1c4fd 100%);
    transform: scale(1.08);
}
body {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #222;
    font-family: 'Segoe UI', Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}
.container {
    background: rgba(255,255,255,0.95);
    padding: 32px 40px 24px 40px;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    text-align: center;
    position: relative;
}
.board {
    display: grid;
    grid-template-columns: repeat(3, 90px);
    grid-template-rows: repeat(3, 90px);
    gap: 14px;
    margin: 28px auto 18px auto;
    width: max-content;
}
.cell {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-radius: 16px;
    font-size: 2.8rem;
    font-weight: bold;
    color: #ff5e62;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: background 0.2s, transform 0.1s;
    user-select: none;
}
.cell.x {
    color: #ff5e62;
    text-shadow: 0 2px 8px #ffb88c44;
}
.cell.o {
    color: #2196f3;
    text-shadow: 0 2px 8px #90caf944;
}
.cell:hover {
    background: linear-gradient(135deg, #fcb69f 0%, #a1c4fd 100%);
    transform: scale(1.07);
}
.status {
    font-size: 1.25rem;
    margin-bottom: 14px;
    min-height: 28px;
    color: #333;
    font-weight: 500;
}
.restart-btn {
    padding: 16px 40px;
    font-size: 1.18rem;
    background: linear-gradient(90deg, #f7971e 0%, #ffd200 100%);
    color: #222;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 44px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px #fcb69f44;
    transition: background 0.2s, transform 0.1s;
    display: block;
    align-self: center;
}
/* Game Over Overlay */
.gameover-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.75);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s;
}
/* Gameover box centered in overlay */
.gameover-box {
    background: rgba(0,0,0,0.82);
    border-radius: 24px;
    padding: 38px 38px 32px 38px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
    color: #fff;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.gameover-overlay h2 {
    font-size: 2.2rem;
    margin-bottom: 18px;
    color: #ffd200;
    text-shadow: 0 2px 12px #f7971e88;
}
.gameover-overlay .score-info {
    margin-bottom: 18px;
    font-size: 1.1rem;
    color: #fff;
}
.gameover-overlay .restart-btn {
    margin-top: 0;
    font-size: 1.18rem;
    margin-bottom: 0;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}