trictrac/client_web/assets/style.css

358 lines
9.1 KiB
CSS
Raw Normal View History

2026-03-25 16:44:37 +01:00
/* ── Reset & base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: sans-serif;
2026-03-25 16:44:37 +01:00
background: #c8b084;
display: flex;
justify-content: center;
2026-03-25 16:44:37 +01:00
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:not(:disabled):hover { opacity: 0.85; }
/* ── Game container ─────────────────────────────────────────────────── */
.game-container {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.75rem;
width: 100%;
max-width: 900px;
}
2026-03-29 17:15:22 +02:00
/* ── 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 ─────────────────────────────────────────────────────────── */
2026-03-26 21:13:24 +01:00
.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 {
2026-03-25 16:44:37 +01:00
background: #f5edd8;
border-radius: 6px;
padding: 0.5rem 1rem;
font-size: 0.9rem;
2026-03-25 16:44:37 +01:00
box-shadow: 0 1px 4px rgba(0,0,0,0.2);
width: 100%;
max-width: 900px;
}
.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;
2026-03-25 16:44:37 +01:00
}
2026-03-27 11:43:21 +01:00
/* ── Status bar ─────────────────────────────────────────────────────── */
2026-03-25 16:44:37 +01:00
.status-bar {
display: flex;
gap: 1rem;
align-items: center;
font-size: 1.05rem;
font-weight: 500;
}
2026-03-27 11:43:21 +01:00
/* ── Dice bars ──────────────────────────────────────────────────────── */
.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;
}
2026-03-25 16:44:37 +01:00
2026-03-26 21:13:24 +01:00
/* ── 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;
2026-03-27 16:29:53 +01:00
align-items: center;
gap: 0.5rem;
padding: 2px 4px;
border-radius: 3px;
2026-03-26 21:13:24 +01:00
}
2026-03-27 16:29:53 +01:00
.jan-expandable { cursor: pointer; }
.jan-expandable:hover { background: rgba(0,0,0,0.06); }
2026-03-26 21:13:24 +01:00
.jan-positive { color: #1a5c1a; }
.jan-negative { color: #8b1a1a; }
.jan-label { flex: 1; }
2026-03-27 16:29:53 +01:00
.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; }
2026-03-26 21:13:24 +01:00
2026-03-25 16:44:37 +01:00
/* ── 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);
}
.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;
2026-03-25 16:44:37 +01:00
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;
2026-03-25 16:44:37 +01:00
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.8rem;
2026-03-25 16:44:37 +01:00
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;
2026-03-25 16:44:37 +01:00
}
.checker + .checker { margin-top: 2px; }
.checker.white {
2026-03-25 16:44:37 +01:00
background: radial-gradient(circle at 35% 35%, #ffffff, #cccccc);
color: #333;
}
.checker.black {
2026-03-25 16:44:37 +01:00
background: radial-gradient(circle at 35% 35%, #555555, #111111);
color: #eee;
}