* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ffe6f2 0%, #ffcce5 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.top-menu {
    background: white;
    border-radius: 10px;
    padding: 10px 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    gap: 15px;
}

.menu-items {
    display: flex;
    gap: 8px;
}

.menu-btn {
    background: linear-gradient(135deg, #ffb3d9 0%, #ff99cc 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 1em;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 179, 217, 0.4);
}

.menu-btn:active {
    transform: translateY(0);
}

.menu-btn.active {
    background: linear-gradient(135deg, #ffe6f2 0%, #ffd9ec 100%);
    color: #ff99cc;
    border: 2px solid #ffb3d9;
}

.select-container {
    display: flex;
    align-items: center;
}

.language-select {
    padding: 6px 12px;
    font-size: 1em;
    border: 1px solid #ffb3d9;
    border-radius: 10px;
    /* background: linear-gradient(135deg, #ffb3d9 0%, #ff99cc 100%); */
    background: #ffd4e4;
    color: #ff99cc;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    min-width: 150px;
}

.language-select:hover {
    border-color: #ff99cc;
    box-shadow: 0 2px 8px rgba(255, 179, 217, 0.2);
}

.language-select:focus {
    border-color: #ff99cc;
    box-shadow: 0 0 0 3px rgba(255, 179, 217, 0.1);
}

.language-select option {
    background: linear-gradient(135deg, #ffb3d9 0%, #ff99cc 100%);
    /* color: rgb(117, 82, 121);
     */color: #ff99cc;
    padding: 8px;
}

.container {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    align-items: flex-start;
}

.container > main {
    flex: 1;
    background: white;
    border-radius: 15px;
    padding: 0px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    min-width: 0;
}

header h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2.5em;
}

main p {
    color: #666;
    font-size: 1.2em;
    margin-bottom: 30px;
}

#clickButton {
    background: linear-gradient(135deg, #ffb3d9 0%, #ff99cc 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1em;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#clickButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 179, 217, 0.4);
}

#clickButton:active {
    transform: translateY(0);
}

#message {
    margin-top: 20px;
    font-size: 1.1em;
    color: #ffb3d9;
    font-weight: bold;
    min-height: 30px;
}

.font-list-container {
    margin-top: 20px;
    padding: 15px;
    background: #fffbfc;
    border-radius: 10px;
    border: 2px solid #ffb3d9;
    max-width: 100%;
    text-align: left;
}

.preview-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.preview-input {
    flex: 1;
    padding: 10px 15px;
    font-size: 1em;
    border: 2px solid #ffb3d9;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s;
    background: white;
    color: #333;
}

.preview-input:focus {
    border-color: #ff99cc;
    box-shadow: 0 0 0 3px rgba(255, 179, 217, 0.1);
}

.preview-input::placeholder {
    color: #aaa;
}

