body {
    /* background-color: beige; */
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 0;
}

/* Full-page Bard background using Data Dragon splash (no patch segment) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1; /* keep it behind all content */
    background-image: url('https://ddragon.leagueoflegends.com/cdn/img/champion/splash/Bard_0.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    /* readability over the image */
    filter: brightness(0.5);
}

main {
    width: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap; /* allow top containers to wrap instead of squeezing */
    justify-content: center; /* center row when narrower screens */
    opacity: 0.85;
}

header {
    background-color: beige;
    padding: 20px;
    text-align: center;
    max-width: 100%;
    border-radius: 30px;
    border: 1px solid #ccc;
    opacity: 0.85;
}

.matchup-info-container {
    margin: 5px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    border: 1px solid #ccc;
    border-radius: 30px;
    background-color: beige;
}

.quiz-container {
    margin: 5px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* width: 100%;  Avoid forcing full width in a flex row */
    flex: 1 1 360px; /* let it share space with siblings */
    min-width: 320px;
    border: 1px solid #ccc;
    border-radius: 30px;
    background-color: beige;
}

.quiz-container h3 {
    text-align: center;
    margin-bottom: 15px;
}

.items-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    /* border: 1px solid #ccc;
    border-radius: 30px;
    background-color: #fff; */
}

.summary-container {
    margin: 20px;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 30px;
    background-color: beige;
    min-width: 320px;
    /* width: 100%; */
    flex:  0 100%;
    display: none; /* Hidden by default */
}

.summary-container.visible {
    display: block; /* Show when all items are selected */
}

ul {
    list-style-type: none;
    padding: 0;
}

hr {
    border: none;
}

.items-list {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
}

/* Fixed width for h4 headings in if-winning/if-losing to align items */
.items-list h4 {
    min-width: 100px;
    flex-shrink: 0;
    margin: 0;
    display: flex;
    align-items: center;
}

.item {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    background-color: beige;
    gap: .5rem;
    position: relative;       
    overflow: visible;        
}

/* Health-tagged selection highlight */
.item.health {
    border-color: #2ecc71; /* green */
    /* Thicker visual ring: inner glow + outer ring (doesn't change layout) */
    box-shadow:
        0 0 0 3px rgba(46, 204, 113, 0.28) inset,
        0 0 0 3px rgba(46, 204, 113, 0.6);
}

.item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* flex-shrink: 0; */
}

/* Space below the specific boots li so the dropdown has room */
.item.boots-dropdown {
    margin-bottom: 21px;
}

/* Space for item dropdowns */
.item.item-dropdown {
    margin-bottom: 21px;
    opacity: 0.85;
}

/* Style all dropdowns positioned under their items */
.item > select {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    padding: 2px;
    font-size: 10px;
    border: 1px solid #ccc;
    background-color: white;
    box-sizing: border-box;
    z-index: 10;
}

/* Style optgroup headers in dropdowns */
.item > select optgroup {
    font-weight: bold;
    font-style: normal;
    color: #333;
    background-color: white;
}

.item > select option {
    font-weight: normal;
    padding-left: 8px;
}

/* Style disabled options (already selected items) */
.item > select option:disabled {
    color: #999;
    font-style: italic;
    text-decoration: line-through;
}

/* Legacy specific class (can be removed if using generic select rule above) */
.item > .boots-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    padding: 2px;
    font-size: 10px;
    border: 1px solid #ccc;
    background-color: white;
    box-sizing: border-box;
    opacity: 0.85;
}

/* Champion container styling */
.random-champions-container {
    margin: 5px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* width: 100%; */
    /* width: 100%;  Avoid forcing full width in a flex row */
    flex: 1 1 360px; /* share row width */
    min-width: 320px;
    border: 1px solid #ccc;
    border-radius: 30px;
    background-color: beige;
}

.champions-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.champions-container h2 {
    margin-bottom: 10px;
    font-size: 18px;
    text-align: center;
}

.enemy-team-list,
.my-team-list {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 5px;
}

.champion-dropdown {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    background-color: white;
    position: relative;
    overflow: visible;
    margin-bottom: 21px; /* Space for dropdown */

}

/* Borders that indicate adaptive damage type */
.champion-dropdown.type-ad {
    border-color: #f39200; /* orange for AD */
    /* inner ring + outer ring (match item.health style) */
    box-shadow:
        0 0 0 3px rgba(243,146,0,0.28) inset,
        0 0 0 3px rgba(243,146,0,0.6);
    transition: box-shadow 160ms ease, border-color 160ms ease;
}
.champion-dropdown.type-ap {
    border-color: #0066ff; /* blue for AP */
    /* inner ring + outer ring (match item.health style) */
    box-shadow:
        0 0 0 3px rgba(0,102,255,0.28) inset,
        0 0 0 3px rgba(0,102,255,0.6);
    transition: box-shadow 160ms ease, border-color 160ms ease;
}

.champion-dropdown img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Apply same visual ring to the image so the colored area surrounds the icon */
.champion-dropdown.type-ad img,
.champion-dropdown.type-ap img {
    border-radius: 6px;
    box-shadow: inherit;
}

/* Style champion dropdowns positioned under their boxes */
.champion-dropdown > select {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    padding: 2px;
    font-size: 10px;
    border: 1px solid #ccc;
    background-color: white;
    box-sizing: border-box;
    z-index: 10;
}

.champion-dropdown > select option {
    font-weight: normal;
    padding-left: 4px;
}

.champion-dropdown > select option:disabled {
    color: #999;
    font-style: italic;
    text-decoration: line-through;
}

/* Bard label styling (looks like the dropdown) */
.champion-dropdown .champion-label {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    padding: 2px;
    font-size: 10px;
    border: 1px solid #ccc;
    background-color: white;
    box-sizing: border-box;
    z-index: 10;
    text-align: left;
    margin: 0; /* remove default p margins to align exactly like select */
    white-space: nowrap; /* prevent wrapping unlike select */
    color: #333;
}

/* Button to regenerate teams */
#new-champions-button {
    display: block;
    margin: 20px auto 0;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    background-color: beige;
    border: 2px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#new-champions-button:hover {
    background-color: #f0f0f0;
    border-color: #999;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

#new-champions-button:active {
    background-color: red;
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#new-champions-button:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

footer {
    width: 100%;
    display: flex;
    flex-direction: column; 
    align-items: stretch;    
    text-align: start;      
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 30px;
    background-color: beige;
    max-width: 80%;
}

footer h2 {
    margin: 0 0 8px 0; 
    align-self: center; 
    text-align: center;
    
}

footer ul {
    padding-left: 20px; 
    margin: 0;
    list-style-type: square;
}