        @font-face {
            font-family: 'Chess Merida Unicode';
            src: url('chess_merida_unicode.ttf') format('truetype');
        }
        body {
            font-family: Arial, sans-serif;
            background-color: #f0f0f0;
            margin: 0;
            padding: 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        .page-title {
            text-align: center;
            margin-bottom: 20px;
        }
        .chess-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 5px;
            max-width: 720px; /* Adjust based on your needs */
        }
        .chess-container {
            background-color: #fff;
            border-radius: 8px;
            padding: 10px;
        }
        .board-wrapper {
            display: flex;
            align-items: center;
        }
        .chessboard {
            width: 200px;
            height: 200px;
            display: grid;
            grid-template-columns: repeat(8, 1fr);
            grid-template-rows: repeat(8, 1fr);
            font-family: 'Chess Merida Unicode', sans-serif;
            border: 2px solid #333;
        }
        .square {
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 20px;
        }
        .white { background-color: #ffffff; }
        .black { background-color: #bbbbbb; }
        .coordinates {
            font-family: Arial, sans-serif;
            font-size: 12px;
            color: #666;
        }
        .file-coords { 
            position: relative;
            width: 200px;
            height: 15px;
            margin-top: 2px;
        }
        .file-coords span {
            position: absolute;
            width: 25px;
            text-align: center;
        }
        .rank-coords {
            display: flex;
            flex-direction: column-reverse;
            justify-content: space-around;
            height: 200px;
            margin-right: 2px;
        }

        .result-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 10px;
        }

        .result-text {
            text-align: left;
            font-weight: bold;
            color: #333;
        }

        #openPopupBtn {
            display: block;
            padding: 5px 20px;
            font-size: 16px;
            background-color: black;;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        #openPopupBtn:hover {
            background-color: #bbbbbb;
            color: black;
        }

        .button-container {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin: 7px 0;
        }

        .button-container button {
            display: block;
            padding: 5px 20px;
            font-size: 16px;
            background-color: black;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        .button-container button:hover {
            background-color: #bbbbbb;
            color: black;
        }

        #printBtn {
            display: block;
            padding: 5px 20px;
            font-size: 16px;
            background-color: black;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        #printBtn:hover {
            background-color: #bbbbbb;
            color: black;
        }

        @media print {
            body {
                background-color: white;
                padding: 0;
            }
            .chess-grid {
                page-break-inside: avoid;
            }
            .chess-container {
                box-shadow: none;
                border: 1px solid #bbbbbb;
            }

            .moves-container {
                box-shadow: none;
                border: 1px solid #bbbbbb;
            }

            .input-container {
                box-shadow: none;
                border: 1px solid #bbbbbb;
            }

            .follow-number-container {
                box-shadow: none;
                border: 1px solid #bbbbbb;
            }

            #openPopupBtn, #printBtn, #decreaseStartBtn, #increaseStartBtn, footer {
                display: none;
            }
        }
        #dynamic-title {
            text-align: center;
            font-size: 24px;
            font-weight: bold;
            margin-bottom: 10px;
            font-variant-caps: small-caps;
        }
        .popup {
            display: none;
            position: fixed;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
            z-index: 1000;
        }
        
        .popup-content {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            background-color: #fff;
            padding: 30px;
            border-radius: 8px;
            max-width: 600px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        
        .popup-content h2 {
            margin-top: 0;
            margin-bottom: 20px;
            text-align: center;
            color: black;
        }
        
        .popup-content h3 {
            margin-top: 20px;
            margin-bottom: 10px;
            color: black;
        }
        .popup-row {
            margin-bottom: 15px;
            display: flex;
            align-items: center;
        }
        .popup-row input {
            flex-grow: 1;
            margin-right: 10px;
            margin-left: 10px;
            padding: 5px;
            border: 1px solid #ccc;
            border-radius: 4px;
        }
        .popup-row select {
            width: 150px;
            padding: 5px;
            border: 1px solid #ccc;
            border-radius: 4px;
        }
        #title-input {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 20px;
            width: 100%;
        }
        .close-btn {
            position: absolute;
            top: 10px;
            right: 15px;
            font-size: 24px;
            cursor: pointer;
            color: #999;
        }
        .close-btn:hover {
            color: #333;
        }
        .update-btn {
            display: block;
            width: 100%;
            padding: 10px;
            background-color: black;
            color: white;
            border: none;
            border-radius: 4px;
            font-size: 16px;
            cursor: pointer;
            transition: background-color 0.3s;
        }
        
        .update-btn:hover {
            background-color: #999;
            color: black;
        }

        .move-indicator {
            width: 15px;
            height: 15px;
            border: 1px solid #000;
        }

        .white-to-move {
            background-color: #fff;
        }

        .black-to-move {
            background-color: #000;
        }
    
        .chess-and-moves-container {
            display: flex;
            flex-direction: column;
            margin-bottom: 5px;
        }
        .moves-container {
            background-color: #fff;
            border-radius: 8px;
            padding: 10px;
            margin-top: 5px;
            position: relative;
        }

        .follow-number-container {
            text-align: center;
            margin-bottom: 5px;
            background-color: #fff;
            border-radius: 8px;
            padding: 5px;
            position: relative;
        }
        
        .follow-number {
         /*    position: absolute;
            top: 5px;
            left: 10px; */
            font-weight: bold;
            font-size: 14px;
        }
        .moves-table {
            width: 100%;
            border-collapse: collapse;
        }
        .moves-table th, .moves-table td {
            border: 1px solid #ddd;
            padding: 2px 5px;
            height: 25px;
            text-align: center;
        }
        .moves-table th {
            background-color: black;
            color: white;
        }
        .moves-table .move-number {
            width: 30px;
            text-align: right;
            font-weight: bold;
        }
        .moves-table .move {
            width: 50%;
        }

        .fen-section, .pgn-upload-section {
            margin-bottom: 20px;
        }
        
        .fen-input-row {
            display: flex;
            align-items: center;
            margin-bottom: 20px;
        }
        
        .fen-input-row input[type="text"] {
            border: 1px solid black;
            height: 20px;
            flex-grow: 1;
            margin-right: 10px;
            margin-left: 10px;
        }
        
        .fen-input-row input[type="number"] {
            border: 1px solid black;
            height: 20px;
            margin-left: 10px;
            width: 40px;
        }

        .fen-input-row select {
            width: 150px;
            font-size: 16px;
            border: 1px solid black;
            height: 25px;
        }

        .file-upload-label {
            display: inline-block;
            padding: 8px 12px;
            background-color: #f0f0f0;
            color: #333;
            border: 1px solid #ccc;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
        }
        
        .file-upload-label:hover {
            background-color: #e0e0e0;
        }
        
        #pgn-upload {
            display: none;
        }      

        .input-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            max-width: 690px;
            width: 100%;
            background-color: #fff;
            border-radius: 8px;
            padding: 5px;
            margin-top: 5px;
        }

        .input-group {
            display: flex;
            align-items: center;
        }

        .input-group label {
            margin-right: 10px;
            font-weight: bold;
            color: black;
        }

        .input-group input[type="text"] {
            padding: 5px;
            border: 1px solid black;
            border-radius: 4px;
            font-size: 14px;
        }

        #name-input {
            width: 200px;
        }

        #score-input {
            width: 50px;
        }

        footer {
            color: black;
            text-align: center;
            font-style: italic;
            font-size: 12px;
            margin-top: -10px;
        }

        .print-footer {
            position: fixed;
            bottom: 0;
            width: 100%;
            text-align: center;
            font-size: 12px;
            color: black;
        }