@font-face {
    font-family: "sunshine 8x8";
    src: url("fonts/sunshine 8x8.ttf") format("truetype");
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: "sunshine 8x8";
    src: url("fonts/sunshine 8x8 light.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}


:root {
    font-family: "sunshine 8x8", sans-serif;
    font-weight: normal;
    font-size: 8px;
    word-spacing: -6px;
    line-height: 10px;

    user-select: none;
    image-rendering: pixelated;

    -webkit-font-smoothing: none;
    --black: rgb(0, 0, 0);
    --blue: rgb(0, 0, 170);
    --green: rgb(0, 170, 0);
    --cyan: rgb(0, 170, 170);
    --red: rgb(170, 0, 0);
    --magenta: rgb(170, 0, 170);
    --brown: rgb(170, 85, 0);
    --light-gray: rgb(170, 170, 170);
    --gray: rgb(85, 85, 85);
    --light-blue: rgb(85, 85, 255);
    --light-green: rgb(85, 255, 85);
    --light-cyan: rgb(85, 255, 255);
    --light-red: rgb(255, 85, 85);
    --light-magenta: rgb(255, 85, 255);
    --yellow: rgb(255, 255, 85);
    --white: rgb(255, 255, 255);

    --cardTextureMap: url("sprites/cardfaces/card_map.png");
    --miniCardTextureMap: url("sprites/minicards/mini_card_0.png");
    --cardBackTexture: url("sprites/cardbacks/classic.png");
    --chipTextureMap: url("sprites/chips/chips.png");
    --cloud-start: url("sprites/interface/cloud_start.png");
    --cloud-end: url("sprites/interface/cloud_end.png");
    --lampsTextureMap: url("sprites/interface/lamps.png");
    --interfaceTexture: url("sprites/interface/interface.png");

    --gameSpeed: 2;
    --gameVolume: 10;
    --activeRange: 1;
}

body {
    margin: 0;
    padding: 0;

    height: 100svh;

    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;

    background-color: var(--black);
}

#screen {
    visibility: hidden;
    background-color: var(--green);
    height: 180px;
    width: 320px;
    position: relative;
    cursor: none;
}


/* Фишки  */
.chip {
    position: absolute;
    height: 20px;
    width: 24px;

    background-image: var(--chipTextureMap);
    background-position: 0px -44px;
}

.chipBig {
    position: absolute;
    height: 44px;
    width: 28px;

    background-image: var(--chipTextureMap);
    background-position: -28px 0px;
}

.R1 {
    left: 254px;
    top: 144px;
}

.R2 {
    left: 274px;
    top: 134px;
}

.R3 {
    left: 254px;
    top: 120px;
}

.R4 {
    left: 283px;
    top: 120px;
}

.L1 {
    left: 9px;
    top: 144px;
}

.L2 {
    left: 29px;
    top: 134px;
}

.L3 {
    left: 9px;
    top: 120px;
}

.L4 {
    left: 38px;
    top: 120px;
}

.shoe {
    position: absolute;
    left: 256px;
    top: 27px;
    height: 45px;
    width: 37px;
    background: var(--cardBackTexture);
}

/* Меню */
#menu {
    position: absolute;
    width: 100%;
    display: flex;
    z-index: 100;
    height: 10px;
    background: var(--light-gray);
    font-weight: bold;
}

#logo {
    padding: 1px 4px 1px 8px;
}

.menu_btn {
    position: relative;
    height: 8px;
    padding: 1px 4px 1px 4px;
}

.menu_btn:hover {
    background: var(--black);
    color: var(--light-gray);
    --cursorMode: pointer
}

.menu_btn ul {
    list-style: none;
    position: absolute;
    padding: 0px;
    margin: 0px;
    top: 100%;
    left: 0px;

    width: max-content;
    border: 1px solid var(--black);
    display: none;

}

.menu_btn:hover>ul {
    display: block;
}

.menu_btn_hide:hover>ul {
    display: none;
}

.menu_btn li {
    background-color: var(--light-gray);
    color: var(--black);
    padding: 1px 4px 1px 2px;
}

.menu_btn li:hover {
    background-color: var(--black);
    color: var(--light-gray);
}

/* Сообщение */
#message-space {
    position: absolute;
    width: 100%;
    height: 100%;

    z-index: 200;

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

#message-window {
    height: max-content;
    width: max-content;
    background: var(--light-gray);
    border: 1px solid var(--black);
    box-shadow: -1px 1px var(--black);
    font-weight: bold;
    color: var(--black);
    padding: 2px;
}

/* Облачко */

#cloud {
    position: absolute;

    left: 10px;
    top: 19px;

    width: 80px;
    height: fit-content;

    border: 1px solid var(--black);
    box-shadow: -1px 1px var(--black);

    background: var(--yellow);
    background-image: var(--cloud-start), var(--cloud-end);
    background-position: top, bottom;
    background-repeat: no-repeat;

}

