/**************************************************** RESET ****************************************************/

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,
ol,
ul,
li,
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;
    vertical-align: baseline;
    box-sizing: border-box;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
    display: block;
}

body {
    line-height: 1;
    overflow:hidden;
}

ol,
ul {
    list-style: none;
}

blockquote,
q {
    quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
    content: "";
    content: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/**************************************************** VARIABLE ****************************************************/

:root {
    --padding-small: 0.5vw;
    --type: 4vw;
    --button-height:5vw;
    --color-1: #A36537;
    --color-2: #F8AC00;
    --color-3: #6681D0;
    --color-4: #3FA535;
    --color-5: #DB1A16;
    --color-6: #1B1B1A;
    --color-7: #BDE1EC;
    --color-8: #C9D9AC;
    --color-9:#98999a;
}

/**************************************************** BASIC ****************************************************/

* {
    font-size: var(--type);
    line-height: 100%;
    font-weight: normal;
    font-family: Arial, sans-serif;
    -moz-osx-font-smoothing: grayscale;
    -webkit-overflow-scrolling: touch;
    -webkit-text-size-adjust: 100%;
    -webkit-box-shadow: none;
    box-shadow: none;
    font-style: normal;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    touch-action: manipulation;
    color:black !important;
    -ms-overflow-style: none;
    scrollbar-width: none;
    border-radius: 0px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

b {
    font-weight: bold;
}

body {
    background-color: var(--color-2);
}

input {
    border:0px;
    outline:0px;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

::-webkit-scrollbar {
    display: none;
}

::-webkit-input-placeholder { color: black; }
:-moz-placeholder { color: black; }

:focus::-webkit-input-placeholder { color: black; }
:focus:-moz-placeholder { color: black; }

/**************************************************** COLORS ****************************************************/

.color-1 {
    background-color: var(--color-1);
}

.color-2 {
    background-color: var(--color-2);
}

.color-3 {
    background-color: var(--color-3);
}

.color-4 {
    background-color: var(--color-4);
}

.color-5 {
    background-color: var(--color-5);
}

.color-6 {
    background-color: var(--color-6);
}

.color-7 {
    background-color: var(--color-7);
}

.color-8 {
    background-color: var(--color-8);
}

.color-9 {
    background-color: var(--color-9);
}

/**************************************************** TYPOGRAPHY ****************************************************/

a {
    color:inherit;
    text-decoration:none;
}

.text-center {
    text-align:center;
    justify-content: center;
    align-items: center;
}

.text-left {
    text-align:left;
}

.text-right {
    text-align:right;
}

/**************************************************** PADDING ****************************************************/

.padding-small {
    padding:var(--padding-small);
}

.padding-top-small {
    padding-top:var(--padding-small);
}

.padding-bottom-small {
    padding-bottom:var(--padding-small);
}

.padding-left-small {
    padding-left:var(--padding-small);
}

.padding-right-small {
    padding-right:var(--padding-small);
}

.padding-bottom-0 {
    padding-bottom:0px
}

/**************************************************** GRID ****************************************************/

.grid {
    display: flex;
    flex-flow: row wrap;
    flex-grow: 0;
    flex-shrink: 0;
    width: 100%;
    align-items: flex-start;
    align-content: flex-start;
    position: relative;
}

.w-1-12 {
    width: calc(100% / 12 * 1);
}

.w-2-12 {
    width: calc(100% / 12 * 2);
}

.w-3-12 {
    width: calc(100% / 12 * 3);
}

.w-4-12 {
    width: calc(100% / 12 * 4);
}

.w-5-12 {
    width: calc(100% / 12 * 5);
}

.w-6-12 {
    width: calc(100% / 12 * 6);
}

.w-7-12 {
    width: calc(100% / 12 * 7);
}

.w-8-12 {
    width: calc(100% / 12 * 8);
}

.w-9-12 {
    width: calc(100% / 12 * 9);
}

.w-10-12 {
    width: calc(100% / 12 * 10);
}

.w-11-12 {
    width: calc(100% / 12 * 11);
}

.w-12-12 {
    width: calc(100% / 12 * 12);
}

img,
video {
    width: 100%;
    display: block;
}

/**************************************************** POSITION ****************************************************/

.position-sticky {
    position: sticky;
}

.content {
    height: calc(100dvh - var(--button-height));
    overflow:auto;
}

button {
    appearance: none;
    margin:0px;
    border:0px;
    outline:0px;
    cursor:pointer;
    text-transform: uppercase;
}

.button,
.button-wrapper {
    height:var(--button-height);
    overflow:hidden;
}

@media screen and (min-width: 769px) {
    .hover:not(:disabled):hover {
        background:white;
    }
}

.padding-bottom-button {
    padding-bottom:var(--button-height);
}

.game-state {
    height: 100dvh;
    overflow: auto;
    display: flex;
}

#loadingIndicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    overflow: hidden;
}

#loadingProgress {
    position: absolute;
    top: 0;
    left: 0;
    width: 0px;
    height: 100%;
    z-index: 1001;
}

#loadingPercentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1002;
    width: 100%;
    text-align: center;
    overflow: hidden;
}

