* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-transition: none;
    transition: none;
    text-decoration: none;
}

html {
    font-size: 14px;
}

body {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    height: 100%;
    position: fixed;
}

body {
    font-family: Arial, sans-serif;
    background-color: #c7c7c7;
    display: flex;
    flex-direction: column;
}

textarea {
    width: 100%;
    height: 200px;
}

input[type="text"] {
    padding: 10px;
    min-width: 100px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
button {
    padding: 10px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
button.red {
    background-color: var(--button-red-background);
    color: white;
}
button.red:hover {
    background-color: var(--button-red-background-hover);
}
button[type="submit"] {
    background-color: #5cb85c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 6px;
}
button[type="submit"]:hover {
    background-color: #4cae4c;
}

[disabled] {
    opacity: 0.7;
    pointer-events: none !important;
}

.disable-animation,
.disable-animation * {
  -moz-animation: none !important;
  -webkit-animation: none !important;
  -ms-animation: none !important;
  animation: none !important;
  -moz-transition: none !important;
  -webkit-transition: none !important;
  -ms-transition: none !important;
  transition: none !important;
}

.hidden {
  visibility: hidden;
  opacity: 0;
  display: none;
}

.w100 {
    width: 100%;
}

@keyframes plateFlash {
    0% {background-color: var(--plate-active);}
    100% {background-color: var(--plate-normal);}
}

:root {
    --background-tertiary: #FDF6EC;
    --background-secondary: #5C4033;
    --background-secondary-alt: #ece5db;
    --text-secondary: #FAF3E0;
    --plate-normal: #795a3e;
    --plate-hover: #8d7056;
    --plate-active: #e0c091;
    --plate-active-hover: #eac791;
    --plate-word-color: #2B1F14;
    --plate-len-color: white;
    --article-container-background: #faebd7;
}

:root {
    --background-tertiary: #ecedf0;
    --background-secondary: #fff;
    --background-secondary-alt: #dbdddf;

    --background-modifier-hover: rgba(116, 127, 141, 0.08);
    --background-modifier-active: rgba(116, 127, 141, 0.16);
    --background-modifier-selected: rgba(116, 127, 141, 0.24);
    --background-modifier-accent: rgba(0, 0, 0, 0.07);

    --border-color-1: rgba(116, 127, 141, 0.12);
    --background-floating: #fff;
    --text-secondary: #000;
    --header-secondary: #4f5660;
    --header-shadow: rgba(0, 0, 0, 0.24);

    --scrollbar-auto-thumb: #ccc;
    --scrollbar-auto-track: #f2f2f2;
    --scrollbar-thin-thumb: rgba(79, 84, 92, 0.3);
    --scrollbar-thin-track: transparent;

    --color-shadow: rgba(0, 0, 0, 0.25098);
    --button-red-background: #ee4145;
    --button-red-background-hover: #aa2e30;

    --plate-normal: #80725e;
    --plate-hover: #685c4b;
    --plate-active: #e0c091;
    --plate-active-hover: #eac791;
    --plate-word-color: #000000;
    --plate-len-color: white;
    --article-container-background: #faebd7;
}

#root, body {
    background-color: var(--background-tertiary);
}

#root {
    height: 100% !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wrapper {
    position: relative;
    display: flex;
    flex-direction: row;
    height: 100%;
    width: 100%;
}
.wrapper > .page {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
}
.wrapper > .page > header > h1{
    padding: 0 16px;
}
.wrapper > .page > header {
    display: flex;
    height: 48px;
    position: sticky;
    align-items: center;
    top: 0;
    overflow-x: auto;
    backdrop-filter: saturate(180%) blur(20px);
    background-color: var(--background-secondary);
    box-shadow: 0 2px 4px 0 var(--header-shadow);
    color: var(--text-secondary);
    width: 100%;
    z-index: 999;
}
.wrapper > .page > .main-content {
    display: flex;
    width: 100%;
    height: 100%;
    flex: 1;
    overflow: hidden;
    position: relative;
    max-width: 1050px;
    max-height: 1300px;
}

.start-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}
#start-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 200px;
}


.game-container {
    display: flex;
    flex-direction: row;
    margin: 16px;
    border-radius: 10px;
    background-color: var(--background-secondary-alt);
    box-shadow: 3px 3px 16px rgba(0, 0, 0, 0.24);
    border: 1px solid var(--border-color-1);
    overflow: hidden;
}
.game-container > .article-container {
    background-color: var(--article-container-background);
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 100%;
    height: 100%;
    padding: 8px;
}
.game-container > .predict-container {
    flex: 1 0 25%;
    max-height: 100%;
    overflow-y: hidden;
    background-color: var(--background-tertiary);
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
}

.article-container {
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 8px;
}
.article-container > .text,
.article-container > .title {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    row-gap: 2px;
    font-size: 16px;
}

.article-container .newline {
    flex: 1 100%;
    height: 4px;
}
.article-container .whitespace {
    min-width: 3px;
}

