body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.container {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    min-width: 40%;
    text-align: center;
    justify-content: flex-start;
    align-items: center;
}

#calc_wrapper {
    min-width: 70%;
    width: 500px;
}

h1{
    margin-bottom: 20px;
}

h2{
    margin: 18px 0 0 0;
}

input, select {
    font-size: 16px;
    box-shadow: 1px 3px 4px rgba(0, 0, 0, 0.2);
    outline: none;
    height: 4ch;
}

.input-section {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.input-section label {
    display: block;
    margin-bottom: 5px;
}

.input-section input, select {
    margin-bottom: 15px;
    padding: 5px;
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 7px;
    box-sizing: border-box;
}

.input-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.width_left{
    flex: 1;
}

.width_right{
    flex: 3;
}

.even_width{
    flex: 1;
}

.label-input-pair {
    display: flex;
    flex-direction: column;
}

#toggle-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

#weighting, #more_10 {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

#buttonContainer {
    display: inline-flex;
    gap: 10px;
}

#calculateButton, #reset {
    padding: 10px 15px;
    width: 100%;
    border: 1px solid transparent;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.2);
    background-color: rgb(36, 154, 214);
    transition: background-color 0.3s ease, transform 0.3s ease;
    width: 30%;
    margin: auto;
    outline: none;
    flex: 1;
    text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.75);
}

#reset:hover, #calculateButton:hover {
    border: 1px solid #666;
    background-color: rgb(27, 131, 182);
    box-shadow: inset 0px 4px 10px rgba(0, 0, 0, 0.5);
    text-shadow: 0px 2px 1px rgba(255, 255, 255, 0.5);
}

#output-section {
    margin-top: 30px;
    border-radius: 10px;
    border: 1px solid #ccc;
}

.score-grid {
    grid-template-columns: repeat(6, 30px);
    grid-gap: 5px;
    justify-content: center;
}

.end-row {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    gap: 10px;
}

#arrowScores {
    margin: 0 10px;
}

.arrow-score {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 15%;
    color: white;
    border: 1px solid #FFF;
    box-shadow: 1px 3px 4px rgba(0, 0, 0, 0.2);
    font-size: 20px;
}

.arrow-score::after {
    content: attr(data-score);
    position: absolute;
    display: flex;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border-radius: 50%;
    pointer-events: none;
    justify-content: center;
    align-items: center;
}

.arrow-score[data-score="🕷️"]::after {
    content: attr(data-score);
    font-size: 2em;
}

.end_score {
    color: #000;
    border-left: 2px solid #AAA;
    border-radius: 10px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    position: relative;
    font-size: 18px;
    white-space: nowrap;
    box-shadow: -4px 0px 4px rgba(0, 0, 0, 0.2);
    width: 2em; /* fixed width to ensure consistent box size */
}

.end_score::after {
    content: " ";
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: transparent #AAA transparent transparent;
}

