/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header and Navigation */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.nav-brand i {
    margin-right: 0.5rem;
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #667eea;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Main Content */
.main {
    margin-top: 80px;
    padding-top: 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    color: white;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Analyzer Section */
.analyzer-section {
    background: white;
    margin: 2rem auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    padding: 3rem;
}

.analyzer-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
    font-size: 2.5rem;
}

/* Tabs */
.analyzer-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 1rem 2rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover,
.tab-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Main Layout for Side-by-Side */
.analyzer-main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    min-height: 70vh;
    padding: 1rem;
}

.chess-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.analysis-section {
    display: flex;
    flex-direction: column;
}

/* Chess Board */
.chess-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 80vw; /* Much bigger like Lichess - increased from 52vw to 80vw */
}

/* Board wrapper with coordinates */
.board-wrapper {
    position: relative;
    display: grid;
    grid-template-areas: 
        ". files ."
        "ranks board ."
        ". bottom-files .";
    grid-template-columns: 30px 1fr 30px;
    grid-template-rows: 30px 1fr 30px;
    align-items: center;
    justify-items: center;
    gap: 0;
    width: 100%;
    max-width: 80vw; /* Much bigger like Lichess - increased from 52vw to 80vw */
    aspect-ratio: 1.15; /* Increased aspect ratio to prevent cutoff */
    min-height: 600px; /* Increased minimum height for bigger board */
}

.board-files {
    grid-area: files;
    display: flex;
    justify-content: space-around;
    width: 100%;
    height: 30px;
}

.board-files.bottom {
    grid-area: bottom-files;
}

.board-ranks {
    grid-area: ranks;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 100%;
    width: 30px;
}

.board-ranks.right {
    position: absolute;
    right: -30px;
    top: 0;
    height: 400px;
    display: none;
    flex-direction: column;
    justify-content: space-around;
}

.file-coord, .rank-coord {
    color: #000;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    min-width: 20px; /* Ensure minimum width for readability */
    min-height: 20px; /* Ensure minimum height for readability */
}

.chess-board {
    grid-area: board;
    width: 100%;
    height: 100%;
    max-width: 600px; /* Much bigger like Lichess - increased from 400px to 600px */
    max-height: 600px; /* Much bigger like Lichess - increased from 400px to 600px */
    min-height: 400px; /* Ensure minimum size for visibility */
    border-radius: 12px;
    overflow: visible; /* Changed from hidden to visible to prevent cutoff */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Hide internal coordinates/notations from chessboard.js */
.chess-board .square-label,
.chess-board .notation,
.chess-board [class*="notation"],
.chess-board [class*="coordinate"],
.chess-board .square-label,
.chess-board .square-label *,
.chess-board [class*="label"],
.chess-board [class*="coord"],
.chess-board .square-notation,
.chess-board .square-coordinate,
.chess-board .notation-label,
.chess-board .coordinate-label,
.chess-board .file-label,
.chess-board .rank-label,
.chess-board .square[data-square]::before,
.chess-board .square[data-square]::after,
.chess-board .square > span,
.chess-board .square > div,
.chess-board .square > *:not(.piece),
.chess-board [class*="number"],
.chess-board [class*="digit"],
.chess-board .square[data-square] > *:not(.piece),
.chess-board .square[data-square] > span,
.chess-board .square[data-square] > div {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Move highlighting styles */
.move-highlight {
    position: absolute;
    width: 50px; /* Will be set dynamically in JavaScript */
    height: 50px;
    border: 3px solid #667eea;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.3);
    pointer-events: none;
    z-index: 500; /* Lower z-index to appear behind pieces */
    animation: pulse 2s infinite;
}

.move-highlight.source {
    border-color: #51cf66;
    background: rgba(81, 207, 102, 0.3);
}

.move-highlight.destination {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.3);
}

/* Variant highlight colors when Black is to move */
.move-highlight.for-black.source {
    border-color: #339af0; /* blue */
    background: rgba(51, 154, 240, 0.3);
}

.move-highlight.for-black.destination {
    border-color: #f03e3e; /* darker red */
    background: rgba(240, 62, 62, 0.3);
}

/* Light yellow shading for source square */
.move-highlight.source-shade {
    border: none;
    background: rgba(255, 255, 0, 0.3);
    border-radius: 0;
    animation: none;
    z-index: 999;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

/* Color selection styling */
.color-selection {
    margin: 1rem 0;
    text-align: center;
}

.color-selection-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.color-options {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.8);
}

.color-option:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
}

