@font-face {
    font-family: Scada;
    src: url(../fonts/Scada-Regular.ttf);
}

html, body {
    overflow-y: auto;
}

/* Belt and suspenders on top of the scroll areas' own hiding below — a kiosk
   browser forcing classic (always-on) scrollbar chrome, or a fraction of a
   pixel of rounding at some zoom level, can still paint a track here even
   with nothing to actually scroll. */
html::-webkit-scrollbar, body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

body {
    max-height: 100vh;
    background: url(../img/background.png);
}
body:fullscreen::backdrop {
    background: transparent;
}

label {
    display: block;
}

.datatable {
    border-collapse: collapse;
}

.datatable tr:nth-child(even) {
    background: #ddd;
}

.datatable th,
.datatable td {
    padding: 5px;
    min-width: 20px;
    border-left: 1px solid #777;
    border-right: 1px solid #777;
    text-align: left;
}

.money-horse-section {
    color: white;
    font-family: "Scada", serif;
}

.money-horse-section a {
    color: white;
}

.money-horse-section button {
    outline: none;
}

.money-horse-section input {
    padding: 1px 0;
    border: 0;
    background: #5A5A5A;
    font: 22px "Scada";
    color: white;
}

button, input[type=submit] {
    cursor: pointer;
    border: none;
}

.money-horse-section .js_template {
    display: none;
}

.money-horse-section .active {
    display: block !important;
}

.money-horse-section .content {
    position: relative;
    /*height: 100%;*/
    margin: 0 auto;
}

.money-horse-section .button {
    display: inline-block;
    min-width: 320px;
    padding: 24px 42px;
    border: 0;
    background: center / 100% 100% no-repeat url(../img/red.png);
    color: #fff6e0;
    font: bold 24px "Scada";
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 2px 2px rgba(0, 0, 0, .65);
    cursor: pointer;
    margin: 0 10px;
    transition: filter .15s ease, transform .08s ease;
}

.money-horse-section .button:hover:not([disabled]) {
    filter: brightness(1.08);
}

.money-horse-section .button:active:not([disabled]) {
    transform: translateY(1px);
}

.money-horse-section .button[disabled] {
    filter: grayscale(70%);
    opacity: .6;
    cursor: default;
}

.money-horse-section .button.start {
    display: inline-block;
    background-image: url(../img/green.png);
}

.money-horse-section .button-outline {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border: 2px solid #F1E23E;
    border-radius: 999px;
    background: transparent;
    color: #F1E23E;
    font: bold 15px "Scada";
    letter-spacing: .5px;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease;
}

.money-horse-section .button-outline.shown {
    display: inline-flex;
}

.money-horse-section .button-outline:hover {
    background: rgba(241, 226, 62, .15);
}

.lds-hourglass {
    display: inline-block;
    position: relative;
    width: 64px;
    height: 64px;
}

.lds-hourglass:after {
    content: " ";
    display: block;
    border-radius: 50%;
    width: 0;
    height: 0;
    margin: 6px;
    box-sizing: border-box;
    border: 26px solid;
    border-color: #fff transparent #fff transparent;
    animation: lds-hourglass 1.2s infinite;
}

@keyframes lds-hourglass {
    0% {
        transform: rotate(0);
        animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    }
    50% {
        transform: rotate(900deg);
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    }
    100% {
        transform: rotate(1800deg);
    }
}

.money-horse-section .loading_indicator {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.money-horse-section .loading_indicator .message {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 300px;
    height: 110px;
    margin: -25px 0 0 -100px;
    line-height: 50px;
    text-align: center;
    background: #222;
    padding: 10px 0;
    font-size: 32px;
}

body.loading .loading_indicator {
    display: block;
}

.money-horse-section .notification {
    display: none;
    max-width: 600px;
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 500;
    background: url(../img/account_background.jpg);
    padding: 10px;
    border: 3px solid;
    box-shadow: 0 0 10px 2px black;
}

.money-horse-section .notification.message {
    border-color: #E2FAB1;
}

.money-horse-section .notification.error {
    border-color: #FA8D72;
}

.money-horse-section .notification .close {
    position: absolute;
    right: -5px;
    top: -5px;
    display: block;
    width: 14px;
    height: 14px;
    background: no-repeat center center url(../img/cancel.png);
}

.money-horse-section .screen {
    display: none;
    /*margin-top: 9px;*/
}

.money-horse-section .panel {
    position: relative;
    height: 89px;
    background: repeat-x url(../img/panel.png);
}

.money-horse-section .panel::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 46px;
    z-index: -1;
    background: repeat-x left bottom url(../img/flags.svg);
    background-size: auto 46px;
    animation: panel-flags-drift 14s linear infinite;
    pointer-events: none;
}

