
body {
    font-family: Arial, Helvetica, sans-serif;
    text-align: center;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
}

#guesses-grouped {
    display: flex;
    flex-direction: row;
    gap: 20px;
}
    
hr {
    width: min(500px, 80vw);
    max-width: 500px;
    margin-bottom: 0px;
}

#title {
    font-size: clamp(24px, 6vw, 36px);
    font-weight: bold;
    letter-spacing: 2px;
    margin-top: 50px;
    margin-bottom: 5px;
}

#description {
    font-size: clamp(10px, 4vw, 15px);
    font-weight: 500;
    letter-spacing: 1px;
    margin: 4px 0;
}

.tile {
    /* Box */
    border: 2px solid lightgray;
    flex: 1 1 calc(33.333% - 6px); /* 3 columns, minus 2 gaps (≈6px) */
    aspect-ratio: 1 / 1;           /* keep square tiles */
    min-width: 80px;
    min-height: 80px;
    max-width: 120px;
    max-height: 120px;
    animation: fadeIn 0.6s ease-out forwards;

    /* Text */
    color: black;
    font-size: clamp(11px, 3vw, 16px);
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    cursor: pointer;
    border-radius: 4px;
}

#board {
    width: min(90vw, 400px);
    height: min(90vw, 400px);
    max-width: 400px;
    max-height: 400px;
    margin: 10px auto 0;  /* center horizontally */
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    padding: 5px;
    box-sizing: border-box; /* makes padding part of width/height */
}


#chainboard {
    width: 90%;        /* proportional, but not tied to vw */
    max-width: 950px;  /* cap */
    height: clamp(60px, 12vw, 90px);
    border: 3px solid grey;
    margin: 0 auto;
    margin-top: 10px;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-start;
    align-content: flex-start;
    padding: 8px;
    gap: 0px;
    overflow-y: hidden;
    background-color: #f8f8f8;
}

.chaintile {
    /* Box */
    border: 2px solid lightgray;
    width: clamp(45px, 8vw, 80px);
    height: clamp(45px, 8vw, 80px);
    margin: 2px;
    margin-left: 4px;
    margin-right: 4px;
    flex-shrink: 0;

    /* Text */
    color: black;
    font-size: clamp(7px, 1.5vw, 12px);
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    cursor: grab;
    border-radius: 4px;
    background-color: white;
    transition: all 0.2s ease;
    word-wrap: break-word;
}

/*jump in animation when chaintile gets added*/
.jump-in {
    animation: jumpIn 0.15s ease-in forwards;
}

/*jump in animation when chaintile gets added*/
.shrink-out {
    animation: shrinkOut 0.15s ease-out forwards;
}

/* a correct chaintile in the middle of a chain */
.chaintile.correct-middle {
    /* Box */
    border-top: 6px solid darkgray;
    border-bottom: 6px solid darkgray;
    border-right: none;
    border-left: none;
    margin-left: 0px;
    margin-right: 0px;
    border-radius: 0px;

    /* Text */
    color: white;
    background-color: #6AAA64;
}

/* a correct chaintile on the right end of a chain */
.chaintile.correct-right {
    /* Box */
    border-top: 6px solid darkgray;
    border-bottom: 6px solid darkgray;
    border-right: 6px solid darkgray;
    border-left: none;
    margin-left: 0px;
    border-radius: 0px;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;

    /* Text */
    color: white;
    background-color: #6AAA64;
}

/* a correct chaintile on the left end of a chain */
.chaintile.correct-left {
    /* Box */
    border-top: 6px solid darkgray;
    border-bottom: 6px solid darkgray;
    border-right: none;
    border-left: 6px solid darkgray;
    margin-right: 0px;
    border-radius: 0px;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;

    /* Text */
    color: white;
    background-color: #6AAA64;
}

.chaintile:active {
    cursor: grabbing;
}

.chaintile.dragging {
    opacity: 0.5;
    transform: translateY(-1px);
    z-index: 1000;
}

.chaintile.drag-over-right {
    transform: translateX(15px);
}

.chaintile.drag-over-left {
    transform: translateX(-15px);
}

.chaintile.incorrect {
    background-color: rgb(209, 207, 207);
    animation: shake 0.4s ease-in-out;
}

.correct { 
    background-color: #6AAA64;
    color: white;
    border-color: white;
    pointer-events: none; /* disables clicks */
    user-select: none;
}

