html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/*
div {
    border:2px solid red;
}
*/
body {
    font-family: Roboto, Helvetica, Arial, sans-serif;
	margin-top: 0px;
}

ol, ul {
    list-style: none;
}

em {
    font-style: italic;
}

#tileselected {
	color: #FFD700;
    padding: 8px 16px;
    margin: 6px 4px;
    font-size:1.0em;
    font-weight: 500;
}

#tileselect, #levelSelected {
    font-size:1.0em;
}

#levelselect {
    font-size:0.9em;
    cursor:pointer; 
}

.menu_game {
    margin: 28px 0px 12px 0px;
    font-size: 1.0em;
    font-weight: 600;
}

.menu {
    margin: 22px 5px 12px 10px;
    font-size: 1.0em;
    font-weight: 600;
}

.menu a, .menu_game a{
	text-decoration: none;
	margin: 12px 6px;
    font-size: 1.0em;
}

.menu a:hover, .menu_game a:hover {
	color: #FFD700;
}

.button-large {
	-moz-box-shadow: 2px 3px 0px 0px #2c3e50;
	-webkit-box-shadow: 2px 3px 0px 0px #2c3e50;
	box-shadow: 2px 3px 0px 0px #2c3e50;
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #bfdaf3), color-stop(1, #6fabe4));
	background: -moz-linear-gradient(top, #6fabe4 5%, #bfdaf3 100%);
	background: -webkit-linear-gradient(top, #6fabe4 5%, hsl(209, 29%, 39%) 100%);
	background: -o-linear-gradient(top, #6fabe4 5%, #bfdaf3 100%);
	background: -ms-linear-gradient(top, #6fabe4 5%, #bfdaf3 100%);
	background: linear-gradient(to bottom, #6fabe4 5%, #bfdaf3 100%);
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#6fabe4', endColorstr='#bfdaf3',GradientType=0);
	background-color: #6fabe4;
	-moz-border-radius: 0.2em;
	-webkit-border-radius: 0.2em;
	border-radius: 0.2em;
	border: 1px solid #6D4C41;
	font-size: 1.0em;
	text-shadow: 0px 0px 0px #2c3e50;
}

.button-large:hover {
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #bfdaf3), color-stop(1, #6fabe4));
	background: -moz-linear-gradient(top, #bfdaf3 5%, #6fabe4 100%);
	background: -webkit-linear-gradient(top, #bfdaf3 5%, #6fabe4 100%);
	background: -o-linear-gradient(top, #bfdaf3 5%, #6fabe4 100%);
	background: -ms-linear-gradient(top, #bfdaf3 5%, #6fabe4 100%);
	background: linear-gradient(to bottom, #bfdaf3 5%, #6fabe4 100%);
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#bfdaf3', endColorstr='#6fabe4',GradientType=0);
	background-color: #bfdaf3;
}

.button-large:active {
	position: relative;
	top: 0.15em;
}

.button-large:focus {
    outline-color: #2c3e50;
}

.menu-title {
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #fff !important;
    font-size: 2em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0em;
    text-shadow: 2px 2px 0 #000, 0 0 8px #0ff;
    animation: menu_pulse 2s infinite;
    filter: contrast(200%) brightness(120%);
    mix-blend-mode: screen;
    
}
.menu-tagline {
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #ddd !important;
    font-size: 1em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0em;
    text-shadow: 2px 2px 0 #000, 0 0 8px #0ff;
    animation: menu_pulse 2s infinite;
    filter: contrast(150%) brightness(120%);
    mix-blend-mode: screen;
    
}

@keyframes menu_pulse {

    0%,
    100% {
        text-shadow: 0 0 4px #0ff;
    }

    50% {
        text-shadow: 0 0 12px #0ff;
    }
}


h1 {
    text-align: center;
    font-size: 0.9em;
    padding: 0.2em;
    text-decoration: underline;
}

label {
    vertical-align: middle;
    font-size: 0.8em;
    color:#FFD700;
    margin: 0px 0px 0px 0px;
}

.tool-tip {
    float: right;
    margin-top: -3.6em;
    margin-right: -0.4em;
    position: relative;
}

.tool-tip button {
    background: none;
    border: none;
    color: #000000;
    font-size: 1.0em;
    font-weight: 600;
}

.tool-tip .tool-tip-text {
    visibility: hidden;
    width: 5.5em;
	font-size: 0.8em;
    background-color: #000000;
    color: #FFFFFF;
    text-align: center;
    padding: 5px 0;
    position: absolute;
    top: 2.1em;
    right: 0;
    z-index: 1;
    border-radius: 0.3em;
}

.tool-tip:hover .tool-tip-text {
    visibility: visible;
    right: 2em
}

#gamecase {
    display: flex;
    flex-wrap: wrap;
    max-width: 312px;
    margin-top:370px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

#main {
    display: flex;
    flex-wrap: wrap;
    max-width: 268px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    margin-top:10 px;
}

.arcade{
    margin:8px 0px 8px 0px;
}

.status {
    display: flex;
    flex-direction:row;
    flex-wrap: wrap;
    max-width: 100%;
    background-color:#46637F;
    margin-left: auto;
    vertical-align: middle;
    margin-right: auto;
    padding: 0.1em;
    text-align: center;
    border-radius:0.2em;
}
#gameboard{

    display:none; 
}

.rating {
    width: 20%;
}

#best_time {
    color:#FFD700;
    max-width: 40%;
    vertical-align:middle;
    padding-left:3px;
}

.move-counter, .timer {
    font-size: 0.9em;
}

.rating {
    font-size: 1.4em;
    color: #FFEA00;
    display: inline;
}

.restart-btn {
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 0.9em;
    font-weight: 600;
    cursor:pointer;
}

.game-board {
    max-width: 50%;
    margin-left: auto;
    margin-right: auto;
    background-color: #2c3e50;
    background-color: #2e2e2e;
    border-radius: 0.3em;
    box-shadow: 0 3px 3px #808080;
}

.game-grid-row {
    display: flex;
    flex-wrap: nowrap;
}

.game-card {
    width: 5.16em;
    height: 5.16em;
    background-color: #212121;
    background: rgba(255, 234, 0, 0.7);
    border-radius: 0.1em;
    margin: 0.1em;
    box-shadow: 2px 0 10px #212121;
    cursor: pointer;
    border-top: 1px solid #bbbbbb;
    border-left: 1px solid #cccccc;
}

.game-card-img {
    visibility: hidden;
    width: 5.16em;
    height: 5.16em;
    object-fit: cover;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    left: 50%;
    transform: translate(-50%, -0%);
    top: 0;
    width: 353px;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

/* Level Complete Modal */
.modal_low {
    display: none;
    position: fixed;
    z-index: 1;
    left: 50%;
    transform: translate(-50%, -0%);
    top: 360px;
    width: 310px;
    height: 140px;
}

.modal-content {
    width: 86%;
    color:#fff;
    margin: auto;
    padding: 0;
    position: relative;
    top: 10%;
    background-color: #222;
    border: 2px solid #555555;
    border-radius: 0.5em;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.modal-header {
    padding: 0.6em 0.5em;
    font-size: 1.0em;
    font-weight: bold;
    text-align: center;
}

.modal-body {
    padding: 0.5em 0.5em;
}

.modal-body .message {
    text-align: center;
    font-size: 0.8em;
}

.modal-body .message p {
    margin-bottom: 0.1em;
}

.game-over-icons {
    animation: shakeIt 1.5s linear infinite;
    position: relative;
}

.modal-footer {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    padding: 0 1em 1.5em;
    margin-top:10px;
}

.modal-footer button {
    padding: 0.3em 1em;
    width: 120px;
}

.close {
    font-size: 1.6em;
    float: right;
    margin-right: 0.9em;
    margin-top: 0.4em;
    position: relative;
    animation: animateCloseIcon 5s linear 2s infinite;
}

.close:hover, .close:focus {
    color: #8D6E63;
    cursor: pointer;
}

.page-footer {
    position:absolute;
    bottom:0;
    width:88%;
    left: 50%;
    transform: translate(-50%, -0%);
    border-top: 1px solid #444;
    padding: 0.1em 2px;
    text-align: center;
    font-size: 0.7em;
    color: #ffffff;
    background: #222;
}

.page-footer-link {
    color: #fff;
    font-weight: 700;
}

.page-footer-link:hover {
    color: #4fabe4;
}

.page-footer-link:active {
    text-decoration: none;
}

.page-footer-link:focus {
    outline: #A1887F auto 5px;
}

.page-footer-link:visited {
    color: #eeeeee;
}

.show-img {
    visibility: visible;
    animation: animateShowImage 0.4s linear alternate;
}

.disabled {
    pointer-events: none;
}

.show-modal {
    display: block;
}

/* How to Play Modal */
.modal-body  {
    padding: 0 1.0em;
    font-size:0.9em;
}

.instructions p {

    font-size:0.9em;
    font-weight:100;
    padding: 5px 0px;
}

#extName, #gameName {
    margin: auto;
    color:#FFD700;
    text-align:center;
    font-size:0.9em;
    text-transform: uppercase;
    -webkit-text-stroke: 1px #FFD700;
    padding: 4px;
}

.completed {
    text-align:center;
    margin:0 auto;
}

#alert {
    text-align:center;
    top:80px;
    position:absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index:15;
}

#alert_best_time, #alert_best_moves {
    text-align:center;
    font-size:0.9em;
    color:#e1e451;
    padding: 6px;
    margin-top:6px;
    border: 3px solid #888888;
    border-radius:0.4em;
    background: rgba(48, 48, 48, 0.95);
    display:none;
    visibility:hidden;
}

.centertrigger {
    text-align:center;
    margin-top:10px;
    margin-bottom:12px;
}

.mask {
    margin: auto;
    margin-top:0;
    margin-bottom:6px;
    width: 100px;
    height: 100px;
    overflow: hidden;
    box-shadow: 0 2px 2px #808080;
}

  ul.images {
    position: relative;
    top: -16px;
    left: -40px;
  }

  ul.images li {
    float: left;
  }
  
  ul.triggers {
    display: inline-block;
    max-width:80%;
    margin:auto;
  }

  ul.triggers li {
    float: left;
    margin: 0 2px;
    font: bold 12px arial;
    cursor: pointer;
    background-color: #ccc;
    color: #000;
    padding: 1px 3px;
  }

  ul.triggers li.selected {
    background-color:#FFD700;
    color: #000;
  }
  
  .control {
    position: absolute;
    top: 250px;
    color: blue;
    cursor: pointer;
  }

  .prev {
    left: 130px;
  }

  .next {
    left: 202px;
  }

  
#reset{
    cursor:pointer;
    padding-left:8px;
}

.beveled {
    border-radius:0.8em;
    border-top: 1px solid #ccc;
    border-left: 1px solid #ccc;
    border-bottom: 2px solid #444;
    border-right: 2px solid #444;
}

.flipImage {
    animation: animateShowImage 0.9s linear alternate;
}

/* Animations */

@keyframes shakeIt {
    0% { top: 0em; left: 0em; }
    40% { top: 0em; left: 0em; }
    43% { top: -0.7em; left: 0em; }
    46% { top: 0em; left: -0.3em; }
    48% { top: -0.4em; left: 0.3em; }
    50% { top: 0em; left: 0em; }
    100% { top: 0em; left: 0em; }
}

@-moz-keyframes shakeIt {
    0% { top: 0em; left: 0em; }
    40% { top: 0em; left: 0em; }
    43% { top: -0.7em; left: 0em; }
    46% { top: 0em; left: -0.3em; }
    48% { top: -0.4em; left: 0.3em; }
    50% { top: 0em; left: 0em; }
    100% { top: 0em; left: 0em; }
}

@-webkit-keyframes shakeIt {
    0% { top: 0em; left: 0em; }
    40% { top: 0em; left: 0em; }
    43% { top: -0.7em; left: 0em; }
    46% { top: 0em; left: -0.3em; }
    48% { top: -0.4em; left: 0.3em; }
    50% { top: 0em; left: 0em; }
    100% { top: 0em; left: 0em; }
}

@keyframes animateCloseIcon {
    0% { top: 0em; }
    40% { top: 0em; }
    43% { top: -0.2em; }
    46% { top: 0em; }
    48% { top: 0.2em; }
    50% { top: 0em; }
    100% { top: 0em; }
}

@-moz-keyframes animateCloseIcon {
    0% { top: 0em; }
    40% { top: 0em; }
    43% { top: -0.1em; }
    46% { top: 0em; }
    48% { top: 0.1em; }
    50% { top: 0em; }
    100% { top: 0em; }
}

@-webkit-keyframes animateCloseIcon {
    0% { top: 0em; }
    40% { top: 0em; }
    43% { top: -0.1em; }
    46% { top: 0em; }
    48% { top: 0.1em; }
    50% { top: 0em; }
    100% { top: 0em; }
}

@keyframes animateShowImage {
    0% { transform: rotateY(90deg); opacity: 0;}
    100%{ transform: rotateY(0); opacity: 1; }
}

@-webkit-keyframes animateShowImage {
    0% { transform: rotateY(90deg); opacity: 0;}
    100%{ transform: rotateY(0); opacity: 1; }
}

@-moz-keyframes animateShowImage {
    0% { transform: rotateY(90deg); opacity: 0;}
    100%{ transform: rotateY(0); opacity: 1; }
}

@keyframes enter {
    0% {
      opacity: 0;
    }
    8% {
      opacity: 1;
    }
    16% {
      opacity: 0;
    }
    32% {
      opacity: 1;
    }
    100% {
      opacity: 0.5;
    }
}

/* Media Queries */
@media only screen and (max-width: 600px) {
    .modal-footer button {
        padding: 0.3em 0.3em;
        width: 35%;
    }
}

@media only screen and (min-width: 600px) and (max-width: 767px) {
    .game-card, .game-card-img {
        width: 5.3em;
        height: 5.3em;
    }

    /* How to Play Modal */
    .modal-body .instructions {
        padding: 0 1.0em;
    }
}

@media only screen and (min-width: 768px) and (max-width: 991px) {
    .game-card, .game-card-img {
        width: 5.8em;
        height: 5.8em;
    }

    /* How to Play Modal */
    .modal-body .instructions {
        padding: 0 1.0em;
    }
}

@media only screen and (min-width: 992px) {
    .status {
        display: block;
    }

    .rating,
    .move-counter,
    .timer,
    .restart-btn {
        width: initial;
    }
    .game-card, .game-card-img {
        width: 6.2em;
        height: 6.2em;
    }
    #gamediv {
        margin-top:10px;
    }
    #playAgain {
        font-size:2.2em;
        z-index:20;
    }

    /* How to Play Modal */
    .modal-body  {
        padding: 0 1.0em;
    }
}

.hidden-img {
    visibility: hidden;
}

.show-img {
    visibility: visible;
    animation: fadeIn 1s;
}

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

/* Define the drop-and-bounce animation */
@keyframes dropBounce {
    0% {
      transform: translateY(0);
    }
    70% {
      transform: translateY(54px); /* Main drop */
    }
    80% {
      transform: translateY(44px); /* First high bounce */
    }
    90% {
      transform: translateY(54px);
    }
    95% {
      transform: translateY(50px); /* Second smaller bounce */
    }
    98% {
      transform: translateY(53px);
    }
    100% {
      transform: translateY(54px); /* Settle */
    }
  }
  
  /* Add this class dynamically */
.animate-drop {
    position:relative;
    animation: dropBounce 2.4s ease-out;
   animation-fill-mode: forwards;  
  /* Ensure it stays at the final position */ 
}

input {
    border:0;
    background:none;
    padding:0;
  }