:root {
    --dark-base-color: #080808;

    --body-bg: #ffffff;
    --app-bg: #292728;

    --font: 'Courier Prime', serif;

    --letter-bg-difficulty-1: rgb(91, 171, 121); /* Green */
    --letter-bg-difficulty-2: #fdd835; /* Yellow */
    --letter-bg-difficulty-3: #ffa500; /* Orange */
    --letter-bg-difficulty-4: rgb(255, 69, 36); /* Red */
    --letter-bg-joker: rgb(59, 190, 255); /* Blue */
    --light-turquoise: #A6D5C1;

    --min-height: 335px;
}

@font-face {
  /* This is the name you will use to refer to the font */
  font-family: 'Courier Prime';

  /* Point to the font files. The browser will use the first one it supports. */
  src: url('../fonts/CourierPrime-Regular.woff2') format('woff2'), /* Modern Browsers */
       url('../fonts/CourierPrime-Regular.woff') format('woff');   /* Older Browsers */

  /* Define the weight and style for this font file */
  font-weight: normal;
  font-style: normal;
}

@font-face {
  /* This is the name you will use to refer to the font */
  font-family: 'Courier Prime';

  /* Point to the font files. The browser will use the first one it supports. */
  src: url('../fonts/CourierPrime-Bold.woff2') format('woff2'), /* Modern Browsers */
       url('../fonts/CourierPrime-Bold.woff') format('woff');   /* Older Browsers */

  /* Define the weight and style for this font file */
  font-weight: bold;
  font-style: bold;
}

html, body {
    width: 100%;
    height: 100dvh;
    min-height: var(--min-height);

    position: relative;

    margin: 0;
    padding: 0;

    background-color: var(--body-bg);

    font-family: Arial, Helvetica, sans-serif;
}

.invisible {
    display: none !important;
}

.w-100 {
    width: 100% !important;
}

.nowrap {
    white-space: nowrap !important;
}

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

.text-center {
    text-align: center !important;
}

.inline-icon {
    display: inline-block;

    width: 1em;
    height: 1em;
    fill: currentColor; /* inherits the 'color' of its parent */
    vertical-align: -0.125em;
}

#app-loading-indicator {
    width: calc(100dvw - 40px);
    height: calc(100dvh - 40px);

    padding: 20px;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

#app-loading-indicator .loading-animation {
    font-size: 3em !important;
}

.main-container {
    width: 100%;
    max-width: 540px;
    height: 100%;

    margin: 0 auto;
    padding: 0;
    background-color: var(--app-bg);

    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-start;

    position: relative;
}

.paper-container, .white-transparent-gradient-overlay {
    width: 91.2%;
    margin-left: 4.25%;
    margin-right: 4.55%;
    /*min-width: 200px;*/

    background-color: #feffff;

    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-start;
}

.white-transparent-gradient-overlay {
    position: absolute;
    top: 0;
    height: 50px;
    z-index: 50;

    background: linear-gradient(to bottom, rgba(255, 255, 255, 1.0), rgba(255, 255, 255, 0));
}

.word-area {
    text-align: center;
    padding: 20px 10px;
    font-family: var(--font);
    font-size: 40px;
    letter-spacing: 2px;
    line-height: 1.4em;
    color: #212121;
    text-transform: uppercase;
    overflow: hidden;
}

.letter-tiles {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px 0;
    margin-bottom: 20px;
}

.tile-container {
    position: relative;
}

.tile-score {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);

    color: #62AE06;
    font-size: 21px;
    font-weight: 500;
    font-family: var(--font);

    /* Animation: slide in from top and fade in */
    animation: tileScoreSlideInFromBottom 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    opacity: 1;
    top: -25px;

    /* Fly to banner animation (triggered by JS) */
    transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}
@keyframes tileScoreSlideInFromBottom {
    from {
        opacity: 0;
        top: 25px;
    }
    to {
        opacity: 1;
        top: -25px;
    }
}
.tile-score::before {
    content: '+';
}

.tile-score.level-score {
    padding-right: 20px;

    animation: tileScoreSlideInFromTop 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    opacity: 1;
    top: 60px;
}
@keyframes tileScoreSlideInFromTop {
    from {
        opacity: 0;
        top: 10px;
    }
    to {
        opacity: 1;
        top: 60px;
    }
}

.tile-score.negative { color: #FF7777 !important; }
.tile-score.negative::before {
    content: '-' !important;
}

.letter-tile {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font);
    font-size: 48px;
    font-weight: 700;
    color: #212121;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);

    text-transform: uppercase;
}
@media screen and (max-width: 330px) {
    .letter-tile {
        width: 50px;
        height: 50px;
        font-size: 36px;
    }
}
@media screen and (max-width: 275px) {
    .letter-tile {
        width: 45px;
        height: 45px;
        font-size: 32px;
    }
}

