/* base.css */
body {
    background-color: var(--page-bg);
    font-family: var(--font-body);
    font-weight: 700;
    color: var(--text);
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

#header {
    overflow: hidden;
    background-blend-mode: screen;
    background: var(--header-gradient); 
    box-shadow: 0px 5px 10px 0px rgb(0 0 0 / 50%);
    border-bottom: solid 1px rgba(0, 0, 0, .4)
}

#header:before,
#footer:before {
    content: "";
    position: absolute;
    width: 200vw;
    height: 700%;
    top: -300%;
    left: -50%;
    z-index: -1;
    background: url(../img/Pattern.png) 0 0 repeat;
    background-size: auto 8%;
    transform: rotate(-5deg);
    mix-blend-mode: soft-light;
    opacity: 0.2;
}

#shop_link {
    background: var(--shop-link-gradient);
    border: solid 1px var(--shop-link-border);
    border-radius: 6px;
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.5);
    color: #000;
    display: block;
    font-family: var(--font-button);
    font-size: 26px;
    font-weight: 100;
    text-transform: uppercase;
    text-shadow: 1px 1px #c9c8d3;
    padding: 2px;
    text-align: center;
    text-decoration: none;
    transition-duration: .25s;
}

/*
 * Кнопка входа стоит рядом с «Магазином», но вторичная: контурная, а не
 * залитая. Две одинаково яркие кнопки в шапке спорили бы за внимание, а
 * магазин здесь главное действие.
 *
 * Цвета берутся из --link: он есть у всех тем и заведомо читается на шапке —
 * это цвет её же ссылок.
 */
#auth_link,
#player_search_link {
    background: none;
    border: solid 1px var(--link);
    border-radius: 6px;
    color: var(--link);
    font-family: var(--font-button);
    font-size: 20px;
    font-weight: 100;
    text-transform: uppercase;
    white-space: nowrap;
    padding: 6px 14px;
    cursor: pointer;
    transition-duration: .25s;
}

#auth_link:active,
#player_search_link:active {
    filter: brightness(0.8);
    transition-duration: .1s;
}

#main {
    background-size: 100% 100%;
}

/*
 * Слои декоративного фона рисует тема: у каждой игры своя графика и своя
 * раскладка, общего здесь только то, что слоёв два.
 */
#background:before,
#background:after {
    content: "";
    width: 100%;
    height: 100%;
    position: absolute;
    background-repeat: no-repeat;
}

#game_iframe {
    border-width: 0px;
    border-radius: 10px;    
    box-shadow: 0px 0px 10px 0 #000; 
}

.section .section-body {
    background-color: var(--section-bg);
    color: var(--section-text);
    box-shadow: 0px 0px 10px 0 #000;
    border-radius: 14px;
    backdrop-filter: blur(4px);
}

.section h1,
.section h2 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--section-text);
}

p {
    font-family: var(--font-body);
}

a {
    text-decoration: none;
    color: var(--link);
}

a:hover {
    text-decoration: underline;
}

a:link {
    color: var(--link);
}

a:active {
    color: var(--link-active);
}

a:visited {
    color: var(--link);
}

@media screen and (max-width: 1200px) {
    #shop_link_container {
        width: 100px;
    }

    #shop_link {
        font-size: 18px;
    }

    #auth_link,
    #player_search_link {
        font-size: 14px;
        padding: 5px 10px;
    }
}

