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

body {
    font-family: 'Noto Sans', sans-serif;
    background: #f5f5f5;
    color: #222;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

h1 {
    font-size: 24px;
}

.btn-achievements {
    padding: 8px 16px;
    background: white;
    color: #222;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-achievements:hover {
    background: #f5f5f5;
    border-color: #999;
}

.stats {
    display: flex;
    gap: 24px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 11px;
    color: #666;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
}

main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 20px;
}

section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

h2 {
    font-size: 18px;
    margin-bottom: 16px;
}

.novel-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label {
    min-width: 100px;
    font-size: 13px;
}

select {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.btn-create {
    padding: 10px 20px;
    background: #222;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.btn-create:hover {
    background: #444;
}

.btn-create:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.novels-list, .ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.novel-item, .ranking-item {
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.novel-item:hover, .ranking-item:hover {
    border-color: #999;
}

.novel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.novel-title {
    font-weight: 600;
    font-size: 14px;
}

.novel-genre {
    font-size: 11px;
    color: #666;
    background: #f0f0f0;
    padding: 3px 6px;
    border-radius: 3px;
}

.novel-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #666;
}

.ranking-position {
    font-size: 20px;
    font-weight: 700;
    color: #999;
    margin-right: 10px;
}

.ranking-item {
    display: flex;
    align-items: center;
}

.ranking-info {
    flex: 1;
}

.my-novel {
    background: #fffbf0;
    border-color: #ffd700;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 24px;
    font-size: 13px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 1;
}

.modal-close:hover {
    color: #222;
}

.achievements-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.achievement-item {
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s;
}

.achievement-item.unlocked {
    border-color: #ffd700;
    background: #fffef7;
}

.achievement-item.locked {
    opacity: 0.5;
    background: #fafafa;
}

.achievement-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.achievement-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.achievement-desc {
    font-size: 11px;
    color: #666;
}

.achievement-unlocked-date {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
}

@media (max-width: 968px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    h1 {
        font-size: 20px;
    }
    
    .stats {
        flex-direction: column;
        gap: 12px;
    }
    
    .form-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-group label {
        min-width: auto;
    }
    
    .achievements-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

