html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

.gtw-mobile-game {
    display: none;
}

body.gtw-mobile-mode {
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(46, 17, 5, 0.58), rgba(121, 53, 18, 0.28), rgba(46, 17, 5, 0.58)),
        repeating-linear-gradient(90deg, #4b210f 0 19px, #703018 19px 37px, #58230e 37px 57px);
    font-family: Arial, Helvetica, sans-serif;
}

body.gtw-mobile-mode #animation_container {
    display: none !important;
}

body.gtw-mobile-mode .gtw-mobile-viewport {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(46, 17, 5, 0.46), rgba(121, 53, 18, 0.18), rgba(46, 17, 5, 0.46)),
        repeating-linear-gradient(90deg, #4b210f 0 19px, #703018 19px 37px, #58230e 37px 57px);
}

body.gtw-mobile-mode .gtw-mobile-game {
    position: absolute;
    top: 0;
    left: 50%;
    display: block;
    width: 560px;
    height: 900px;
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(46, 17, 5, 0.38), rgba(121, 53, 18, 0.16), rgba(46, 17, 5, 0.38)),
        repeating-linear-gradient(90deg, #4b210f 0 19px, #703018 19px 37px, #58230e 37px 57px);
    transform: translateX(-50%) scale(var(--gtw-mobile-scale, 1));
    transform-origin: top center;
}

.gtw-mobile-header {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 560px;
    height: 151px;
    background: url("/guessTheWord/images/mobileTittle.png") center top / 560px 151px no-repeat;
}

