/*
 * account/ and creator/ pages. Colours come from the game's fight art (data/img/background.png), the black outlines
 * from the logo. The two pages are the two fighters: account is the fire side, creator the purple chakra side.
 */
:root {
    --night: #0f2a33;
    --night-deep: #0a1f27;
    --panel: #173c47;
    --line: #2c5966;
    --rice: #f6f2e7;
    --muted: #b6cdd2;
    --ember: #ffa81f;
    --chakra: #b794f0;
    --shrine: #d4231f;
    --shrine-text: #ff8b7f;
    --bamboo: #8fd05f;
    --outline: #000;
    --accent: var(--ember);
    --display: "Russo One", "Arial Black", sans-serif;
    --body: "Barlow", "Segoe UI", Arial, sans-serif;
}

.side-chakra {
    --accent: var(--chakra);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--night);
    color: var(--rice);
    font-family: var(--body);
    font-size: 17px;
    line-height: 1.5;
}

a {
    color: var(--accent);
    font-weight: 600;
}

a:hover {
    color: var(--rice);
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

h1, h2, h3 {
    font-family: var(--display);
    font-weight: 400;
    line-height: 1.15;
    margin: 0;
}

h2 {
    font-size: 1.55rem;
}

h3 {
    font-size: 1.1rem;
}

p {
    margin: 0;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.9rem;
}

.stack > * + * {
    margin-top: 14px;
}

/* ---------- Top bar ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px clamp(16px, 4vw, 40px);
    background: var(--night-deep);
    border-bottom: 3px solid var(--outline);
    position: relative;
    z-index: 2;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--rice);
    font-family: var(--display);
    font-weight: 400;
    text-decoration: none;
}

.brand img {
    width: 38px;
    height: 38px;
    display: block;
}

.topnav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px 18px;
}

.topnav a {
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
}

.topnav a:hover {
    color: var(--rice);
    text-decoration: underline;
}

/* ---------- Hero: the fight art, cropped to this page's fighter ---------- */
.hero {
    position: relative;
    min-height: 330px;
    display: flex;
    align-items: flex-end;
    /* the side padding lines the text up with the edge of .page below it */
    padding: 36px max(clamp(16px, 4vw, 40px), calc((100vw - 1120px) / 2 + 40px)) 76px;
    background-color: var(--night);
    background-image:
        linear-gradient(to bottom, rgba(15, 42, 51, 0) 55%, var(--night) 94%),
        linear-gradient(to right, var(--night) 0, var(--night) 34%, rgba(15, 42, 51, 0) 68%),
        url("../../data/img/background.png");
    background-repeat: no-repeat;
    background-size: auto, auto, 1640px auto;
    background-position: 0 0, 0 0, right -170px top -30px;
}

.side-chakra .hero {
    justify-content: flex-end;
    background-image:
        linear-gradient(to bottom, rgba(15, 42, 51, 0) 55%, var(--night) 94%),
        linear-gradient(to left, var(--night) 0, var(--night) 40%, rgba(15, 42, 51, 0) 66%),
        url("../../data/img/background.png");
    background-position: 0 0, 0 0, left -300px top -10px;
}

.hero-text {
    width: min(620px, 100%);
    position: relative;
}

/* the logo's treatment: white letters, heavy black stroke, hard drop */
.hero h1 {
    color: #fff;
    font-size: clamp(2.3rem, 6.4vw, 4.4rem);
    letter-spacing: 0.01em;
    overflow-wrap: anywhere;
    paint-order: stroke fill;
    -webkit-text-stroke: 0.16em var(--outline);
    text-shadow: 0.07em 0.09em 0 var(--outline);
}

.hero p {
    margin-top: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    max-width: 34em;
}

/* ---------- Page ---------- */
.page {
    width: min(1120px, 100%);
    margin: -44px auto 0;
    padding: 0 clamp(16px, 4vw, 40px) 56px;
    position: relative;
}

.page-narrow {
    width: min(740px, 100%);
}

.panel {
    background: var(--panel);
    border: 3px solid var(--outline);
    border-radius: 6px;
    box-shadow: 6px 6px 0 var(--outline);
    padding: clamp(18px, 3vw, 28px);
}

.panel + .panel,
.section {
    margin-top: 30px;
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
    margin-bottom: 14px;
}

/* ---------- Notices ---------- */
.notice {
    border: 3px solid var(--outline);
    border-left: 12px solid var(--ember);
    border-radius: 6px;
    background: var(--night-deep);
    padding: 12px 16px;
    margin-bottom: 22px;
    font-weight: 500;
}

.notice-good {
    border-left-color: var(--bamboo);
}

.notice-bad {
    border-left-color: var(--shrine);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    font: 400 1rem var(--display);
    color: #000;
    background: var(--accent);
    border: 3px solid var(--outline);
    border-radius: 6px;
    box-shadow: 3px 3px 0 var(--outline);
    padding: 11px 20px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    color: #000;
    background: var(--rice);
}

.btn:active {
    transform: translate(3px, 3px);
    box-shadow: none;
}

.btn:disabled {
    background: var(--line);
    color: var(--muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-quiet {
    background: transparent;
    color: var(--rice);
    box-shadow: none;
    border-color: var(--line);
}

.btn-quiet:hover {
    color: #000;
}

.btn-danger {
    background: var(--shrine);
    color: #fff;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

/* ---------- Forms ---------- */
.field {
    display: block;
}

.field + .field,
.field-row + .field,
.field + .field-row,
.field-row + .field-row {
    margin-top: 16px;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
}

.field-row .field {
    margin-top: 0;
}

.field > span {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.field small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    font: 500 1rem var(--body);
    color: var(--rice);
    background: var(--night-deep);
    border: 2px solid var(--outline);
    border-radius: 4px;
    padding: 10px 12px;
    color-scheme: dark;
}

textarea {
    min-height: 92px;
    resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    border-color: var(--accent);
    outline-offset: 0;
}

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

fieldset:disabled {
    opacity: 0.55;
}

.check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-weight: 500;
}

.check input {
    width: 20px;
    height: 20px;
    flex: none;
    margin-top: 3px;
    accent-color: var(--accent);
}

/* ---------- Sign in ---------- */
.signin {
    min-height: calc(100vh - 62px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background-color: var(--night);
    background-image:
        linear-gradient(rgba(10, 31, 39, 0.35), rgba(10, 31, 39, 0.82)),
        url("../../data/img/background.png");
    background-size: auto, cover;
    background-position: 0 0, center top;
    background-repeat: no-repeat;
}

.signin .panel {
    width: min(430px, 100%);
}

.signin h1 {
    font-size: 1.9rem;
}

.signin .btn {
    width: 100%;
}

/* ---------- Account: the licence + the stamp ---------- */
.licence {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px 28px;
}

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

.figure img {
    width: 54px;
    height: 54px;
}

.figure b {
    display: block;
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(2rem, 6vw, 3rem);
    line-height: 1.05;
}

.stamp {
    display: inline-block;
    font-family: var(--display);
    font-size: clamp(1.5rem, 5vw, 2.3rem);
    color: var(--bamboo);
    border: 5px solid currentColor;
    border-radius: 10px;
    padding: 6px 18px;
    /* room for the corners once it's rotated, so they stay inside the panel */
    margin: 10px 14px;
    transform: rotate(-7deg);
    animation: stamp-hit 280ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.stamp-banned {
    color: var(--shrine-text);
}

@keyframes stamp-hit {
    from {
        opacity: 0;
        transform: rotate(-16deg) scale(2.3);
    }
    to {
        opacity: 1;
        transform: rotate(-7deg) scale(1);
    }
}

.licence-foot {
    grid-column: 1 / -1;
    border-top: 2px solid var(--line);
    padding-top: 16px;
}

.ban-reason br {
    display: none;
}

.ban-reason b {
    display: block;
    font-family: var(--display);
    font-weight: 400;
    font-size: 1.15rem;
    color: var(--shrine-text);
}

.creator-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    margin-top: 30px;
    padding: 18px 20px;
    border: 3px solid var(--chakra);
    border-radius: 6px;
    background: var(--night-deep);
}

.creator-strip .btn {
    --accent: var(--chakra);
}

/* ---------- Creator dashboard ---------- */
.dash {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 30px;
    align-items: start;
}

.dash-main > * + *,
.dash-side > * + * {
    margin-top: 30px;
}

/* the live code is what a creator shows on stream, so nothing else on the page competes with it */
.drop {
    background: var(--night-deep);
    border: 3px solid var(--chakra);
    border-radius: 6px;
    padding: 18px;
    text-align: center;
    margin-bottom: 18px;
}

.drop-code {
    font-family: var(--display);
    font-size: clamp(1.9rem, 6.8vw, 3.9rem);
    line-height: 1.1;
    letter-spacing: 0.06em;
    color: #fff;
    overflow-wrap: anywhere;
    user-select: all;
}

.drop-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 26px;
    margin: 8px 0 14px;
    font-size: 1.1rem;
    font-weight: 600;
}

.drop-timer {
    color: var(--chakra);
    font-variant-numeric: tabular-nums;
}

.reward-pick {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.reward-pick label {
    display: block;
    cursor: pointer;
}

.reward-pick input {
    position: absolute;
    opacity: 0;
}

.reward-pick span {
    display: block;
    text-align: center;
    font-weight: 600;
    padding: 12px;
    border: 2px solid var(--line);
    border-radius: 6px;
    background: var(--night-deep);
}

.reward-pick input:checked + span {
    border-color: var(--chakra);
    box-shadow: inset 0 0 0 2px var(--chakra);
}

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

.rows {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rows li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 14px;
    padding: 10px 0;
    border-top: 2px solid var(--line);
}

.rows li:first-child {
    border-top: 0;
}

.code-name {
    font-family: var(--display);
    letter-spacing: 0.04em;
}

.tag {
    display: inline-block;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 1px 9px;
    border-radius: 999px;
    color: #000;
    background: var(--muted);
}

.tag-live {
    background: var(--bamboo);
}

.tag-soon {
    background: var(--chakra);
}

.empty {
    color: var(--muted);
    padding: 6px 0;
}

/* ---------- Terms ---------- */
.terms h2 {
    font-size: 1.2rem;
    margin-top: 26px;
    margin-bottom: 6px;
}

.terms ul {
    margin: 6px 0 0;
    padding-left: 20px;
}

.terms li + li {
    margin-top: 4px;
}

.terms p + p,
.terms ul + p {
    margin-top: 10px;
}

/* the plain-words summary above the full text */
.terms-short {
    border: 2px solid var(--line);
    border-left: 8px solid var(--accent);
    border-radius: 6px;
    background: var(--night-deep);
    padding: 14px 18px;
    margin-top: 20px;
}

.terms-short p {
    margin-top: 10px;
}

.terms-toc {
    border-top: 2px solid var(--line);
    margin-top: 20px;
    padding-top: 16px;
}

.terms-toc ol {
    columns: 2;
    column-gap: 28px;
    margin: 0;
    padding-left: 26px;
}

.terms-toc li {
    break-inside: avoid;
    padding: 2px 0;
}

@media (max-width: 560px) {
    .terms-toc ol {
        columns: 1;
    }
}

/* ---------- Footer ---------- */
.foot {
    padding: 20px clamp(16px, 4vw, 40px);
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

/* ---------- Small screens: the fighter sits above the text ---------- */
@media (max-width: 860px) {
    .dash {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 700px) {
    .hero,
    .side-chakra .hero {
        justify-content: flex-start;
        min-height: 0;
        padding-top: 200px;
        padding-bottom: 66px;
        background-image:
            linear-gradient(to bottom, rgba(15, 42, 51, 0) 110px, var(--night) 250px),
            url("../../data/img/background.png");
        background-size: auto, auto 360px;
        background-position: 0 0, calc(50vw - 610px) 0;
    }

    .side-chakra .hero {
        background-position: 0 0, calc(50vw - 327px) 0;
    }

    .licence {
        grid-template-columns: minmax(0, 1fr);
    }

    /* a grid item stretches by default, and a rotated full-width box runs off the panel */
    .stamp {
        justify-self: start;
    }

    .brand span {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stamp {
        animation: none;
    }

    .btn:active {
        transform: none;
    }
}