.letter-tile > span {
    position: relative;
    top: 3px;
}

.background-light-turquoise {
    background-color: var(--light-turquoise);
}

.background-difficulty-0 {
    background-color: var(--letter-bg-joker);
}
.background-difficulty-1 {
    background-color: var(--letter-bg-difficulty-1);
}
.background-difficulty-2 {
    background-color: var(--letter-bg-difficulty-2);
}
.background-difficulty-3 {
    background-color: var(--letter-bg-difficulty-3);
}
.background-difficulty-4 {
    background-color: var(--letter-bg-difficulty-4);
}

.typewriter-container {
    width: 100%;
    position: relative;

    padding: 0;
    margin: 0;
}

.typewriter-img {
    width: 100%;
    display: block;
}

.lever-img {
    width: 10%;

    position: absolute;
    bottom: 67.4%;
    right: 6.5%;
}

.white-background {
    background-color: white !important;
}

.icon-circle {
    width: 35px;
    height: 35px;
    border-radius: 50%;

    color: var(--dark-base-color);
    background-color: #d9d9d9;
    border: none;

    font-size: 16px;

    display: flex;
    justify-content: center;
    align-items: center;
}

.icon-button {
    cursor: pointer;
}

.icon-button:hover, .icon-button:active {
    background-color: #cbcbcb !important;
}

.icon-button.white-background:hover, .icon-button.white-background:active {
    background-color: #f8f8f8 !important;
}

.bottom-input-section {
    width: 100%;

    padding: 15px 8px;
    box-sizing: border-box;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;

    background-color: #eeeeee;
}

.bottom-input-section .icon-button:hover, .bottom-input-section .icon-button:active {
    background-color: #fafafa !important;
}
.bottom-input-section .icon-button:disabled {
    color: #aaaaaa !important;
    background-color: #fafafa !important;
}

#bottom-input {
    border-radius: 25px;
    border: none;
    padding: 9px;
    width: calc(100% - 35px - 15px * 2 - 10px);
    max-width: 400px;
    height: 35px;
    font-size: 16px;

    box-sizing: border-box;
}

#bottom-input:disabled {
    background: #fafafa;
    color: #404040 !important;
}

.shake-animation {
    animation: shakeAnimation 0.35s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes shakeAnimation {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-8px); }
    40%, 60% { transform: translateX(8px); }
    100% { transform: translateX(0); }
}

.banner-container {
    position: absolute;
    top: 15px;
    z-index: 100;

    width: 60px;
    height: 54px;

    font-family: var(--font);
}

.banner-container.banner-bottom {
    top: unset !important;
    bottom: 73px !important;
}

.banner-container.banner-left {
    left: 0;
    padding-right: 2px;
    z-index: 101 !important;

    border-radius: 0 10px 10px 0;
    box-shadow: 4px 4px 4px rgba(0,0,0,0.1);
}

.banner-container.banner-right {
    right: 0;
    padding-left: 2px;
    
    border-radius: 10px 0 0 10px;
    box-shadow: -4px 4px 4px rgba(0,0,0,0.1);

    cursor: pointer;
}

.banner-container-inner {
    position: relative;
    width: 100%;
    height: 100%;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.banner-main-content {
    font-size: 20px;
    font-weight: bold;
    color: #212121;

    line-height: 1.2em;
}

.banner-label {
    font-size: 10px;

    margin-bottom: -12px;
}

.modal-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background-color: rgba(0,0,0,0.6);
    z-index: 500;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.level-up-modal {
    width: 30%;
    aspect-ratio: 1 / 1;

    background-color: white;
    padding: 20px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;

    text-transform: uppercase;
    font-weight: bold;
    font-size: 16px;

    border-radius: 10px;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.5);

    /* Plop out animation */
    animation: levelUpPlop 0.5s cubic-bezier(0.23, 1.5, 0.32, 1) forwards;
    transform: scale(1);
    opacity: 1;
}
@keyframes levelUpPlop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    60% {
        transform: scale(1.15);
        opacity: 1;
    }
    80% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.level-up-modal picture, .level-up-modal img {
    width: 100%;
    object-fit: contain;
}

.reload-button {
    margin: -30px auto 0 auto;
}
.reload-button:hover, .reload-button:active {
    transform: rotate(15deg);
}

