:root{
    --card-bg:rgba(0, 0, 0, 0.5);

    --decoration-effect:2px solid var(--color-effect);
    --decoration-flavour:2px solid var(--green-1);
    --decoration-ability:2px solid var(--color-ability);
    --decoration-critical:2px solid var(--color-critical);
    --decoration-name:2px solid var(--white-1);

    --color-ability:var(--blue-1);
    --color-effect:var(--yellow-1);
    --color-critical:var(--red-2);

    --toggle-bg:rgba(31, 20, 51, 0.8);
 /*    --text-shadow:-1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; */
    --text-shadow:-2px -2px 0 #000000d8, 2px -2px 0 #000000d8, -2px 2px 0 #000000d8, 2px 2px 0 #000000d8;
    --transition: transition: all 0.2s steps(4, end);


  --text-h: var(--white-1);
  --text-m: var(--white-2);
  --text-l: var(--white-3);
  --bg-1: #056c6c;
  --bg-2: rgba(45, 27, 78, 0.9);;

  --white-1:#f5f5f5;
  --white-2:#f2f4f8;
  --white-3:#cdd1d5;
  --blue-1: #4D9DD0;
  --blue-2: #3C82B5;
  --blue-3: #316E9E;
  --red-1: #F28784;
  --red-2:#ff6b6b;
  --red-3: #E14B3A;
  --red-4: #B43C31;
  --green-1: #69B68D;
  --green-2: #4E9472;
  --green-3: #3E785E;
  --yellow-0: #e9c46a;
  --yellow-1: #F79B15;
  --yellow-2: #DB8D1D;
  --yellow-3: #B47621;

  --navy: #324461;
  --purple-1:#9f608b;
  --purple-2:#6b4e94;
  --black:#111111;
  --container-background:#374244;
    --icon-idle:var(--yellow-0);
}
@font-face {
  font-family: Jacquard;
  src: url('Jacquard12-Regular.ttf')  format('truetype');
  
}

@font-face {
  font-family: Jersey;
  src: url('Jersey10-Regular.ttf')  format('truetype');
}

@font-face {
  font-family: Alagard;
  src: url('alagard.ttf')  format('truetype');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
       font-family: "Jersey", 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-shadow: var(--text-shadow);
}

body {
    background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 100%);
    color: #f8f8f8;
    min-height: 100vh;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
}

h1 {
    font-family: "Alagard", 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 10px;
    color: var(--yellow-0);
    text-shadow: var(--text-shadow);
}

.description {
    max-width: 800px;
    margin: 0 auto 25px;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #d0c4e4;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(45, 27, 78, 0.7);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.05em;

    .damage-input{
            padding: 12px 20px;
            border-radius: 8px;
            border: 2px solid #6b4e94;
            background: rgba(31, 20, 51, 0.8);
            color: white;
            font-size: 1rem;
            cursor: pointer;
            transition: var(--transition);
            appearance: none;
            min-width: 200px;   
        }
    



    .search-container {
        position: relative;
        display: flex;
        align-items: center;

        .search-input {
            padding: 12px 20px 12px 45px;
            border-radius: 25px;
            border: 2px solid #6b4e94;
            background: rgba(31, 20, 51, 0.8);
            color: white;
            font-size: 1rem;
            min-width: 300px;
        }

        .search-input:focus {
            outline: none;
            border-color: var(--yellow-0);
            box-shadow: 0 0 15px rgba(233, 196, 106, 0.3);
        }
        

        .search-icon {
            position: absolute;
            left: 15px;
            color: #9f85c9;
        }
    }
    .search-container:hover {
        transform: translate(-1px, -2px);
    }

}


