/* The site's look: dark bevelled panels, parchment and gold lettering, in
   the spirit of Dominions but drawn by us. Loaded after styles.css, which
   holds the layout; this file only dresses it.

   None of it is Illwinter's art. The textures in theme/ are SVG drawn by
   scripts/make_theme_art.py, the bevels and the wax seal are CSS, and the
   heading font is Black Chancery, which is public domain. Body text uses
   the visitor's own serif. Keep it that way: game files must not be served
   here without Illwinter's permission. */

@font-face {
    font-family: 'Black Chancery';
    src: url(theme/fonts/BlackChancery.ttf) format('truetype');
    font-display: swap;
}

:root {
    --ink: #2b1d10;
    --ink-soft: #5a4128;
    --ink-red: #6b1d10;
    --gold: #f0cf7a;
    --gold-deep: #c9a24f;
    --bone: #e9dcc0;
    --label: #d8c9a8;
    --bevel: #8a7656;
    --bevel-light: #b29a72;
    --bevel-dark: #574833;
    --seal: #8e2014;
    --paper: #e2cfa2;

    /* The site's own colour names, pointed at the theme. */
    --discord-blue: var(--gold);
    --discord-grey: #b9a888;
    --discord-dark: #12100d;
    --discord-light: #2a241c;
    --background-color: #111;
}

body {
    background:
        radial-gradient(ellipse at center, rgba(0, 0, 0, .2) 0%, rgba(0, 0, 0, .78) 100%) fixed,
        #16120f url(theme/grain-dark.svg) 0 0 / 512px repeat;
    color: var(--label);
    font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
    font-size: 1.05rem;
}

a {
    color: var(--gold);
}

/* Top bar and footer: dark bars with a bone-coloured bevel */
.modern-nav,
.site-footer {
    background: linear-gradient(#211c16, #0c0a08);
}

.modern-nav {
    border-bottom: 2px solid var(--bevel);
    box-shadow: 0 2px 0 #000, 0 6px 16px rgba(0, 0, 0, .7);
    position: relative;
    z-index: 1;
}

.modern-nav .nav-brand {
    font-family: 'Black Chancery', serif;
    font-weight: normal;
    font-size: 1.7rem;
    color: var(--gold);
    text-shadow: 2px 2px 0 #000;
    line-height: 1;
}

.modern-nav .nav-brand:hover,
.modern-nav .nav-brand:focus {
    color: #fff3cf;
}

.modern-nav a,
.nav-logout button {
    font-family: 'Black Chancery', serif;
    font-size: 1.2rem;
    letter-spacing: 0;
    text-transform: none;
    color: var(--label);
    text-shadow: 1px 1px 0 #000;
}

.modern-nav-links a:hover,
.nav-account a:hover,
.nav-logout button:hover,
.nav-logout button:focus {
    color: var(--gold);
}

.modern-nav-links a[aria-current="page"] {
    color: var(--gold);
    border-bottom-color: var(--gold-deep);
}

.modern-nav-links a.nav-discord {
    color: var(--label);
}

.modern-nav-links a.nav-discord:hover,
.modern-nav-links a.nav-discord:focus {
    color: var(--gold);
}

.nav-account {
    border-left-color: var(--bevel);
}

.nav-user {
    font-style: italic;
    color: var(--bone);
}

.site-footer {
    border-top: 2px solid var(--bevel);
    box-shadow: 0 -2px 0 #000;
    color: var(--discord-grey);
    font-size: 0.95rem;
}

.site-footer a {
    color: var(--gold);
}

.site-footer a:hover,
.site-footer a:focus {
    color: #fff3cf;
}

/* Headings: Black Chancery in gold, over a small gold diamond */
.page-heading,
body.donate h2,
.error-container h1 {
    font-family: 'Black Chancery', serif;
    font-weight: normal;
    font-size: 2.8rem;
    color: var(--gold);
    text-shadow: 2px 2px 0 #000;
}

body.donate h2 {
    align-self: stretch;
}

.page-heading::after,
body.donate h2::after {
    content: "";
    display: block;
    height: 20px;
    margin: 8px auto 0;
    max-width: 320px;
    background: url(theme/ornament.svg) center / contain no-repeat;
    filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, .8));
}

.turn-summary {
    font-style: italic;
    color: var(--bone);
    font-size: 1.15rem;
    text-shadow: 1px 1px 0 #000;
}

/* Parchment: a paper colour with generated grain, darkened towards a
   ragged edge. The paper is a layer behind the content, so the drop
   shadow can follow the torn edge. */
.info-panel,
.home-hero,
.error-container {
    position: relative;
    isolation: isolate;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .7));
    color: var(--ink);
}

