html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

@media (max-width: 576px) {
    body.modal-open {
        overflow: auto !important; /* Allow scrolling on mobile */
        padding-right: 0 !important;  
    }
}

@media (max-width: 576px) {
    .modal-dialog {
        position: absolute !important;
        margin: 10px;
    }
}


.position-relative {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

#gameTitle {
    position: relative;
    display: inline-block;
}

#infoButton {
    position: absolute;
    left: 61%; /* 61 */
    bottom: 0.3rem;
    margin-left: 40px; /* Move it exactly 30px to the right */
    text-decoration: none;
    -webkit-text-stroke: 1px;
}



.modal-content {
    overscroll-behavior: contain;
}



html, body {
    touch-action: manipulation; /* Disables double-tap zoom */
    -webkit-tap-highlight-color: transparent; /* Removes tap highlight */
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0px;
}

.countdownle-title{
    padding-top: 15px;
    padding-bottom: 0px
}

.game-section {
    display: none;
}

.active-game {
    display: block;
}

.letter-box, .number-box, .conundrum-box {
    display: inline-block;
    width: 50px;
    height: 50px;
    margin: 5px;
    text-align: center;
    line-height: 50px;
    font-size: 24px;
    font-weight: bold;
    border: 2px solid #333;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.btn-primary {
    margin: 20px;
}

.btn-in-game {
    margin-top: 20px;
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    min-width: 100px;
}

.btn-next {
    margin-top: 20px;
}

.real-time-rules-link {
    margin-top: 10px;
}

.gametimer {
    margin-bottom: 25px;
}

.fade-in {
    animation: fadeIn 0.3s forwards;
}


.tile {
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    border: 2px solid #333;
    width: 50px;
    height: 50px;
    margin: 5px;
    line-height: 43px;
    font-size: 24px;
    font-weight: bold;
    border-radius: 5px;
    background-color: #f9f9f9;
    transform: perspective(1000px) rotateY(0deg); /* Set perspective for 3D effect */
    transition: transform 0.6s ease-in-out, background-color 0.3s ease;
}

.tile-conundrum {
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    border: 2px solid #333;
    width: 50px;
    height: 50px;
    margin: 5px;
    line-height: 43px;
    font-size: 24px;
    font-weight: bold;
    border-radius: 5px;
    background-color: #f9f9f9;
    transform: perspective(1000px) rotateX(0deg); /* Set perspective for 3D effect */
    transition: transform 0.6s ease-in-out, background-color 0.3s ease;
}

.target {
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    border: 2px solid #333;
    width: 80px;
    height: 80px;
    margin: 5px;
    line-height: 70px;
    font-size: 32px;
    font-weight: bold;
    border-radius: 5px;
    background-color: #f9f9f9;
    margin-top: 20px;
}

.flip-animation {
    transform: perspective(1000px) rotateY(180deg); /* Rotate the card to simulate a flip */
    background-color: #ddd; /* Optional: Change the background during the flip */
}

.flip-animation-conundrum {
    transform: perspective(1000px) rotateX(180deg); /* Rotate the card to simulate a flip */
    background-color: #ddd; /* Optional: Change the background during the flip */
}

/*.collapse ul {
    max-height: 150px;
    overflow-y: auto;
}*/


.tile::after {
    content: '';
    display: inline-block;
    width: 100%;
    height: 100%;
}

.countdown-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; /* Full width */
    height: 0; /* Start with no height */
    background-color: rgba(0, 0, 255, 0.2); /* Low-opacity blue */
    z-index: 0; /* Ensure it's behind all other elements */
    transition: height 0.1s linear; /* Smooth height transition */
}

.game-section {
    position: relative;
    overflow: hidden; /* Ensure the blue box doesn't overflow the game section */
    z-index: 1; /* Content above the background */
}

.countdown-background-full {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw; /* Full width of the viewport */
    height: 0; /* Start with no height */
    background-color: rgba(0, 0, 255, 0.05); /* Low-opacity blue */
    z-index: 1000; /* Ensure it's above everything else */
    pointer-events: none; /* Allow interactions with other elements */
    transition: height 0.1s linear; /* Smooth height transition */
}

.game-input {
    width: 250px;
    margin-left: auto;
    margin-right: auto;
}


/*.summary-screen {
    text-align: center;
    margin: 20px;
}*/

.summary-table {
    width: 60%;
    margin: 0 auto 20px;
    border-collapse: collapse;
}

.summary-table th,
.summary-table td {
    border: 1px solid #ddd;
    padding: 8px;
}

.summary-table th {
    background-color: #f4f4f4;
    font-weight: bold;
}

.summary-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.summary-table tr:hover {
    background-color: #ddd;
}

.long-term-stat {
    margin-bottom: 0;
}

button {
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
}

