/* ---- Main Container ---- */
#kanji-practice-app {
    max-width: 500px;
    margin: 20px auto;
    padding: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
}

#kanji-input {
    width: 100%;
    padding: 12px;
    font-size: 24px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* ---- Quick Action Icons ---- */
#quick-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 5px; /* Khoảng cách với bảng vẽ */
}

#quick-actions button {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #555;
    transition: background-color 0.2s;
}

#quick-actions button:hover {
    background: #e0e0e0;
}

#quick-actions button svg {
    width: 22px;
    height: 22px;
}

/* ---- Drawing Board ---- */
#drawing-board-container {
    position: relative;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    aspect-ratio: 1 / 1; 
}

#kanji-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    touch-action: none; 
    cursor: crosshair;
    background: #fff;
}

/* ---- Settings Popup ---- */
#settings-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Lớp phủ màu đen mờ */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#settings-popup.hidden {
    opacity: 0;
    pointer-events: none; /* Không thể tương tác khi bị ẩn */
}

.settings-content {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: scale(1);
    transition: transform 0.3s ease;
}

#settings-popup.hidden .settings-content {
    transform: scale(0.9);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.settings-header h3 {
    margin: 0;
    font-size: 20px;
}

#close-settings-btn {
    background: none;
    border: none;
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0 5px;
}

.settings-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.control-group label {
    font-weight: 500;
}
.control-group select, .control-group input[type="color"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: white;
}
.control-group input[type="range"] {
    width: 100%;
}
.range-slider label span {
    background-color: #eee;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}