@keyframes panel-flags-drift {
    from { background-position-x: 0; }
    to { background-position-x: -322px; }
}

@media (prefers-reduced-motion: reduce) {
    .money-horse-section .panel::after {
        animation: none;
    }
}

.money-horse-section .panel .title_row {
    position: absolute;
    left: 10px;
    top: 6px;
    max-width: calc(50% - 70px);
    display: flex;
    align-items: center;
    gap: 14px;
    overflow: hidden;
}

.money-horse-section .panel .title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 30px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.money-horse-section .panel .limits {
    position: absolute;
    right: 59px;
    top: 3px;
    font-size: 18px;
}

.money-horse-section .panel .menu {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 25px;
    z-index: 2;
}

.money-horse-section .panel .toggle_menu {
    width: 49px;
    height: 49px;
    background: center url(../img/more.png) no-repeat;
}

.money-horse-section .panel .menu_items {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    min-width: 190px;
    background: url(../img/menu.png);
    padding: 10px;
    text-align: right;
}

.money-horse-section .panel .menu_items a {
    display: block;
}

.money-horse-section .screen .avatar_background {
    position: absolute;
    width: 163px;
    height: 163px;
    background: no-repeat 0 0 url(../img/avatars.png);
}

.money-horse-section .screen .avatar {
    width: 100%;
    height: 100%;
    background: no-repeat url(../img/avatars.png);
}

.money-horse-section .screen .family0 .avatar {
    background-position: -163px 0;
}

.money-horse-section .screen .family1 .avatar {
    background-position: -326px 0;
}

.money-horse-section .screen .family2 .avatar {
    background-position: -489px 0;
}

.money-horse-section .screen .family3 .avatar {
    background-position: -652px 0;
}

.money-horse-section .screen .family4 .avatar {
    background-position: -815px 0;
}

.money-horse-section .screen .family5 .avatar {
    background-position: -978px 0;
}

.money-horse-section .game_screen {
    position: relative;
    text-align: center;
}

.money-horse-section .game_screen .participants_container {
    height: 354px;
    background: repeat-x center center url(../img/game_background.png);
    text-align: center;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* old Edge */
}

/* Scrolling (drag/touch/wheel) still works here -- only the visible track is
   gone, same as the belt-and-suspenders rule on html/body above. */
.money-horse-section .game_screen .participants_container::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.money-horse-section .game_screen .participants_container .participants {
    width: 1024px;
    margin: 0 auto;
}


.money-horse-section .game_screen .participant {
    display: inline-block;
    width: 315px;
    height: 160px;
    position: relative;
    text-shadow: black 0 0 5px;
    text-align: left;
}

.money-horse-section .game_screen .participant .avatar_background {
    top: 15px;
    z-index: 1;
}

.money-horse-section .game_screen .participant .name {
    position: absolute;
    left: 152px;
    top: 46px;
    width: 150px;
    font-size: 19px;
}

.money-horse-section .game_screen .participant .coeff_container {
    position: absolute;
    left: 152px;
    top: 75px;
    width: 140px;
}

.money-horse-section .game_screen .participant .coeff {
    display: inline-block;
    font-size: 25px;
}

.money-horse-section .game_screen .participant .coeff_hint {
    display: inline-block;
    width: 77px;
    font-size: 12px;
}

.money-horse-section .game_screen .participant .bet {
    position: absolute;
    left: 78px;
    top: 115px;
    width: 215px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
}

.money-horse-section .game_screen .participant .bet .create {
    position: absolute;
    left: 72px;
    top: 5px;
}

.money-horse-section .game_screen .participant.has_bet .bet .create {
    display: none;
}

.money-horse-section .game_screen .participant .bet .create .value {
    position: absolute;
    display: block;
    width: 136px;
    height: 28px;
    padding-left: 3px;
}

.money-horse-section .game_screen .participant .bet .create.has_value .value {
    width: 109px;
}

.money-horse-section .game_screen .participant .bet .create .confirm {
    display: none;
    width: 27px;
    height: 30px;
    position: absolute;
    left: 112px;
    top: 0;
    line-height: 21px;
    background: #999;
    color: white;
}

.money-horse-section .game_screen .participant .bet .create.has_value .confirm {
    display: block;
}

.money-horse-section .game_screen .participant .bet .view {
    display: none;
}

.money-horse-section .game_screen .participant.has_bet .bet .view {
    display: block;
}

.money-horse-section .game_screen .participant.has_bet .bet .view .value {
    position: absolute;
    right: 90px;
    top: 10px;
    background: no-repeat right center url(../img/bet.png);
    padding-right: 20px;
}