.circular-timer-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    /*    height: 300px;*/
    aspect-ratio: 1 / 1;
    z-index: -5; /* Place in the background */
    pointer-events: none;
    opacity: 0.15; /* Semi-transparent for background effect */
    -webkit-backface-visibility: hidden;
}

.border-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient( transparent 0deg, transparent 180deg ); /* Start with no progress */
    position: fixed;
    z-index: -4;
    /*border: 0px solid white;*/ /* Outer donut shape */
    box-shadow: 0 0 0 5px rgba(0, 0, 255, 0.5); /* Creates the border effect */
    -webkit-backface-visibility: hidden;
}

.mask-circle {
    width: 80%;
    height: 80%;
    fill: white;
    position: fixed;
    z-index: -2;
    border-radius: 50%;
    background-color: white;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 5px solid rgba(0, 0, 255, 0.5);
    -webkit-backface-visibility: hidden;
}

.timer-line {
    border-left: 6px solid rgba(0, 0, 255, 0.5);
    height: 90%;
    top: 55%;
    /*tweak top to only show on bottom half */
    left: 50%;
    transform: translate(-50%, -50%);
    position: fixed;
    z-index: -3;
    -webkit-backface-visibility: hidden;
}

.countdown-number {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -53%);
    font-size: 300px;
    font-weight: bold;
    color: rgba(0, 0, 255, 0.8);
    z-index: -1; /* Ensure it's above all layers */
    pointer-events: none;
    -webkit-backface-visibility: hidden;
}

.tiles-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    gap: 10px; /* Spacing between tiles */
    margin-top: 20px;
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.additional-content {
    max-height: 0; /* Initially hidden */
    overflow: hidden; /* Hide content when collapsed */
    transition: max-height 0.5s ease; /* Smooth height expansion */
}

.additional-content.show {
    max-height: 500px; /* An approximate value greater than the content height */
}

.keyboard-container {
    vertical-align: middle;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
    flex: auto;
    flex-direction: column;
    display: flex;
    height: 150px;
    /*    width: 400px;*/
    /*    width: 300px;*/
    max-width: 400px;
    -webkit-backface-visibility: hidden;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-transform: translateZ(0);
    -webkit-perspective: 1000;
}

.keyboard-row {
    /*    flex: auto;*/
    flex-direction: row;
    display: flex;
    /*    height: 100px;*/
    -webkit-backface-visibility: hidden;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-transform: translateZ(0);
    -webkit-perspective: 1000;
}

.keyboard-key {
    flex: auto;
    display: inline-block;
    /*height: 60px;*/ /*change here*/
    width: max-content;
    /*    border: 2px solid rgba(0, 0, 255, 0.5);*/
    border-radius: 5px;
    margin: 3px;
    text-align: center;
    vertical-align: middle;
    font-size: 20px;
    font-weight: bold;
    /*    text-justify: auto;*/
    color: white;
    line-height: 44px;
    /*    background-color: #66aeff;*/
    background-color: #0b5ed7;
    padding: 0.1rem 0.6rem;
    -webkit-backface-visibility: hidden;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-transform: translateZ(0);
    -webkit-perspective: 1000;
}

.backspace {
/*    border: 2px solid rgba(255, 0, 0, 0.5);*/
/*    background-color: #ffaeae;*/
    background-color: #ff7777;
}

.parentheses {
    background-color: #999999;
}

.parentheses-text {
    font-size: 1.5rem;
    margin-top: -0.3rem;
}

.operation {
    -webkit-text-stroke: 1px;
}

.asterisk {
    -webkit-text-stroke: 0px !important;
    font-size: 1.1rem !important;
}

.simple-timer {
    margin-top: 4px;
    margin-bottom: 4px;
}

/*something about the most recent commit did finally fix the weird flickering on iOS. If I identify it then I can focus on that change.*/
#numbersKeyboard.disabled {
    pointer-events: none; /* Prevent clicking */
    filter: blur(3px) brightness(0.6); /* Visually indicate it's disabled */
    -webkit-backface-visibility: hidden;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-transform: translateZ(0);
    -webkit-perspective: 1000;
    z-index: 10
}




/*display: inline-block;
text-align: center;
vertical-align: middle;
border: 2px solid #333;
width: 50px;
height: 50px;
margin: 5px;
line-height: 43px;
font-size: 24px;
font-weight: bold;
border-radius: 5px;
background-color: #f9f9f9;
transform: perspective(1000px) rotateY(0deg);*/ /* Set perspective for 3D effect */
/*transition: transform 0.6s ease-in-out, background-color 0.3s ease;*/


/*TODO consider styling dependent on whether mobile, namely the timer display. also I wonder if some bootstrap magic is causing the inconsistency between simulated mobile and actual mobile?*/