body {   
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #121212; /* Dark background */
    font-family: 'Arial', sans-serif;
    margin: 8px;
    overflow: hidden;
}

.home-link {
    position: fixed;
    top: 18px;
    right: 20px;
    z-index: 3000;
    padding: 10px 16px;
    border-radius: 8px;
    background: #fff;
    color: #171717;
    text-decoration: none;
    font-weight: bold;
}

#winner {
    text-align: center;
    color: white;
}

/* Wrapper for board (to keep it centered) */
.game-container {
    display: flex;
    justify-content: center; /* Keep the board centered */
    align-items: center;
    width: 100%;
}

/* Move buttons to the left */
.controls {
    position: absolute;
    left: 20px; /* Moves buttons to the left */
    top: 60%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

/* Team containers */
.team-container {
    position: absolute;
    top: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Move left team box */
.team-left {
    left: 20px;
}

/* Move right team box */
.team-right {
    right: 20px;
}

/* Team boxes (rectangles) */
.team-box {
    width: 150px; /* Reduced width */
    min-height: 126px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    font-size: 24px; /* Adjusted font size */
    font-weight: bold;
    color: white;
    cursor: pointer;
    box-sizing: border-box;
}

.team-box p {
    margin: 0 0 10px;
    line-height: 1;
}

.team-box > div {
    display: flex;
    gap: 6px;
}

.team-box > div button {
    width: 58px;
}

/* Green box for Team 1 */
.green {
    background-color: #008000;
}

/* Red box for Team 2 */
.red {
    background-color: #d00000;
}

/* Clicking effect */
.team-box:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* Style for buttons */
button {
    padding: 6px 12px; /* Reduced padding */
    font-size: 14px; /* Adjusted font size */
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    color: white;
    background-color: #444;
    transition: 0.3s;
    width: 120px; /* Reduced width */
}

button:hover {
    background-color: #666;
}

/* Timer Container (Hidden by default) */
#timerContainer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 30px;
    font-size: clamp(24px, 5vw, 48px);
    font-weight: bold;
    border-radius: 10px;
    text-align: center;
    display: none;
    z-index: 2000;
}

/* Move hexagonal board slightly down */
.board-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 30px;
}

/* Board styles */
.board {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Hexagon grid styling */
.row {
    display: flex;
    gap: 2px;
    margin-top: -20px;
}

.hexagon {
    width: 90px;
    height: 98px;
    background-color: #2a2a2a;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

/* Winning glow animation */
@keyframes winning-glow {
    0% { box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }
    100% { box-shadow: 0 0 20px rgba(255, 255, 255, 1); }
}

.hexagon.winning {
    animation: winning-glow 0.8s infinite alternate;
}

/* Blinking effect */
.hexagon.blink {
    animation: blink 0.5s infinite alternate;
}

@keyframes blink {
    0% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Adjust row positioning */
.row:nth-child(odd) {
    margin-right: 100px;
    margin-left: 8px;
}

/* Top and Bottom Rows - Red Team */
.row:first-child .hexagon,
.row:last-child .hexagon {
    background-color: #d00000;
    color: transparent;
}

/* First and Last Columns - Green Team */
.row .hexagon:first-child,
.row .hexagon:last-child {
    background-color: #008000;
    color: transparent;
}
