/******************************************************************************/
/* License */
/******************************************************************************/

/* Copyright (c) 2026 Klaleus
 *
 * This software is provided "as-is", without any express or implied warranty.
 * In no event will the authors be held liable for any damages arising from the use of this software.
 *
 * Permission is granted to anyone to use this software for any purpose, including commercial applications,
 * and to alter it and redistribute it freely, subject to the following restrictions:
 *
 *     1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
 *        If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
 *
 *     2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
 *
 *     3. This notice may not be removed or altered from any source distribution.
 */

/******************************************************************************/

/* Codeberg: https://codeberg.org/Klaleus/aoe2flashcards.com */

/******************************************************************************/

/**********/
/* States */
/**********/

::selection
{
    background-color: gray;
}

:focus-visible
{
    outline: 3px dashed white;
}

/***********/
/* General */
/***********/

*
{
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html
{
    color: whitesmoke;
    font-family: 'Times New Roman', Times, serif;
    line-height: 1.5;
    text-shadow: 0 2px 4px #222;
}

body
{
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header
{
    background-color: #434343;
    background-image: url("images/other/history_strategy.png");
    background-position: center;
    background-size: cover;
    border: 7px solid;
    border-image-slice: 7;
    border-image-source: url("images/other/frame_silver.png");
    padding: 30px 0 35px 0;
    text-align: center;
}

main
{
    justify-content: center;
    background-image: url("images/other/mainmenu_bg.png");
    background-position: 75%;
    background-size: cover;
    flex-grow: 1;
    padding: 40px 0;
}

section
{
    width: 100%;
}

footer
{
    background-color: #434343;
    background-image: url("images/other/history_strategy.png");
    background-position: center;
    background-repeat: repeat-x;
    background-size: cover;
    border: 7px solid;
    border-image-slice: 7;
    border-image-source: url("images/other/frame_silver.png");
    text-align: center;
    padding: 30px 0 35px 0;
}

h1
{
    font-size: 2.5rem;
}

#legal
{
    text-align: left;
}

button
{
    background-color: transparent;
    background-size: 100% 100%;
    border: none;
    color: inherit;
    cursor: pointer;
    display: block;
    font: inherit;
    text-shadow: inherit;
}

input[type="checkbox"]
{
    appearance: none;
    background-size: cover;
    cursor: pointer;
}

input[type="checkbox"]:checked
{
    background-image: url("images/buttons/checkbox_checked_normal.png");
}

input[type="checkbox"]:checked:hover
{
    background-image: url("images/buttons/checkbox_checked_hover.png");
}

input[type="checkbox"]:checked:active
{
    background-image: url("images/buttons/checkbox_checked_active.png");
}

input[type="checkbox"]:not(:checked)
{
    background-image: url("images/buttons/checkbox_unchecked_normal.png");
}

input[type="checkbox"]:not(:checked):hover
{
    background-image: url("images/buttons/checkbox_unchecked_hover.png");
}

input[type="checkbox"]:not(:checked):active
{
    background-image: url("images/buttons/checkbox_unchecked_active.png");
}

label
{
    cursor: pointer;
    flex-grow: 1;
    padding: 0 50px 0 10px;
}

div:has(> label)
{
    align-items: center;
    background-size: 100% 100%;
    display: flex;
}

/*
select
{
    background-color: #D7B394;
    border: 7px solid;
    border-image-slice: 7;
    border-image-source: url("images/other/frame_bronze.png");
    color: #4C342A;
    font: inherit;
    font-weight: bold;
    height: 50px;
    padding: 0 5px;
    min-width: min-content;
}
*/

a
{
    color: lightskyblue;
    text-decoration: none;
}

#complete-container
{
    background-color: black;
    background-image: url("images/other/loadingbar_full.png");
    background-repeat: no-repeat;
    background-size: 0;
    border: 7px solid;
    border-image-slice: 7;
    border-image-source: url("images/other/frame_silver.png");
    font-weight: bold;
    padding: 10px 20px 15px 20px;
    text-align: center;
}

/***********/
/* Utility */
/***********/

.page-width
{
    margin: 0 auto;
    max-width: 800px;
    padding-left: 20px;
    padding-right: 20px;
}

.small-width
{
    margin: 0 auto;
    max-width: 500px;
    padding-left: 20px;
    padding-right: 20px;
}

.column
{
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.row
{
    align-items: center;
    display: flex;
    gap: 20px;
}

.column-or-row
{
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 600px)
{
    .column-or-row
    {
        flex-direction: row;
    }
}

.big-button
{
    background-image: url("images/buttons/button_big_normal.png");
    background-size: 100% 100%;
    height: 50px;
    width: 150px;
}

.big-button:hover
{
    background-image: url("images/buttons/button_big_hover.png");
}

.big-button:active
{
    background-image: url("images/buttons/button_big_active.png");
}

.big-button[disabled]
{
    background-image: url("images/buttons/button_big_disabled.png");
}

.small-button
{
    height: 50px;
    width: 50px;
}

/***********/
/* Banners */
/***********/

.blue-banner
{
    background-image: url("images/other/player_banner_blue.png");
}

.cyan-banner
{
    background-image: url("images/other/player_banner_cyan.png");
}

.green-banner
{
    background-image: url("images/other/player_banner_green.png");
}

.gray-banner
{
    background-image: url("images/other/player_banner_grey.png");
}

.lightblue-banner
{
    background-image: url("images/other/player_banner_lightblue.png");
}

.orange-banner
{
    background-image: url("images/other/player_banner_orange.png");
}

.pink-banner
{
    background-image: url("images/other/player_banner_pink.png");
}

.purple-banner
{
    background-image: url("images/other/player_banner_purple.png");
}

.red-banner
{
    background-image: url("images/other/player_banner_red.png");
}

.yellow-banner
{
    background-image: url("images/other/player_banner_yellow.png");
}

/***********/
/* Buttons */
/***********/

#previous
{
    background-image: url("images/buttons/campaign_remove_normal.png");
    grid-area: previous;
}

#previous:hover
{
    background-image: url("images/buttons/campaign_remove_hover.png");
}

#previous:active
{
    background-image: url("images/buttons/campaign_remove_active.png");
}

#previous[disabled], #previous:hover[disabled], #previous:active[disabled]
{
    background-image: url("images/buttons/campaign_remove_disabled.png");
}

#next
{
    background-image: url("images/buttons/campaign_add_normal.png");
    grid-area: next;
}

#next:hover
{
    background-image: url("images/buttons/campaign_add_hover.png");
}

#next:active
{
    background-image: url("images/buttons/campaign_add_active.png");
}

#next[disabled], #next:hover[disabled], #next:active[disabled]
{
    background-image: url("images/buttons/campaign_add_disabled.png");
}

#shuffle
{
    grid-area: shuffle;
}

#tree
{
    grid-area: tree;
}

#audio
{
    grid-area: audio;
}

#archery-range
{
    grid-area: archery-range;
}

#barracks
{
    grid-area: barracks;
}

#blacksmith
{
    grid-area: blacksmith;
}

#buildings
{
    grid-area: buildings;
}

#castle
{
    grid-area: castle;
}

#costs
{
    grid-area: costs;
}

#dock
{
    grid-area: dock;
}

#emblems
{
    grid-area: emblems;
}

#monastery
{
    grid-area: monastery;
}

#siege-workshop
{
    grid-area: siege-workshop;
}

#stable
{
    grid-area: stable;
}

#team-bonuses
{
    grid-area: team-bonuses;
}

#techs
{
    grid-area: techs;
}

#town-center
{
    grid-area: town-center;
}

#unique-units
{
    grid-area: unique-units;
}

#unique-techs
{
    grid-area: unique-techs;
}

#university
{
    grid-area: university;
}

#archery-range-label
{
    grid-area: archery-range-label;
}

#barracks-label
{
    grid-area: barracks-label;
}

#blacksmith-label
{
    grid-area: blacksmith-label;
}

#buildings-label
{
    grid-area: buildings-label;
}

#castle-label
{
    grid-area: castle-label;
}

#costs-label
{
    grid-area: costs-label;
}

#dock-label
{
    grid-area: dock-label;
}

#emblems-label
{
    grid-area: emblems-label;
}

#monastery-label
{
    grid-area: monastery-label;
}

#siege-workshop-label
{
    grid-area: siege-workshop-label;
}

#stable-label
{
    grid-area: stable-label;
}

#team-bonuses-label
{
    grid-area: team-bonuses-label;
}

#techs-label
{
    grid-area: techs-label;
}

#town-center-label
{
    grid-area: town-center-label;
}

#unique-units-label
{
    grid-area: unique-units-label;
}

#unique-techs-label
{
    grid-area: unique-techs-label;
}

#university-label
{
    grid-area: university-label;
}

/*************/
/* Flashcard */
/*************/

#flashcard
{
    /* This matches the typical aspect ratio of a physical flashcard. */
    aspect-ratio: 5 / 3;
    background-image: url("images/other/popup_menu_bg_small.png");
    color: #4C342A;
    padding: 50px;
    text-shadow: none;
    width: 100%;
}

@media (min-width: 500px)
{
    #flashcard
    {
        font-size: 1.5rem;
    }
}

@media (min-width: 700px)
{
    #flashcard
    {
        font-size: 2rem;
    }
}

#icon
{
    align-self: center;
    background-color: black;
    border: 7px solid;
    border-image-slice: 7;
    border-image-source: url("images/other/frame_gold.png");
    height: 50px;
    margin-bottom: -55px;
    width: 50px;
    z-index: 1;
}

@media (min-width: 500px)
{
    #icon
    {
        height: 75px;
        margin-bottom: -70px;
        width: 75px;
    }
}

@media (min-width: 700px)
{
    #icon
    {
        height: 100px;
        margin-bottom: -85px;
        width: 100px;
    }
}

/************/
/* Controls */
/************/

.controls
{
    font-weight: bold;
}

@media (width < 600px)
{
    .controls > :nth-child(2)
    {
        flex-direction: column;
    }
}

.filters
{
    display: grid;
    gap: 10px;
}

@media (min-width: 600px)
{
    .filters
    {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 800px)
{
    .filters
    {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.filters > :nth-child(8n + 1)
{
    background-image: url("images/other/player_banner_blue.png");
}

.filters > :nth-child(8n + 2)
{
    background-image: url("images/other/player_banner_red.png");
}

.filters > :nth-child(8n + 3)
{
    background-image: url("images/other/player_banner_green.png");
}

.filters > :nth-child(8n + 4)
{
    background-image: url("images/other/player_banner_yellow.png");
}

.filters > :nth-child(8n + 5)
{
    background-image: url("images/other/player_banner_cyan.png");
}

.filters > :nth-child(8n + 6)
{
    background-image: url("images/other/player_banner_pink.png");
}

.filters > :nth-child(8n + 7)
{
    background-image: url("images/other/player_banner_grey.png");
}

.filters > :nth-child(8n + 8)
{
    background-image: url("images/other/player_banner_orange.png");
}

/********/
/* Hint */
/********/

span[data-hint]
{
    text-decoration: underline;
    text-decoration-color: #4C342Aaa;
    text-decoration-style: dotted;
}

#hint-container
{
    background-color: black;
    bottom: 0;
    border: 7px solid;
    border-image-slice: 7;
    border-image-source: url("images/other/frame_silver.png");
    left: 0;
    padding: 10px 20px;
    position: fixed;
    text-align: center;
    text-shadow: none;
    width: 100%;
}