:root{
            --blood-red: #8b0000;
            --dark-red: #5a0000;
            --charcoal: #1a1a1a;
            --mid-gray: #2a2a2a;
            --light-gray: #444;
            --bone: #e6d3a7;
            --rust: #882f09;
            --darkBlood: #380c0c;
        }

        *{
            margin: 0px;
        }

        body{
            background-color: var(--charcoal);
            background-image: url("https://www.gamereactor.eu/media/20/kentaromiura_creator_3472093_650x.jpg");
            background-size: cover;
            background-attachment: fixed;
            background-repeat: no-repeat;
            text-align: center;
            color: var(--bone);
            position: relative;
            font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
        }
        body::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(rgba(26, 26, 26, 0.9), rgba(26, 26, 26, 0.7));
            pointer-events: none;
            z-index: -1;
        }
        
        nav{
            background: linear-gradient(to bottom, var(--darkBlood), var(--charcoal));
            padding: 1rem 2rem;
            margin-bottom: 30px;
            text-align:justify;
            border-bottom: 3px solid var(--rust);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
            position: relative;
            z-index: 14;
        }

        #title{
            color: whitesmoke;
            font-size: 2.5rem;
            font-weight: 700;
            text-shadow: 3px 3px 0 var(--blood-red), 6px 6px 0 rgba(0, 0, 0, 0.7);
            position: relative;
            display: inline-block;
            padding: 0.5rem 1rem;
            cursor:pointer;
            text-decoration: none;
        }

        #title:hover{
            transform:scale(1.05);
        }
        
        #title::after {
            content: "";
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 3px;
            background: var(--rust);
            transform: scaleX(0);
            transform-origin: bottom right;
            transition: transform 0.3s ease;
        }

         #title:hover::after {
            transform: scaleX(1);
            transform-origin: bottom left;
        }

        .gameSpace{
             max-width: 1200px;
            margin: 2rem auto;
            padding: 2rem;
            background: rgba(26, 26, 26, 0.8);
            border: 3px solid var(--blood-red);
            border-radius: 5px;
            box-shadow: 0 0 20px rgba(139, 0, 0, 0.3), inset 0 0 15px rgba(0, 0, 0, 0.5);
            position: relative;
        }
        .gameSpace::before {
            content: "";
            position: absolute;
            top: 10px;
            left: 10px;
            right: 10px;
            bottom: 10px;
            border: 1px solid rgba(212, 175, 55, 0.2);
            pointer-events: none;
        }

        #titleCard {
            text-align: center;
            padding: 1rem;
            margin-bottom: 2rem;
            border-bottom: 2px solid var(--blood-red);
        }
        
        #titleCard img {
            max-width: 350px;
            height: auto;
            filter: drop-shadow(0 0 10px rgba(139, 0, 0, 0.7));
            margin-bottom: 1rem;
        }
        
        #titleCard h2 {
            font-size: 1.8rem;
            color: var(--blood-red);
            text-shadow: 1px 1px 2px rgba(43, 41, 41, 0.8);
            margin-bottom: 0.5rem;
        }
        
        #titleCard h3 {
            font-size: 1.3rem;
            color: var(--bone);
            text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
        }

        #giveUp{
            position: absolute;
            top: 2rem;
            right: 2rem;
            padding: 0.5rem 1.5rem;
            background: linear-gradient(to bottom, var(--mid-gray), var(--charcoal));
            border: 2px solid var(--blood-red);
            color: var(--bone);
            font-family: 'Cinzel', serif;
            font-size: 1.1rem;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
        }

        #giveUp:hover{
            transform: scale(1.1);
        }

        #gamePlay{
            display: flex;
            justify-content: center;
            margin-bottom: 2rem;
            position: relative;
        }

        .game-stats {
            display: flex;
            justify-content: space-around;
            margin: 2rem 0;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .stat-box {
            background: rgba(0, 0, 0, 0.5);
            border: 2px solid var(--rust);
            border-radius: 8px;
            padding: 1rem;
            min-width: 150px;
        }

        .statVal {
            font-size: 2rem;
            color: var(--gold);
            font-weight: bold;
        }


        #charInp:focus {
            border-color: var(--blood-red);
            box-shadow: inset 0 0 12px rgba(212, 55, 55, 0.4), 0 0 10px rgba(139, 0, 0, 0.3);
        }
        
        #charInp::placeholder {
            color: #888;
        }


        #charInp{
            width: 400px;
            padding: 0.8rem 1.2rem;
            background: rgba(42, 42, 42, 0.8);
            border: 2px solid var(--blood-red);
            color: var(--bone);
            font-size: 1.2rem;
            outline: none;
            box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5);
            transition: all 0.3s ease;
        }

        #submitInp{
             background: var(--dark-red);
            color: var(--bone);
            padding: 0.8rem 1.2rem;
            cursor: pointer;
            border: 2px solid var(--dark-red);
            border-left: none;
            font-size: 1.8rem;
            transition: all 0.3s ease;
        }

        #submitInp:hover{
            background: var(--blood-red);
            color: white;
        }

        #dropdown {
            position: absolute;
            background: rgba(30, 15, 5, 0.95);
            border: 2px solid #5a2d0e;
            border-top: none;
            border-radius: 0 0 5px 5px;
            max-height: 350px;
            overflow-y: auto;
            z-index: 1;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
            display:none; 
            top: 100%;
            width: 440px;
            font-size: 20px;
            right:34.2%;
            border-radius: 7px;
        }
        .dropItem {
            padding: 12px 20px;
            border-bottom: 1px solid #3a1f0e;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            z-index:2;
            align-items: center;
            text-align: center;
            
        }

        .dropImg{
             width: 50px;
            height: 50px;
            object-fit: cover;
            border-radius: 4px;
            margin-right: 12px;
            border: 1px solid var(--rust);
        }
        
        .dropItem:hover .dropImg {
            transform: scale(1.05);
            box-shadow: 0 0 5px rgba(197, 165, 63, 0.5);
        }

        .details{
            font-size: 10px;
        }
        
        .dropItem:hover {
            background: rgba(139, 0, 0, 0.3);
            transform: scale(1.05);
        }

        #results{
            margin: 0 auto 100px;
            width: calc(100% - 40px); /* accounts for padding */
            max-width: 1200px; /* or whatever maximum width you prefer */
            overflow-x: auto;
            scrollbar-color: rgb(220, 0, 34) #2a2a3c;
            scrollbar-width: thin;
            background: rgba(42, 42, 42, 0.6);
            border: 2px solid var(--rust);
            padding: 10px;
            box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);
            display: block;
        }

        #scrollCont {
            overflow-x: auto;
            min-width: min-content;
            width: 100%;
        }

        #results::-webkit-scrollbar {
            height: 12px;
        }

        #results::-webkit-scrollbar-track {
            background: #2a2a3c;
            border-radius: 10px;
        }

        #results::-webkit-scrollbar-thumb {
            background: rgb(220, 0, 34);
            border-radius: 10px;
        }


        #labelRow,.charRow{
            text-align: center;
            justify-content: center;
            display: grid;
            grid-template-columns: 
                minmax(100px, 1fr) 
                minmax(100px, 1fr) 
                minmax(100px, 1fr) 
                minmax(100px, 1fr) 
                minmax(100px, 1fr) 
                minmax(100px, 1fr) 
                minmax(100px, 1fr) 
                minmax(100px, 1fr);
            gap: 5px;
            min-width: min-content;
            width: 100%;
            align-items: center;
        }


        .itemR{
             display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            background: linear-gradient(135deg, #1b1b1d 0%, #2c2c2e 100%);
            border-radius: 10px;
            height: 50px;
            padding: 5px;
            font-size: clamp(14px, 1.5vw, 20px);
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            min-width: 0; 
            transition: all 0.3s ease;
        }

        .characterImg{
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: flex;
            border-radius: 10px;
            gap:2px;
        }

        .item{
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            background: linear-gradient(135deg, #1b1b1d 0%, #2c2c2e 100%);
            border-radius: 10px;
            padding: 5px;
            font-size: clamp(14px, 1.5vw, 20px);
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            min-width: 0; 
            transition: all 0.3s ease;
            aspect-ratio: 1 / 1;
            height: auto;
            gap:2px;
            text-wrap:inherit;
        }

        #howTo{
            max-width: 1200px;
            margin: 2rem auto;
            padding: 2rem;
            background: rgba(26, 26, 26, 0.8);
            border: 3px solid var(--rust);
            border-radius: 5px;
            box-shadow: 0 0 20px rgba(139, 0, 0, 0.3), inset 0 0 15px rgba(0, 0, 0, 0.5);
        }

        #howTo h2 {
            font-size: 1.8rem;
            color: var(--bone);
           
        }
        
        #howTo p {
            margin-bottom: 15px;
            color: var(--dark-bone);
        }

        .step-header {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
            /* margin-left: 30px; */
            /* text-align: center; */
        }
        
        .step-number {
            background: var(--rust);
            color: white;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 1.2rem;
            margin-right: 15px;
            flex-shrink: 0;
        }
        
        .visual-guide{
            margin: 20px 0;
            padding: 15px;
            background: rgba(20, 20, 22, 0.7);
            border-radius: 8px;
            border: 1px solid rgba(139, 0, 0, 0.3);
        }

        .samplePlay{
            width:fit-content;
            max-width: 100%;
            height: auto;
        }

        .color-key{
            display: flex;
            justify-content: center;
            gap: 20px;
            margin: 20px 0;
            flex-wrap: wrap;
        }
        
        .key-item {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .color-box {
            width: 20px;
            height: 20px;
            border-radius: 4px;
        }
        
        .attribute-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 15px;
            margin-top: 20px;
        }
        
        .attribute-card {
            background: rgba(30, 30, 33, 0.7);
            padding: 15px;
            border-radius: 8px;
            border: 1px solid rgba(139, 0, 0, 0.2);
        }
        
        .attribute-title {
            color: var(--rust);
            font-weight: bold;
            margin-bottom: 5px;
        }
        
        .attribute-example {
            color: var(--dark-bone);
            font-size: 0.9rem;
        }
        
        .tip-box {
            background: rgba(139, 0, 0, 0.15);
            border-left: 4px solid var(--rust);
            padding: 15px;
            margin: 20px 0;
            border-radius: 0 8px 8px 0;
        }
        
        .tip-title {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
            color: var(--bone);
        }
        
        .tip-icon {
            color: var(--rust);
            font-weight: bold;
        }
        
        .call-to-action {
            text-align: center;
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid rgba(139, 0, 0, 0.3);
        }

        .correct, .correct-box{
            background: #0e5a1f;
        }

        .incorrect, .incorrect-box{
            background: #5a130e;
        }

        #finished{
            position:fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 90%;
            max-width: 700px;
            background: linear-gradient(135deg, #1e1e1e 0%, #0d0d0d 100%);
            border-radius: 20px;
            padding: 40px;
            text-align: center;
            z-index: 11;
            box-shadow: 0 0 40px rgba(220, 0, 34, 0.8);
            border: 5px solid rgb(220, 0, 34);
            display: none;
            animation: pulse 2s infinite;
        }

        .closeBut{
            position: absolute;
            top: 15px;
            right: 15px;
            width: 30px;
            height: 30px;
            background: var(--blood-red);
            color: var(--bone);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 1.2rem;
            font-weight: bold;
            z-index: 12;
            transition: all 0.3s ease;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
        }

        .closeBut:hover {
            transform: scale(1.1);
            background: var(--dark-red);
            box-shadow: 0 0 10px rgba(220, 0, 34, 0.8);
        }

            .endImg {
              max-width: 150px;
              width: 100%;
              height: auto;
              flex-shrink: 0;
              border-radius: 8px;       /* optional styling */
              box-shadow: 0 2px 8px rgba(0,0,0,0.15);
            }
            #endCont{
                display: inline-flex;
              align-items: center;
              gap: 1rem;
            }
            .endText {
              display: flex;
              flex-direction: column;
              margin: 0.4rem 0;
              color: #eee;
              font-family: "Segoe UI", sans-serif;
              text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
              letter-spacing: 0.5px;
              line-height: 1.2;
            
            }
            
            .endText h2 {
              margin: 0.25rem 0;
              font-size: 1.5rem;
              line-height: 1.2;
            }

        #overlay{
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            z-index: 10;
            display: none;
        }
        .endTit{
            font-size: 1.8rem;
            color: var(--blood-red);
            text-shadow: 1px 1px 2px rgba(43, 41, 41, 0.8);
            margin-bottom: 0.5rem;
        }

        #confirmation {
            display: none;
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: linear-gradient(to bottom, var(--mid-gray), var(--charcoal));
            color: var(--bone);
            padding: 15px 40px;
            border-radius: 8px;
            font-weight: bold;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7), 0 0 15px rgba(139, 0, 0, 0.5);
            z-index: 1000;
            border: 2px solid var(--rust);
            animation: slideDown 0.5s, fadeOut 0.5s 2.5s forwards;
            text-transform: uppercase;
        }

        #confirmation.show {
            display: block;
            animation: slideDown 0.5s, fadeOut 0.5s 2.5s forwards;
        }

        footer {
            background: linear-gradient(to bottom, var(--darkBlood), var(--charcoal));
            padding: 1rem 2rem;
            margin-top: 30px;
            text-align:justify;
            border-top: 3px solid var(--rust);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
            position: relative;
            z-index: 14;
            text-align: center;
        }
        .copyright {
            margin-top: 1rem;
            font-size: 0.9rem;
            color: #999;
        }
        .privPol{
            margin-top: 1rem;
            font-size: 1rem;
            color: #999;
        }
        .privPol:hover{
           color: #e1dbdb;
        }

        /* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    body {
        background-position: center center;
    }
    
    nav {
        padding: 0.8rem 1rem;
        margin-bottom: 20px;
        text-align: center;
    }
    
    #title {
        font-size: 1.8rem;
        text-shadow: 2px 2px 0 var(--blood-red), 4px 4px 0 rgba(0, 0, 0, 0.7);
        display: block;
    }
    
    .gameSpace {
        margin: 1rem auto;
        padding: 1rem;
    }
    
    #titleCard img {
        max-width: 250px;
    }
    
    #titleCard h2 {
        font-size: 1.4rem;
    }
    
    #titleCard h3 {
        font-size: 1.1rem;
    }
    
    #giveUp {
        position: relative;
        top: unset;
        right: unset;
        margin: 1rem auto;
        display: block;
    }
    
    #gamePlay {
        flex-direction: column;
        align-items: center;
    }
    
    #charInp {
        width: 85%;
        max-width: 300px;
        font-size: 1rem;
        padding: 0.7rem 1rem;
    }
    
    #submitInp {
        padding: 0.7rem 1.2rem;
        font-size: 1.4rem;
        border-left: 2px solid var(--dark-red);
        margin-top: 10px;
        width: 85%;
        max-width: 300px;
    }
    
    #dropdown {
        width: calc(85% + 22px);
        max-width: 322px;
        right: unset;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .game-stats {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
    
    .stat-box {
        width: 80%;
        min-width: unset;
    }
    
    #results {
        margin: 0 auto 50px;
        padding: 5px;
        width: 95%;
    }
    
    #labelRow,.charRow{
    display: grid;
    grid-template-columns: repeat(8, auto);
    gap: 5px;
    align-items: center;
    text-align: center;
    width: 100%;

        }

.itemR,
  .item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 5px;
    font-size: clamp(12px, 4vw, 16px);
    border-radius: 10px;
    min-width: 0;
    height: auto;
    white-space: normal;
    word-break: break-word; 
    overflow-wrap: anywhere; 
    text-overflow: clip;  
  }

    
    #howTo {
        padding: 1.5rem;
        margin: 1.5rem auto;
    }
    
    #howTo h2 {
        font-size: 1.5rem;
    }
    
    .attribute-list {
        grid-template-columns: 1fr;
    }
    
    .step-header {
        margin-left: 0;
    }
    
    .samplePlay {
        width: 100%;
    }
    
    #finished {
        width: 95%;
        padding: 20px;
    }
    
    .endTit {
        font-size: 1.5rem;
    }
    
    footer {
        padding: 1rem;
        text-align: center;
    }
}

/* Additional adjustments for very small devices */
@media screen and (max-width: 480px) {
    #title {
        font-size: 1.5rem;
    }
    
    #titleCard img {
        max-width: 200px;
    }

             #labelRow,.charRow{
            display: grid;
            grid-template-columns: 
                minmax(80px, 1fr) 
                minmax(80px, 1fr) 
                minmax(80px, 1fr) 
                minmax(80px, 1fr) 
                minmax(80px, 1fr) 
                minmax(80px, 1fr) 
                minmax(80px, 1fr) 
                minmax(80px, 1fr);
            gap: 4px;
            min-width: min-content;
            width: 100%;
            align-items: center; 
        }


        .itemR{
            border-radius: 5px;
            height: 30px;
            padding: 3px;
            font-size: clamp(10px, 1.2vw, 15px);
            min-width: 0; 
            display: flex;           
              justify-content: center; 
              align-items: center;     
              text-align: center; 
        }

        .item{
            display: flex;               /* ensure it stays a flex container */
            justify-content: center;     /* horizontal centering */
            align-items: center;         /* vertical centering */
            text-align: center;   
            border-radius: 5px;
            padding: 3px;
            font-size: clamp(10px, 1.2vw, 15px);
            aspect-ratio: 7 / 3;
            height: auto;
            gap:2px;
            text-wrap:inherit;
        }
    
    .stat-box {
        width: 90%;
    }
}
        