.deck-selector, .suit-selector{
        display: flex;
        align-items: center;
        gap: 15px;

        

      
    }
  .dropdown {
            padding: 12px 20px;
            border-radius: 8px;
            border: 2px solid #6b4e94;
            background: rgba(31, 20, 51, 0.8);
            color: white;
            font-size: 1rem;
            cursor: pointer;
            transition: var(--transition);
            appearance: none;
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e9c46a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
            background-repeat: no-repeat;
            background-position: right 15px center;
            background-size: 16px;
            padding-right: 45px;
            min-width: 200px;   
        }

        .dropdown:hover {
            transform: translate(-1px, -2px);
        }

        .dropdown:focus {
            outline: none;
            border-color: var(--yellow-0);
            box-shadow: 0 0 15px rgba(233, 196, 106, 0.3);
        }

        .dropdown option {
            background: #2d1b4e;
            color: white;
            padding: 10px;
        }
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1800px;
    margin: 0 auto;

    .section-header {
        grid-column: 1 / -1;
        font-size: 2rem;
        text-align: center;
        letter-spacing: 3px;
        border-radius: 8px;
        font-family: "Alagard", 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        color: var(--yellow-0);
    }

    
}

.card, .monster-card {
    background: #3a2471;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
    position: relative;
    height: 550px;
    display: flex;
    flex-direction: column;
    max-width: 300px;
    border:1px solid black;
}

.card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.5);
}

.card-image {
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    border-radius: 12px;

    .card-index {
        font-family: "Alagard", 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        position: absolute;
        top: 2px;
        left: 0;
        right:0;
        margin:auto;
        color: var(--text-l);
        font-weight: bold;
        font-size: 0.8rem;
        z-index: 10;
        text-align: center;
    }

    .soloterrare-card .card-overlay {
        background: linear-gradient(to top, rgba(0, 0, 0, 01) 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
    }

    .card-overlay {
        z-index: 10;
        position: absolute;
        justify-content: space-between;
        bottom: 0;
        left: 0;
        right: 0;
        top: 0;
        background: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 20%, transparent 100%);
        padding: 16px;
        color: white;
        display: flex;
        flex-direction: column;
        gap: 4px;

        .soloterrare-stats {
            width:100%;
            display:flex;
            gap: 2px;
            margin-bottom: -4px;
            justify-content: space-between;

            .stat {
                background: rgba(0, 0, 0, 0.4);
                border-radius: 4px;
                position: relative;
                color: var(--white-3);
                /* Add flexbox for better text alignment */
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
            }

            /* Use background-image instead of content for the icons */
            .stat::before {
                content: "";
                position: absolute;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                width: 48px;
                height: 48px;
                background-size: contain;
                background-repeat: no-repeat;
                background-position: center;
                opacity: 0.5; /* Make icon more transparent */
                z-index: 1; /* Place behind text */
            }

            .stat.attack::before {
                background-image: url(crossed-swords.svg);
            }

            .stat.defence::before {
                background-image: url(shield.svg);
            }

            .stat.chips::before {
                background-image: url(two-coins.svg);
            }

            .stat-value {
                color: #e9c46a;
                font-weight: bold;
                text-align: center;
                width: 100%;
                z-index: 2; /* Higher than the icon */
                font-size: 2rem;
                line-height: 1.2rem;
                font-family: "Jacquard", system-ui;
                position: relative; /* Ensure z-index works */
            }

            .stat-label {
                font-family: "Jersey", 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
                font-size: 1rem;
                text-align: center;
                width: 100%;
                z-index: 2; /* Higher than the icon */
                position: relative; /* Ensure z-index works */
            }


        }

        .toggle-container {
            position: absolute;
            top: 80px;
            right: 15px;
            z-index: 10;
            display:flex;
            flex-direction: column;
            gap:2px;

            /* Toggle button style */
            .toggle-btn {
                padding: 6px 12px;
                font-family: "Alagard", 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
                font-size: 0.9rem;
                letter-spacing:0.01em;
                background: var(--toggle-bg);
                color: var(--text-h);
                color: #d0c4e4;
                border-left: 2px solid transparent;
                border-right: 2px solid transparent;
                border-top: none;
                border-bottom: none;
                border-radius: 8px;
                cursor: pointer;
                transition: var(--transition)
            }

            /* Active toggle button style */
            .toggle-btn.active {
                background: var(--toggle-bg);
                color: var(--yellow-0);
                border-left: var(--decoration-effect);
                border-right: var(--decoration-effect);
                box-shadow: 0 0 10px rgba(233, 196, 106, 0.5);
            }
        }

        .card-name, .card-name.overlay-effect {
            width:100%;
            text-align: center;
            font-size: 1.6rem;
            font-weight: bold;
            color: var(--yellow-0);
            font-family: "Alagard", 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            letter-spacing:0.05em;
            border-left: var(--decoration-name);
            border-right: var(--decoration-name);
        }
    


        .overlay-effect {
            font-size: 1rem;
            line-height: 1.1;
            padding: 4px 8px;
            background: var(--card-bg);
            border-radius: 8px;
            border-left: var(--decoration-effect);
            border-right: var(--decoration-effect);
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
            letter-spacing:0.02em;
            text-align: left;
        }
            /* Soloterrare specific styles */
        .overlay-effect.solo {
            /* font-style: italic; */
            border-left: var(--decoration-flavour);
            border-right: var(--decoration-flavour);
            color: var(--text-l);
            font-family: "Alagard", 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            font-size: 0.9rem;
            letter-spacing:0.01em;
        }

        .overlay-effect.ability {
            border-left: var(--decoration-ability);
            border-right: var(--decoration-ability);
        }

        .overlay-effect.critical {
            border-left: var(--decoration-critical);
            border-right: var(--decoration-critical);
        

        }
        
        .contents{

            .content-section {
                display: none;
                flex-direction: column;
                letter-spacing:0.02em;
                gap: 4px;
            }

            .content-section.active {
                display: flex;
            }
        }    

    }
}