.color-option input[type="radio"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

.color-option:has(input[type="radio"]:checked) {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    color: #667eea;
    font-weight: 600;
}

.color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #333;
    display: inline-block;
}

.color-indicator.white {
    background: #fff;
    border-color: #666;
}

.color-indicator.black {
    background: #333;
    border-color: #333;
}

.board-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Upload Area */
.upload-container {
    max-width: 500px;
    margin: 0 auto;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    background: rgba(102, 126, 234, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #764ba2;
    background: rgba(118, 75, 162, 0.05);
}

.upload-area i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.upload-area h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.upload-area p {
    color: #666;
    margin-bottom: 1rem;
}

.upload-preview {
    text-align: center;
}

.upload-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.upload-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* FEN Input */
.fen-container {
    max-width: 600px;
    margin: 0 auto;
}

.fen-input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fen-input-group label {
    font-weight: 600;
    color: #333;
}

.fen-input-group input {
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.fen-input-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* Analysis Results */
.analysis-results {
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
}

.analysis-results h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
    font-size: 2rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.result-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.result-card h4 {
    color: #333;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-content,
.move-content,
.eval-content,
.moves-content {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Next Move Display Styles */
.next-move-content {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    margin-top: 0.5rem;
}

.next-move-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.next-move-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.move-notation {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.move-description {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    line-height: 1.4;
    margin-top: 0.25rem;
    padding: 0.5rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
    border-left: 3px solid #667eea;
}

.next-move-eval {
    font-size: 1.2rem;
    font-weight: 600;
}

.eval-score {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: bold;
}

.next-move-engine {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.engine-name {
    background: #f0f0f0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

/* Features Section */
.features-section {
    background: white;
    padding: 4rem 0;
    margin: 2rem 0;
}

.features-section h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: #333;
    font-size: 2.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    background: #f8f9fa;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: #333;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* Pricing Section */
.pricing-section {
    background: white;
    padding: 4rem 0;
    margin: 2rem 0;
}

.pricing-section h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: #333;
    font-size: 2.5rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.pricing-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border: 2px solid transparent;
}

.pricing-card:hover {
    transform: translateY(-5px);
}

.pricing-card.featured {
    border-color: #667eea;
    transform: scale(1.05);
}

.pricing-header {
    text-align: center;
    margin-bottom: 2rem;
}

.pricing-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.price {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
}

.price span {
    font-size: 1rem;
    color: #666;
}

.pricing-features {
    list-style: none;
    margin-bottom: 2rem;
}

.pricing-features li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pricing-features i.fa-check {
    color: #28a745;
}

.pricing-features i.fa-times {
    color: #dc3545;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #333;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.error-message {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Footer */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .analyzer-section {
        margin: 1rem;
        padding: 2rem;
    }
    
    .chess-board {
        width: 300px;
        height: 300px;
    }
    
    .analyzer-tabs {
        flex-direction: column;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid,
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-card.featured {
        transform: none;
    }
}

/* Contact Section */
.contact-section {
    background: white;
    padding: 4rem 0;
    margin: 2rem 0;
}

.contact-section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 2rem;
}

.contact-form {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.contact-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 2rem;
}

.contact-form textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    resize: vertical;
}

.contact-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

@media (max-width: 768px) {
    .contact-form .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .chess-board {
        width: 250px;
        height: 250px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .analyzer-section {
        padding: 1rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Messages */
.message {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-weight: 600;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Analysis Panel Styles */
.analysis-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    height: fit-content;
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Analysis Messages Area */
.analysis-messages {
    padding: 0 1.5rem;
    min-height: auto;
}

.analysis-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: 12px 12px 0 0;
}

.analysis-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.analysis-header i {
    margin-right: 0.5rem;
}

.analysis-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    max-height: calc(70vh - 80px);
}

.analysis-placeholder {
    text-align: center;
    color: #666;
    padding: 2rem;
}

.analysis-placeholder i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 1rem;
    display: block;
}

.analysis-placeholder p {
    margin: 0;
    font-size: 1rem;
}

/* Analysis Results Styles */
.analysis-results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.position-status, .best-move, .no-moves {
    background: rgba(246, 248, 250, 0.8);
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid #667eea;
}

.position-status h4, .best-move h4, .no-moves h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
}

.position-status h4 i, .best-move h4 i, .no-moves h4 i {
    margin-right: 0.5rem;
    color: #667eea;
}

.status-text {
    margin: 0;
    color: #666;
    font-weight: 500;
}

.move-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.move-notation {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.move-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 2px solid #dee2e6;
}

.move-type {
    font-size: 0.8rem;
    font-weight: bold;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.move-type.checkmate {
    background: #ffe6e6;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.move-type.check {
    background: #fff3cd;
    color: #f39c12;
    border: 1px solid #f39c12;
}

.move-type.capture {
    background: #fff0e6;
    color: #e67e22;
    border: 1px solid #e67e22;
}

.move-description {
    color: #555;
    font-style: italic;
    line-height: 1.4;
}

.move-details {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.evaluation {
    background: #e8f4f8;
    color: #2c3e50;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.engine {
    background: #f0f0f0;
    color: #666;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .analyzer-main-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chess-container {
        max-width: 90vw; /* Much bigger like Lichess - increased from 78vw to 90vw */
    }
    
   .board-wrapper {
        max-width: 90vw; /* Much bigger like Lichess - increased from 78vw to 90vw */
        grid-template-columns: 35px 1fr 35px; /* Increased coordinate areas for better spacing */
        grid-template-rows: 35px 1fr 35px; /* Increased coordinate areas for better spacing */
        min-height: 450px; /* Increased for better board visibility */
        aspect-ratio: 1.15; /* Adjusted aspect ratio for smaller screens */
        width: auto;
    }
    
    .board-files {
        height: 35px; /* Match grid template for better spacing */
    }
    
    .board-ranks {
        width: 35px; /* Match grid template for better spacing */
    }
    
    .chess-board {
        min-height: 350px; /* Ensure minimum board size on smaller screens */
        max-height: 500px; /* Prevent excessive height */
    }
    
    .file-coord, .rank-coord {
        width: 35px; /* Match grid template for better spacing */
        height: 35px; /* Match grid template for better spacing */
        font-size: 14px; /* Slightly larger font for readability */
    }
}

@media (max-width: 768px) {
    .analyzer-main-layout {
        padding: 0.5rem;
        min-height: auto;
    }
    
    .chess-container {
        max-width: 90vw;
    }
    
    .board-wrapper {
        max-width: 90vw;
        grid-template-columns: 20px 1fr 20px; /* Even smaller coordinate areas */
        grid-template-rows: 20px 1fr 20px; /* Even smaller coordinate areas */
        min-height: 300px; /* Ensure adequate height for mobile */
        aspect-ratio: 1.25; /* Adjusted aspect ratio for mobile */
        width: auto;
    }
    
    .board-files {
        height: 20px; /* Smaller height for coordinates */
    }
    
    .board-ranks {
        width: 20px; /* Smaller width for coordinates */
    }
    
    .chess-board {
        min-height: 280px; /* Ensure minimum board size on mobile */
        max-height: 400px; /* Prevent excessive height on mobile */
    }
    
    .file-coord, .rank-coord {
        width: 20px; /* Smaller coordinate size */
        height: 20px; /* Smaller coordinate size */
        font-size: 10px; /* Smaller font size */
    }
    
    .analysis-panel {
        max-height: 50vh;
    }
    
    .analysis-content {
        max-height: calc(50vh - 80px);
        padding: 1rem;
    }
} 