body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f5f5f5;
    padding: 20px 0;
}

.container {
    text-align: center;
    max-width: 800px;
    width: 100%;
    background-color: #f7f3e9;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

h1 {
    color: #664229;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

#status {
    margin: 20px 0;
    font-size: 1.4rem;
    font-weight: bold;
    color: #664229;
}

#board {
    display: grid;
    grid-template-columns: repeat(3, 120px);
    grid-template-rows: repeat(3, 120px);
    gap: 8px;
    margin: 0 auto;
    width: 376px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><rect width="200" height="200" fill="%23d9b38c"/><path d="M0,0 L200,200 M200,0 L0,200" stroke="%23b3895e" stroke-width="1"/><path d="M0,50 L200,50 M0,100 L200,100 M0,150 L200,150 M50,0 L50,200 M100,0 L100,200 M150,0 L150,200" stroke="%23b3895e" stroke-width="0.5"/></svg>');
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    border: 5px solid #8c6239;
}

.cell {
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid #8c6239;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
    user-select: none;
    position: relative;
    border-radius: 5px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
    color: #333;
}

.cell:hover {
    background-color: rgba(255, 243, 224, 0.4);
}

button {
    margin-top: 20px;
    padding: 12px 30px;
    font-size: 1.1rem;
    background-color: #8c6239;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

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

.win {
    background-color: rgba(200, 230, 201, 0.7);
}

#mode-info {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #664229;
}

.shake {
    animation: shake 0.2s;
}

.destroyed {
    color: #ff0000;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s;
}

#rules {
    background-color: rgba(232, 245, 233, 0.7);
    border: 1px solid #a5d6a7;
    border-radius: 5px;
    padding: 10px 20px;
    margin-top: 25px;
    margin-bottom: 15px;
    text-align: left;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#rules h3 {
    margin-top: 5px;
    margin-bottom: 10px;
    color: #4e342e;
    text-align: center;
}

#rules ul {
    padding-left: 20px;
    margin-bottom: 5px;
}

#rules li {
    margin-bottom: 8px;
    line-height: 1.4;
    color: #4e342e;
}

@keyframes shake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(5deg); }
    100% { transform: rotate(0deg); }
}

#timer {
    display: none;
}

#health-info {
    display: none;
}

.penalty {
    color: #ff5722;
    font-weight: bold;
    animation: blink 1s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.computer-attack {
    animation: pulse 0.5s;
    background-color: rgba(255, 235, 238, 0.7);
}

@keyframes pulse {
    0% { transform: scale(1); background-color: rgba(255, 255, 255, 0.1); }
    50% { transform: scale(1.1); background-color: rgba(255, 205, 210, 0.7); }
    100% { transform: scale(1); background-color: rgba(255, 235, 238, 0.7); }
}

.health-indicator {
    position: absolute;
    top: -12px;
    right: -12px;
    background-color: #4CAF50;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.health-1 {
    box-shadow: inset 0 0 8px 4px rgba(255, 0, 0, 0.5);
}

.health-2 {
    box-shadow: inset 0 0 8px 4px rgba(255, 165, 0, 0.5);
}

.health-3 {
    box-shadow: inset 0 0 8px 4px rgba(0, 128, 0, 0.5);
}