260 lines
4.9 KiB
CSS
260 lines
4.9 KiB
CSS
:root {
|
|
--bg: #1b2735;
|
|
--panel: #24344a;
|
|
--water: #2f6f9e;
|
|
--water-dark: #24597f;
|
|
--grid-line: #16232f;
|
|
--fog: #3a536b;
|
|
--text: #eef3f8;
|
|
--accent: #e8b23a;
|
|
}
|
|
|
|
* { box-sizing: border-box; }
|
|
|
|
body {
|
|
margin: 0;
|
|
font-family: "Segoe UI", Verdana, sans-serif;
|
|
background: linear-gradient(180deg, var(--bg), #0e1620);
|
|
color: var(--text);
|
|
min-height: 100vh;
|
|
}
|
|
|
|
.app {
|
|
max-width: 1100px;
|
|
margin: 0 auto;
|
|
padding: 24px 16px 60px;
|
|
}
|
|
|
|
header { text-align: center; margin-bottom: 8px; }
|
|
header h1 { margin: 0 0 4px; font-size: 2.1rem; }
|
|
.subtitle { margin: 0; opacity: 0.75; }
|
|
|
|
.message {
|
|
text-align: center;
|
|
min-height: 1.4em;
|
|
margin: 14px auto 20px;
|
|
padding: 10px 16px;
|
|
background: var(--panel);
|
|
border-radius: 8px;
|
|
max-width: 640px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.screen.hidden { display: none; }
|
|
|
|
h2, h3 { text-align: center; }
|
|
|
|
.placement-controls {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 10px;
|
|
justify-content: center;
|
|
align-items: center;
|
|
margin-bottom: 18px;
|
|
}
|
|
|
|
button {
|
|
background: var(--accent);
|
|
color: #2a1c00;
|
|
border: none;
|
|
border-radius: 6px;
|
|
padding: 10px 16px;
|
|
font-size: 0.95rem;
|
|
font-weight: 700;
|
|
cursor: pointer;
|
|
transition: transform 0.08s ease, opacity 0.15s ease;
|
|
}
|
|
button:hover:not(:disabled) { transform: translateY(-1px); }
|
|
button:disabled { opacity: 0.4; cursor: not-allowed; }
|
|
|
|
.fleet-picker {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 8px;
|
|
justify-content: center;
|
|
}
|
|
|
|
.fleet-picker button {
|
|
background: var(--panel);
|
|
color: var(--text);
|
|
border: 2px solid transparent;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
}
|
|
.fleet-picker button.selected { border-color: var(--accent); }
|
|
.fleet-picker button.placed { opacity: 0.35; cursor: default; }
|
|
|
|
.boards {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 32px;
|
|
justify-content: center;
|
|
}
|
|
|
|
.board-wrap { margin-bottom: 20px; }
|
|
|
|
.board {
|
|
display: grid;
|
|
grid-template-columns: repeat(10, 34px);
|
|
grid-template-rows: repeat(10, 34px);
|
|
gap: 2px;
|
|
background: var(--grid-line);
|
|
padding: 4px;
|
|
border-radius: 8px;
|
|
width: max-content;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.cell {
|
|
width: 34px;
|
|
height: 34px;
|
|
background: var(--water);
|
|
position: relative;
|
|
border-radius: 3px;
|
|
cursor: default;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
overflow: visible;
|
|
}
|
|
|
|
.cell.own { background: var(--water-dark); }
|
|
|
|
#enemy-board .cell {
|
|
cursor: crosshair;
|
|
background: var(--fog);
|
|
}
|
|
#enemy-board .cell:hover:not(.hit):not(.miss) {
|
|
background: #4a6a87;
|
|
}
|
|
|
|
.cell.preview-ok { outline: 2px solid #2ecc71; }
|
|
.cell.preview-bad { outline: 2px solid #e74c3c; }
|
|
|
|
.cell.miss::after {
|
|
content: "";
|
|
width: 8px;
|
|
height: 8px;
|
|
border-radius: 50%;
|
|
background: rgba(255,255,255,0.6);
|
|
}
|
|
|
|
.cell.hit {
|
|
background: #7a2323 !important;
|
|
}
|
|
.cell.hit::after {
|
|
content: "💥";
|
|
font-size: 18px;
|
|
}
|
|
|
|
/* --- Wappler ship sprite, built purely from CSS shapes --- */
|
|
.wappler {
|
|
position: relative;
|
|
width: 24px;
|
|
height: 26px;
|
|
}
|
|
.wappler .cap {
|
|
position: absolute;
|
|
top: -1px;
|
|
left: 2px;
|
|
width: 18px;
|
|
height: 9px;
|
|
background: var(--hat, #c0392b);
|
|
border-radius: 9px 9px 3px 3px;
|
|
transform: rotate(-8deg);
|
|
filter: drop-shadow(0 1px 0 rgba(0,0,0,0.4));
|
|
}
|
|
.wappler .cap::after {
|
|
content: "";
|
|
position: absolute;
|
|
top: 6px;
|
|
right: -7px;
|
|
width: 10px;
|
|
height: 4px;
|
|
background: var(--hat, #c0392b);
|
|
border-radius: 0 4px 4px 0;
|
|
}
|
|
.wappler .head {
|
|
position: absolute;
|
|
top: 9px;
|
|
left: 4px;
|
|
width: 16px;
|
|
height: 14px;
|
|
background: #f0c090;
|
|
border-radius: 50% 50% 45% 45%;
|
|
}
|
|
.wappler .stoppel {
|
|
position: absolute;
|
|
top: 17px;
|
|
left: 4px;
|
|
width: 16px;
|
|
height: 6px;
|
|
background: rgba(60, 40, 20, 0.28);
|
|
border-radius: 0 0 8px 8px;
|
|
}
|
|
.wappler .brille {
|
|
position: absolute;
|
|
top: 13px;
|
|
left: 5px;
|
|
width: 14px;
|
|
height: 4px;
|
|
background: #111;
|
|
border-radius: 2px;
|
|
box-shadow: 2px -1px 0 -1px rgba(255,255,255,0.6);
|
|
}
|
|
.wappler .grinser {
|
|
position: absolute;
|
|
top: 18px;
|
|
left: 8px;
|
|
width: 8px;
|
|
height: 4px;
|
|
border-bottom: 2px solid #7a4a2a;
|
|
border-radius: 0 0 8px 8px;
|
|
}
|
|
|
|
.cell.hit .wappler { filter: grayscale(1) brightness(0.6); transform: rotate(90deg); }
|
|
.cell.hit .wappler .brille { box-shadow: none; }
|
|
.cell.hit .wappler::before {
|
|
content: "✕";
|
|
position: absolute;
|
|
inset: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: #fff;
|
|
font-weight: bold;
|
|
font-size: 14px;
|
|
transform: rotate(-90deg);
|
|
}
|
|
|
|
.fleet-status {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 6px;
|
|
justify-content: center;
|
|
margin-top: 10px;
|
|
max-width: 340px;
|
|
}
|
|
.fleet-status .badge {
|
|
font-size: 0.78rem;
|
|
padding: 4px 8px;
|
|
border-radius: 12px;
|
|
background: var(--panel);
|
|
}
|
|
.fleet-status .badge.sunk {
|
|
text-decoration: line-through;
|
|
opacity: 0.5;
|
|
background: #5a1a1a;
|
|
}
|
|
|
|
#new-game-btn { display: block; margin: 24px auto 0; }
|
|
|
|
@media (max-width: 560px) {
|
|
.board {
|
|
grid-template-columns: repeat(10, 28px);
|
|
grid-template-rows: repeat(10, 28px);
|
|
}
|
|
.cell { width: 28px; height: 28px; }
|
|
}
|