/* ============================================================
   chess.css - ШАХМАТЫ С ДРАКОНАМИ
   Версия: 5.2 - АДАПТИВНОСТЬ ДЛЯ 4K
   ============================================================ */

/* ============================================================
   ОСНОВНЫЕ СТИЛИ
   ============================================================ */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: #1a1a1a;
    min-height: 100vh;
}

.game-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    padding: 16px;
    background: #1a1a1a;
}

.game-container {
    background: #2a2a2a;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    transition: all 0.3s ease;
}

.board-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.board-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0 2px;
}

.board-controls .game-title {
    color: #eee;
    font-weight: 300;
    letter-spacing: 2px;
    font-size: 18px;
    margin: 0;
    flex: 1;
    white-space: nowrap;
}

.board-controls .btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-fullscreen {
    padding: 6px 14px;
    background: #2a4a6a;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 4px;
    touch-action: manipulation;
}

.btn-fullscreen:hover { background: #3a6a8a; }
.btn-fullscreen:active { 
    background: #1a3a5a;
    transform: scale(0.97);
}

.btn-fullscreen.fullscreen-active {
    background: #6a2a2a;
}

.btn-fullscreen.fullscreen-active:hover {
    background: #8a3a3a;
}

.btn-fullscreen .fullscreen-icon {
    font-size: 16px;
}

.btn-fullscreen .fullscreen-label {
    font-size: 11px;
    font-weight: normal;
}

.btn-reset {
    padding: 6px 16px;
    background: #4a3728;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.btn-reset:hover { background: #5c4a3a; }
.btn-reset:active { 
    background: #3a2718;
    transform: scale(0.97);
}

.table-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: auto;
}

table {
    border-collapse: collapse;
    border: 3px solid #4a3728;
    table-layout: fixed;
    margin: 0 auto;
}

td {
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    max-width: 46px;
    max-height: 46px;
    text-align: center;
    vertical-align: middle;
    font-weight: bold;
    border: 1px solid #3a3a3a;
    position: relative;
    cursor: pointer;
    padding: 0;
    font-size: 28px;
    line-height: 46px;
    overflow: hidden;
    transition: background 0.1s ease;
    touch-action: manipulation;
}

td span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: inherit;
    line-height: 1;
    transition: none;
    pointer-events: none;
}

/* ============================================================
   ЦВЕТА КЛЕТОК
   ============================================================ */
.light {
    background: #f0d9b5 !important;
}

.dark {
    background: #b58863 !important;
}

.hidden {
    background: #1a1a1a !important;
    border: 1px solid #2a2a2a;
    cursor: default;
    color: #2a2a2a;
}

.hidden span {
    font-size: 14px !important;
    color: #2a2a2a;
}

.revealed {
    background: #4a7a4a !important;
    border: 2px solid #7aff7a !important;
}

.revealed.light {
    background: #5a8a5a !important;
}

.revealed.dark {
    background: #3a6a3a !important;
}

td.coord {
    background: #2c2c2c !important;
    color: #aaa;
    border: none;
    cursor: default;
    width: 18px;
    height: 46px;
    min-width: 18px;
    min-height: 46px;
    max-width: 18px;
    max-height: 46px;
    font-size: 10px;
    line-height: 46px;
    padding: 0;
    font-weight: normal;
    text-align: center;
    pointer-events: none;
}

td.coord-left { text-align: right; padding-right: 3px; width: 16px; min-width: 16px; max-width: 16px; font-size: 9px; }
td.coord-right { text-align: left; padding-left: 3px; width: 16px; min-width: 16px; max-width: 16px; font-size: 9px; }
td.coord-top, td.coord-bottom { height: 18px; min-height: 18px; max-height: 18px; font-size: 9px; line-height: 18px; width: 46px; min-width: 46px; max-width: 46px; }

/* ============================================================
   ВЫДЕЛЕНИЯ
   ============================================================ */
.selected {
    background: #ffd700 !important;
    box-shadow: inset 0 0 15px rgba(255,215,0,0.5);
    z-index: 2;
}

.legal-move::after {
    content: "●";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: rgba(0,255,0,0.6);
    pointer-events: none;
}