.end_score_value, .end_score_average {
    display: block;
    text-align: center;
    min-width: 2.5ch;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.end_score_divider {
    width: 100%;
    height: 1px;
    background-color: #CCC;
    margin: 2px 0;
}

.score-X {
    background: rgb(246, 193, 19);
    color: #000;
    font-weight: bold;
    text-shadow: 0px 2px 2px rgba(255, 255, 255, 0.75);
}

.score-X::after {
    background:#e6b800;
    background: linear-gradient(180deg,rgba(246, 223, 19, 1) 47%, rgba(184, 165, 0, 1) 50%, rgba(246, 223, 19, 1) 100%);
    border: 1px solid #fff;
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
}

.score-10, .score-9 {
    border-color: #d4d4d4;
    background: rgb(246, 223, 19);
    background: linear-gradient(180deg,rgb(255, 255, 255) 0%, rgba(246, 223, 19, 1) 30%, rgba(246, 223, 19, 1) 45%, rgba(184, 165, 0, 1) 47%, rgba(246, 223, 19, 1) 100%);
    color: #000;
    font-weight: bold;
    text-shadow: 0px 2px 2px rgb(255, 255, 255);
}

.score-10::after, .score-9::after {
    background: rgb(246, 223, 19);
    border: 1px solid #fff;
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
}

.score-8, .score-7 {
    background: #E5001E;
    background: linear-gradient(180deg,rgba(229, 0, 30, 1) 30%, rgb(157, 2, 23) 100%);
    text-shadow: 0px 2px 2px rgba(0, 0, 0, 0.75);
}

.score-8::after, .score-7::after {
    background: #E5001E;
    border: 1px solid #ffa7a7;
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
}

.score-6, .score-5 {
    background: #249AD6;
    background: linear-gradient(180deg,rgba(36, 154, 214, 1) 30%, rgba(28, 111, 153, 1) 100%);
    text-shadow: 0px 2px 2px rgba(0, 0, 0, 0.75);
}

.score-6::after, .score-5::after {
    background: #249AD6;
    border: 1px solid #7bd3ff;
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
}

.score-4, .score-3 {
    background: #000;
    text-shadow: 0px 2px 2px rgba(154, 154, 154, 0.75);
}

.score-4::after, .score-3::after {
    border: 1px solid #c9c9c9;
    box-shadow: 0px 0px 5px rgba(255, 255, 255, 1);
}

.score-2, .score-1 {
    background-color: #FFF;
    color: #000;
    font-weight: bold;
    text-shadow: 0px 2px 2px rgba(154, 154, 154, 0.75);
}

.score-2::after, .score-1::after {
    border: 1px solid #4b4b4b;
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.75);
}

.score-0 {
    background-color: rgb(20, 129, 44);
    text-shadow: 0px 2px 2px rgba(0, 0, 0, 0.75);
}

.score-0::after {
    border: 1px solid #2a402b;
    box-shadow: 0px 0px 5px rgb(35, 63, 40);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}
 
input:checked + .slider {
    background-color: rgb(36, 154, 214);
}

input:checked + .slider::before {
    transform: translateX(26px);
}

.sub-total {
    position: relative;
}

#total_container, .subtotal_container, #classification_container{
    display: inline-flex;
    gap: 10px;
    padding: 10px 0;
}

.distance_header{
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 14px 0;
}

.tally {
    border: 1px solid rgb(255, 196, 0);
    padding: 5px 10px;
    border-radius: 20px;
    box-shadow: 1px 3px 4px rgba(0, 0, 0, 0.2), inset 0 5px 8px rgba(255, 255, 255, 0.5);
    display: flex;
    height: 2ch;
}

.tally_rating {
    display: flex;
    justify-content: center;
    align-items: center;
}

.tally_rating_content {
    border: 1px solid rgb(255, 196, 0);
    padding: 5px 10px;
    border-radius: 20px;
    box-shadow: 1px 3px 4px rgba(0, 0, 0, 0.2), inset 0 5px 8px rgba(255, 255, 255, 0.5);
}

.tally_distance{
    flex: 0 0 auto;
}

.tally_ten {
    border: 1px solid rgb(255, 255, 0);
    background: linear-gradient(to bottom, rgba(246, 223, 19, 0.9) 0%, rgba(246, 193, 19, 0.9) 70%);
}

.tally_x {
    background: linear-gradient(to bottom, rgba(246, 193, 19, 0.9) 0%, rgba(246, 223, 19, 0.9) 70%);
    box-shadow: 1px 3px 4px rgba(0, 0, 0, 0.2), inset 0 5px 8px rgba(255, 255, 255, 0.5);
}

.classification_gray{
    border-color: gray;
    background-color: rgb(233, 233, 233);
}

.classification_white{
    border-color: #FFF;
    background-color: rgb(229, 229, 229);
}

.classification_black{
    border-color: #000;
    background-color: rgb(25, 25, 25);
    color: #FFF;
}

