/* The pages around the game: signing in, your empires, friends, settings
   (templates/_site.html): the game's sky and green hills behind a parchment
   card. The colours, font, buttons, boxes and tooltips are brand.css's. */

html { background: var(--grass-deep); }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--sky-low);
    font: 15px/1.45 var(--text);
}

/* The scene behind everything: sky, clouds, hills, two of the game's people. */

.scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: linear-gradient(var(--sky-top), var(--sky-low) 62%);
    pointer-events: none;
}

.cloud {
    position: absolute;
    width: 220px;
    height: 64px;
    border-radius: 64px;
    background: #fff;
    opacity: 0.95;
}

.cloud::before,
.cloud::after {
    content: "";
    position: absolute;
    background: #fff;
    border-radius: 50%;
}

.cloud::before { width: 96px; height: 96px; left: 34px; top: -48px; }
.cloud::after { width: 72px; height: 72px; left: 112px; top: -30px; }

.cloud.c1 { left: 6%; top: 9%; }
.cloud.c2 { right: 8%; top: 17%; transform: scale(1.3); }
.cloud.c3 { left: 42%; top: 4%; transform: scale(0.7); opacity: 0.8; }

.hills {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 46vh;
}

/* The page itself */

.page {
    position: relative;
    z-index: 1;
    max-width: 880px;
    margin: 0 auto;
    padding: 28px 16px 48px;
}

.logo {
    display: block;
    width: 240px;
    max-width: 70%;
    margin: 0 auto 18px;
}

.logo img {
    display: block;
    width: 100%;
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.25));
}

.card {
    position: relative;
    background: var(--parchment);
    border: 3px solid var(--parchment-edge);
    border-radius: 16px;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.55), 0 14px 30px rgba(30, 60, 10, 0.35);
    padding: 22px 26px 26px;
}

/* the gold flourishes in the corners of the game's pop-ups */
.card::before,
.card::after {
    content: "";
    position: absolute;
    width: 34px;
    height: 34px;
    border: 3px solid var(--flourish);
    pointer-events: none;
}

.card::before { top: 7px; left: 7px; border-right: 0; border-bottom: 0; border-top-left-radius: 12px; }
.card::after { bottom: 7px; right: 7px; border-left: 0; border-top: 0; border-bottom-right-radius: 12px; }

h1, h2, h3 { margin: 0 0 12px; }

h1 { font-size: 24px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }

h2 img, h3 img {
    height: 26px;
    vertical-align: -6px;
    margin-right: 4px;
}

p { margin: 0 0 12px; }

a { color: #1f6fb2; }

.muted { color: var(--ink-soft); font-size: 13px; }

/* the line above the card's content: who you are, and where to go */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: -4px 0 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--parchment-line);
    font-size: 14px;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar form { margin: 0; }

/* Messages */

.message {
    border-radius: 10px;
    padding: 10px 14px;
    margin: 0 0 16px;
    font-size: 14px;
}

.message.error { background: #ffe7e3; border: 2px solid #e58a7c; color: #8a1d0e; }
.message.done { background: #eaf6d6; border: 2px solid #9fcb5a; color: #2f5a0c; }

/* Forms */

label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin: 12px 0 5px;
}

/* A form's boxes, one under the other (brand.css draws them). */
input[type="text"],
input[type="password"],
input:not([type]) {
    display: block;
    width: 100%;
    max-width: 340px;
}

.choice input:focus-visible + span {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.hint { color: var(--ink-soft); font-size: 12px; margin-top: 4px; }

/* Discord and Google: their own colours, as they ask */

.providers {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.provider {
    flex: 1 1 220px;
    min-height: 46px;
    margin-top: 0;
    font: 600 16px var(--text);
    text-shadow: none;
}

.icon { width: 22px; height: 22px; flex: none; vertical-align: middle; }
.icon.discord { color: #5865f2; }
.provider .icon.discord { color: #fff; }

.provider.discord {
    border-color: #4752c4;
    background: #5865f2;
    box-shadow: 0 3px 0 #3c45a5;
    color: #fff;
}

.provider.google {
    border-color: #dadce0;
    background: #fff;
    box-shadow: 0 3px 0 #c4c7cc;
    color: #3c4043;
}

.or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 6px;
    color: var(--ink-soft);
    font-size: 13px;
}

.or::before,
.or::after {
    content: "";
    flex: 1;
    border-top: 2px solid var(--parchment-line);
}

/* Two forms side by side (log in | new player), one above the other on phones */

.columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 36px;
}

.columns > * { min-width: 0; }

@media (max-width: 640px) {
    .columns { grid-template-columns: 1fr; }
    .columns > * + * { border-top: 2px solid var(--parchment-line); padding-top: 18px; margin-top: 10px; }
    .card { padding: 18px 16px 20px; }
}

/* Your empires */

.empires {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.empire {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px 16px;
    border: 2px solid var(--parchment-edge);
    border-radius: 14px;
    background: #fffdf0;
}

.empire .name {
    font: 800 18px var(--round);
    overflow-wrap: anywhere;
}

.empire .level { color: var(--ink-soft); font-size: 13px; }
.empire .button { margin-top: 12px; align-self: flex-start; }

.empire.new {
    align-items: flex-start;
    justify-content: center;
    border-style: dashed;
    background: transparent;
}

/* How to play: three choices as tiles */

.choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin: 0 0 18px;
    padding: 0;
    border: 0;
}

.choices legend {
    font: 800 16px var(--round);
    margin-bottom: 8px;
    padding: 0;
}

.choice { margin: 0; font-weight: 400; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }

.choice span {
    display: block;
    height: 100%;
    padding: 10px 12px;
    border: 2px solid var(--parchment-edge);
    border-radius: 12px;
    background: #fff;
    font-size: 13px;
    color: var(--ink-soft);
}

.choice b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 2px; }
.choice input:checked + span { border-color: var(--green-bottom); background: #f1fae2; box-shadow: 0 0 0 2px var(--green-top); }

/* Settings */

.section + .section {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 2px solid var(--parchment-line);
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 12px 0;
}

.row + .row { border-top: 1px solid var(--parchment-line); }
.row form { margin: 0; }
.row .what { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row .what .icon { width: 26px; height: 26px; }
.row .what img { width: 30px; flex: none; }

.inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.inline input { display: inline-block; width: 220px; }
.inline select { height: 36px; }
.row .inline .button.small { min-height: 36px; }

details.delete summary {
    cursor: pointer;
    color: #a1281c;
    font-size: 13px;
    margin-top: 6px;
}

details.delete form { margin-top: 8px; }