.preview-button {
    padding: 10px 20px;
    font-size: 1em;
    background: linear-gradient(135deg, #ffb3d9 0%, #ff99cc 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.preview-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 179, 217, 0.4);
}

.preview-button:active {
    transform: translateY(0);
}

.font-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* 복사 히스토리 박스 */
.copy-history {
    background: #fffbfc;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 300px;
    min-height: 400px;
    position: sticky;
    top: 20px;
    border: 2px solid #ffb3d9;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #ffb3d9;
    padding-bottom: 10px;
}

.history-title {
    color: #646464;
    font-size: 1.0em;
    margin: 0;
    flex: 1;
}

.history-actions {
    display: flex;
    gap: 8px;
}

.history-action-btn {
    background: linear-gradient(135deg, #ffb3d9 0%, #ff99cc 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.history-action-btn:hover {
    background: linear-gradient(135deg, #ff99cc 0%, #ff80bf 100%);
    transform: scale(1.1);
}

.history-action-btn:active {
    transform: scale(0.95);
}

.history-action-btn svg {
    width: 16px;
    height: 16px;
}

.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.history-item {
    background: white;
    border-radius: 8px;
    padding: 10px 35px 10px 10px;
    margin-bottom: 8px;
    border: 1px solid #ffb3d9;
    font-size: 0.9em;
    color: #555;
    word-break: break-word;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    /* 유니코드 수학 문자 지원 폰트 */
    font-family: 'Cambria Math', 'Latin Modern Math', 'STIX Two Math', 'Asana Math', 'Computer Modern', 'Times New Roman', serif;
}

.history-item:hover {
    background: #fff0f5;
    transform: translateX(-3px);
    box-shadow: 0 2px 8px rgba(255, 179, 217, 0.3);
}

.history-item:active {
    transform: translateX(0);
}

.history-item-delete {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #ff6b9d;
    color: white;
    border: none;
    border-radius: 4px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    padding: 0;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    background: #ff4081;
    transform: translateY(-50%) scale(1.1);
}

.history-item-delete:active {
    transform: translateY(-50%) scale(0.9);
}

.history-item-delete svg {
    width: 14px;
    height: 14px;
}

/* 이모티콘 페이지 스타일 */
.emoji-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    user-select: none; /* 텍스트 선택 방지 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.emoji-category-section {
    background: linear-gradient(135deg, #ffb3d9 0%, #ff99cc 100%);
    border-radius: 15px;
    padding: 15px;
    /* box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15); */
}

.category-header {
    color: white;
    font-size: 0.9em;
    font-weight: bold;
    margin-bottom: 10px;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.category-btn {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.category-btn.active {
    background: white;
    color: #ff99cc;
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

.subcategory-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 15px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
}

.subcategory-btn {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.subcategory-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

.subcategory-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: #ff99cc;
    border-color: white;
    font-weight: bold;
}

.emoji-display-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    min-height: 400px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 12px;
    user-select: none; /* 텍스트 선택 방지 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.emoji-group-header {
    grid-column: 1 / -1;
    font-size: 0.9em;
    color: #666;
    /* font-weight: bold; */
    padding-bottom: 8px;
    border-bottom: 2px solid #ffb3d9;
    margin-bottom: 12px;
    margin-top: 20px;
    text-align: left;
}

.emoji-group-header:first-child {
    margin-top: 0;
}

.emoji-item {
    background: white;
    border: 1px solid #ffb3d9;
    border-radius: 4px;
    padding: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    word-break: break-all;
    height: auto;
    color: #666;
     /* 유니코드 수학 문자 지원 폰트 */
    font-family: 'Cambria Math', 'Latin Modern Math', 'STIX Two Math', 'Asana Math', 'Computer Modern', 'Times New Roman', serif;
    user-select: none; /* 텍스트 선택 방지 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.emoji-item:hover {
    background: #fff0f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 179, 217, 0.3);
    border-color: #ff99cc;
}

.emoji-item:active {
    transform: translateY(0);
}

.emoji-item.text-art {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    white-space: pre;
    text-align: center;
    line-height: 1.2em;
}

/* 텍스트 길이에 따른 버튼 크기 조절 */
.emoji-item.medium-emoji {
    grid-column: span 2;
}

.emoji-item.long-emoji {
    grid-column: span 3;
}

.emoji-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #ffffff;
    padding: 20px;
    font-size: 0.9em;
}

/* 반응형: 작은 화면에서는 1열로 표시 및 히스토리 숨김 */
@media (max-width: 768px) {
    .font-list {
        grid-template-columns: 1fr;
    }
    
    .container {
        flex-direction: column;
    }
    
    .copy-history {
        display: none;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
    
    .emoji-item {
        padding: 6px;
        font-size: 1.0em;
        min-height: 50px;
    }
    
    /* 작은 화면에서는 긴 텍스트도 span 조정 */
    .emoji-item.medium-emoji {
        grid-column: span 2;
    }
    
    .emoji-item.long-emoji {
        grid-column: span 3;
    }
}

.font-item {
    padding: 6px 10px;
    margin: 0;
    background: white;
    border-radius: 8px;
    border: 1px solid #ffb3d9;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.2s;
    color: #555;
    user-select: none;
    /* 유니코드 수학 문자 지원 폰트 */
    font-family: 'Cambria Math', 'Latin Modern Math', 'STIX Two Math', 'Asana Math', 'Computer Modern', 'Times New Roman', serif;
}

.font-item:hover {
    background: #fff0f5;
    border-color: #ffb3d9;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(255, 179, 217, 0.2);
}

/* 토스트 메시지 스타일 */
#toast-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, #ffb3d9 0%, #ff99cc 100%);
    color: white;
    padding: 20px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    font-size: 1.0em;
    /* font-weight: bold; */
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

#toast-message.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

#toast-message.toast-success {
    background: linear-gradient(135deg, #ffb3d9 0%, #ff99cc 100%);
}

#toast-message.toast-error {
    background: linear-gradient(135deg, #7b1fa2 0%, #6a1b9a 100%);
}