.text-modal {
    width: 75%;
    max-width: 400px;
    background-color: white;
    margin: 20px;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.5);

    max-height: calc(80% - 100px);
    overflow-y: auto;

    animation: fade-in 0.4s cubic-bezier(0.075, 0.82, 0.165, 1) forwards;
    opacity: 1;
    transform: scale(1);
}
@keyframes fade-in {
	0% { opacity: 0; transform: scale(0); }
	100% { opacity: 1; transform: scale(1); }
}

.modal-title {
    font-size: 24px;
    font-weight: bold;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.text-button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    border: none;
    border-radius: 18px;
    padding: 4px 6px;
    
    height: 30px;
    
    width: 180px;
    max-width: 100%;

    cursor: pointer;

    display: inline-block;

    color: black;
}
.text-button:hover, .text-button:active {
    filter: brightness(90%);
}
.text-button:disabled {
    filter: none;
    cursor: default;
}

.loading-animation {
    font-size: 24px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.leaderboard-table {
	width: 100%;
	text-align: left;
}

.leaderboard-table tr:nth-child(2n) {
    background-color: #f8f8f8;
}

.leaderboard-table-row-of-player {
    background-color: var(--letter-bg-difficulty-2) !important;
}

.leaderboard-table-name-cell {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.modal-leaderboard-player-name {
    font-size: 22px;
    font-weight: bold;
}

.player-name-center-wrap {
    display: inline-block;
    position: relative;
    width: fit-content;

    font-size: 22px;
    font-weight: bold;
}

.player-name-center-wrap .modal-leaderboard-player-name {
    display: inline-block;
    text-align: center;
}

.player-name-center-wrap .edit-icon {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate(140%, -50%);

    height: 16px;
    font-size: 16px;

    cursor: pointer;
}

.leaderboard-user-icon {
    width: 100px;
    height: 100px;

    margin: 20px auto;
    
    color: #464646;
    background-color: #ededed;

    font-size: 52px;
}

/* Main container for the three stat blocks */
.stats-container {
    display: flex; /* Aligns the stat blocks in a row */
    justify-content: center; /* Centers the blocks horizontally */
    align-items: center; /* Aligns the blocks vertically */
    gap: 12px; /* Creates space between the blocks */
    padding: 20px 0; /* Adds vertical space around the container */
    width: 100%;
}

/* Individual stat block styling */
.stat-block {
    background-color: #ffffff; /* White background for the card */
    border-radius: 12px; /* Rounded corners */
    padding: 15px 16px 25px 16px; /* Inner spacing */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* Subtle drop shadow */
    text-align: center; /* Center-aligns the text inside */
    min-width: 70px; /* Ensures blocks have a minimum width */
    flex-grow: 1; /* Allows blocks to grow if there's extra space */
    max-width: 120px; /* Prevents blocks from becoming too wide */

    position: relative;
}

/* The top row containing the icon and number */
.stat-value {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px; /* Space between icon and number */
}

/* Styling for the icon (emoji) */
.stat-icon {
    font-size: 20px;
}

/* Styling for the large number */
.stat-number {
    font-size: 24px;
    font-weight: 700; /* Bold */
    color: #1a1a1a; /* Dark text color */
}

/* Styling for the small text label below the number */
.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: #6c6c6c; /* Gray color for less emphasis */
    
    width: calc(100% - 20px);

    position: absolute;
    bottom: 8px;
    right: 50%;
    transform: translateX(50%); /* Center the label horizontally */
}

@media screen and (max-width: 450px) {
    .stat-block {
        min-width: 55px; /* Adjust minimum width for smaller screens */
    }

    .stat-icon {
        font-size: 18px; /* Adjust icon font size */
    }

    .stat-number {
        font-size: 16px; /* Adjust number font size */
    }

    .stat-label {
        font-size: 10px; /* Adjust label font size */
    }
}

@media screen and (max-width: 350px) {
    .stat-block {
        min-width: 40px; /* Adjust minimum width for smaller screens */
    }

    .stat-icon {
        font-size: 18px; /* Adjust icon font size */
    }

    .stat-number {
        font-size: 16px; /* Adjust number font size */
    }

    .stat-label {
        font-size: 8px; /* Adjust label font size */
    }
}

.raffle-info-table {
    width: 100%;
    text-align: left;
}

.raffle-info-table td {
    padding: 6px 0;
    vertical-align: top;
    line-height: 1.4em;
}

.raffle-info-table td:nth-child(1) {
    white-space: nowrap;
}

.raffle-ticket-icon {
    color: #dfba5d;
    font-size: 1.8em;
    display: inline-block;
    margin-bottom: 10px;
}