.classification_blue{
    background-color: rgb(36, 154, 214);
    border-color: rgb(166, 207, 227);
}

.classification_red{
    background-color: rgb(229, 0, 30);
    border-color: rgb(227, 166, 166);
    color: #FFF;
}

.classification_gold{
    border-color: gold;
    background-color: rgb(249, 244, 163);
}

.classification_master_bowman{
    border-color: gray;
    background-color: rgb(249, 244, 163);
}

.classification_gmb{
    border-color: #000;
    background-color: rgb(249, 244, 163);
}

@keyframes reflection {
    0% {
      background-position: 0% 100%;
    }
    50% {
      background-position: 0% 350%;
    }
    100% {
      background-position: 0% 100%;
    }
  }

.classification_elite_bronze{
    border-color: gold;
    background: linear-gradient(180deg, #c6925e, #b18f6e, #c39b73, #865c42);
    background-size: 100% 150%;
    animation: reflection 10s infinite ease-in-out;
    color: #FFF;
}

.classification_elite_silver{
    border-color: gold;
    background: linear-gradient(180deg, #d9d9d9, #f2f2f2, #bfbfbf, #a6a6a6);
    background-size: 100% 150%;
    animation: reflection 10s infinite ease-in-out;
}

.classification_elite_gold{
    border-color: gold;
    background: linear-gradient(180deg, #e6b800, #f9d423, #ffec99, #d4af37);
    background-size: 100% 150%;
    animation: reflection 10s infinite ease-in-out;
}

.badges {
    border: 1px solid #FFF;
    border-radius: 20px;
    padding: 7px;
    background-color: #FFF;
    box-shadow: inset 0px 1px 2px rgba(0, 0, 0, 0.5);
    min-width: 2ch;
    min-height: 2ch;
    position: relative;
    bottom: 45%;
    line-height: 130%;
}

#alertOverlay {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* animation: none; */
}

.alert-visible {
    animation: fadeInDrop 0.5s ease forwards;
    pointer-events: auto;
}

.alert-hidden {
    animation: fadeOutRise 0.5s ease forwards;
}

#alertMessage {
    padding: 10px 15px;
    border: 1px solid #CCC;
    background-color: rgb(229, 0, 30);
    color: #FFF;
    font-size: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.2);
}

/* Keyframes */

@keyframes fadeInDrop {
    0% {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes fadeOutRise {
    0% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

/* Media Queries for Smartphones */

@media (max-width: 768px) {

    .container {
        width: 80%;
    }

    #calc_wrapper{
        width: unset;
    }

    header {
        width: 80%;
    }

    .input-section {
        gap: 10px;
        width: 90%;
        margin: auto;
    }

    input, select {
        font-size: 16px;
        padding: 8px;
    }

    #calculateButton, #reset {
        font-size: 14px;
        padding: 12px;
        margin: unset;
        width: unset;
        color: #000;
    }

    #calculateButton:hover, #reset:hover, #calculateButton:active, #reset:active{
        box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.2);
        background-color: rgb(36, 154, 214);
    }

    h1, h2 {
        font-size: 20px;
    }

    #alertOverlay {
        top: 20%;
        width: 80%;
    }

    #alertMessage {
        font-size: 16px;
        width: 100%;
    }

    .score-grid {
        grid-template-columns: repeat(3, 60px);
        grid-gap: 8px;
    }

    .end-row {
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
    }

    .end_score {
        border-radius: 6px;
        font-size: 14px;
    }

    .arrow-score {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        border-radius: 22px;
        font-size: 16px;
        font-weight: bold;
    }

    .arrow-score::after {
        top: 8px;
        left: 18%;
        right: 18%;
        bottom: 8px;
    }
    
    #total_container, .subtotal_container{
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .tally_rating_content {
        font-size: 14px;
    }

    .badges {
        line-height: 1.4;
    }

    .width_right{
        flex: 2;
    }

}