.selected {
    background-color: #787C7E;
    color: white;
    border-color: white;
}

/* fun lil animation for when you win*/
.win-tile {
    border-color: white;
    animation: win 1.5s ease forwards; 
}

#guesses-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

/* guess tracker */
#guess-circles {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

#guesses-remaining {
    font-size: clamp(12px, 4vw, 17px);
    font-weight: 500;
    letter-spacing: 1px;
    margin: 4px 0;
}

.guess-circle {
    width: clamp(10px, 5vw, 12px);
    height: clamp(10px, 5vw, 12px);
    border-radius: 50%;
    border: 2px solid #555;
    background-color: #555;
    display: inline-block;
    transition: all 0.2s;
}

/* a "used guess" state */
.guess-circle.used {
    border: 2px solid white;
    background-color: white;
    height: 0px;
    width: 0px;
}

/* lock-in button */
#submit {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    background-color: white;
    

    border: 2px solid grey;
    border-radius: 999px; /* oval */
    color: white;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.3s ease;
    margin-left: 30px;
    margin-right: 10px;

    color: black;
}

#submit:hover {
    transform: scale(1.05);
}

#submit:active {
    transform: scale(0.95);
}


/* yes button */
#yes {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    background-color: white;
    

    border: 2px solid grey;
    border-radius: 999px; /* oval */
    color: white;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.3s ease;
    margin-left: 10px;
    margin-right: 10px;

    color: black;
}

#yes:hover {
    transform: scale(1.05);
}

#yes:active {
    transform: scale(0.95);
}

/* no button */
#no {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    background-color: white;
    

    border: 2px solid grey;
    border-radius: 999px; /* oval */
    color: white;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.3s ease;
    margin-left: 10px;
    margin-right: 10px;

    color: black;
}

#no:hover {
    transform: scale(1.05);
}

#no:active {
    transform: scale(0.95);
}

/* back to puzzle button */
#share-results {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    background-color: white;

    border: 2px solid grey;
    border-radius: 999px; /* oval */
    color: white;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.3s ease;
    margin-left: 10px;
    margin-right: 10px;

    color: black;
}

#share-results:hover {
    transform: scale(1.05);
}

#share-results:active {
    transform: scale(0.95);
}

/* back to puzzle button */
#see-definitions {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    background-color: white;
    

    border: 2px solid grey;
    border-radius: 999px; /* oval */
    color: white;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.3s ease;
    margin-left: 10px;
    margin-right: 10px;

    color: black;
}

#see-definitions:hover {
    transform: scale(1.05);
}

#see-definitions:active {
    transform: scale(0.95);
}



.inactive {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none; /* disables clicks */
}

/* shuffle button */
#shuffle {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    background-color: white;
    

    border: 2px solid grey;
    border-radius: 999px; /* oval */
    color: white;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.3s ease;
    margin-right: 10px;

    color: black;
}

#shuffle:hover {
    transform: scale(1.05);
}

#shuffle:active {
    transform: scale(0.95);
}

.hovered {
    transform: scale(1.05);
}

.active {
    transform: scale(0.95);
}

/* clear button */
#clear {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    background-color: white;
    

    border: 2px solid grey;
    border-radius: 999px; /* oval */
    color: white;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.3s ease;
    margin-right: 40px;

    color: black;
}

#clear:hover {
    transform: scale(1.05);
}

#clear:active {
    transform: scale(0.95);
}

/* Alert styling */
.alert {
    position: fixed;      
    top: 100px;                   /* towards the top */
    left: 50%;                   /* center horizontally */
    transform: translate(-50%); /* shift back by half width */
    
    background: #000;             /* black background */
    color: #fff;                  /* white text */
    
    max-width: min(90vw, 600px);  /* responsive size */
    padding: 14px 24px;
    border-radius: 8px;
    font-weight: bold;
    font-size: clamp(16px, 2.5vw, 18px); /* medium-ish */
    text-align: center;

    opacity: 0;
    animation: alertSlideIn 0.3s ease forwards;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 1000;
}

/* Overlay behind the alert */
.alert-overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: rgba(0,0,0,0.5); /* semi-transparent black */
z-index: 999;               /* below the alert */
}