/* theme.css */
:root {
  /* окно игры: поле широкое, 2:1, во всю ширину окна браузера */
  --game-height: min(calc(100vw/2), 100vh - 60px);
  --game-width: min(100vw, calc(100vh/0.3));
  --game-height-portrait: min(calc(100vw/2), 100vh);
  --logo-height: 130%;
  --logo-top: -3px;
  --font-body: Montserrat;
  --font-display: "Uni Sans";
  --font-button: Bankir;
  --item-text: #fff;
  --bonus-text: #FBD75A;
  --text-shadow: 1px 1px #000;
  --text: #fff;
  --section-text: #fff;
  --footer-text: #fff;
  --link: #fff;
  --link-active: #ffba00;
  --section-link: #fff;
  --page-bg: #00412e;
  --header-gradient: linear-gradient(180deg, rgb(1, 50, 21) 0%, rgb(1, 99, 70) 100%);
  --shop-link-gradient: linear-gradient(180deg, #E6B1DC 0%, #881EFF 100%);
  --shop-link-border: #BD85FF;
  --footer-bg: #062825;
  --section-bg: #26b85436;
  --search-input-bg: #dadcf0;
  --search-input-color: #000;
  --button-gradient: linear-gradient(rgba(4, 13, 34, 1) 0%, rgba(12, 33, 58, 1) 100%);
  --popup-border: #3f8d88;
  --popup-gradient: linear-gradient(rgba(0, 26, 24, 0.5) 0%, rgba(0, 6, 6, 0.5) 100%);
  --item-gradient: linear-gradient(to right bottom, #359361 0%, #046450 25%, #046450 55%, #359361 100%);
}

@font-face {
  font-family: Montserrat;
  src: url("../fonts/Montserrat-Regular.ttf");
}

@font-face {
  font-family: "Uni Sans";
  src: url("../fonts/Uni Sans Heavy.otf");
}

@font-face {
  font-family: Bankir;
  src: url('https://static.skillcap.net/htmlGames/nardi/shared/fonts/bankir.ttf');
}

#fullscreenbtn {
  background-image: url("https://static.skillcap.net/htmlGames/backgammon/shared/img/fullscreen.png");
}

/* слои декоративного фона: раскладка эллипсов повторяет боевую */
#background:before {
  background:
    url("../img/elippse small.png") calc(100% - 233px) 2275px,
    url("../img/elippse small.png") calc(100% - 163px) 1407px /289px,
    url("../img/elippse small.png") -142px 1200px,
    url("../img/elippse small.png") 43px 1816px,
    url("../img/elippse small.png") -142px 10px,
    url("../img/elippse small.png") 59px 281px,
    url("../img/elippse small.png") calc(100% - 163px) 196px,
    url("../img/elippse small.png") -142px 1200px;
  background-repeat: no-repeat;
  opacity: 0.7;
}

#background:after {
  background:
    url("../img/elip small.png") 60% 1200px / 900px,
    url("../img/elip small.png") -298px 140px / 700px,
    url("../img/elip small.png") calc(100% - 263px) 46px / 600px,
    url("../img/elip small.png") -535px 850px / 800px;
  background-repeat: no-repeat;
}

/* navigation.css */
/* Positioned independently: the existing game header is hidden in portrait. */
.site-navigation {
    position: fixed;
    top: 0;
    left: 16px;
    z-index: 60;
    font: 600 16px/1.4 var(--font-body);
    word-spacing: normal;
}
.site-navigation-desktop {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 60px;
}
.site-navigation a {
    display: block;
    padding: 10px 0;
}
.site-navigation [aria-current="page"] { text-decoration: underline; }
.site-navigation-mobile { display: none; }
.footer-page-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 24px;
    margin-bottom: 12px;
}
.footer-page-links a,
.footer-page-links a:visited { color: var(--footer-text); }
#footer:has(.footer-page-links) {
    height: auto;
    min-height: 250px;
    max-height: none;
    padding: 20px 12px;
    box-sizing: border-box;
}
@media (max-width: 1100px), (orientation: portrait) {
    .site-navigation {
        position: relative;
        left: auto;
        top: auto;
        padding: 8px 12px;
        background: var(--page-bg);
    }
    /* Landscape retains the existing fixed header. Reserve its height once. */
    body:not(.information-page) .site-navigation { padding-top: 68px; }
    body:has(.site-navigation) #main { padding-top: 0; }
    .site-navigation-desktop { display: none; }
    .site-navigation-mobile { display: block; }
    .site-navigation summary {
        cursor: pointer;
        width: fit-content;
        padding: 10px 14px;
        border: 1px solid currentColor;
        border-radius: 8px;
    }
    .site-navigation-mobile nav { padding: 8px 14px; }
    .site-navigation a { padding: 12px 0; }
}
@media (orientation: portrait) {
    body:not(.information-page) .site-navigation { padding-top: 8px; }
}
/*
 * Телефон в альбомной ориентации. Отдельная строка меню сдвигала игру на 120px
 * вниз, и рамка высотой 100vh - 60px уходила за край экрана: игра рассчитывает,
 * что стоит сразу под шапкой, и сама запирает прокрутку страницы. Поэтому здесь
 * меню встаёт в шапку, а под неё, как и раньше, резервируется 60px.
 */
