:root {
    --bg-color: #000;
    --text-color: #f1f1f1;
    --sf-orange: #fd9110;
    --row-bg: #2a2a2a;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 20px;
}

header h1 {
    text-align: center;
    color: var(--sf-orange);
}

.tierlist-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
	height: 80vh;
}

.tiers-wrapper {
    flex: 3;
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: #000;
    border-radius: 8px;
}

.tier-row {
    display: flex;
    background: var(--row-bg);
    min-height: 100px;
	border-radius: 12px;
}

.tier-label {
    width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: bold;
    color: #000;
    padding: 10px;
    flex-shrink: 0;
	border-radius: 12px 0px 0px 12px;
}

.tier-dropzone {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 5px;
    padding: 5px;
}

.pool-wrapper {
    flex: 1;
    background: var(--row-bg);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-height: 0; 
}

.pool-wrapper h3 {
    margin-top: 0; 
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #ddd;
}

.pool {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: max-content;
    gap: 10px;
    justify-items: center;
    align-content: flex-start;
    padding-right: 5px;
}

.pool::-webkit-scrollbar {
    width: 8px;
}
.pool::-webkit-scrollbar-track {
    background: #111; 
    border-radius: 4px;
}
.pool::-webkit-scrollbar-thumb {
    background: #444; 
    border-radius: 4px;
}
.pool::-webkit-scrollbar-thumb:hover {
    background: var(--sf-orange);
}

.item {
    position: relative;
    width: 100%;
    max-width: 90px;
    background: #444;
    cursor: grab;
    border-radius: 4px;
}

.item:active {
    cursor: grabbing;
}

.item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.item-name {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.75);
    color: #f1f1f1;
    font-size: 0.65rem;
    padding: 3px 2px;
    box-sizing: border-box;
    text-align: center;
    pointer-events: none; 
    font-weight: 500;
}

.actions {
    text-align: center;
    margin-top: 30px;
}

button {
    background: var(--sf-orange);
    color: #000;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background: #f5a23e;
}

.hidden { display: none !important; }
#share-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex; align-items: center; justify-content: center;
}
.modal-content {
    background: var(--row-bg); padding: 30px; border-radius: 10px; text-align: center;
}
.modal-content input {
    width: 100%; padding: 10px; margin: 15px 0; background: #111; color: #fff; border: 1px solid #444;
}


.author-note {
    text-align: center;
    color: #aaa;
    margin-top: -15px;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.author-note strong {
    color: var(--sf-orange);
}

#floating-save-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    z-index: 100;
    font-size: 1.1rem;
    padding: 15px 35px;
    border: 2px solid #000;
    animation: popIn 0.3s ease-out forwards;
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
    #floating-save-btn {
        bottom: 20px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 90%;
        max-width: 350px;
        animation: none; 
    }
}

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}

.modal-content input {
    width: 100%; padding: 12px; margin: 15px 0; background: #111; color: #fff; 
    border: 1px solid var(--border); border-radius: 4px; box-sizing: border-box; text-align: center;
}
.modal-content input:focus {
    border-color: var(--sf-green); outline: none;
}

.modal-buttons {
    display: flex; gap: 10px; justify-content: center; margin-top: 15px;
}

.btn-secondary {
    background: #444; color: #fff;
}
.btn-secondary:hover {
    background: #555;
}


.create-own-cta {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    background: var(--row-bg);
    border-radius: 8px;
    color: #ddd;
    font-size: 1.1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--border);
}

.create-own-cta a {
    color: var(--sf-orange);
    font-weight: bold;
    text-decoration: none;
    margin-left: 5px;
}


.read-only-actions {
    text-align: center;
    margin-top: 30px;
}

.btn-download {
    background: #2a2a2a;
    color: #fff;
    border: 1px solid var(--border);
}
.btn-download:hover {
    background: #333;
    border-color: #555;
}

#capture-area {
    padding-top: 10px;
    padding-bottom: 20px; 
}





@media (max-width: 768px) {
	body {
		padding: 10px;
		padding-bottom: 250px;
	}
    .tierlist-container {
        flex-direction: column; 
		height: auto;
    }
    .pool {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
		        overflow-y: scroll;
    }
    .item {
        width: 70px;
    }
	
	.pool-wrapper {
        min-height: auto;
        height: 200px;
        position: fixed;
        bottom: 0px;
        left: 0px;
        width: 90%;
        padding: 10px 5%;
        overflow: scroll;
	}
	
	.tier-label {
		font-size: 14px;
		width: 75px;
	}
}
