@import url('https://fonts.googleapis.com/css2?family=Nanum+Gothic+Coding:wght@400;700&display=swap');

/* --- 기본 설정 --- */
* { box-sizing: border-box; user-select: none; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0; padding: 0;
    background-color: #000;
    font-family: 'Nanum Gothic Coding', 'Gulim', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: #e0e0e0;
    overflow: hidden;
}

.screen {
    width: 100%;
    max-width: 480px;
    height: 100%;
    background-color: #121212;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* --- 헤더 --- */
.app-header {
    height: 50px;
    background: linear-gradient(to bottom, #cc0000, #990000);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 18px;
    border-bottom: 2px solid #550000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    z-index: 10;
}

/* --- 컨텐츠 영역 공통 --- */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    position: relative;
    background: #202020;
}

/* --- 메인 메뉴 --- */
.page-main { display: block; padding: 20px; text-align: center; }
.guide-text { margin-top: 20px; color: #aaa; font-size: 12px; }

.grid-menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: background-color 0.2s;
}
.app-icon:active { background-color: #333; }

/* 아이콘 박스 및 이미지 스타일 */
.icon-box {
    width: 70px; height: 70px;
    border-radius: 18px;
    margin-bottom: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.6);
    overflow: hidden; /* 이미지가 둥근 모서리를 넘지 않게 */
    background: #333;
}

.icon-box img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 이미지가 박스에 꽉 차게 */
}

.app-name { font-size: 14px; color: #ddd; font-weight: bold; }

.notice-box {
    margin-top: 40px;
    border: 1px dashed #555;
    padding: 15px;
    color: #888;
    font-size: 12px;
    line-height: 1.6;
}

/* --- 번역기 페이지 --- */
.page-trans { display: none; padding: 15px; }
.section-label { color: #aaa; font-size: 12px; margin-bottom: 5px; }

.trans-input {
    width: 100%; height: 120px;
    background: #fff;
    border: 2px solid #555;
    padding: 12px;
    font-family: inherit;
    font-size: 16px;
    color: #000;
    resize: none;
    margin-bottom: 15px;
    border-radius: 4px;
}

.trans-result-box {
    background: #000;
    border: 2px solid #444;
    padding: 15px;
    min-height: 100px;
    color: #ff9900;
    font-family: inherit;
    font-size: 16px;
    margin-bottom: 15px;
    border-radius: 4px;
    line-height: 1.4;
}

.action-btn {
    width: 100%;
    background: linear-gradient(to bottom, #444, #222);
    color: white;
    border: 1px solid #666;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    border-radius: 4px;
}
.action-btn:active { background: #111; }

/* --- 사전 페이지 --- */
.page-dict { display: none; padding: 0; height: 100%; flex-direction: column; }

.dict-search-bar {
    padding: 10px;
    background: #333;
    border-bottom: 1px solid #555;
}
.dict-search-input {
    width: 100%; padding: 8px;
    background: #fff; border: 1px solid #888;
    font-family: inherit;
}

.dict-list-area { flex: 1; overflow-y: auto; padding: 10px; }

.word-item {
    background: #2a2a2a;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    border-left: 4px solid #cc0000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.word-eng { font-weight: bold; font-size: 16px; color: #fff; }
.word-aruvi { color: #ff9900; font-family: monospace; }
.word-type { font-size: 10px; color: #aaa; background: #444; padding: 2px 4px; border-radius: 2px; margin-left: 5px; }

.dict-footer-btn {
    padding: 15px;
    background: #444;
    text-align: center;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    border-top: 1px solid #555;
}

.add-form-overlay {
    display: none;
    background: #202020;
    padding: 15px;
    border-top: 2px solid #cc0000;
    animation: slideUp 0.3s;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.form-title { color: #ff9900; font-weight: bold; margin-bottom: 10px; }
.dict-input, .dict-select { width: 100%; padding: 10px; margin-bottom: 10px; background: #eee; border: 1px solid #888; }
.save-btn { background: #cc0000; color: white; width: 100%; padding: 12px; border: none; font-weight: bold; cursor: pointer; }
.close-btn { text-align: center; padding-top: 10px; color: #aaa; cursor: pointer; }

/* --- 하단 소프트 키 --- */
.bottom-bar {
    height: 50px;
    background: linear-gradient(to bottom, #222, #000);
    display: flex;
    border-top: 1px solid #444;
    flex-shrink: 0;
}
.soft-key {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    border-right: 1px solid #333;
}
.soft-key:last-child {