Files
NowChess-Frontend/src/app/pages/game/game.component.css
T
shosho996 c02414ea40 fix: NCWF-2 bugs and desing fixes (#7)
Co-authored-by: Lala, Shahd <Shahd.Lala@sybit.de>
Reviewed-on: #7
2026-05-15 02:16:43 +02:00

530 lines
14 KiB
CSS

/* ============================================================
DESIGN TOKENS — dark mode (default)
============================================================ */
:host {
--nc-neon: #ff45c8;
--nc-neon-soft: rgba(255, 69, 200, 0.55);
--nc-neon-clock-bg: rgba(255, 69, 200, 0.08);
--nc-bg: #06060d;
--nc-surface: rgba(20, 17, 42, 0.6);
--nc-surface-solid: rgba(10, 8, 22, 0.95);
--nc-text: #fff;
--nc-text-muted: rgba(255, 255, 255, 0.65);
--nc-text-dim: rgba(255, 255, 255, 0.45);
--nc-border: rgba(255, 255, 255, 0.08);
--nc-border-strong: rgba(255, 255, 255, 0.15);
--nc-warning: #ffb13a;
--nc-warning-soft: rgba(255, 177, 58, 0.4);
--nc-danger: #ff7a7a;
--nc-danger-soft: rgba(255, 122, 122, 0.3);
--nc-danger-bg: rgba(255, 122, 122, 0.08);
--nc-success: #5ee5a1;
--nc-clock-bg: rgba(0, 0, 0, 0.4);
--nc-btn-bg: rgba(255, 255, 255, 0.03);
--nc-btn-hover-bg: rgba(255, 255, 255, 0.07);
--nc-seg-bg: rgba(0, 0, 0, 0.3);
--nc-sans: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
--nc-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
}
/* ============================================================
LIGHT MODE TOKEN OVERRIDES
============================================================ */
:host-context(html:not([data-theme='dark'])) {
--nc-neon: #c026d3;
--nc-neon-soft: rgba(192, 38, 211, 0.45);
--nc-neon-clock-bg: rgba(192, 38, 211, 0.07);
--nc-bg: #f5f0fc;
--nc-surface: rgba(255, 255, 255, 0.88);
--nc-surface-solid: rgba(255, 255, 255, 0.98);
--nc-text: #0f0022;
--nc-text-muted: rgba(15, 0, 34, 0.65);
--nc-text-dim: rgba(15, 0, 34, 0.40);
--nc-border: rgba(15, 0, 34, 0.10);
--nc-border-strong: rgba(15, 0, 34, 0.20);
--nc-warning: #d97706;
--nc-warning-soft: rgba(217, 119, 6, 0.35);
--nc-danger: #dc2626;
--nc-danger-soft: rgba(220, 38, 38, 0.25);
--nc-danger-bg: rgba(220, 38, 38, 0.06);
--nc-success: #059669;
--nc-clock-bg: rgba(0, 0, 0, 0.04);
--nc-btn-bg: rgba(0, 0, 0, 0.03);
--nc-btn-hover-bg: rgba(0, 0, 0, 0.06);
--nc-seg-bg: rgba(0, 0, 0, 0.06);
}
/* ============================================================
SHELL & AMBIENT BG
============================================================ */
.game-shell {
min-height: 100dvh;
background: var(--nc-bg);
font-family: var(--nc-sans);
color: var(--nc-text);
position: relative;
}
.game-shell::before {
content: "";
position: fixed;
inset: 0;
background:
radial-gradient(ellipse 80% 50% at 20% 100%, rgba(212, 77, 74, 0.08), transparent 60%),
radial-gradient(ellipse 60% 40% at 90% 0%, rgba(74, 41, 98, 0.18), transparent 60%);
pointer-events: none;
z-index: 0;
}
:host-context(html:not([data-theme='dark'])) .game-shell::before {
background:
radial-gradient(ellipse 80% 50% at 20% 100%, rgba(192, 38, 211, 0.06), transparent 60%),
radial-gradient(ellipse 60% 40% at 90% 0%, rgba(120, 40, 180, 0.08), transparent 60%);
}
/* ============================================================
PAGE CONTAINER
============================================================ */
.page {
position: relative;
z-index: 1;
max-width: 1320px;
margin: 0 auto;
padding: 28px 32px 60px;
}
/* ============================================================
BREADCRUMB
============================================================ */
.crumb {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 18px;
font-family: var(--nc-mono);
font-size: 11px;
letter-spacing: 0.16em;
text-transform: uppercase;
}
.crumb-link {
color: var(--nc-text-dim);
text-decoration: none;
display: inline-flex;
align-items: center;
gap: 6px;
transition: color 0.15s;
}
.crumb-link:hover { color: var(--nc-neon); }
.crumb-sep { color: var(--nc-text-dim); opacity: 0.5; }
.crumb-current { color: var(--nc-text-muted); }
/* ============================================================
GAME HEADER
============================================================ */
.game-header {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 24px;
margin-bottom: 28px;
padding-bottom: 20px;
border-bottom: 1px solid var(--nc-border);
}
.game-title {
display: flex;
flex-direction: column;
gap: 8px;
}
.game-title h1 {
margin: 0;
font-size: 26px;
font-weight: 600;
letter-spacing: -0.01em;
color: var(--nc-text);
display: inline-flex;
align-items: center;
gap: 14px;
}
.tag-rated {
font-family: var(--nc-mono);
font-size: 10px;
letter-spacing: 0.22em;
color: var(--nc-neon);
border: 1px solid var(--nc-neon-soft);
padding: 4px 10px;
text-transform: uppercase;
}
.game-meta-strip {
display: flex;
align-items: center;
gap: 14px;
font-family: var(--nc-mono);
font-size: 11px;
color: var(--nc-text-dim);
letter-spacing: 0.06em;
}
.game-id {
display: inline-flex;
align-items: center;
gap: 6px;
color: var(--nc-text-muted);
}
.game-id strong { color: var(--nc-text); font-weight: 500; }
.meta-dot {
width: 3px;
height: 3px;
background: var(--nc-text-dim);
border-radius: 50%;
flex-shrink: 0;
}
.copy-btn {
background: transparent;
border: none;
color: var(--nc-text-dim);
cursor: pointer;
padding: 2px 4px;
display: inline-flex;
transition: color 0.15s;
}
.copy-btn:hover { color: var(--nc-neon); }
.header-actions { display: flex; gap: 8px; align-items: center; }
/* ============================================================
BUTTONS
============================================================ */
.btn {
font-family: var(--nc-sans);
font-size: 11px;
letter-spacing: 0.18em;
text-transform: uppercase;
font-weight: 600;
padding: 9px 14px;
cursor: pointer;
border: 1px solid var(--nc-border-strong);
background: var(--nc-btn-bg);
color: var(--nc-text);
display: inline-flex;
align-items: center;
gap: 6px;
transition: background 0.15s, border-color 0.15s;
}
.btn:hover {
background: var(--nc-btn-hover-bg);
border-color: var(--nc-text-muted);
}
.btn-primary {
background: var(--nc-neon) !important;
color: #fff !important;
border-color: var(--nc-neon) !important;
box-shadow: 0 0 14px rgba(255, 69, 200, 0.3);
font-weight: 700;
padding: 9px 14px;
flex-shrink: 0;
}
.btn-primary:hover { box-shadow: 0 0 20px rgba(255, 69, 200, 0.5); }
.btn-ghost {
background: transparent;
border: none;
color: var(--nc-text-muted);
padding: 8px 12px;
font-size: 12px;
letter-spacing: 0.04em;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 6px;
font-family: var(--nc-sans);
transition: color 0.15s;
}
.btn-ghost:hover { color: var(--nc-neon); }
/* ============================================================
STATE MESSAGES (loading / error)
============================================================ */
.state-message {
display: flex;
align-items: center;
gap: 10px;
padding: 20px;
font-family: var(--nc-mono);
font-size: 13px;
color: var(--nc-text-muted);
letter-spacing: 0.06em;
}
.state-error {
color: var(--nc-danger);
background: var(--nc-danger-bg);
border: 1px solid var(--nc-danger-soft);
}
/* ============================================================
COMPLETION BANNER
============================================================ */
.completion-banner {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 16px 20px;
margin-bottom: 24px;
background: rgba(255, 69, 200, 0.06);
border: 1px solid var(--nc-neon-soft);
animation: slideIn 0.35s ease-out;
}
@keyframes slideIn {
from { opacity: 0; transform: translateY(-10px); }
to { opacity: 1; transform: translateY(0); }
}
.completion-title { font-size: 16px; font-weight: 600; color: var(--nc-neon); }
.completion-link {
font-family: var(--nc-mono);
font-size: 11px;
letter-spacing: 0.14em;
text-transform: uppercase;
color: var(--nc-text-muted);
text-decoration: none;
border-bottom: 1px solid var(--nc-border-strong);
padding-bottom: 2px;
transition: color 0.15s, border-color 0.15s;
flex-shrink: 0;
}
.completion-link:hover { color: var(--nc-neon); border-color: var(--nc-neon-soft); }
/* ============================================================
MAIN GRID
============================================================ */
.layout {
display: grid;
grid-template-columns: minmax(0, 1fr) 340px;
gap: 28px;
align-items: start;
}
/* ============================================================
BOARD COLUMN
============================================================ */
.board-col {
display: flex;
flex-direction: column;
gap: 12px;
max-width: 520px;
width: 100%;
margin: 0 auto;
}
.status-strip {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 14px;
background: rgba(255, 69, 200, 0.05);
border: 1px solid rgba(255, 69, 200, 0.15);
font-size: 12px;
}
:host-context(html:not([data-theme='dark'])) .status-strip {
background: rgba(192, 38, 211, 0.04);
border-color: rgba(192, 38, 211, 0.18);
}
.status-left { display: inline-flex; align-items: center; gap: 10px; }
.status-pulse {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--nc-neon);
box-shadow: 0 0 6px var(--nc-neon);
animation: pulse 1.8s ease-in-out infinite;
flex-shrink: 0;
}
@keyframes pulse {
0%, 100% { opacity: 1; transform: scale(1); }
50% { opacity: 0.35; transform: scale(0.7); }
}
.status-text { font-weight: 500; color: var(--nc-text); letter-spacing: 0.02em; }
.status-side {
font-family: var(--nc-mono);
font-size: 10px;
letter-spacing: 0.14em;
color: var(--nc-text-dim);
}
/* container-type + aspect-ratio give cqw/cqh a defined size for the chess-board component */
.board-wrap {
container-type: size;
aspect-ratio: 1 / 1;
padding: 10px;
background: var(--nc-surface);
border: 1px solid var(--nc-border);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 69, 200, 0.06);
}
:host-context(html:not([data-theme='dark'])) .board-wrap {
box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1);
}
/* ============================================================
SIDE COLUMN
============================================================ */
.side { display: flex; flex-direction: column; gap: 12px; }
.side-card {
background: var(--nc-surface);
border: 1px solid var(--nc-border);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
}
.side-card-summary {
list-style: none;
cursor: pointer;
padding: 13px 16px;
display: flex;
align-items: center;
gap: 8px;
user-select: none;
}
.side-card-summary::-webkit-details-marker { display: none; }
.side-card-title {
font-size: 11px;
letter-spacing: 0.22em;
text-transform: uppercase;
color: var(--nc-text-muted);
font-weight: 600;
flex: 1;
}
.side-card-meta {
font-family: var(--nc-mono);
font-size: 10px;
color: var(--nc-text-dim);
letter-spacing: 0.08em;
}
.chev { color: var(--nc-text-dim); flex-shrink: 0; transition: transform 0.2s; }
.side-card[open] .chev { transform: rotate(180deg); }
.side-card[open] .side-card-summary { border-bottom: 1px solid var(--nc-border); }
.side-card-body {
padding: 14px 16px;
display: flex;
flex-direction: column;
gap: 10px;
}
/* ============================================================
UCI INPUT
============================================================ */
.uci-row { display: flex; gap: 6px; }
.uci-input {
flex: 1;
background: var(--nc-clock-bg);
border: 1px solid var(--nc-border);
color: var(--nc-text);
font-family: var(--nc-mono);
font-size: 13px;
padding: 9px 12px;
letter-spacing: 0.04em;
outline: none;
transition: border-color 0.15s;
}
.uci-input:focus { border-color: var(--nc-neon-soft); }
.uci-input::placeholder { color: var(--nc-text-dim); }
.uci-hint { margin: 0; font-size: 11px; color: var(--nc-text-dim); line-height: 1.4; }
/* ============================================================
BOARD DESIGN SEGMENTED CONTROL
============================================================ */
.seg {
display: flex;
border: 1px solid var(--nc-border);
padding: 2px;
background: var(--nc-seg-bg);
}
.seg-btn {
flex: 1;
background: transparent;
border: none;
color: var(--nc-text-muted);
padding: 7px 10px;
font-size: 11px;
font-family: var(--nc-sans);
letter-spacing: 0.08em;
cursor: pointer;
transition: background 0.15s, color 0.15s;
}
.seg-btn.active { background: var(--nc-neon); color: #fff; font-weight: 700; }
/* ============================================================
TOAST
============================================================ */
.toast {
position: fixed;
bottom: 24px;
left: 50%;
transform: translateX(-50%) translateY(20px);
background: var(--nc-surface-solid);
border: 1px solid var(--nc-neon-soft);
color: var(--nc-text);
padding: 10px 18px;
font-size: 12px;
font-family: var(--nc-mono);
letter-spacing: 0.08em;
z-index: 500;
opacity: 0;
transition: opacity 0.2s, transform 0.2s;
pointer-events: none;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
/* ============================================================
RESPONSIVE
============================================================ */
@media (max-width: 1100px) {
.layout { grid-template-columns: 1fr; }
.board-col { max-width: 560px; margin: 0 auto; }
}
@media (max-width: 640px) {
.page { padding: 16px 16px 48px; }
.game-header { flex-direction: column; align-items: flex-start; gap: 12px; }
.game-title h1 { font-size: 20px; }
}