.gtw-mobile-header h1,
.gtw-mobile-header p {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.gtw-mobile-progress {
    position: absolute;
    z-index: 5;
    top: 34px;
    right: 45px;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
    width: 218px;
    height: 30px;
    box-sizing: border-box;
    padding: 5px 7px;
    background: linear-gradient(#f8fafc, #e7ebf0);
    border: 2px solid rgba(127, 141, 139, 0.72);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(255, 255, 255, 0.45);
}

.gtw-mobile-progress span {
    display: block;
    background: #111;
    border-radius: 1px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.gtw-mobile-progress span.is-empty {
    visibility: hidden;
}

.gtw-mobile-stats {
    position: absolute;
    top: 151px;
    left: 0;
    z-index: 4;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    width: 560px;
    height: 92px;
    padding: 12px 40px 11px;
    box-sizing: border-box;
    background: linear-gradient(#c2df67, #94b448);
    overflow: hidden;
}

.gtw-mobile-stats::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/guessTheWord/images/mobileTittle.png") center / 560px auto no-repeat;
    opacity: 0.18;
    pointer-events: none;
}

.gtw-mobile-stat {
    position: relative;
    z-index: 1;
    display: grid;
    min-width: 0;
    grid-template-rows: 31px 36px;
    align-content: start;
    text-align: center;
}

.gtw-mobile-stat span {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 29px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.24);
    white-space: nowrap;
}

.gtw-mobile-stat strong {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0 6px;
    box-sizing: border-box;
    border: 2px solid rgba(127, 141, 139, 0.72);
    border-radius: 2px;
    background: linear-gradient(#f8fafc, #e7ebf0);
    color: #015265;
    font-size: 29px;
    font-weight: 700;
    line-height: 1;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12);
}

.gtw-mobile-clock {
    position: relative;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    margin-right: 10px;
    box-sizing: border-box;
    border: 3px solid #4f8794;
    border-radius: 50%;
    background:
        conic-gradient(#015265 var(--gtw-clock-cycle-angle, 0deg), transparent 0),
        linear-gradient(#f8fafc, #e7ebf0);
    box-shadow: inset 0 0 0 2px #e7ebf0;
}

.gtw-mobile-clock::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 7px;
    width: 8px;
    height: 5px;
    border-radius: 4px 4px 1px 1px;
    background: #4f8794;
}

.gtw-mobile-stat strong .gtw-mobile-time-text {
    display: inline-flex;
    min-width: 58px;
    justify-content: flex-start;
    color: #015265;
    text-shadow: none;
}

.gtw-mobile-stat strong.is-warning .gtw-mobile-clock {
    animation: gtw-mobile-clock-warning 600ms ease-in-out infinite alternate;
}

@keyframes gtw-mobile-clock-warning {
    from {
        transform: scale(1);
        filter: none;
    }

    to {
        transform: scale(1.08);
        filter: drop-shadow(0 0 3px rgba(208, 75, 50, 0.68));
    }
}

.gtw-mobile-stat:nth-child(2) strong::before {
    content: none;
}

.gtw-mobile-word {
    position: absolute;
    top: 265px;
    left: 80px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 400px;
    height: 43px;
    padding: 5px 11px;
    box-sizing: border-box;
    border: 2px solid #314018;
    border-radius: 6px;
    background: linear-gradient(#c2df67, #96bd42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 2px 0 rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.gtw-mobile-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 auto;
    min-width: 19px;
    height: 100%;
    color: #087dc2;
    font-size: 29px;
    font-weight: 900;
    line-height: 1;
}

.gtw-mobile-letter.is-target {
    color: #087dc2;
}

.gtw-mobile-letter.is-flashing {
    color: transparent;
}

.gtw-mobile-picture-wrap {
    position: absolute;
    top: 321px;
    left: 14px;
    z-index: 1;
    width: 532px;
    height: 355px;
}

.gtw-mobile-picture {
    position: relative;
    width: 532px;
    height: 355px;
    overflow: hidden;
    box-sizing: border-box;
    border: 3px solid #b76b27;
    background: #fff;
    box-shadow:
        0 0 0 2px #fff,
        0 0 0 4px rgba(95, 40, 11, 0.95),
        0 5px 0 rgba(0, 0, 0, 0.22);
}

.gtw-mobile-picture img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.gtw-mobile-grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(18, 1fr);
    grid-template-rows: repeat(12, 1fr);
}

.gtw-mobile-cell {
    box-sizing: border-box;
    background: #d6d6d6;
    border-right: 1px solid #9b9b9b;
    border-bottom: 1px solid #9b9b9b;
}

.gtw-mobile-cell:nth-child(18n) {
    border-right: 0;
}

.gtw-mobile-cell:nth-last-child(-n + 18) {
    border-bottom: 0;
}

.gtw-mobile-cell.is-revealed {
    visibility: hidden;
}

.gtw-mobile-win-sweep {
    position: absolute;
    z-index: 4;
    left: -255px;
    bottom: -255px;
    width: 490px;
    height: 490px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.56) 18%, rgba(255, 255, 255, 0.18) 42%, rgba(255, 255, 255, 0) 72%);
    mix-blend-mode: screen;
    animation: gtw-mobile-win-sweep 3s cubic-bezier(0.18, 0.72, 0.22, 1) forwards;
}

@keyframes gtw-mobile-win-sweep {
    0% {
        transform: translate3d(0, 0, 0) scale(0.92);
        opacity: 0;
    }

    12% {
        opacity: 0.95;
    }

    78% {
        opacity: 0.85;
    }

    100% {
        transform: translate3d(830px, -595px, 0) scale(1.08);
        opacity: 0;
    }
}

.gtw-mobile-keyboard {
    position: absolute;
    top: 705px;
    left: 67px;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(6, 55px);
    grid-auto-rows: 55px;
    gap: 10px 12px;
    width: 426px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    pointer-events: auto;
}

.gtw-mobile-key {
    width: 55px;
    height: 55px;
    margin: 0;
    padding: 0;
    border: 1px solid #8d8d8d;
    border-radius: 6px;
    background: linear-gradient(#ffffff 0%, #f1f1f1 46%, #cccccc 100%);
    color: #050505;
    font-size: 29px;
    font-weight: 900;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 3px 2px rgba(0, 0, 0, 0.48);
    touch-action: manipulation;
}

.gtw-mobile-key:disabled {
    opacity: 0.45;
}

.gtw-mobile-end {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 19px;
    padding: 46px 54px;
    box-sizing: border-box;
    background: rgba(75, 33, 15, 0.94);
    text-align: center;
}

.gtw-mobile-end[hidden] {
    display: none;
}

.gtw-mobile-end h2 {
    margin: 0;
    font-size: 56px;
    line-height: 1.1;
}

.gtw-mobile-end p {
    margin: 0 0 10px;
    font-size: 38px;
    font-weight: 800;
}

.gtw-mobile-highscore-form {
    width: 100%;
    padding: 18px;
    box-sizing: border-box;
    border: 2px solid #314018;
    border-radius: 6px;
    background: linear-gradient(#c2df67, #96bd42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 3px 0 rgba(0, 0, 0, 0.28);
}

.gtw-mobile-highscore-form[hidden] {
    display: none;
}

.gtw-mobile-highscore-form label {
    display: block;
    margin: 0 0 11px;
    color: #fff;
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.28);
}

.gtw-mobile-highscore-form div {
    display: grid;
    grid-template-columns: 1fr 126px;
    gap: 10px;
}

.gtw-mobile-highscore-form input,
.gtw-mobile-highscore-form button,
.gtw-mobile-highscores button {
    min-height: 58px;
    box-sizing: border-box;
    border-radius: 5px;
    font: 800 28px/1 Arial, Helvetica, sans-serif;
}

.gtw-mobile-highscore-form input {
    width: 100%;
    border: 2px solid rgba(127, 141, 139, 0.72);
    padding: 0 12px;
    background: linear-gradient(#f8fafc, #e7ebf0);
    color: #015265;
}

.gtw-mobile-highscore-form button,
.gtw-mobile-highscores button {
    border: 2px solid #314018;
    background: linear-gradient(#ffffff, #d9d9d9);
    color: #213312;
}

.gtw-mobile-highscores {
    width: 100%;
    padding: 18px 16px;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    background: rgba(32, 14, 7, 0.62);
}

.gtw-mobile-highscores[hidden] {
    display: none;
}

.gtw-mobile-highscores h3 {
    margin: 0 0 11px;
    color: #fff;
    font-size: 38px;
    line-height: 1;
}

.gtw-mobile-highscores ol {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gtw-mobile-highscores li {
    display: grid;
    grid-template-columns: 44px 1fr 104px;
    align-items: center;
    min-height: 46px;
    padding: 0 11px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.92);
    color: #015265;
    font-size: 27px;
    font-weight: 800;
    text-align: left;
}

.gtw-mobile-highscores li span:first-child {
    color: #4f8794;
}

.gtw-mobile-highscores li span:nth-child(2) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gtw-mobile-highscores li strong {
    text-align: right;
}

.gtw-mobile-highscores button {
    min-height: 50px;
    margin-top: 11px;
    padding: 0 22px;
    font-size: 22px;
}

.gtw-mobile-end-actions {
    display: grid;
    grid-template-columns: repeat(2, 184px);
    gap: 12px;
}

.gtw-mobile-end-actions button {
    min-height: 64px;
    border: 2px solid #314018;
    border-radius: 6px;
    background: linear-gradient(#c2df67, #96bd42);
    color: #213312;
    font-size: 27px;
    font-weight: 900;
}