/* Are you sure? menu styling */
#are-you-sure {
    visibility: hidden;
    position: fixed;      
    top: 50%;                   /* center vertically */
    left: 50%;                   /* center horizontally */
    transform: translate(-50%, -50%); /* shift back by half width and half height */
    
    background: #fff;             
    color: black;                  

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    user-select: none;
    
    max-width: min(90vw, 500px);  /* responsive size */
    padding: 14px 24px;
    border: 2px solid black;
    border-radius: 8px;
    font-size: clamp(16px, 2.5vw, 18px); /* medium-ish */
    text-align: center;

    opacity: 1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 1000;
}
#are-you-sure.show {
visibility: visible; 
animation: alertJumpIn 0.3s ease forwards;
}

#are-you-sure.hide {
    visibility: visible; 
    animation: alertShrinkOut 0.3s ease forwards;
}

.alert.finished {
    animation: alertSlideOut 0.3s ease forwards;
}

/* end menu styling */
#end-menu {
    visibility: hidden;
    position: fixed;      
    top: 50%;                   /* center vertically */
    left: 50%;                   /* center horizontally */
    transform: translate(-50%, -50%); /* shift back by half width and half height */

    gap: 10px;
    
    background: #fff;             
    color: black;   

    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    
    align-items: center;
    justify-content: center;
    user-select: none;
    
    max-width: min(90vw, 500px);  /* responsive size */
    padding: 14px 24px;
    padding-bottom: 30px;
    border: 2px solid black;
    border-radius: 8px;
    font-size: clamp(16px, 2.5vw, 18px); /* medium-ish */
    text-align: center;

    opacity: 1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 1000;
}
#end-menu.show {
visibility: visible; 
animation: alertJumpIn 0.3s ease forwards;
}

#end-menu.hide {
    visibility: visible; 
    animation: alertShrinkOut 0.3s ease forwards;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes alertSlideOut {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes jumpIn {
    from {
        transform: scale(1.2);
    }
    to {
        transform: scale(1);
    }
}

@keyframes shrinkOut {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(0);
    }
}

@keyframes alertJumpIn {
    from {
        opacity: 0;
        transform: translate(-40%, -50%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes alertShrinkOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%);

    }
    to {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
}

@keyframes shake {
    0% { transform: translateX(0) }
    12.5% { transform: translateX(5px) }
    25% { transform: translateX(-5px) }
    37.5% { transform: translateX(5px) }
    50% { transform: translateX(0) }
    62.5% { transform: translateX(5px) }
    75% { transform: translateX(-5px) }
    87.5% { transform: translateX(5px) }
    100% { transform: translateX(0) }
}

@keyframes win {
    from {
        transform: rotate(0deg);
    }
    
    to {
        transform: rotate(360deg);
    }

}


#topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 45px; /* maybe a little taller */
    background: #f9f9f9;
    border-bottom: 1px solid lightgray;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    z-index: 900;
}

#info {
    font-size: 12px;
}

.icon-button {
    width: 36px;      /* same width and height → perfect circle */
    height: 36px;
    border-radius: 50%;
    display: flex;    /* center the icon */
    align-items: center;
    justify-content: center;

    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 10px;
    margin-right: 10px;
    border: 2px solid black;   /* explicit border */
    background: #f9f9f9;          /* consistent background */
    transition: background 0.2s;
}

.icon-button:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* how to play styling */
#how-to-play {
    visibility: hidden;
    position: fixed;      
    top: 50%;                   /* center vertically */
    left: 50%;                   /* center horizontally */
    transform: translate(-50%, -50%); /* shift back by half width and half height */

    gap: 0px;
    
    background: #fff;             
    color: black;   

    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    
    align-items: center;
    justify-content: center;
    user-select: none;
    
    max-width: min(90vw, 500px);  /* responsive size */
    padding: 14px 24px;
    padding-bottom: 30px;
    border: 2px solid black;
    border-radius: 8px;
    font-size: clamp(16px, 2.5vw, 18px); /* medium-ish */
    text-align: center;

    opacity: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 1000;
}
#how-to-play.show {
    opacity: 1;
    visibility: visible; 
    animation: alertJumpIn 0.3s ease forwards;
}

#how-to-play.hide {
    opacity: 1;
    visibility: visible; 
    animation: alertShrinkOut 0.3s ease forwards;
}

#definitions-menu {
    visibility: hidden;
    background: #fff;
    color: black;
    border: 2px solid black;
    border-radius: 8px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    display: grid;
    grid-template-columns: 1fr 3fr;  /* words left, defs right */
    grid-auto-rows: minmax(40px, auto);
    row-gap: 0px;
    column-gap: 20px;

    height: 60vh;
    max-width: min(90vw, 500px);
    overflow-y: scroll;
    padding: 20px;
    z-index: 1000;
}

