418 lines
10 KiB
CSS
418 lines
10 KiB
CSS
/* ── Reset & base ──────────────────────────────────────────────────── */
|
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
|
|
body {
|
|
font-family: sans-serif;
|
|
background: #c8b084;
|
|
display: flex;
|
|
justify-content: center;
|
|
padding: 1.5rem;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
/* ── Login / Connecting screens ────────────────────────────────────── */
|
|
.login-container {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.75rem;
|
|
max-width: 320px;
|
|
margin-top: 4rem;
|
|
}
|
|
|
|
.login-container h1 { font-size: 2rem; text-align: center; margin-bottom: 0.5rem; }
|
|
|
|
input[type="text"] {
|
|
padding: 0.5rem 0.75rem;
|
|
font-size: 1rem;
|
|
border: 1px solid #aaa;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.error-msg { color: #c00; font-size: 0.9rem; }
|
|
|
|
.connecting { font-size: 1.2rem; margin-top: 4rem; text-align: center; }
|
|
|
|
/* ── Buttons ────────────────────────────────────────────────────────── */
|
|
.btn {
|
|
padding: 0.5rem 1.25rem;
|
|
font-size: 1rem;
|
|
border: none;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
transition: opacity 0.15s;
|
|
}
|
|
.btn:disabled { opacity: 0.4; cursor: default; }
|
|
.btn-primary { background: #3a6b3a; color: #fff; }
|
|
.btn-secondary { background: #5a4a2a; color: #fff; }
|
|
.btn-bot { background: #2a5a7a; color: #fff; }
|
|
.btn:not(:disabled):hover { opacity: 0.85; }
|
|
|
|
/* ── Game container ─────────────────────────────────────────────────── */
|
|
.game-container {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 0.75rem;
|
|
width: 100%;
|
|
}
|
|
|
|
/* ── Language switcher ──────────────────────────────────────────────── */
|
|
.lang-switcher {
|
|
display: flex;
|
|
gap: 0.25rem;
|
|
}
|
|
|
|
.lang-switcher button {
|
|
font-size: 0.75rem;
|
|
padding: 0.15rem 0.4rem;
|
|
border: 1px solid rgba(0,0,0,0.3);
|
|
border-radius: 3px;
|
|
background: transparent;
|
|
cursor: pointer;
|
|
color: inherit;
|
|
opacity: 0.6;
|
|
}
|
|
|
|
.lang-switcher button.lang-active {
|
|
opacity: 1;
|
|
font-weight: bold;
|
|
background: rgba(0,0,0,0.12);
|
|
}
|
|
|
|
.login-container .lang-switcher {
|
|
justify-content: flex-end;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
/* ── Top bar ─────────────────────────────────────────────────────────── */
|
|
.top-bar {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
width: 100%;
|
|
}
|
|
|
|
.quit-link {
|
|
font-size: 0.85rem;
|
|
color: #5a4a2a;
|
|
text-decoration: underline;
|
|
cursor: pointer;
|
|
}
|
|
|
|
/* ── Player score panel ─────────────────────────────────────────────── */
|
|
.player-score-panel {
|
|
background: #f5edd8;
|
|
border-radius: 6px;
|
|
padding: 0.5rem 1rem;
|
|
font-size: 0.9rem;
|
|
box-shadow: 0 1px 4px rgba(0,0,0,0.2);
|
|
width: 100%;
|
|
}
|
|
|
|
.player-score-header {
|
|
margin-bottom: 0.3rem;
|
|
}
|
|
|
|
.player-name {
|
|
font-weight: bold;
|
|
font-size: 1rem;
|
|
}
|
|
|
|
.score-bars {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
}
|
|
|
|
.score-bar-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.score-bar-label {
|
|
font-size: 0.8rem;
|
|
color: #555;
|
|
width: 3.5rem;
|
|
text-align: right;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.score-bar {
|
|
width: 140px;
|
|
height: 10px;
|
|
background: rgba(0,0,0,0.12);
|
|
border-radius: 5px;
|
|
overflow: hidden;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.score-bar-fill {
|
|
height: 100%;
|
|
border-radius: 5px;
|
|
transition: width 0.3s;
|
|
}
|
|
|
|
.score-bar-points { background: #4a7a3a; }
|
|
.score-bar-holes { background: #7a4a2a; }
|
|
|
|
.score-bar-value {
|
|
font-size: 0.8rem;
|
|
color: #444;
|
|
min-width: 2.5rem;
|
|
}
|
|
|
|
.bredouille-badge {
|
|
font-size: 0.7rem;
|
|
font-weight: bold;
|
|
color: #fff;
|
|
background: #c07800;
|
|
border-radius: 3px;
|
|
padding: 0.05em 0.35em;
|
|
cursor: default;
|
|
}
|
|
|
|
.player-jans {
|
|
margin-top: 0.35rem;
|
|
border-top: 1px solid rgba(0,0,0,0.1);
|
|
padding-top: 0.25rem;
|
|
}
|
|
|
|
/* ── Board + side panel ─────────────────────────────────────────────── */
|
|
.board-and-panel {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: flex-start;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.side-panel {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.75rem;
|
|
min-width: 160px;
|
|
padding-top: 0.25rem;
|
|
}
|
|
|
|
.action-buttons {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
/* ── Status bar ─────────────────────────────────────────────────────── */
|
|
.status-bar {
|
|
display: flex;
|
|
gap: 1rem;
|
|
align-items: center;
|
|
font-size: 1.05rem;
|
|
font-weight: 500;
|
|
}
|
|
|
|
/* ── Dice bar ───────────────────────────────────────────────────────── */
|
|
.dice-bar {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.75rem;
|
|
}
|
|
|
|
/* ── Die face (SVG) ─────────────────────────────────────────────────── */
|
|
.die-face rect {
|
|
fill: #fffff0;
|
|
stroke: #2a1a00;
|
|
stroke-width: 2;
|
|
}
|
|
.die-face circle {
|
|
fill: #1a0a00;
|
|
}
|
|
.die-face.die-used rect {
|
|
fill: #d8d4c8;
|
|
stroke: #8a7a60;
|
|
}
|
|
.die-face.die-used circle {
|
|
fill: #8a7a60;
|
|
}
|
|
|
|
/* ── Jan panel ──────────────────────────────────────────────────────── */
|
|
.jan-panel {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 2px;
|
|
background: #f5edd8;
|
|
border-radius: 6px;
|
|
padding: 0.4rem 1rem;
|
|
font-size: 0.9rem;
|
|
box-shadow: 0 1px 4px rgba(0,0,0,0.15);
|
|
min-width: 260px;
|
|
}
|
|
|
|
.jan-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
padding: 2px 4px;
|
|
border-radius: 3px;
|
|
}
|
|
.jan-expandable { cursor: pointer; }
|
|
.jan-expandable:hover { background: rgba(0,0,0,0.06); }
|
|
|
|
.jan-positive { color: #1a5c1a; }
|
|
.jan-negative { color: #8b1a1a; }
|
|
|
|
.jan-label { flex: 1; }
|
|
.jan-tag {
|
|
font-size: 0.75rem;
|
|
padding: 0.1em 0.4em;
|
|
border-radius: 3px;
|
|
background: rgba(0,0,0,0.08);
|
|
color: #555;
|
|
white-space: nowrap;
|
|
}
|
|
.jan-pts { font-weight: bold; text-align: right; min-width: 3rem; }
|
|
|
|
.jan-moves { padding: 1px 4px 4px 1rem; display: flex; flex-direction: column; gap: 2px; }
|
|
.jan-moves.hidden { display: none; }
|
|
.jan-move-line { font-family: monospace; font-size: 0.8rem; color: #444; }
|
|
|
|
/* ── Game-over overlay ──────────────────────────────────────────────── */
|
|
.game-over-overlay {
|
|
position: fixed;
|
|
inset: 0;
|
|
background: rgba(0, 0, 0, 0.6);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
z-index: 100;
|
|
}
|
|
|
|
.game-over-box {
|
|
background: #f5edd8;
|
|
border-radius: 8px;
|
|
padding: 2rem 2.5rem;
|
|
text-align: center;
|
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 1.25rem;
|
|
min-width: 260px;
|
|
}
|
|
|
|
.game-over-box h2 {
|
|
font-size: 1.75rem;
|
|
}
|
|
|
|
.game-over-winner {
|
|
font-size: 1.25rem;
|
|
font-weight: bold;
|
|
color: #3a6b3a;
|
|
}
|
|
|
|
.game-over-actions {
|
|
display: flex;
|
|
gap: 0.75rem;
|
|
justify-content: center;
|
|
}
|
|
|
|
/* ── Board ──────────────────────────────────────────────────────────── */
|
|
.board {
|
|
background: #2e6b2e;
|
|
border: 4px solid #1a3d1a;
|
|
border-radius: 8px;
|
|
padding: 4px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
user-select: none;
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.4);
|
|
position: relative;
|
|
}
|
|
|
|
.board-row {
|
|
display: flex;
|
|
gap: 4px;
|
|
}
|
|
|
|
.board-quarter {
|
|
display: flex;
|
|
gap: 2px;
|
|
}
|
|
|
|
.board-bar {
|
|
width: 20px;
|
|
background: #1a3d1a;
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.board-center-bar {
|
|
height: 12px;
|
|
background: #1a3d1a;
|
|
border-radius: 3px;
|
|
}
|
|
|
|
/* ── Fields ─────────────────────────────────────────────────────────── */
|
|
.field {
|
|
width: 60px;
|
|
height: 180px;
|
|
background: #d4a843;
|
|
border-radius: 4px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: flex-end;
|
|
padding: 4px 2px;
|
|
position: relative;
|
|
transition: background 0.1s;
|
|
}
|
|
|
|
/* Alternating field colours */
|
|
.board-quarter .field:nth-child(odd) { background: #c49030; }
|
|
.board-quarter .field:nth-child(even) { background: #d4a843; }
|
|
|
|
.top-row .field { justify-content: flex-start; }
|
|
|
|
.field.clickable { cursor: pointer; }
|
|
.field.clickable:hover { background: #e8c060 !important; }
|
|
.field.selected { background: #88bb44 !important; outline: 2px solid #446622; }
|
|
.field.dest { background: #aad060 !important; }
|
|
|
|
.field-num {
|
|
font-size: 0.65rem;
|
|
color: rgba(0,0,0,0.45);
|
|
position: absolute;
|
|
bottom: 2px;
|
|
}
|
|
|
|
.top-row .field-num { bottom: auto; top: 2px; }
|
|
|
|
/* ── Checkers ───────────────────────────────────────────────────────── */
|
|
.checker-stack {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
}
|
|
|
|
.checker {
|
|
width: 40px;
|
|
height: 40px;
|
|
border-radius: 50%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 0.8rem;
|
|
font-weight: bold;
|
|
border: 2px solid rgba(0,0,0,0.3);
|
|
box-shadow: inset 0 2px 4px rgba(255,255,255,0.3), 0 1px 3px rgba(0,0,0,0.3);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.checker + .checker { margin-top: 2px; }
|
|
|
|
.checker.white {
|
|
background: radial-gradient(circle at 35% 35%, #ffffff, #cccccc);
|
|
color: #333;
|
|
}
|
|
|
|
.checker.black {
|
|
background: radial-gradient(circle at 35% 35%, #555555, #111111);
|
|
color: #eee;
|
|
}
|