.legal-capture {
    background: rgba(255,0,0,0.25) !important;
    box-shadow: inset 0 0 15px rgba(255,0,0,0.2);
}

.legal-reveal {
    background: rgba(0,255,0,0.25) !important;
    box-shadow: inset 0 0 20px rgba(0,255,0,0.3);
}

.check-king {
    background: rgba(255,0,0,0.45) !important;
    box-shadow: inset 0 0 15px rgba(255,0,0,0.3);
}

/* ============================================================
   ЦВЕТА ФИГУР
   ============================================================ */
.piece-white {
    color: #ffffff !important;
    text-shadow: 
        0 0 3px rgba(0,0,0,0.95),
        0 0 6px rgba(0,0,0,0.8),
        0 0 12px rgba(0,0,0,0.6),
        0 1px 3px rgba(0,0,0,0.9),
        0 2px 6px rgba(0,0,0,0.5) !important;
}

.piece-black,
.piece-black.pawn-symbol,
.piece-black span,
td .piece-black,
td .piece-black.pawn-symbol {
    color: #0a0a0a !important;
    text-shadow: 
        0 0 3px rgba(255,255,255,0.98),
        0 0 6px rgba(255,255,255,0.9),
        0 0 12px rgba(255,255,255,0.7),
        0 1px 3px rgba(255,255,255,0.95),
        0 2px 6px rgba(255,255,255,0.5) !important;
}

.pawn-symbol {
    color: inherit !important;
}

.dragon {
    font-size: 28px;
    line-height: 1;
}

.dragon span {
    font-size: 28px !important;
    line-height: 1;
}

.dragon-white {
    color: #ffffff !important;
    text-shadow: 
        0 0 3px rgba(0,0,0,0.95),
        0 0 6px rgba(0,0,0,0.8),
        0 0 12px rgba(0,0,0,0.6),
        0 1px 3px rgba(0,0,0,0.9),
        0 0 20px rgba(255,200,50,0.15) !important;
}

.dragon-black {
    color: #0a0a0a !important;
    text-shadow: 
        0 0 3px rgba(255,255,255,0.98),
        0 0 6px rgba(255,255,255,0.9),
        0 0 12px rgba(255,255,255,0.7),
        0 1px 3px rgba(255,255,255,0.95) !important;
}

/* ============================================================
   ИСТОРИЯ ХОДОВ
   ============================================================ */
.move-history {
    max-height: 120px;
    overflow-y: auto;
    font-family: monospace;
    margin-top: 10px;
    padding: 6px;
    background: #1a1a1a;
    border-radius: 4px;
    width: 100%;
    max-width: 500px;
    font-size: 10px;
}

.move-history div { 
    padding: 2px 0; 
    border-bottom: 1px solid #333;
    font-size: 10px;
    color: #aaa;
}