#definitions-menu.show {
    opacity: 1;
    visibility: visible; 
    animation: alertJumpIn 0.3s ease forwards;
}

#definitions-menu.hide {
    opacity: 1;
    visibility: visible; 
    animation: alertShrinkOut 0.3s ease forwards;
}

.word {
    grid-column: 1;
    background: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-weight: bold;
    align-self: center;
}

.bridge {
    grid-column: 2;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}

.definition {
    background: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-style: italic;
    margin-left: 8px;
}

.split-arrow {
    width: 40px;
    height: auto;
}

#rotate-message {
    visibility: hidden;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    color: black;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 20px;
}
#rotate-message p {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}   
#phone-icon {
    width: 60px;
    height: auto;
}

@media (max-width: 600px) {

    body {
        padding: 5px;
    }

    #title {
        margin-top: 30%;
        font-size: clamp(18px, 5vw, 26px);
    }

    #description {
        font-size: clamp(9px, 3.5vw, 12px);
        margin: 2px 0;
    }

    /* Main container: board left, chainboard right */
    #main-container {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 6px;
        margin-top: 10%;
    }

     /* mobile group: board + guesses menu */
    .mobile-group {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: min(130px, 40vw);
        margin-top: 0px;
        margin-left: 0px;
        flex: 1;  /* Take remaining space after chainboard */
        min-width: 0;  /* Allow shrinking */
    }

    #board {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
        width: 90px;
        height: 90px;
        gap: 3px;
        transform: translate(-70%, -65%);
        margin-top: 50px;
    }

    .tile {
        flex: none;         /* stop flex from resizing */
        min-width: 70px;       /* override the 80px floor */
        min-height: 70px;
        max-width: none;    /* remove the 120px cap */
        max-height: none;
        width: auto;        /* let grid sizing work */
        height: auto;
        font-size: 10px;
    }

    /* Chainboard: vertical and long */
    #chainboard {
        display: flex;
        flex-direction: column;
        width: 65px;      /* thin fixed width */
        height: 400px;    /* taller to use vertical space */
        max-height: 80vh; /* fit mobile screen */
        overflow-y: auto;
        overflow-x: hidden;
        padding: 4px;
        justify-content: center;
        align-items: center; 
        margin-right: 15px;
    }

    .chaintile {
        width: 60px;         /* fill chainboard width */
        height: 33px;
        font-size: 9px;
        margin-left: 0px; 
        margin-right: 0px;
    }

    /* Topbar icons smaller */
    .icon-button {
        width: 28px;
        height: 28px;
        font-size: 14px;
        margin-left: 5px;
        margin-right: 5px;
    }

    /* Definitions menu full width if needed */
    #definitions-menu {
        max-width: 90vw;
        height: 50vh;
        grid-template-columns: 1fr; /* stack vertically */
    }

    /* Reorganize guesses menu into two rows for mobile */
    #guesses-menu {
        display: flex;
        flex-direction: column;  /* Stack the two rows vertically */
        align-items: center;
        justify-content: center;
        gap: 12px;
        width: 100%;
        padding: 6px 10px;
        margin-top: 10px;
        box-sizing: border-box;
    }


    #guesses-remaining {
        margin: 0;
        white-space: nowrap;
        font-size: clamp(11px, 3.5vw, 15px);
    }

    #guess-circles {
        display: flex;
        gap: 4px;
        justify-content: center;
        align-items: center;
        padding: 2px 0;
    }

    /* Bottom row: buttons stacked vertically */
    #button-row {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 6px;
        width: 100%;
    }

    #button-row button,
    #button-row #submit,
    #button-row #shuffle,
    #button-row #clear {
        width: 40%;
        max-width: 280px;
        margin: 0;
        box-sizing: border-box;
        font-size: clamp(10px, 3vw, 13px);;
    }

    /* how to play menu styling */
    #how-to-play {
        align-items: center;
        justify-content: center;
        user-select: none;
        
        max-width: min(80vw, 450px);  /* responsive size */
        padding: 28px 48px;
        font-size: clamp(13px, 2.5vw, 16px); /* medium-ish */
        padding-bottom: 30px;
        border: 2px solid black;
        border-radius: 8px;
        text-align: center;
    }

    #info {
        font-size: 10px !important;
    }

    /* a correct chaintile in the middle of a chain */
    .chaintile.correct-middle {
        /* Box */
        border-left: 5px solid darkgray;
        border-right: 5px solid darkgray;
        border-top: none;
        border-bottom: none;
        margin-top: 0px;
        margin-bottom: 0px;
        border-radius: 0px;
        margin-left: 0px; 
        margin-right: 0px;
    }

    /* a correct chaintile on the right end of a chain */
    .chaintile.correct-right {
        /* Box */
        border-left: 5px solid darkgray;
        border-bottom: 5px solid darkgray;
        border-right: 5px solid darkgray;
        border-top: none;
        margin-top: 0px;
        border-radius: 0px;
        border-bottom-left-radius: 4px;
        border-bottom-right-radius: 4px;
        margin-left: 0px; 
        margin-right: 0px;
    }

    /* a correct chaintile on the left end of a chain */
    .chaintile.correct-left {
         /* Box */
        border-left: 5px solid darkgray;
        border-bottom: none;
        border-right: 5px solid darkgray;
        border-top: 5px solid darkgray;
        margin-bottom: 0px;
        border-radius: 0px;
        border-top-left-radius: 4px;
        border-top-right-radius: 4px;
        margin-left: 0px; 
        margin-right: 0px;
    }

    .chaintile.drag-over-right {
        transform: translateY(15px);
    }

    .chaintile.drag-over-left {
        transform: translateY(-15px);
    }

    /* Are you sure? menu styling */
    #are-you-sure {
        max-width: min(80vw, 400px);  /* responsive size */
        padding: 28px 48px;
        font-size: clamp(15px, 3vw, 18px); /* medium-ish */
        white-space: normal;
    }

    #are-you-sure-text {
        min-width: 200px;
    }

    #share-results {
        margin-bottom: 12px;
    }

    #definitions-menu {
        display: grid;
        grid-template-columns: 1fr 3fr;  /* words left, defs right */
        grid-auto-rows: minmax(60px, auto);
        row-gap: 0px;
        column-gap: 20px;

        height: 60vh;
        max-width: min(90vw, 500px);
        overflow-y: scroll;
        padding: 20px;
        z-index: 1000;
        font-size: clamp(13px, 2.5vw, 16px); /* medium-ish */
    }

    #example{
        font-size: medium;
    }

    #drag-icon {
        width: 18px;
        height: auto;
        content: url("vertical-drag.png");
    }
}