@media (orientation: landscape) and (max-height: 520px) {
    body:has(#game_iframe) .site-navigation {
        position: fixed;
        top: 0;
        left: 0;
        padding: 8px 12px;
        background: none;
    }
    body:has(#game_iframe) #main { padding-top: 60px; }
    body:has(#game_iframe) .site-navigation-mobile nav {
        background: var(--page-bg);
        border-radius: 0 0 10px 10px;
    }
}
/* на узком экране логотип прижат к левому краю — уступает место кнопке меню */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 768px) {
    body:has(#game_iframe) #titleImage { left: 140px; }
}

/* Меню и действия делят одну строку; логотип не занимает место поверх них. */
@media (max-width: 600px) {
    #header-actions {
        right: 8px;
        left: auto;
        padding-right: 0;
        transform: translateY(-50%);
        gap: 8px;
        word-spacing: normal;
    }
    #header #auth_link_container { min-width: 0; width: 70px; }
    #header #shop_link_container { min-width: 0; width: 110px; }
    #header #auth_link, #header #shop_link { font-size: 18px; }
    body:not(.information-page) .site-navigation { padding-left: 8px; }
    .site-navigation summary { padding: 8px; font-size: 14px; }
}
@media (orientation: landscape) and (max-height: 520px) and (max-width: 1100px) {
    body:has(#game_iframe) #titleImage,
    body:has(#game_iframe) #glowTitleImage { display: none; }
}

/*
 * Телефон в альбомной ориентации, браузер умеет полный экран. Рамка игры
 * получает пропорции экрана: игра считает раскладку один раз, по рамке, и на
 * весь экран только растягивает её — при других пропорциях внизу оставалась
 * пустая полоса высотой с шапку. Цена — узкие поля по бокам на странице.
 */
@media (orientation: landscape) and (max-height: 520px) {
    #game[data-screen-ratio] #game_iframe {
        height: calc(100vh - 60px);
        width: min(100vw, calc((100vh - 60px) * var(--screen-ratio)));
    }

    /*
     * Кнопка полного экрана — в шапке, рядом с меню. Под игрой до неё не
     * добраться: касания по рамке забирает игра, и страницу ими не прокрутить.
     * z-index у #game снят, иначе кнопка осталась бы под шапкой.
     */
    body:has(#game_iframe) #game { z-index: auto; }
    body:has(#game_iframe) #fullscreenbtn {
        position: fixed;
        top: 11px;
        left: 132px;
        margin: 0;
        z-index: 62;
    }
}

/* information.css */
body.information-page {
    margin: 0;
    word-spacing: normal;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.65;
}
.information-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px max(20px, calc((100% - 960px) / 2));
    background: var(--header-gradient);
}
.information-header > a { font-weight: 700; }
.information-header .site-navigation { position: static; }
.information-content {
    max-width: 860px;
    margin: 36px auto;
    padding: 24px 32px;
    color: var(--section-text);
    background: var(--section-bg);
    border-radius: 14px;
}
.information-content h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.2; }
.information-content h2 { font-size: 24px; line-height: 1.3; margin-top: 36px; }
.information-content p { margin: 16px 0; }
.information-play {
    display: inline-block;
    padding: 10px 24px;
    border: 1px solid currentColor;
    border-radius: 8px;
    font-weight: 700;
}
.information-content a,
.information-content a:visited { color: var(--section-text); }
.information-footer a,
.information-footer a:visited { color: var(--footer-text); }
.information-footer {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 28px;
    padding: 28px 16px;
    background: var(--footer-bg);
}
@media (max-width: 1100px), (orientation: portrait) {
    .information-header { align-items: flex-start; padding: 12px 16px; }
    .information-header .site-navigation { padding: 0; background: transparent; }
}
@media (max-width: 600px) {
    .information-content { margin: 16px 12px; padding: 16px; }
}