.info-panel::before,
.home-hero::before,
.error-container::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 50% 45%, rgba(255, 250, 232, .45) 0%, rgba(255, 250, 232, 0) 55%),
        url(theme/grain-paper.svg) 0 0 / 512px repeat,
        var(--paper);
    box-shadow: inset 0 0 70px rgba(100, 58, 18, .55), inset 0 0 22px rgba(85, 48, 14, .75);
    -webkit-mask: url(theme/torn-edge.svg) 0 0 / 100% 100% no-repeat;
    mask: url(theme/torn-edge.svg) 0 0 / 100% 100% no-repeat;
}

.info-panel {
    padding: 26px 44px;
}

.info-panel p,
.info-panel {
    color: var(--ink);
    font-size: 1rem;
}

.info-panel a {
    color: var(--ink-red);
    font-weight: bold;
}

/* Data sits on dark bevelled panels: lighter edges top-left, darker
   bottom-right, a black line either side. */
.table-container > .table-responsive,
.tab-pane > .table-responsive,
body.donate .card {
    background: linear-gradient(160deg, #26211b 0%, #13100d 55%, #0b0907 100%);
    border: 3px solid;
    border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
    border-radius: 6px;
    box-shadow:
        0 0 0 1px #000,
        inset 0 0 0 1px #000,
        inset 0 2px 0 1px rgba(255, 230, 180, .07),
        0 8px 18px rgba(0, 0, 0, .6);
    padding: 6px 10px;
}

.table {
    box-shadow: none;
    border-radius: 0;
    margin-bottom: 0;
}

.table-container .table.table-dark {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255, 235, 190, .04);
    --bs-table-striped-color: var(--label);
    --bs-table-hover-bg: rgba(240, 207, 122, .08);
    --bs-table-hover-color: #fff3cf;
    border-color: rgba(138, 118, 86, .35);
    color: var(--label);
}

.table-container .table thead {
    background: none !important;
}

.table-container .table.table-dark thead th {
    font-family: 'Black Chancery', serif;
    font-weight: normal;
    font-size: 1.25rem;
    color: var(--gold);
    text-shadow: 1px 1px 0 #000;
    border-bottom: 2px solid var(--bevel);
    white-space: nowrap;
}

/* My games */
.games-table tbody tr.needs-turn > td:first-child {
    box-shadow: inset 4px 0 0 var(--seal);
}

.game-title a {
    color: var(--gold);
    font-size: 1.1rem;
    text-shadow: 1px 1px 0 #000;
}

.game-title a:hover,
.game-title a:focus {
    color: #fff3cf;
}

.turn-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(#a3281a, #6e150c);
    color: #f8e7bd;
    border: 1px solid #2e0804;
    border-radius: 3px;
    box-shadow: inset 0 1px 0 rgba(255, 200, 150, .3), 0 1px 0 #000;
    padding: 1px 8px 1px 5px;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: .3px;
}

/* A plain wax-seal dot. */
.turn-badge::before {
    content: "";
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #e0583f, #8e1d0f 60%, #4d0b05);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), inset 0 0 0 2px rgba(0, 0, 0, .15);
}

.your-nation {
    color: var(--bone);
    font-style: italic;
}

.link-button {
    color: var(--gold-deep);
    font-family: inherit;
}

.link-button:hover,
.link-button:focus-visible {
    color: var(--gold);
}

.nation-list {
    background: rgba(0, 0, 0, .35);
    border: 1px solid rgba(138, 118, 86, .4);
    border-radius: 2px;
    font-size: 0.95rem;
}

.nation-list .nation-name {
    color: var(--bone);
}

.you-tag {
    background: var(--gold-deep);
    color: #1d1309;
    border-radius: 2px;
    font-weight: bold;
}

.countdown {
    color: var(--bone);
}

.status-key {
    color: var(--discord-grey);
    font-size: 0.9rem;
    margin-top: 12px;
}

.last-updated {
    font-style: italic;
}

.games-message {
    text-align: center;
}

.loader {
    border-color: rgba(138, 118, 86, .4);
    border-top-color: var(--gold);
}

/* Nation winrates */
.era-tabs {
    border-bottom-color: var(--bevel);
}

.era-tabs .nav-link {
    font-family: 'Black Chancery', serif;
    font-size: 1.3rem;
    color: var(--label);
    text-shadow: 1px 1px 0 #000;
}

.era-tabs .nav-link.active {
    color: var(--gold);
    border-bottom-color: var(--gold-deep);
}

.stats-table > tbody > tr > td:first-child,
.nation-short {
    color: var(--bone);
}

.nation-epithet {
    color: #9a8a6c;
    font-style: italic;
}

.fair-example {
    color: var(--bone);
    text-shadow: 1px 1px 0 #000;
}

