:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --border-color: #334155;
    --crop-border: #ef4444;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

p {
    color: #94a3b8;
}

/* Link to Player */
.player-link {
    display: inline-block;
    margin-top: 5px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px dashed var(--primary-color);
}

.player-link:hover {
    color: var(--primary-hover);
    border-bottom: 1px solid var(--primary-hover);
}

.upload-section {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px dashed var(--border-color);
    text-align: center;
    margin-bottom: 2rem;
}

input[type="file"] {
    display: none;
}

.custom-file-upload {
    display: inline-block;
    padding: 0.5rem 1rem;
    cursor: pointer;
    background-color: var(--primary-color);
    border-radius: 0.25rem;
    font-weight: 600;
    transition: background 0.2s;
}

.custom-file-upload:hover {
    background-color: var(--primary-hover);
}

#fileName {
    margin-left: 1rem;
    color: #cbd5e1;
}

.editor-container {
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* New Cropper Layout */
.cropper-wrapper {
    position: relative;
    width: 100%;
    background-color: #000;
    /* FIX: Contain shadow so it doesn't darken the whole page */
    overflow: hidden;
    margin-bottom: 1.5rem;
    border-radius: 0.25rem;
    display: flex;
    justify-content: center;
    user-select: none;
}

.crop-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

#sourceImage {
    display: block;
    max-width: 100%;
    max-height: 60vh;
    pointer-events: none;
    user-select: none;
}

.crop-box {
    position: absolute;
    top: 0;
    left: 0;
    width: 128px;
    height: 64px;
    border: 2px solid var(--crop-border);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    /* Dim effect */
    cursor: move;
    z-index: 10;
    box-sizing: border-box;
}

.controls {
    display: grid;
    gap: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #cbd5e1;
}

.split-inputs {
    display: flex;
    gap: 1rem;
}

.split-inputs input {
    width: 100%;
}

input[type="text"],
input[type="number"] {
    background-color: #334155;
    border: 1px solid var(--border-color);
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 0.25rem;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
}

.output-section {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
}

pre {
    background-color: #0f172a;
    padding: 1rem;
    border-radius: 0.25rem;
    overflow-x: auto;
    font-size: 0.85rem;
    color: #4ade80;
    max-height: 300px;
}

.secondary-btn {
    background-color: #475569;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    cursor: pointer;
    margin-top: 1rem;
}

.loading {
    text-align: center;
    color: #fbbf24;
    font-weight: 600;
}