/* base.css -- what every page of the site stands on: the page itself, the mark, the footer line, the cookie bar,
 * the share field and the stage's expand button. */

* {
    box-sizing: border-box;
    text-decoration: none;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--f-surface-1);
    color: var(--f-fg);
    font-family: var(--f-font);
    font-style: normal;
    font-weight: 400;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

a { color: var(--f-accent); }
a:hover { opacity: 0.7; }

/* for screen readers only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------------------------------------------------------------- the mark
   An svg (site/brand.mjs): a link bent into an «n» between two ports, on an ember tile; font-size is its size.
   Over a link to the home page it tilts a little. */
.brand-mark {
    display: inline-block;
    flex: 0 0 auto;
    width: 1em;
    height: 1em;
    font-size: 36px;
    vertical-align: middle;
    transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.brand-link:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }

@media (prefers-reduced-motion: reduce) {
    .brand-mark { transition: none; }
}

/* ---------------------------------------------------------------- the footer line */
.footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
    margin-top: auto;
    padding: 24px 20px 32px;
    border-top: 1px solid var(--f-surface-6);
}

/* ---------------------------------------------------------------- the cookie bar
   At the window's bottom until «Принять»: under the support chat (9999), over the rest. */
.consent {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 12px 20px;
    border-top: 1px solid var(--f-surface-6);
    box-shadow: 0 -8px 24px rgb(0 0 0 / 35%);
    background-color: var(--f-surface-3);
}
.consent[hidden] { display: none; }

.consent-text {
    max-width: 760px;
    margin: 0;
    color: var(--f-fg-2);
    font-size: 13px;
    line-height: 1.5;
}

.consent-ok {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    height: var(--f-control-h);
    padding: 0 18px;
    border: 1px solid var(--f-accent-2);
    border-radius: 8px;
    background-color: var(--f-accent-2);
    color: var(--f-on-accent);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.consent-ok:hover { opacity: 0.85; }

/* ---------------------------------------------------------------- a game's link to copy
   On the home cards' menu and in the game page's «Поделиться»: the place it stands in sets its width. */
.link-box {
    display: flex;
    gap: 4px;
}

.link-box-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 5px 8px;
    border: 1px solid var(--f-surface-6);
    border-radius: 6px;
    outline: none;
    background-color: rgb(15 13 10 / 70%);
    color: var(--f-fg-2);
    font: inherit;
    font-size: 12px;
}
.link-box-input:focus { border-color: var(--f-accent-2); color: var(--f-fg); }

.link-box-copy {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 28px;
    padding: 0;
    border: 1px solid var(--f-surface-6);
    border-radius: 6px;
    background: transparent;
    color: var(--f-fg-2);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.link-box-copy:hover,
.link-box-copy.is-copied { border-color: var(--f-accent-2); color: var(--f-fg); }

.link-box-icon { width: 14px; height: 14px; }
.link-box-icon-done,
.link-box-copy.is-copied .link-box-icon-copy { display: none; }
.link-box-copy.is-copied .link-box-icon-done { display: block; }

/* ---------------------------------------------------------------- the stage's expand button
   Over an asset's graph: the page stretches its stage (.is-maximized) itself, not the browser's fullscreen. A game's
   stage has its own buttons (game.css). Under either the page does not scroll meanwhile. */
body.stage-max { overflow: hidden; }

.expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--f-surface-6);
    border-radius: 8px;
    background: rgb(15 13 10 / 55%);
    color: var(--f-fg);
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.expand-btn[hidden] { display: none; }             /* its display would beat the browser's [hidden] */
.expand-btn:hover { border-color: var(--f-accent-2); background: rgb(255 106 26 / 45%); opacity: 1; }

/* two corner brackets on the diagonal; drawn in when the stage is out («свернуть») */
.expand-btn-icon {
    position: relative;
    width: 16px;
    height: 16px;
}
.expand-btn-icon::before,
.expand-btn-icon::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 7px;
    border-style: solid;
    border-color: currentColor;
}
.expand-btn-icon::before { top: 0; left: 0; border-width: 2px 0 0 2px; }
.expand-btn-icon::after { right: 0; bottom: 0; border-width: 0 2px 2px 0; }
.expand-btn.is-on .expand-btn-icon::before { top: 2px; left: 2px; }
.expand-btn.is-on .expand-btn-icon::after { right: 2px; bottom: 2px; }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 640px) {
    .footer { gap: 20px; padding: 20px 16px 28px; }
    .consent { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 16px; }
}