/* The fair-share line, in bone rather than white. */
.fair-bar::before {
    background-color: rgba(233, 220, 192, .5);
}

.fair-level {
    background-color: #7d7466;
}

/* Logged-out home page: the whole pitch on a parchment sheet */
.home-hero {
    margin-top: 24px;
    padding: 44px 56px 48px;
}

.home-hero h1 {
    font-family: 'Black Chancery', serif;
    font-weight: normal;
    font-size: 4rem;
    line-height: 1;
    color: #3a2410;
    text-shadow: 0 1px 0 rgba(255, 240, 200, .5);
}

.home-tagline {
    color: var(--ink);
    font-size: 1.25rem;
}

.home-note {
    color: var(--ink-soft);
    font-style: italic;
}

.home-hero .home-secondary-link,
.home-join a {
    color: var(--ink-red);
    font-weight: bold;
}

.home-hero .home-secondary-link:hover,
.home-hero .home-secondary-link:focus {
    color: #000;
}

/* Buttons: a dark plaque with a bone bevel and gold lettering */
.button-primary,
body.donate .donate-link {
    background: linear-gradient(#3b3026, #17120e);
    color: var(--gold);
    border: 2px solid;
    border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
    border-radius: 3px;
    box-shadow: inset 0 1px 0 rgba(255, 230, 180, .25), 0 3px 0 #000, 0 6px 12px rgba(0, 0, 0, .5);
    font-family: 'Black Chancery', serif;
    font-size: 1.35rem;
    text-shadow: 1px 1px 0 #000;
}

.button-primary:hover,
.button-primary:focus,
body.donate .donate-link:hover,
body.donate .donate-link:focus {
    background: linear-gradient(#4d3f31, #211a14);
    color: #fff3cf;
}

/* Donate */
body.donate {
    color: var(--label);
    font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
}

body.donate .card.bg-dark {
    background: linear-gradient(160deg, #26211b 0%, #13100d 55%, #0b0907 100%) !important;
}

body.donate .card-title {
    font-family: 'Black Chancery', serif;
    font-size: 1.5rem;
    color: var(--gold);
}

body.donate .card-text {
    color: var(--label);
}

.highlight-text {
    color: var(--gold);
}

/* Flash and error messages */
.flash-message {
    background: linear-gradient(#1f1a15, #0c0a08);
    border: 1px solid var(--bevel);
    border-left: 4px solid var(--gold-deep);
    color: var(--bone);
}

.flash-error {
    border-left-color: var(--seal);
}

.error-container h1 {
    color: #3a2410;
    text-shadow: 0 1px 0 rgba(255, 240, 200, .5);
}

@media (max-width: 768px) {
    /* On phones each game is its own small panel. */
    .table-container > .table-responsive {
        background: none;
        border: none;
        box-shadow: none;
        padding: 0;
    }

    .games-table tbody tr {
        background: linear-gradient(160deg, #241f19, #0d0b09);
        border: 1px solid var(--bevel);
        border-left-width: 4px;
        border-radius: 3px;
        box-shadow: 0 0 0 1px #000, 0 4px 10px rgba(0, 0, 0, .6);
        margin-bottom: 12px;
    }

    .games-table tbody tr.needs-turn {
        border-left-color: var(--seal);
    }

    .status-key {
        background: rgba(0, 0, 0, .45);
        border: 1px solid rgba(138, 118, 86, .4);
        padding: 8px;
    }

    .tab-pane > .table-responsive {
        background: linear-gradient(160deg, #26211b 0%, #13100d 55%, #0b0907 100%);
        border: 2px solid;
        border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
        padding: 4px;
    }

    /* Smaller headers that may wrap, so the winrates table fits without
       scrolling sideways. */
    .table-container .table.table-dark.stats-table thead th {
        font-size: 1.05rem;
        line-height: 1.1;
        white-space: normal;
        vertical-align: bottom;
    }

    .page-heading,
    body.donate h2 {
        font-size: 2.2rem;
    }

    .home-hero {
        padding: 36px 28px 40px;
    }

    .home-hero h1 {
        font-size: 3.2rem;
    }

    .info-panel {
        padding: 22px 26px;
    }
}

@media (max-width: 576px) {
    .modern-nav .nav-brand {
        font-size: 1.4rem;
    }

    .modern-nav a,
    .nav-logout button {
        font-size: 1.02rem;
    }

    .era-tabs {
        gap: 0;
    }

    .era-tabs .nav-link {
        font-size: 1.1rem;
        padding: 8px 10px;
    }
}

/* The smallest phones: a slimmer panel and bar so the winrates table fits. */
@media (max-width: 359.98px) {
    .tab-pane > .table-responsive {
        padding: 0;
    }

    .fair-bar {
        width: 44px;
        margin-right: 4px;
    }
}
