@font-face {
    font-family: "Adobe NotDef";
    src: url("./AND-Regular.ttf")
}

@font-face {
    src: url("./NotoSerifOldUyghur-Regular-20250808.ttf");
    font-family: "Noto Serif Old Uyghur";
    font-weight: 400;
    font-style: normal;
}

body {
    writing-mode: sideways-lr;
    text-align: right;
    block-size: 100vh;
    font-family: 'Noto Serif Old Uyghur', 'Hiragino Mincho ProN', 'MS Mincho', 'Adobe NotDef', serif;
}

h1 {
    text-align: center;
    margin-block-start: 2rem;
}

p {
    margin-block-start: 1em;
    margin-block-end: 1em;
    font-size: 2.0em;
}

.Bitigu {
    font-feature-settings: "liga" 1, "calt" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    touch-action: manipulation;
}

.keyboard-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
    writing-mode: horizontal-tb;
    text-align: left;
    touch-action: manipulation;
}

.keyboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #e0e0e0;
    border-bottom: 1px solid #ccc;
    cursor: pointer;
}

.keyboard-content {
    padding: 10px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    opacity: 0;
}

.keyboard-container.expanded .keyboard-content {
    max-height: 500px;
    overflow-y: auto;
    opacity: 1;
}

@media (max-width: 768px) {
    .keyboard-container {
        bottom: 10px;
        right: 10px;
        width: 280px;
        max-width: calc(100vw - 20px);
    }

    .keyboard-container.expanded .keyboard-content {
        max-height: 400px;
    }
}

.keyboard-actions {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.action-btn {
    padding: 5px 5px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.action-btn:hover {
    background: #0056b3;
}

.delete-btn {
    background: #dc3545;
}

.delete-btn:hover {
    background: #c82333;
}

.keyboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 5px;
}

.key {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 5px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    min-height: 80px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.key:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.key:active {
    transform: translateY(0);
    box-shadow: none;
}

.key-char {
    font-size: 24px;
    line-height: 1.2;
}

.key-code {
    font-size: 10px;
    color: #666;
    margin-top: 2px;
}

.key-name {
    font-size: 9px;
    color: #888;
    margin-top: 2px;
    text-align: center;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .keyboard-container {
        bottom: 10px;
        right: 10px;
        width: 280px;
        max-width: calc(100vw - 20px);
    }

    .keyboard-grid {
        grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    }

    .key-char {
        font-size: 20px;
    }

    .key-name {
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    .keyboard-grid {
        grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
    }

    .key {
        padding: 5px 3px;
        min-height: 70px;
    }

    .key-char {
        font-size: 18px;
    }

    .key-code {
        font-size: 8px;
    }

    .key-name {
        font-size: 7px;
    }
}