body {
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-color: #f0f2f5;
    color: #333;
    /* This will be used to prevent scrolling when lightbox is open */
    overflow-y: auto; 
}

/* --- New Styles for Hamburger Menu Toggle --- */
.menu-toggle {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1001;
    
    display: block;
    width: 50px;
    height: 50px;
    cursor: pointer;
}

.menu-toggle:before,
.menu-toggle .middle,
.menu-toggle:after {
    content: '';
    position: absolute;
    width: 50px;
    height: 4px;
    background: #fff;
    border-radius: 10px;
    transition: all ease 0.3s;
}

.menu-toggle:before {
    margin-top: 0px;
    transform-origin: right top;
}

.menu-toggle .middle {
    display: block;
    margin-top: 15px;
    transform-origin: 50% 50%;
}

.menu-toggle:after {
    margin-top: 30px;
    transform-origin: right top;
}

.menu-toggle:hover:before {
    width: 20px;
    margin-top: 5px;
    transform: rotate(-32deg);
}

.menu-toggle:hover:after {
    width: 20px;
    margin-top: 25px;
    transform: rotate(31deg);
}

.menu-toggle:hover .middle {
    transform: rotateY(140deg);
}

.menu-toggle.open:before {
    margin-top: 23px;
    transform: rotate(45deg);
    width: 50px;
}

.menu-toggle.open:after {
    margin-top: 23px;
    transform: rotate(-45deg);
    width: 50px;
}

.menu-toggle.open .middle {
    opacity: 0;
    transform: scaleX(0);
    transition: all ease 0.1s;
}

/* --- End New Hamburger Toggle Styles --- */


/* --- New Lightbox Styles --- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Dark semi-transparent background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Ensures it's on top of all other content */
    
    /* Initially hidden with transition properties */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.lightbox-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain; /* Ensures the whole image is visible within the lightbox */
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5); /* Subtle shadow around the image */
    
    /* Initial state for zoom-in effect */
    transform: scale(0.8);
    transition: transform 0.3s ease-in-out;
}

.lightbox-overlay.visible .lightbox-image {
    transform: scale(1); /* Zoom to actual size when visible */
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 3em; /* Large 'X' symbol */
    cursor: pointer;
    z-index: 2001; /* Ensure close button is above the image */
    line-height: 1; /* Adjust vertical alignment for the 'X' symbol */
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.lightbox-close:hover {
    opacity: 1;
}
/* --- End New Lightbox Styles --- */


.offscreen-menu {
    position: fixed;
    top: -300px;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    padding: 20px;
    padding-top: 70px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: top 0.3s ease-in-out;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.offscreen-menu.open {
    top: 0;
}

.offscreen-menu h1 {
    margin-top: 0;
    margin-bottom: 20px;
}

.offscreen-menu .controls {
    margin-bottom: 0;
}


h1 {
    color: #2c3e50;
}

.controls {
    gap: 15px;
    align-items: center;
}

input[type="file"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

button:hover {
    background-color: #0056b3;
}

.unranked-items {
    width: 80%;
    min-height: 100px;
    border: 2px dashed #ccc;
    background-color: #e9ecef;
    margin-bottom: 30px;
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.unranked-items h2 {
    width: 100%;
    text-align: center;
    color: #555;
    margin-bottom: 10px;
}

.tier-list-container {
    width: 80%;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.tier {
    display: flex;
    min-height: 150px;
    border-bottom: 1px solid #eee;
    background-color: #ffffff;
    align-items: center;
    padding: 10px;
    position: relative;
    flex-wrap: wrap;
    gap: 10px;
}

.tier:last-child {
    border-bottom: none;
}

.tier-label {
    font-weight: bold;
    font-size: 1.8em;
    margin-right: 20px;
    min-width: 40px;
    text-align: center;
    color: #555;
}

.S-tier { background-color: #ffdddd; }
.A-tier { background-color: #ffeebb; }
.B-tier { background-color: #ddffdd; }
.C-tier { background-color: #ddeeff; }
.D-tier { background-color: #eeeeee; }

.draggable-item {
    border-radius: 5px;
    cursor: grab;
    background-color: transparent;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: transform 0.1s ease-out;
    box-sizing: border-box;
    flex-shrink: 0;
    flex-grow: 0;
    position: relative;
    height: 120px;
}

.draggable-item img {
    height: 100%;
    width: auto;
    display: block;
    object-fit: contain;
}

.draggable-item.dragging {
    opacity: 0.5;
}

.tier.drag-over, .unranked-items.drag-over {
    background-color: #cceeff;
    border-color: #007bff;
}

.drag-indicator {
    height: 120px;
    width: 5px;
    background-color: #007bff;
    margin: 0 5px;
    flex-shrink: 0;
    pointer-events: none;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

.item-label-display {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.7em;
    padding: 2px 5px;
    text-align: center;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
}

.draggable-item:hover .item-label-display {
    opacity: 1;
}

.item-label-input {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background-color: white;
    border: 1px solid #007bff;
    padding: 0 5px;
    font-size: 0.7em;
    text-align: center;
    box-sizing: border-box;
    z-index: 10;
}

.hidden {
    display: none !important;
}