.game-container > .predict-container > .header {
    display: flex;
    flex-direction: row;
    position: relative;
    padding: 5px 8px;
    width: 100%;
    backdrop-filter: saturate(180%) blur(20px);
    background-color: var(--background-secondary);
    box-shadow: 0 2px 4px 0 var(--header-shadow);
    min-height: 40px;
    z-index: 9;
}
.game-container > .predict-container > .header .time {
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    align-content: center;
    text-align: left;
    padding: 0 4px;
}
.game-container > .predict-container > .header .actions {
    margin-left: auto;
    height: 100%;
    display: flex;
    align-items: center;
}
.game-container > .predict-container > .header .actions > * {
    max-height: 100%;
}
.game-container > .predict-container > .header .actions > button {
    padding: 6px 12px;
    height: 100%;
}
.game-container > .predict-container > .scroller {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
    padding: 8px;
    height: 100%;
}
.game-container > .predict-container > .guess-form {
    padding: 8px;
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--background-secondary-alt);
}
#guess-form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-container > .predict-container .guess-history {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
    flex: 1;
}
.game-container > .predict-container
.guess-history > .history-item.not-present {
    background-color: var(--background-modifier-accent);
    color: #000;
    /* border: 1px solid var(--text-warning); */
}
.game-container > .predict-container
.guess-history > .history-item {
    height: 32px;
    width: 100%;
    background-color: var(--background-secondary);
    border-radius: 8px;
    padding: 8px;
    font-size: 14px;
    align-content: center;
    margin-bottom: 4px;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}
.game-container > .predict-container
.guess-history > .history-item > .word {
    position: relative;
    text-overflow: ellipsis;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
}
.game-container > .predict-container
.guess-history > .history-item > .word-measure {
    margin-left: auto;
}

/** ALL ABOUT TITLE PLATES **/
.article-container > .title .plate {
    background-color: var(--plate-normal);
    min-width: 20px;
    min-height: 30px;
    position: relative;
    user-select: none;
    border-radius: 4px;
    font-size: 20px;
}
.article-container > .title .plate.highlighted {
    animation: plateFlash 2s ease-out;
}
.article-container > .title .plate:hover {
    background-color: var(--plate-hover) !important;
}
.article-container > .title .plate.complete {
    background-color: var(--plate-active) !important;
}
.article-container > .title .plate.complete:hover {
    background-color: var(--plate-active-hover) !important;
}
.article-container > .title .plate > * {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    transition: opacity .1s linear;
}
.article-container > .title .plate > .plateWord {
    opacity: 1;
    white-space: nowrap;
    color: var(--plate-word-color);
    padding: 0 8px;
    line-height: 1;
    font-weight: 600;
}
.article-container > .title .plate:hover > .plateWord {
    opacity: 0;
}
.article-container > .title .plate.complete > .plateWord {
    opacity: 1 !important;
}
.article-container > .title .plate > .plateLen {
    opacity: 0;
    position: absolute;
    color: var(--plate-len-color);
}
.article-container > .title .plate:hover > .plateLen {
    opacity: 1;
}
.article-container > .title .plate.complete > .plateLen {
    display: none;
}

/** ALL ABOUT TEXT PLATES **/
.article-container > .text .plate {
    background-color: var(--plate-normal);
    min-width: 10px;
    min-height: 16px;
    height: 20px;
    position: relative;
    user-select: none;
    border-radius: 4px;
    font-size: 14px;
}
.article-container > .text .plate.highlighted {
    animation: plateFlash 2s ease-out;
}
.article-container > .text .plate:hover {
    background-color: var(--plate-hover) !important;
}
.article-container > .text .plate.complete {
    background-color: var(--plate-active) !important;
}
.article-container > .text .plate.complete:hover {
    background-color: var(--plate-active-hover) !important;
}
.article-container > .text .plate > * {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    transition: opacity .1s linear;
}
.article-container > .text .plate > .plateWord {
    opacity: 1;
    white-space: nowrap;
    color: var(--plate-word-color);
    padding: 0 6px;
    line-height: 1;
}
.article-container > .text .plate:hover > .plateWord {
    opacity: 0;
}
.article-container > .text .plate.complete > .plateWord {
    opacity: 1 !important;
}
.article-container > .text .plate > .plateLen {
    opacity: 0;
    position: absolute;
    color: var(--plate-len-color);
}
.article-container > .text .plate:hover > .plateLen {
    opacity: 1;
}
.article-container > .text .plate.complete > .plateLen {
    display: none;
}

/** ALL ABOUT PLATE TOOLTIPS **/
.article-container .plate > .tooltip > .guess-item > .word {
    position: relative;
    text-overflow: ellipsis;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
}
.article-container .plate > .tooltip > .guess-item > .word-score {
    margin-left: auto;
}
.article-container .plate > .tooltip > .guess-item {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
    height: 15px;
    gap: 4px;
}
.article-container .plate > .tooltip {
    visibility: hidden;
    opacity: 0;
    width: auto;
    height: auto;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 4px 8px;
    position: absolute;
    z-index: 999;
    bottom: 110%; /* расположение над элементом */
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    transition: opacity 0.2s;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
}
.article-container .plate:hover > .tooltip {
    visibility: visible;
    opacity: 1;
}
.article-container > .title .plate > .tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 999;
    top: 110%;
    bottom: unset;
    transform: translateX(-50%);
    height: min-content;
}
.article-container > .title .plate:hover > .tooltip {
    visibility: visible;
    opacity: 1;
}

@media (max-width: 800px) {
    .game-container > .predict-container {
        flex: 1 0 185px;
    }
}
@media (max-width: 500px) {
    .game-container {
        flex-direction: column;
    }
    .game-container > .article-container {
        height: auto;
        flex: 1 1 auto;
    }
    .game-container > .predict-container {
        flex: 1 0 40%;
    }
}