gomoku/public/style.css

131 lines
2.9 KiB
CSS

:root {
--color-background-light-pink: #ffe0f0;
--color-text-dark: #333;
--color-game-container-bg: white;
--color-game-container-shadow: rgba(0, 0, 0, 0.1);
--color-board-bg: #ffefff;
--color-board-border: #ffccff;
--color-grid-lines: #ff99ff;
--color-intersection-hover: rgba(255, 192, 203, 0.3);
--color-heart-pink: #FFB6C1;
--color-last-move-glow: rgba(255, 255, 0, 0.7);
}
body {
font-family: Arial, sans-serif;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100vh;
margin: 0;
background-color: var(--color-background-light-pink);
color: var(--color-text-dark);
}
#game-container {
background-color: var(--color-game-container-bg);
padding: 20px;
border-radius: 12px;
box-shadow: 0 0 20px var(--color-game-container-shadow);
text-align: center;
}
.game-board-grid {
position: relative;
width: calc(14 * 30px); /* 14 gaps of 30px between 15 lines */
height: calc(14 * 30px); /* 14 gaps of 30px between 15 lines */
margin-top: 20px;
background-color: var(--color-board-bg);
border: 2px solid var(--color-board-border);
}
/* Grid lines */
.game-board-grid::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image:
linear-gradient(to right, var(--color-grid-lines) 1px, transparent 1px),
linear-gradient(to bottom, var(--color-grid-lines) 1px, transparent 1px);
background-size: 30px 30px;
background-position: -1px -1px;
pointer-events: none;
}
.intersection {
position: absolute;
width: 30px;
height: 30px;
margin-left: -15px;
margin-top: -15px;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
z-index: 1;
}
.intersection:hover {
background-color: var(--color-intersection-hover);
}
/* Heart Stone Styling */
.stone-black-heart, .stone-white-heart {
position: relative;
width: 24px;
height: 24px;
margin: auto;
overflow: hidden;
}
.stone-black-heart::before,
.stone-black-heart::after,
.stone-white-heart::before,
.stone-white-heart::after {
content: '';
position: absolute;
width: 12px;
height: 20px;
border-radius: 50% 50% 0 0;
border: 1px solid var(--color-black); /* Thin black outline - this creates the line through the middle */
box-sizing: border-box;
transform: rotate(-45deg);
transform-origin: 0 100%;
top: 0;
left: 12px;
}
.stone-black-heart::after,
.stone-white-heart::after {
left: 0;
transform: rotate(45deg);
transform-origin: 100% 100%;
}
.stone-black-heart::before, .stone-black-heart::after {
background-color: var(--color-heart-pink);
}
.stone-white-heart::before, .stone-white-heart::after {
background-color: var(--color-white);
}
.last-move {
box-shadow: 0 0 5px 3px var(--color-last-move-glow);
}
#messages {
margin-top: 10px;
font-size: 0.9em;
color: var(--color-text-dark);
}
#player-info {
margin-top: 10px;
font-weight: bold;
color: var(--color-text-dark);
}