.money-horse-section .game_screen .participant.has_bet .bet .view .prize {
    position: absolute;
    right: 14px;
    top: 10px;
    background: no-repeat right center url(../img/prize.png);
    padding-right: 20px;
}

.money-horse-section .game_screen .participant.has_bet .bet .view .cancel {
    position: absolute;
    right: -5px;
    top: -5px;
    display: block;
    width: 14px;
    height: 14px;
    background: no-repeat center center url(../img/cancel.png);
}

.money-horse-section .game_screen .controls {
    display: inline-block;
}

.money-horse-section .game_screen .controls .button {
    display: inline-block;
}

.money-horse-section .game_screen .receipts_container {
    display: none;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: #333;
    z-index: 2;
}

.money-horse-section .game_screen .receipts {
    margin: 10px auto;
    font-size: 16px;
}

.money-horse-section .game_screen .receipts tr:nth-child(even) {
    background: #444;
}

.money-horse-section .game_screen .receipts td {
    padding: 5px 8px;
    text-align: right;
    border-left: 1px solid #777;
    border-right: 1px solid #777;
}

.money-horse-section .game_screen .receipts .remove {
    display: block;
    width: 14px;
    height: 14px;
    background: no-repeat center center url(../img/cancel.png);
}

.money-horse-section .game_screen .min_bet {
    position: absolute;
    left: 13px;
    top: 398px;
    font-size: 20px;
}

.money-horse-section .movie_screen {
    position: relative;
}

.money-horse-section .movie_screen.active {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #000;
}

.money-horse-section .movie_screen .movie_container {
    background: repeat-x url(../img/movie_background.png);
}

.money-horse-section .movie_screen.active .movie_container {
    width: 100%;
    height: 100%;
}

.money-horse-section .movie_screen .movie {
    position: relative;
    border: 3px solid #19231F;
    margin: 0 auto;
}

/* The canvas is now created at window.innerWidth x window.innerHeight (see
   Movie._start) so it already matches this box pixel-for-pixel -- no more
   letterboxing to center. width/height stay forced here only as a safety
   net against an off-by-a-few-px mismatch (e.g. a scrollbar appearing). */
.money-horse-section .movie_screen.active .movie,
.money-horse-section .movie_screen.active .movie canvas {
    width: 100% !important;
    height: 100% !important;
    border: 0;
}

.money-horse-section .finish_screen {
    position: relative;
}

/* Fullscreen like .movie_screen.active (same fixed/inset/z-index), so the
   race doesn't drop back into the normal in-page layout — with nothing
   behind it opaque, that reflow read as "a black section" — the moment
   it ends. panel.png (already used for the top bar, so no new asset) is
   reused here too, for the same reason .winner's own fix below does. */
.money-horse-section .finish_screen.active {
    display: flex !important;
    position: fixed;
    inset: 0;
    z-index: 100;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background:
        repeat-x top url(../img/panel.png),
        linear-gradient(180deg, #142a1c 0%, #0a1811 100%);
}

.money-horse-section .finish_screen .winner {
    /* Smaller than before (170px, was 212px); background is back to the
       original finish_background.png -- .finish_screen.active above is
       what carries the opaque backdrop now, so this card doesn't need to.
       width:100% so the "Vainqueur..." title spans the full screen instead
       of shrinking to its content (the default for a flex child here). */
    width: 100%;
    height: 170px;
    background: repeat-x center center url(../img/finish_background.png);
    text-align: center;
}

.money-horse-section .finish_screen .winner .title {
    padding-top: 9px;
    vertical-align: middle;
    font-size: 36px;
    color: gold;
}

.money-horse-section .finish_screen .winner .avatar_background {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    /* A little smaller on the winner card specifically — the base
       163x163px avatar is sized for the betting panel's own tiles. */
    transform: scale(0.8);
}

.money-horse-section .finish_screen .winner .name {
    display: inline-block;
    vertical-align: middle;
    font-size: 25px;
}

.money-horse-section .finish_screen .receipts {
    margin: 20px auto;
    font-size: 16px;
    background: #333;
}

.money-horse-section .finish_screen .receipts tr:nth-child(even) {
    background: #444;
}

.money-horse-section .finish_screen .receipts td {
    padding: 5px 8px;
    text-align: right;
    border-left: 1px solid #777;
    border-right: 1px solid #777;
}

.money-horse-section .finish_screen .receipts td.win {
    background: #25735e;
}

.money-horse-section .finish_screen .new_game {
    margin: 0 auto;
    display: block;
}

.bet-section .text {
    padding: 0 25px;
}

.repeat-print {
    background-image: url("/static/img/print.svg");
    width: 16px;
    height: 16px;
}