/**
 * Create Game page – sections + upload UX
 * Uses theme variables for light/dark support.
 */

/* ---- Section cards ---- */
.game-section {
    border-radius: 12px;
    border: 1px solid var(--bs-border-color);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.game-section-header {
    padding: 1rem 1.25rem;
    background: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.game-section-header .ti {
    font-size: 1.25rem;
    opacity: 0.9;
}

.game-section-header h5 {
    margin: 0;
    font-weight: 600;
    color: var(--bs-heading-color);
}

.game-section-body {
    padding: 1.5rem 1.25rem;
}

/* ---- Game Identity: banner left + fields right ---- */
.game-identity-body {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: stretch;
}

.game-identity-banner {
    flex: 0 0 320px;
    min-width: 260px;
    display: flex;
    flex-direction: column;
}

.game-identity-banner .banner-zone {
    width: 100%;
    height: 100%;
    min-height: 200px;
    aspect-ratio: auto;
    max-height: none;
}

.game-identity-fields {
    flex: 1;
    min-width: 280px;
}

@media (max-width: 767px) {
    .game-identity-body {
        flex-direction: column;
        align-items: stretch;
    }
    .game-identity-banner {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        min-height: 0;
    }
    .game-identity-banner .banner-zone {
        height: auto;
        min-height: 140px;
        aspect-ratio: 21 / 9;
    }
}

/* ---- Category pills ---- */
.category-pill {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    border: 1px solid var(--bs-border-color);
    color: var(--bs-heading-color) !important; 
    background-color: var(--bs-tertiary-bg);
}
.category-pill:hover {
    transform: translateY(-2px);
    border-color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle) !important;
    color: var(--bs-primary) !important;
}

.category-pill.active {
    background: var(--bs-primary) !important;
    color: var(--bs-body-bg) !important;
    border-color: var(--bs-primary);
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb, 93, 135, 255), 0.35);
}

/* ---- Upload zones (theme-aware) ---- */
.upload-zone {
    border: 2px dashed var(--bs-border-color);
    background: var(--bs-tertiary-bg);
    border-radius: 12px;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
}

.upload-zone input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

/* ---- Banner zone ---- */
.banner-zone {
    aspect-ratio: 21 / 9;
    max-height: 260px;
    padding: 0 !important;
    background: var(--bs-tertiary-bg);
    border: 2px dashed var(--bs-border-color);
}

.banner-zone img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.banner-zone.has-image {
    border-style: solid;
    border-color: var(--bs-border-color);
}

.upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 10px;
    pointer-events: none;
}

.banner-zone:hover .upload-overlay:not(.d-none) {
    opacity: 1;
}

/* ---- Prize slots (5-slot layout) ---- */
.prize-slots {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.prize-slot {
    aspect-ratio: 1;
    border: 2px dashed var(--bs-border-color);
    background: var(--bs-tertiary-bg);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
}

.prize-slot:hover,
.prize-slots-wrap.drag-over .prize-slot.empty {
    border-color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
}

.prize-slot .slot-placeholder {
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
    text-align: center;
    padding: 0.5rem;
}

.prize-slot .ti {
    font-size: 1.75rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0.25rem;
}

.prize-slot.filled {
    border-style: solid;
    padding: 0;
}

.prize-slot.filled .slot-placeholder,
.prize-slot.filled > .ti {
    display: none;
}

.prize-slot.filled img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.prize-slot .slot-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff !important;
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    padding: 0;
    line-height: 1;
}

.prize-slot .slot-remove .ti {
    font-size: 14px !important;
    margin: 0 !important;
    color: #fff !important;
    display: inline-block !important;
}

.prize-slot.filled:hover .slot-remove {
    display: flex;
}

.prize-slot .slot-remove:hover {
    background: var(--bs-danger);
}

.prize-slots-wrap {
    position: relative;
}

.prize-slots-wrap input[type="file"] {
    display: none;
}

@media (max-width: 576px) {
    .prize-slots {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---- Submit button ---- */
.game-submit-btn {
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--bs-primary-rgb, 93, 135, 255), 0.35);
}