.move-history .checkmate { color: #ffd700; font-weight: bold; }
.move-history .stalemate { color: #ff6b6b; font-weight: bold; }
.move-history .check { color: #ff6b6b; font-weight: bold; }

.move-history::-webkit-scrollbar { width: 3px; }
.move-history::-webkit-scrollbar-track { background: #1a1a1a; }
.move-history::-webkit-scrollbar-thumb { background: #4a3728; border-radius: 2px; }

/* ============================================================
   ПОЛНОЭКРАННЫЙ РЕЖИМ
   ============================================================ */
.fullscreen-mode .game-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    padding: 10px !important;
    z-index: 9999 !important;
    background: #1a1a1a !important;
    min-height: 100vh !important;
}

.fullscreen-mode .game-container {
    border-radius: 0 !important;
    background: #1a1a1a !important;
    box-shadow: none !important;
    padding: 10px !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    width: 100% !important;
    height: 100% !important;
}

.fullscreen-mode td {
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    max-width: 52px;
    max-height: 52px;
    font-size: 32px;
    line-height: 52px;
}

.fullscreen-mode .dragon { font-size: 32px; }
.fullscreen-mode .dragon span { font-size: 32px !important; }
.fullscreen-mode td.coord {
    height: 52px;
    line-height: 52px;
    font-size: 11px;
}
.fullscreen-mode td.coord-top,
.fullscreen-mode td.coord-bottom {
    height: 22px;
    min-height: 22px;
    max-height: 22px;
    font-size: 10px;
    line-height: 22px;
    width: 52px;
    min-width: 52px;
    max-width: 52px;
}
.fullscreen-mode td.coord-left,
.fullscreen-mode td.coord-right {
    width: 20px;
    min-width: 20px;
    max-width: 20px;
    font-size: 10px;
}
.fullscreen-mode .board-controls .game-title {
    font-size: 20px;
}

/* ============================================================
   ⭐ 4K ЭКРАНЫ (3840x2160 и выше)
   ============================================================ */
@media (min-width: 2560px) {
    .game-wrapper {
        padding: 32px;
    }
    
    .game-container {
        padding: 32px;
        border-radius: 20px;
        max-width: 90vw;
        box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    }
    
    td {
        width: 72px;
        height: 72px;
        min-width: 72px;
        min-height: 72px;
        max-width: 72px;
        max-height: 72px;
        font-size: 44px;
        line-height: 72px;
        border-width: 1.5px;
    }
    
    td.coord {
        height: 72px;
        line-height: 72px;
        font-size: 16px;
        min-width: 28px;
        max-width: 28px;
    }
    
    td.coord-left {
        width: 28px;
        min-width: 28px;
        max-width: 28px;
        font-size: 16px;
        padding-right: 6px;
    }
    
    td.coord-right {
        width: 28px;
        min-width: 28px;
        max-width: 28px;
        font-size: 16px;
        padding-left: 6px;
    }
    
    td.coord-top, td.coord-bottom {
        height: 28px;
        min-height: 28px;
        max-height: 28px;
        font-size: 14px;
        line-height: 28px;
        width: 72px;
        min-width: 72px;
        max-width: 72px;
    }
    
    .dragon { font-size: 44px; }
    .dragon span { font-size: 44px !important; }
    
    .hidden span { font-size: 22px !important; }
    
    .legal-move::after { font-size: 18px; }
    .legal-capture { background: rgba(255,0,0,0.3) !important; }
    .legal-reveal { background: rgba(0,255,0,0.3) !important; }
    .selected { box-shadow: inset 0 0 30px rgba(255,215,0,0.6); }
    .check-king { background: rgba(255,0,0,0.55) !important; }
    
    .board-controls .game-title {
        font-size: 32px;
        letter-spacing: 4px;
    }
    
    .btn-fullscreen {
        padding: 12px 28px;
        font-size: 22px;
        border-radius: 8px;
    }
    
    .btn-fullscreen .fullscreen-icon { font-size: 22px; }
    .btn-fullscreen .fullscreen-label { font-size: 16px; }
    
    .btn-reset {
        padding: 12px 28px;
        font-size: 18px;
        border-radius: 8px;
    }
    
    .move-history {
        max-height: 200px;
        font-size: 16px;
        max-width: 800px;
        padding: 12px 16px;
        border-radius: 8px;
    }
    
    .move-history div {
        font-size: 16px;
        padding: 4px 0;
    }
    
    .piece-white {
        text-shadow: 
            0 0 6px rgba(0,0,0,0.95),
            0 0 12px rgba(0,0,0,0.8),
            0 0 24px rgba(0,0,0,0.6),
            0 2px 6px rgba(0,0,0,0.9),
            0 4px 12px rgba(0,0,0,0.5) !important;
    }
    
    .piece-black,
    .piece-black.pawn-symbol,
    .piece-black span,
    td .piece-black,
    td .piece-black.pawn-symbol {
        text-shadow: 
            0 0 6px rgba(255,255,255,0.98),
            0 0 12px rgba(255,255,255,0.9),
            0 0 24px rgba(255,255,255,0.7),
            0 2px 6px rgba(255,255,255,0.95),
            0 4px 12px rgba(255,255,255,0.5) !important;
    }
    
    .dragon-white {
        text-shadow: 
            0 0 6px rgba(0,0,0,0.95),
            0 0 12px rgba(0,0,0,0.8),
            0 0 24px rgba(0,0,0,0.6),
            0 2px 6px rgba(0,0,0,0.9),
            0 0 40px rgba(255,200,50,0.2) !important;
    }
    
    .dragon-black {
        text-shadow: 
            0 0 6px rgba(255,255,255,0.98),
            0 0 12px rgba(255,255,255,0.9),
            0 0 24px rgba(255,255,255,0.7),
            0 2px 6px rgba(255,255,255,0.95) !important;
    }

    .fullscreen-mode td {
        width: 80px;
        height: 80px;
        min-width: 80px;
        min-height: 80px;
        max-width: 80px;
        max-height: 80px;
        font-size: 48px;
        line-height: 80px;
    }
    
    .fullscreen-mode .dragon { font-size: 48px; }
    .fullscreen-mode .dragon span { font-size: 48px !important; }
    
    .fullscreen-mode td.coord {
        height: 80px;
        line-height: 80px;
        font-size: 18px;
        min-width: 32px;
        max-width: 32px;
    }
    
    .fullscreen-mode td.coord-left,
    .fullscreen-mode td.coord-right {
        width: 32px;
        min-width: 32px;
        max-width: 32px;
        font-size: 16px;
    }
    
    .fullscreen-mode td.coord-top,
    .fullscreen-mode td.coord-bottom {
        height: 32px;
        min-height: 32px;
        max-height: 32px;
        font-size: 14px;
        line-height: 32px;
        width: 80px;
        min-width: 80px;
        max-width: 80px;
    }
    
    .fullscreen-mode .board-controls .game-title {
        font-size: 32px;
    }
}

/* ============================================================
   5K+ ЭКРАНЫ (5120x2880 и выше)
   ============================================================ */
@media (min-width: 3840px) {
    td {
        width: 100px;
        height: 100px;
        min-width: 100px;
        min-height: 100px;
        max-width: 100px;
        max-height: 100px;
        font-size: 60px;
        line-height: 100px;
        border-width: 2px;
    }
    
    td.coord {
        height: 100px;
        line-height: 100px;
        font-size: 20px;
        min-width: 36px;
        max-width: 36px;
    }
    
    td.coord-left {
        width: 36px;
        min-width: 36px;
        max-width: 36px;
        font-size: 20px;
        padding-right: 8px;
    }
    
    td.coord-right {
        width: 36px;
        min-width: 36px;
        max-width: 36px;
        font-size: 20px;
        padding-left: 8px;
    }
    
    td.coord-top, td.coord-bottom {
        height: 36px;
        min-height: 36px;
        max-height: 36px;
        font-size: 18px;
        line-height: 36px;
        width: 100px;
        min-width: 100px;
        max-width: 100px;
    }
    
    .dragon { font-size: 60px; }
    .dragon span { font-size: 60px !important; }
    
    .hidden span { font-size: 30px !important; }
    
    .legal-move::after { font-size: 24px; }
    
    .board-controls .game-title {
        font-size: 40px;
        letter-spacing: 6px;
    }
    
    .btn-fullscreen {
        padding: 16px 36px;
        font-size: 28px;
        border-radius: 10px;
    }
    
    .btn-fullscreen .fullscreen-icon { font-size: 28px; }
    .btn-fullscreen .fullscreen-label { font-size: 20px; }
    
    .btn-reset {
        padding: 16px 36px;
        font-size: 24px;
        border-radius: 10px;
    }
    
    .move-history {
        max-height: 250px;
        font-size: 20px;
        max-width: 1000px;
        padding: 16px 20px;
    }
    
    .move-history div {
        font-size: 20px;
        padding: 6px 0;
    }

    .fullscreen-mode td {
        width: 110px;
        height: 110px;
        min-width: 110px;
        min-height: 110px;
        max-width: 110px;
        max-height: 110px;
        font-size: 64px;
        line-height: 110px;
    }
    
    .fullscreen-mode .dragon { font-size: 64px; }
    .fullscreen-mode .dragon span { font-size: 64px !important; }
    
    .fullscreen-mode td.coord {
        height: 110px;
        line-height: 110px;
        font-size: 22px;
        min-width: 40px;
        max-width: 40px;
    }
    
    .fullscreen-mode td.coord-left,
    .fullscreen-mode td.coord-right {
        width: 40px;
        min-width: 40px;
        max-width: 40px;
        font-size: 20px;
    }
    
    .fullscreen-mode td.coord-top,
    .fullscreen-mode td.coord-bottom {
        height: 40px;
        min-height: 40px;
        max-height: 40px;
        font-size: 18px;
        line-height: 40px;
        width: 110px;
        min-width: 110px;
        max-width: 110px;
    }
    
    .fullscreen-mode .board-controls .game-title {
        font-size: 40px;
    }
}

/* ============================================================
   АДАПТИВНЫЕ РАЗМЕРЫ (стандартные)
   ============================================================ */
@media (max-width: 900px) {
    td {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        max-width: 40px;
        max-height: 40px;
        font-size: 24px;
        line-height: 40px;
    }
    .dragon { font-size: 24px; }
    .dragon span { font-size: 24px !important; }
    td.coord {
        height: 40px;
        line-height: 40px;
        font-size: 9px;
    }
    td.coord-top, td.coord-bottom {
        height: 16px;
        min-height: 16px;
        max-height: 16px;
        font-size: 8px;
        line-height: 16px;
        width: 40px;
        min-width: 40px;
        max-width: 40px;
    }
    td.coord-left, td.coord-right {
        width: 14px;
        min-width: 14px;
        max-width: 14px;
        font-size: 8px;
    }
}

@media (max-width: 768px) {
    .game-wrapper { padding: 10px; }
    .game-container { padding: 10px; }
    td {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        max-width: 34px;
        max-height: 34px;
        font-size: 20px;
        line-height: 34px;
        border-width: 0.5px;
    }
    .dragon { font-size: 20px; }
    .dragon span { font-size: 20px !important; }
    td.coord {
        height: 34px;
        line-height: 34px;
        font-size: 8px;
    }
    td.coord-top, td.coord-bottom {
        height: 14px;
        min-height: 14px;
        max-height: 14px;
        font-size: 7px;
        line-height: 14px;
        width: 34px;
        min-width: 34px;
        max-width: 34px;
    }
    td.coord-left, td.coord-right {
        width: 12px;
        min-width: 12px;
        max-width: 12px;
        font-size: 7px;
        padding: 0 1px;
    }
    .board-controls .game-title { font-size: 14px; }
    .btn-fullscreen { padding: 4px 10px; font-size: 14px; }
    .btn-fullscreen .fullscreen-label { font-size: 9px; }
    .btn-reset { padding: 4px 12px; font-size: 10px; }
    .move-history { max-height: 80px; font-size: 8px; max-width: 100%; }
    .move-history div { font-size: 8px; }
    .hidden span { font-size: 10px !important; }
    .legal-move::after { font-size: 8px; }
    
    .fullscreen-mode td {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        max-width: 42px;
        max-height: 42px;
        font-size: 26px;
        line-height: 42px;
    }
    .fullscreen-mode .dragon { font-size: 26px; }
    .fullscreen-mode .dragon span { font-size: 26px !important; }
    .fullscreen-mode td.coord {
        height: 42px;
        line-height: 42px;
        font-size: 9px;
    }
    .fullscreen-mode td.coord-top,
    .fullscreen-mode td.coord-bottom {
        height: 18px;
        min-height: 18px;
        max-height: 18px;
        font-size: 8px;
        line-height: 18px;
        width: 42px;
        min-width: 42px;
        max-width: 42px;
    }
    .fullscreen-mode td.coord-left,
    .fullscreen-mode td.coord-right {
        width: 16px;
        min-width: 16px;
        max-width: 16px;
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    .game-wrapper { padding: 6px; }
    .game-container { padding: 6px; border-radius: 8px; }
    td {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
        max-width: 28px;
        max-height: 28px;
        font-size: 17px;
        line-height: 28px;
        border-width: 0.5px;
    }
    .dragon { font-size: 17px; }
    .dragon span { font-size: 17px !important; }
    td.coord {
        height: 28px;
        line-height: 28px;
        font-size: 7px;
    }
    td.coord-top, td.coord-bottom {
        height: 12px;
        min-height: 12px;
        max-height: 12px;
        font-size: 6px;
        line-height: 12px;
        width: 28px;
        min-width: 28px;
        max-width: 28px;
    }
    td.coord-left, td.coord-right {
        width: 10px;
        min-width: 10px;
        max-width: 10px;
        font-size: 6px;
        padding: 0 1px;
    }
    .board-controls .game-title { font-size: 11px; letter-spacing: 0; }
    .board-controls { gap: 4px; margin-bottom: 6px; }
    .btn-fullscreen { padding: 3px 8px; font-size: 12px; }
    .btn-fullscreen .fullscreen-label { display: none; }
    .btn-reset { padding: 3px 8px; font-size: 8px; }
    .move-history { max-height: 60px; font-size: 7px; padding: 3px; margin-top: 6px; }
    .move-history div { font-size: 7px; padding: 1px 0; }
    .hidden span { font-size: 8px !important; }
    .legal-move::after { font-size: 6px; }
    
    .fullscreen-mode td {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        max-width: 34px;
        max-height: 34px;
        font-size: 20px;
        line-height: 34px;
    }
    .fullscreen-mode .dragon { font-size: 20px; }
    .fullscreen-mode .dragon span { font-size: 20px !important; }
    .fullscreen-mode td.coord {
        height: 34px;
        line-height: 34px;
        font-size: 8px;
    }
    .fullscreen-mode td.coord-top,
    .fullscreen-mode td.coord-bottom {
        height: 14px;
        min-height: 14px;
        max-height: 14px;
        font-size: 7px;
        line-height: 14px;
        width: 34px;
        min-width: 34px;
        max-width: 34px;
    }
    .fullscreen-mode td.coord-left,
    .fullscreen-mode td.coord-right {
        width: 14px;
        min-width: 14px;
        max-width: 14px;
        font-size: 7px;
    }
    .fullscreen-mode .board-controls .game-title { font-size: 14px; }
}

@media (max-width: 380px) {
    td {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
        max-width: 24px;
        max-height: 24px;
        font-size: 14px;
        line-height: 24px;
    }
    .dragon { font-size: 14px; }
    .dragon span { font-size: 14px !important; }
    td.coord {
        height: 24px;
        line-height: 24px;
        font-size: 6px;
    }
    td.coord-top, td.coord-bottom {
        height: 10px;
        min-height: 10px;
        max-height: 10px;
        font-size: 5px;
        line-height: 10px;
        width: 24px;
        min-width: 24px;
        max-width: 24px;
    }
    td.coord-left, td.coord-right {
        width: 8px;
        min-width: 8px;
        max-width: 8px;
        font-size: 5px;
        padding: 0;
    }
    .board-controls .game-title { font-size: 9px; }
    .btn-fullscreen { padding: 2px 6px; font-size: 10px; }
    .btn-reset { padding: 2px 6px; font-size: 7px; }
    .move-history { max-height: 40px; font-size: 6px; }
    .move-history div { font-size: 6px; }
    .hidden span { font-size: 6px !important; }
    .legal-move::after { font-size: 5px; }
    
    .fullscreen-mode td {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
        max-width: 28px;
        max-height: 28px;
        font-size: 16px;
        line-height: 28px;
    }
    .fullscreen-mode .dragon { font-size: 16px; }
    .fullscreen-mode .dragon span { font-size: 16px !important; }
    .fullscreen-mode td.coord {
        height: 28px;
        line-height: 28px;
        font-size: 7px;
    }
    .fullscreen-mode td.coord-top,
    .fullscreen-mode td.coord-bottom {
        height: 12px;
        min-height: 12px;
        max-height: 12px;
        font-size: 6px;
        line-height: 12px;
        width: 28px;
        min-width: 28px;
        max-width: 28px;
    }
    .fullscreen-mode td.coord-left,
    .fullscreen-mode td.coord-right {
        width: 12px;
        min-width: 12px;
        max-width: 12px;
        font-size: 6px;
    }
}

/* ============================================================
   PREFERS-REDUCED-MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .btn-fullscreen,
    .btn-reset,
    td {
        transition: none !important;
    }
    .btn-fullscreen:active,
    .btn-reset:active {
        transform: none !important;
    }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .board-controls .btn-group,
    .btn-fullscreen,
    .btn-reset {
        display: none !important;
    }
    .game-wrapper {
        padding: 10px !important;
        min-height: auto !important;
    }
    .game-container {
        box-shadow: none !important;
        border: 1px solid #333 !important;
    }
    .move-history {
        max-height: 200px !important;
        overflow: visible !important;
    }
}