body {
    font-family: sans-serif;
    background-color: #f0f0f0;
    color: #333;
    margin: 0;
    padding: 20px;
    zoom: 0.8; 
}

h1, h2 {
    text-align: center;
}

.tier-container {
    max-width: 1200px;
    margin: 20px auto;
    border: 2px solid #ccc;
    background-color: #fff;
}

.tier-row {
    display: flex;
    min-height: 100px;
    border-bottom: 1px solid #ddd;
    position: relative; 
}

.tier-row:last-child {
    border-bottom: none;
}

.tier-label {
    width: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: #343a40; /* 글자색을 어둡게 변경하여 가독성 확보 */
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.7); /* 그림자를 밝게 하여 입체감 유지 */
    flex-shrink: 0; 
}

.tier-items {
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 130px 10px 10px;
    gap: 10px;
}

.unranked-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    border: 2px solid #ccc;
    background-color: #fff;
}

.unranked-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    min-height: 100px;
}

.draggable {
    width: 80px;
    height: 80px;
    cursor: grab;
    transition: transform 0.2s;
    border-radius: 5px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
    touch-action: none;
}

.draggable:hover {
    transform: scale(1.1);
}

.dragging {
    position: absolute; /* 요소를 문서 흐름에서 제거하여 공간을 없앱니다. */
    opacity: 0;         /* 요소를 완전히 투명하게 만듭니다. */
    z-index: -1;        /* 다른 요소들 밑으로 보내 만약의 충돌을 방지합니다. */
}

.drag-over {
    background-color: #e0e0e0;
}

/* 드래그 위치를 미리 보여주는 플레이스홀더 스타일 */
.drag-placeholder {
    width: 80px;
    height: 80px;
    background-color: #e9ecef;
    border: 2px dashed #adb5bd;
    border-radius: 5px;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.filter-controls fieldset {
    display: flex;
    gap: 15px;
    border: none;
    padding: 0;
    margin: 0;
}

.filter-controls legend {
    font-weight: bold;
    margin-right: 10px;
    font-size: 1em;
}

.filter-controls label {
    cursor: pointer;
}

.filter-controls select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 1em;
}

#filter-btn {
    padding: 8px 20px;
    font-size: 1em;
    font-weight: bold;
    color: white;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#filter-btn:hover {
    background-color: #0056b3;
}

.tier-label[contenteditable="true"] {
    cursor: text;
}
.tier-label[contenteditable="true"]:focus {
    outline: 2px solid #007bff;
    box-shadow: 0 0 5px rgba(0,123,255,0.5);
}

.delete-tier-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background-color: #f1f3f5;
    color: #868e96;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-tier-btn:hover {
    background-color: #dc3545;
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.main-controls {
    display: flex;
    justify-content: center;
    margin: 20px auto;
    max-width: 1200px;
}
#add-tier-btn {
    width: 100%;
    padding: 10px;
    font-size: 1.1em;
    font-weight: bold;
    color: #28a745;
    background-color: #fff;
    border: 2px dashed #28a745;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}
#add-tier-btn:hover {
    background-color: #28a745;
    color: white;
}

.color-picker-btn {
    position: absolute;
    right: 55px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background-color: #f1f3f5;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.color-picker-btn:hover {
    background-color: #dee2e6;
    transform: translateY(-50%) scale(1.1);
}

#color-palette {
    position: absolute;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.1);
    transition: transform 0.15s;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.hidden {
    display: none !important;
}

.move-controls {
    position: absolute;
    right: 95px; 
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.move-up-btn,
.move-down-btn {
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ced4da;
    background-color: #f1f3f5;
    color: #495057;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    transition: background-color 0.2s;
}

.move-up-btn:hover,
.move-down-btn:hover {
    background-color: #dee2e6;
}

.tier-row:first-child .move-up-btn {
    opacity: 0.3;
    cursor: not-allowed;
}

.tier-row:last-child .move-down-btn {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 난이도별 테두리 스타일 */
.draggable.border-nm {
    box-shadow: 0 0 0 4px #28a745; /* NM: 녹색 */
}
.draggable.border-hd {
    box-shadow: 0 0 0 4px #fd7e14; /* HD: 주황색 */
}
.draggable.border-mx {
    box-shadow: 0 0 0 4px #dc3545; /* MX: 빨간색 */
}
.draggable.border-sc {
    box-shadow: 0 0 0 4px #6f42c1; /* SC: 보라색 */
}

#page-footer {
    width: 100%;
    text-align: center;
    padding: 15px 0; /* 위아래 여백 */
    margin-top: 30px; /* 위 컨텐츠와의 간격 */
    font-size: 0.75em; /* 글자 크기 작게 */
    color: #7f8c8d; /* 눈에 덜 띄는 회색 계열 */
}

#page-footer p {
    margin: 0;
    padding: 0 10px; /* 좌우 여백 (내용이 너무 길어질 경우 줄바꿈 위함) */
    line-height: 1.4; /* 줄 간격 */
}

.tier-label * {
    font-weight: bold !important;
    color: inherit !important;
    font-size: inherit !important;
    font-family: inherit !important;
}