#gameImage,
#resultGameImage {
    background-color: var(--color-9);
    flex: 1;
    min-height: 0;
    object-fit: contain;
    height:100%;
}

#description-wrapper {
    position: relative;
}

#description-wrapper,
#resultScore {
    flex: 1;
    min-height: 0;
    object-fit: contain;
    height:100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align:center
}

#infoformat,
#infoslider,
#inforesult {
    position: absolute;
    left:50%;
    transform: translateX(-50%);
    pointer-events: none;
    font-size:10px;
    width:100%;
    padding: var(--padding-small);
    text-align: center;
}

#infoformat {
    bottom:0px;
}

#infoslider {
    bottom:0px;
}

#inforesult {
    bottom:0px;
}

#roundWrapper,
#resultWrapper {
    height: calc(100dvh - (var(--button-height) * 2));
}

#fontSizeSliderContainer {
    width:100%;
    position: relative;
    flex: 1;
    min-height: 0;
    height: auto;
}

#fontSizeSlider {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0px;
    left: 0px;
    cursor: ew-resize;
    inset: 0;
}

#fontSizeThumb {
    width: auto;
    height: 100%;
    position: absolute;
    top: 0px;
    bottom:0px;
    cursor: pointer;
    left:0px;
    max-width: 100%;
    cursor: ew-resize;
    transition: width 0.2s ease; /* Add smooth transition for manual sliding */
}

#fontSizeValue {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

#roundWrapper,
#resultWrapper {
    align-items: stretch;
    height: calc(100dvh - (var(--button-height) * 2));
}

#roundState {
    background-color: var(--color-9);
}

#roundWrapper .w-6-12,
#resultWrapper .w-6-12 {
    display: flex;
    flex-direction: column;
    overflow: auto;
    height:100%;
}

#yearSliderContainer {
    height:auto;
    flex-grow: 1;
    flex-shrink: 1;
}

#resultDisplay p {
    text-align: justify;
    text-align-last: justify;
    width:100%;
}

#leaderboardtable,
#finalLeaderboardtable {
    padding-top: var(--padding-small);
    padding-bottom: var(--padding-small);
}

#leaderboardtable div,
#finalLeaderboardtable div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#leaderboardtable .padding-small,
#finalLeaderboardtable .padding-small {
    padding-bottom:0.23vw;
    padding-top: 0px;
}

#toggleResult,
#toggleGuess {
    display: none;
}

#submitGuess,
#nextRound {
    width:100%;
}

.video, video {
    height: calc(100dvh - (var(--button-height) * 2));
    object-fit: cover;
}

#countdownLottery {
    height: calc(100dvh - (var(--button-height) * 2));
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes countdown {
    0%, 100% {
      background-color: var(--color-5);
    }
    50% {
      background-color: white;
    }
  }
  
  .last-10-seconds {
    animation: countdown 0.5s step-start infinite;
  }

@keyframes perfect {
    0%, 100% {
      background-color: var(--color-2);
    }
    50% {
      background-color: white;
    }
  }
  
  .perfect-score {
    animation: perfect 0.5s step-start infinite;
  }


  @media screen and (max-width: 768px) {

    :root {
        --padding-small: 15px;
        --type: 20px;
        --button-height:50px;
    }

    #toggleResult,
    #toggleGuess {
      display: flex;
    }

    #submitGuess,
    #nextRound {
        width:50%;
    }

    #leaderboardtable {
        padding:10px;
    }

    #leaderboardtable .padding-small {
        padding:5px;   
    }

    #roundWrapper,
    #resultWrapper {
        height: calc(100dvh - (var(--button-height) * 2));
        background-color: var (--color-9);
    }

    #roundWrapper .w-6-12,
    #resultWrapper .w-6-12 {
        width: 100%;
        scroll-snap-align: start;
        min-height: calc(100dvh - (var(--button-height) * 2));
        height: calc(100dvh - (var(--button-height) * 2));
    }

    #thumb {
        height: calc((100dvh - (var(--button-height) * 1)) / 2);
    }

    .video, video {
        width: 100%;
        height: calc(50dvh - (var(--button-height) * 1));
        object-fit: cover;
    }
    
    #countdownLottery {
        width: 100%;
        height: calc(50dvh - (var(--button-height) * 1));
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #infoState .w-4-12 {
        width: 100%;
    }
    
  }

  .disabled {
    background-color: grey !important;
    cursor: not-allowed;
  }

  .disabled * {
    color: var(--color-9) !important;
  }