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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #fff;
    min-height: 100vh;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #eee;
}

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

.tier-row {
    display: flex;
    margin-bottom: 4px;
    min-height: 80px;
    background: #2d2d44;
    border-radius: 4px;
    overflow: hidden;
}

.tier-label {
    width: 80px;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    color: #000;
}

.tier-label.s-tier { background: #ff7f7f; }
.tier-label.a-tier { background: #ffbf7f; }
.tier-label.b-tier { background: #ffff7f; }
.tier-label.c-tier { background: #7fff7f; }
.tier-label.d-tier { background: #7fbfff; }
.tier-label.f-tier { background: #ff7fbf; }

.tier-items {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    padding: 8px;
    gap: 8px;
    min-height: 80px;
    background: #16213e;
    transition: background 0.2s;
}

.tier-items.drag-over {
    background: #1f3460;
}

.unranked-section {
    margin-top: 30px;
    background: #2d2d44;
    border-radius: 4px;
    padding: 15px;
}

.unranked-section h2 {
    margin-bottom: 15px;
    color: #aaa;
    font-size: 18px;
}

.unranked-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 100px;
    padding: 10px;
    background: #16213e;
    border-radius: 4px;
    transition: background 0.2s;
}

.unranked-items.drag-over {
    background: #1f3460;
}

.course-item {
    background: #3d5a80;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: grab;
    user-select: none;
    transition: transform 0.1s, box-shadow 0.1s;
    max-width: 200px;
}

.course-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.course-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.course-code {
    font-weight: bold;
    font-size: 12px;
    color: #98c1d9;
    margin-bottom: 2px;
}

.course-name {
    font-size: 11px;
    color: #e0e0e0;
    line-height: 1.3;
}

.reset-btn {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    background: #e63946;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.reset-btn:hover {
    background: #d62839;
}

/* Mobile styles */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    .tier-row {
        min-height: 60px;
    }

    .tier-label {
        width: 50px;
        min-width: 50px;
        font-size: 20px;
    }

    .tier-items {
        padding: 6px;
        gap: 6px;
        min-height: 60px;
    }

    .course-item {
        padding: 6px 8px;
        max-width: 150px;
        touch-action: none;
    }

    .course-code {
        font-size: 10px;
    }

    .course-name {
        font-size: 9px;
    }

    .unranked-section {
        margin-top: 20px;
        padding: 10px;
    }

    .unranked-section h2 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .unranked-items {
        gap: 6px;
        padding: 8px;
        min-height: 80px;
    }
}

/* Touch dragging styles */
.course-item.touch-dragging {
    position: fixed;
    z-index: 1000;
    opacity: 0.9;
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
    pointer-events: none;
}

.course-item.touch-placeholder {
    opacity: 0.3;
}
