chess-engine / static /css /board.css
Parv Thakar
Initial commit for HF Space
e719c90
Raw
History Blame Contribute Delete
11.9 kB
/* Premium Chess Engine Styles */
:root {
/* Light Mode Variables */
--bg-main: #f8fafc;
--bg-card: #ffffff;
--bg-hover: #f1f5f9;
--text-main: #0f172a;
--text-muted: #64748b;
--border-color: #e2e8f0;
--primary: #3b82f6;
--primary-hover: #2563eb;
--secondary: #64748b;
--secondary-hover: #475569;
--danger: #ef4444;
--danger-hover: #dc2626;
--success: #10b981;
--light-square: #f0d9b5;
--dark-square: #b58863;
--highlight: rgba(186, 202, 68, 0.7);
--last-move: rgba(170, 162, 58, 0.5);
--eval-white: #ffffff;
--eval-black: #333333;
}
[data-theme="dark"] {
/* Dark Mode Variables */
--bg-main: #0f172a;
--bg-card: #1e293b;
--bg-hover: #334155;
--text-main: #f8fafc;
--text-muted: #94a3b8;
--border-color: #334155;
--primary: #3b82f6;
--primary-hover: #60a5fa;
--light-square: #b0b2b5;
--dark-square: #5c6268;
--eval-white: #e2e8f0;
--eval-black: #1e293b;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', sans-serif;
background-color: var(--bg-main);
color: var(--text-main);
transition: background-color 0.3s, color 0.3s;
height: 100vh;
display: flex;
flex-direction: column;
}
/* Typography */
h1, h2, h3, h4 {
font-family: 'Outfit', sans-serif;
color: var(--text-main);
}
/* Navbar */
.navbar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 2rem;
background: var(--bg-card);
border-bottom: 1px solid var(--border-color);
}
.nav-brand {
font-family: 'Outfit', sans-serif;
font-weight: 700;
font-size: 1.5rem;
color: var(--primary);
}
.nav-links {
display: flex;
gap: 1rem;
}
.nav-btn {
background: none;
border: none;
padding: 0.5rem 1rem;
font-size: 1rem;
font-weight: 500;
color: var(--text-muted);
cursor: pointer;
border-radius: 6px;
transition: all 0.2s;
}
.nav-btn:hover, .nav-btn.active {
color: var(--primary);
background: var(--bg-hover);
}
.nav-controls {
display: flex;
gap: 0.5rem;
}
.icon-btn {
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
padding: 0.5rem;
border-radius: 50%;
color: var(--text-muted);
transition: background 0.2s;
}
.icon-btn:hover {
background: var(--bg-hover);
}
/* App Container */
.app-container {
flex: 1;
overflow-y: auto;
position: relative;
}
/* Views */
.view-section {
display: none;
padding: 2rem;
max-width: 1400px;
margin: 0 auto;
animation: fadeIn 0.3s ease;
}
.view-section.active {
display: block;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
/* Buttons */
.btn {
padding: 0.5rem 1rem;
border: none;
border-radius: 6px;
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
}
.btn-large {
padding: 1rem 2rem;
font-size: 1.1rem;
width: 100%;
margin-top: 1rem;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: var(--secondary-hover); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-hover); }
/* Home / New Game View */
.hero-container {
text-align: center;
max-width: 600px;
margin: 4rem auto;
}
.hero-title {
font-size: 3rem;
margin-bottom: 1rem;
}
.hero-subtitle {
color: var(--text-muted);
font-size: 1.2rem;
margin-bottom: 3rem;
}
.new-game-card {
background: var(--bg-card);
padding: 2rem;
border-radius: 12px;
border: 1px solid var(--border-color);
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.new-game-card h2 {
margin-bottom: 1.5rem;
}
.form-group {
margin-bottom: 1.5rem;
text-align: left;
}
.form-group label {
display: block;
margin-bottom: 0.5rem;
font-weight: 500;
color: var(--text-muted);
}
.form-group select {
width: 100%;
padding: 0.75rem;
border: 1px solid var(--border-color);
border-radius: 6px;
background: var(--bg-main);
color: var(--text-main);
font-size: 1rem;
}
/* Game Layout */
.game-layout {
display: grid;
grid-template-columns: 1fr 350px;
gap: 2rem;
align-items: start;
}
.board-area {
display: flex;
gap: 1rem;
justify-content: center;
}
/* Evaluation Bar */
.eval-bar-container {
width: 24px;
background-color: var(--eval-black);
border-radius: 4px;
overflow: hidden;
position: relative;
border: 1px solid var(--border-color);
display: flex;
flex-direction: column;
justify-content: flex-end;
}
.eval-fill {
background-color: var(--eval-white);
width: 100%;
height: 50%; /* 50% means 0.0 */
transition: height 0.5s ease;
}
.eval-text {
position: absolute;
width: 100%;
text-align: center;
font-size: 0.7rem;
font-weight: bold;
color: #888;
top: 50%;
transform: translateY(-50%);
mix-blend-mode: difference;
z-index: 10;
}
/* Chess Board */
.board-wrapper {
flex-grow: 1;
max-width: 800px;
position: relative;
}
.chess-board {
display: grid;
grid-template-columns: repeat(8, 1fr);
grid-template-rows: repeat(8, 1fr);
width: 100%;
aspect-ratio: 1;
border-radius: 4px;
overflow: hidden;
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}
.square {
display: flex;
justify-content: center;
align-items: center;
font-size: clamp(2rem, 6vw, 4.5rem);
cursor: pointer;
position: relative;
user-select: none;
transition: background-color 0.1s;
}
.square.light { background-color: var(--light-square); }
.square.dark { background-color: var(--dark-square); }
.square[data-color="black"] {
color: #000000;
}
.square[data-color="white"] {
color: var(--text-main);
}
.square.selected { background-color: var(--highlight) !important; }
.square.last-move { background-color: var(--last-move) !important; }
.square.legal-move::after {
content: '';
position: absolute;
width: 25%;
height: 25%;
background-color: rgba(0, 0, 0, 0.2);
border-radius: 50%;
}
.square.legal-move.has-piece::after {
width: 85%;
height: 85%;
background-color: transparent;
border: 6px solid rgba(0, 0, 0, 0.2);
border-radius: 50%;
box-sizing: border-box;
}
.board-labels {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
pointer-events: none;
}
.file-label, .rank-label {
position: absolute;
font-size: 12px;
font-weight: 600;
color: var(--text-muted);
}
.file-label { bottom: -20px; }
.rank-label { left: -20px; }
/* Sidebar */
.game-sidebar {
display: flex;
flex-direction: column;
gap: 1rem;
}
.sidebar-controls {
display: flex;
gap: 0.5rem;
}
.sidebar-controls .btn { flex: 1; }
.game-info-card, .move-history-card {
background: var(--bg-card);
padding: 1.5rem;
border-radius: 8px;
border: 1px solid var(--border-color);
}
.info-row {
display: flex;
justify-content: space-between;
padding: 0.5rem 0;
border-bottom: 1px solid var(--border-color);
}
.info-row span:first-child { color: var(--text-muted); }
.move-history-card { flex-grow: 1; }
.move-list {
max-height: 400px;
overflow-y: auto;
font-family: 'Inter', monospace;
font-size: 0.9rem;
margin-top: 1rem;
}
.move-pair {
display: flex;
padding: 0.3rem 0;
}
.move-number { width: 30px; color: var(--text-muted); }
.move { flex: 1; cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.move:hover { background: var(--bg-hover); }
/* Analysis Panel */
.analysis-panel {
margin-top: 2rem;
background: var(--bg-card);
padding: 2rem;
border-radius: 8px;
border: 1px solid var(--border-color);
}
.analysis-panel h3 { margin-bottom: 1.5rem; }
.analysis-summary {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 1rem;
margin-bottom: 2rem;
}
.summary-card, .profile-card {
background: var(--bg-main);
padding: 1.5rem;
border-radius: 8px;
text-align: center;
border: 1px solid var(--border-color);
}
.summary-label, .profile-label { display: block; color: var(--text-muted); margin-bottom: 0.5rem; }
.summary-value, .profile-value { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.analysis-details-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 2rem;
}
.move-analysis, .critical-moments-list {
max-height: 300px;
overflow-y: auto;
margin-top: 1rem;
}
.move-analysis-item {
display: flex;
justify-content: space-between;
padding: 0.5rem;
border-bottom: 1px solid var(--border-color);
cursor: pointer;
}
.move-analysis-item:hover { background: var(--bg-hover); }
.critical-moment {
padding: 1rem;
background: var(--bg-main);
border-left: 4px solid var(--danger);
margin-bottom: 0.5rem;
border-radius: 0 4px 4px 0;
}
/* Classification Colors */
.classification { padding: 2px 6px; border-radius: 4px; font-size: 0.8rem; font-weight: 600; }
.classification.best { background: var(--success); color: white; }
.classification.great { background: #2ecc71; color: white; }
.classification.good { background: #f1c40f; color: #333; }
.classification.inaccuracy { background: #f39c12; color: white; }
.classification.mistake { background: #e67e22; color: white; }
.classification.blunder { background: var(--danger); color: white; }
/* Profile View */
.profile-layout {
max-width: 1000px;
margin: 0 auto;
}
.profile-header {
text-align: center;
margin-bottom: 3rem;
}
.elo-badge {
display: inline-block;
background: linear-gradient(135deg, var(--primary), var(--primary-hover));
color: white;
font-size: 3rem;
font-weight: 700;
padding: 1rem 3rem;
border-radius: 50px;
margin-top: 1rem;
box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}
.profile-summary {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1.5rem;
margin-bottom: 3rem;
}
.profile-details-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1.5rem;
}
.profile-box {
background: var(--bg-card);
padding: 1.5rem;
border-radius: 8px;
border: 1px solid var(--border-color);
}
.profile-box h4 { margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-color); }
.strengths-list, .weaknesses-list, .recommendations-list { list-style: none; }
.strengths-list li { color: var(--success); margin-bottom: 0.5rem; }
.weaknesses-list li { color: var(--danger); margin-bottom: 0.5rem; }
.recommendations-list li { color: var(--text-muted); margin-bottom: 0.5rem; }
.hidden { display: none !important; }
/* Modal Styles */
.modal {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0, 0, 0, 0.6);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
}
.modal-content {
background: var(--bg-card);
padding: 2rem;
border-radius: 12px;
box-shadow: 0 10px 25px rgba(0,0,0,0.5);
border: 1px solid var(--border-color);
width: 90%;
max-width: 400px;
}
.text-center { text-align: center; }
.promo-btn:hover { background: var(--bg-hover) !important; transform: scale(1.05); }
/* Responsive */
@media (max-width: 900px) {
.game-layout { grid-template-columns: 1fr; }
.analysis-details-grid { grid-template-columns: 1fr; }
.profile-summary, .profile-details-grid { grid-template-columns: 1fr; }
.board-wrapper { max-width: 100%; }
}