.card-image::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: inherit; /* Inherit the background from parent */
  background-size: cover;
  background-position: center;
    filter: url(#Pixelate);
  z-index: 1; /* Place behind content */
  pointer-events: none; /* Allow clicks to pass through to content */
}

.overlay-effect::before {
    z-index: 20;  
}





.soloterrare-card {
    height: 550px;
}

.ability .title {
    color: var(--color-ability);
}
.critical .title {
    color: var(--color-critical);
}
.activation .title {
    color: var(--color-effect);
}
.soloterrare-stats {
    width:100%;
    display:flex;
    gap: 2px;
    margin-bottom: -12px;
    justify-content: space-between;

    .stat {
        background: rgba(0, 0, 0, 0.4);
        border-radius: 4px;
        position: relative;
        color: var(--white-3);
        /* Add flexbox for better text alignment */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    /* Use background-image instead of content for the icons */
    .stat::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 48px;
        height: 48px;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        opacity: 0.5; /* Make icon more transparent */
        z-index: 1; /* Place behind text */
    }

    .stat.attack::before {
        background-image: url(crossed-swords.svg);
    }

    .stat.defence::before {
        background-image: url(shield.svg);
    }

    .stat.chips::before {
        background-image: url(two-coins.svg);
    }

    .stat-value {
        color: #e9c46a;
        font-weight: bold;
        text-align: center;
        width: 100%;
        z-index: 2; /* Higher than the icon */
        font-size: 2rem;
        line-height: 1.2rem;
        font-family: "Jacquard", system-ui;
        position: relative; /* Ensure z-index works */
    }

    .stat-label {
        font-family: "Jersey", 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        font-size: 1rem;
        text-align: center;
        width: 100%;
        z-index: 2; /* Higher than the icon */
        position: relative; /* Ensure z-index works */
    }


}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: #9f85c9;
}


/* game*/

        .btn {
            padding: 12px 24px;
            background: #4c2a7a;
            color: white;
            border: none;
            border-radius: 8px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            margin: 10px 5px;
        }
        
        .btn:hover {
            background: #5d3a8c;
            transform: translateY(-2px);
        }
        
        .btn-primary {
            background: #2d1b4e;
            color: #e9c46a;
        }
        
        .btn-primary:hover {
            background: #d4b15d;
            box-shadow: 0 0 15px rgba(233, 196, 106, 0.5);
        }

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .deck-selector, .suit-selector, .dropdown, .search-container, .search-input {
        width: 100%;
    }
    
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .card {
        height: 450px;
    }
    
    .soloterrare-card {
        height: 500px;
    }
}

@media (max-width: 480px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .card {
        height: 400px;
    }
    
    .soloterrare-card {
        height: 450px;
    }
}