#cloud-text {
    width: 64px;
    height: fit-content;
    max-height: 50px;
    margin: 8px 8px 5px 8px;

    /* background: green; */

    line-height: 10px;
    color: var(--red);
    hyphens: auto;
    /* Ломает по буквам */
    /* word-break: break-all; */
    /*Уравнивает количество символов в строках*/
    /* text-wrap: pretty; */
    /*Прячет выходящее за границы контейнера*/
    overflow: hidden;
    /*переносит придерживаясь правил*/
    overflow-wrap: anywhere;
}

#display {
    position: absolute;
    left: 117px;
    top: 154px;
    width: 86px;
    height: 18px;
    /* background: var(--white);
    color: var(--black); */
    background: var(--blue);
    color: var(--white);
    border: 1px solid var(--black);
    box-sizing: border-box;
    overflow: hidden;
    line-height: 8px;
}

#displayStr,
#displayStr2 {
    display: flex;
}

.activeStr {
    /* background: var(--black);
    color: var(--white); */
    background: var(--white);
    color: var(--blue);
}

.lamps {
    position: absolute;
    display: flex;
    justify-content: space-between;
    top: 173px;
    left: 182px;
    height: 4px;
    width: 17px;
}

#lamp_1,
#lamp_2,
#lamp_3 {
    height: 4px;
    width: 5px;

    background: var(--lampsTextureMap);
}

#lamp_1 {
    background-position: 0px 0px;
}

#lamp_2 {
    background-position: -5px 0px;
}

#lamp_3 {
    background-position: -10px 0px;
}

/* Общие стили всплывающих окон */

.popup-space {
    position: absolute;
    height: 100%;
    width: 100%;

    z-index: 200;

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

.popup-window {
    width: 150px;
    background-color: var(--light-gray);
    border: 1px solid var(--black);
    box-shadow: -1px 1px var(--black);
}


.popup-head {
    height: 12px;
    padding: 0;

    background: var(--gray);
    border-bottom: 1px solid var(--black);
    box-sizing: border-box;
    color: var(--white);
    text-align: center;

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

.popup-btn,
.popup-btn-fix {
    padding: 1px 2px 1px 2px;
    margin: 0px 2px 0px 2px;
    border: 1px solid var(--black);
    box-sizing: border-box;
    line-height: 8px;
    --cursorMode: pointer
}

.popup-btn-fix {
    width: 40px;
}

.popup-btn:active,
.popup-btn-fix:active {
    background: var(--black);
    color: var(--light-gray);
}

.popup-footer-r {
    padding: 12px 0px 2px 0px;
    display: flex;
    justify-content: end;
}

.popup-footer-c {
    padding: 2px 0px 2px 0px;
    display: flex;
    justify-content: center;
    text-align: center;
}


/* Окно настроек */

.settings-info {
    padding: 2px 2px 2px 2px;
    color: var(--black);
}

.settings-controls {
    padding-top: 4px;
    display: flex;
}

.settings-progress-bar {
    width: 100%;
    height: 4px;
    margin: 1px;
    background: linear-gradient(to right, var(--black) calc(var(--param) * (100%/var(--max))), var(--light-gray) calc(var(--param) * (100%/var(--max))));
}

.settings-progress-bar-info {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Окно предупреждение */

.alert-info {
    padding: 2px;
    color: var(--black);
}

/* Окно с таблицей */

.data-info {
    margin: 2px 2px 0px 2px;
    padding: 0px 0px 0px 0px;
    border: solid 1px var(--black);

    color: var(--black);

    height: 64px;
    overflow: auto;
}

@-moz-document url-prefix() {
    .data-info {
        scrollbar-width: none;
    }
}

.data-info::-webkit-scrollbar {
    width: 3px;
    background: var(--black);
}

.data-info::-webkit-scrollbar-thumb {
    background: var(--light-gray);
}

.data-info table {
    border-collapse: collapse;
    width: 100%;
}


.data-info tr {
    border-bottom: solid 1px var(--black);
    border-right: solid 1px var(--black);
}

.data-info tr:last-child {
    border-bottom: 0px;
}

.data-info tr:hover {
    background: var(--gray);
    color: var(--light-gray);
}

.data-info td {
    border-right: solid 1px var(--black);
}

.data-info td:nth-child(even) {
    text-align: center;
}

/* Окно лонгрида */

.longread-info {
    margin: 2px 2px 0px 2px;
    padding: 1px 3px 1px 3px;
    border: solid 1px var(--black);

    color: var(--black);

    height: 88px;
    overflow: auto;

    text-align: left;
}

.longread-info .center {
    display: block;
    padding: 0px;
    text-align: center;
}

@-moz-document url-prefix() {
    .longread-info {
        scrollbar-width: none;
    }
}

.longread-info::-webkit-scrollbar {
    width: 3px;
    background: var(--black);
}

.longread-info::-webkit-scrollbar-thumb {
    background: var(--light-gray);
}

canvas {
    position: absolute;

    width: 320px;
    height: 180px;
}

#canvasBack {
    z-index: -1;
}

#canvasMidle {
    z-index: 0;
    pointer-events: none;
}

#canvasUp {
    z-index: 200;
    pointer-events: all;
}

#canvasCursor {
    z-index: 300;
    pointer-events: none;
}

#interface {
    position: absolute;
    height: 100%;
    width: 100%;
    background: var(--interfaceTexture);
}