#rotate-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: white; /* or your game background */
    z-index: 10000;
    visibility: hidden;
}

#rotate-message {
    position: fixed;
    z-index: 10001;
    visibility: hidden;
}

@media screen and (max-width: 1000px) and (orientation: landscape) and (hover: none) {
    #rotate-overlay,
    #rotate-message {
        visibility: visible;
    }
}

/* a correct chaintile in the middle of a chain */
.chaintile.correct-middle1 {
    /* Box */
    border-top: 6px solid darkgray;
    border-bottom: 6px solid darkgray;
    border-right: none;
    border-left: none;
    margin-left: 0px;
    margin-right: 0px;
    border-radius: 0px;

    /* Text */
    color: white;
    background-color: #6AAA64;
}

/* a correct chaintile on the right end of a chain */
.chaintile.correct-right1 {
    /* Box */
    border-top: 6px solid darkgray;
    border-bottom: 6px solid darkgray;
    border-right: 6px solid darkgray;
    border-left: none;
    margin-left: 0px;
    border-radius: 0px;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;

    /* Text */
    color: white;
    background-color: #6AAA64;
}

/* a correct chaintile on the left end of a chain */
.chaintile.correct-left1 {
    /* Box */
    border-top: 6px solid darkgray;
    border-bottom: 6px solid darkgray;
    border-right: none;
    border-left: 6px solid darkgray;
    margin-right: 0px;
    border-radius: 0px;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;

    /* Text */
    color: white;
    background-color: #6AAA64;
}

@media (max-width: 410px) {
    #button-row {
        flex-direction: column;  /* Stack all buttons vertically */
        gap: 6px;
        width: 100%;
    }

    #button-row button,
    #button-row #submit,
    #button-row #shuffle,
    #button-row #clear {
        width: 60%;  /* Make them wider since they're stacked */
        max-width: 200px;
    }
}

html, body, * {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.icon-button img {
  width: 20px;
  height: auto;
}
