:root {
    --bg-color-1: #38C261;
    --bg-color-2: #2EA650;
    --accent-gold: #d4af37;
    --accent-green: #10B981;
    --text-main: #ffffff;
    --card-bg-glass: rgba(255, 255, 255, 0.1);
    --card-border-glass: rgba(255, 255, 255, 0.2);
    --girone-bg: rgba(0, 0, 0, 0.3);
    --girone-border: rgba(255, 255, 255, 0.15);
    --hover-card: rgba(255, 255, 255, 0.25);
    --drag-over: rgba(16, 185, 129, 0.4);
    --font-main: 'Outfit', sans-serif;
}

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

html {
    background-color: var(--bg-color-2);
}

body {
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: var(--bg-color-2);
    background-image: linear-gradient(135deg, var(--bg-color-1) 0%, var(--bg-color-2) 100%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

.overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.5) 100%);
    pointer-events: none;
    z-index: 1;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 4rem;
    position: relative;
    z-index: 2;
    border-bottom: 1px solid var(--card-border-glass);
    background: rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.logo-container {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    max-height: 100%;
    max-width: 150px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

#logo-comune {
    max-width: 190px;
}

h1 {
    font-size: 3.2rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 0 3px 8px rgba(0,0,0,0.3);
    text-align: center;
    flex-grow: 1;
}

main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem 4rem;
    position: relative;
    z-index: 2;
    gap: 2rem;
}

.pool-section {
    background: var(--girone-bg);
    border: 1px solid var(--girone-border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
}

.pool-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent-gold);
    text-align: center;
    font-weight: 700;
    letter-spacing: 1px;
}

.team-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    min-height: 80px;
    padding: 1rem;
    border-radius: 12px;
    border: 2px dashed transparent;
    transition: all 0.3s ease;
}

.team-container.drag-over {
    border-color: var(--card-border-glass);
    background: rgba(255,255,255,0.05);
}

.team-card {
    background: var(--card-bg-glass);
    border: 1px solid var(--card-border-glass);
    padding: 0.8rem 1.2rem;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: grab;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

.team-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.2), transparent);
    transform: skewX(-20deg);
    transition: 0.5s;
}

.team-card:hover {
    background: var(--hover-card);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.team-card:hover::before {
    left: 200%;
}

.team-card:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.team-card.dragging {
    opacity: 0;
}

.hint {
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    margin-top: 1rem;
}

.gironi-section {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    flex-grow: 1;
}

.girone-card {
    flex: 1;
    background: var(--girone-bg);
    border: 1px solid var(--girone-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.girone-card:hover {
    transform: translateY(-5px);
}

.girone-header {
    background: rgba(0,0,0,0.4);
    padding: 1.5rem;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--accent-gold);
}

.girone-header h2 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent-gold);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.capacity {
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--card-bg-glass);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--card-border-glass);
}

.capacity span.full {
    color: var(--accent-green);
}

.slot-container {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 250px;
    border-radius: 0 0 20px 20px;
    transition: all 0.3s ease;
    border: 2px dashed transparent;
}

.slot-container.drag-over {
    background: var(--drag-over);
    border-color: var(--accent-green);
}

.slot-container .team-card {
    width: 100%;
    margin: 0;
    border-radius: 12px;
    font-size: 1.3rem;
    padding: 1.2rem;
    text-align: center;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

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

@media (max-width: 1200px) {
    header { padding: 1rem 2rem; }
    h1 { font-size: 2.2rem; }
    main { padding: 1rem 2rem; }
    .gironi-section { flex-direction: column; }
    .girone-card { min-height: 300px; }
}

/* NAVBAR */
.main-nav {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
    margin: 0;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--accent-gold);
    background: rgba(255, 255, 255, 0.1);
}

/* FOOTER */
.main-footer {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: center;
    padding: 2rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 2;
}

.main-footer p {
    margin: 0.5rem 0;
}

.main-footer a {
    color: var(--accent-gold);
    text-decoration: none;
    font-weight: 700;
}

.main-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .main-nav ul {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}
