/* =========================================================
   RJJ WORLD FAN SCORE
   Mobile-first UI
========================================================= */

:root {
    --bg: #080a0d;
    --card: #11151b;
    --card-2: #151a22;
    --border: #29313d;

    --text: #ffffff;
    --muted: #969da8;

    --red: #f52f45;
    --red-dark: #cf1f34;

    --blue: #1475ff;
    --blue-dark: #075bd4;

    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    width: 100%;
    overflow-x: hidden;

    background: var(--bg);
    color: var(--text);

    font-family: Arial, Helvetica, sans-serif;

    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}


/* =========================================================
   PAGE
========================================================= */

.wrap {
    width: 100%;
    max-width: 720px;

    margin: 0 auto;
    padding: 20px 18px 50px;
}


/* =========================================================
   HEADER
========================================================= */

header {
    margin-bottom: 24px;
}

.brand {
    font-size: 30px;
    font-weight: 900;
    line-height: 1;

    letter-spacing: 3px;
}

.tag {
    margin-top: 7px;

    color: #aaa;

    font-size: 12px;
    letter-spacing: 6px;
}


/* =========================================================
   GENERAL CARDS
========================================================= */

.card {
    width: 100%;

    margin: 16px 0;
    padding: 26px;

    background:
        linear-gradient(
            145deg,
            #12171e,
            #10141a
        );

    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.card small {
    display: block;

    margin-bottom: 8px;

    color: #c1c5cb;

    font-size: 13px;
    font-weight: 500;

    letter-spacing: .5px;
}

.card h1 {
    margin: 8px 0 14px;

    color: #fff;

    font-size: 30px;
    font-weight: 900;

    line-height: 1.08;
}

.card h2 {
    margin: 8px 0 18px;

    color: #fff;

    font-size: 27px;
    font-weight: 900;

    line-height: 1.1;
}

.card p {
    color: #d4d7dc;

    font-size: 16px;
    line-height: 1.5;
}


/* =========================================================
   FAN ACCOUNT
========================================================= */

.fanAccount {
    margin-bottom: 22px;
}

.registeredFan h1 {
    margin-bottom: 10px;
}

.fanTikTok {
    margin-top: 14px;

    color: var(--muted);

    font-size: 14px;
}

.fanActions {
    margin-top: 20px;
}

.fanActionButton {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 48px;

    padding: 13px 20px;

    background: #fff;
    color: #080a0d;

    border-radius: 11px;

    font-size: 14px;
    font-weight: 900;

    text-decoration: none;
}


/* =========================================================
   TIKTOK / REGISTRATION
========================================================= */

.tiktokLogin {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 52px;

    margin: 20px 0 16px;
    padding: 14px;

    background: #fff;
    color: #080a0d;

    border-radius: 11px;

    font-size: 15px;
    font-weight: 900;

    text-decoration: none;
}

.orDivider {
    display: flex;

    align-items: center;

    gap: 12px;

    margin: 18px 0;
}

.orDivider::before,
.orDivider::after {
    content: "";

    flex: 1;

    height: 1px;

    background: #303640;
}

.orDivider span {
    color: var(--muted);

    font-size: 12px;
}


/* =========================================================
   FORMS
========================================================= */

input {
    width: 100%;
    min-height: 50px;

    margin: 7px 0;
    padding: 13px 14px;

    background: #0b0e12;
    color: #fff;

    border: 1px solid #414852;
    border-radius: 10px;

    font-size: 16px;
}

input:focus {
    outline: none;

    border-color: #fff;
}

input::placeholder {
    color: #747b84;
}

label {
    display: block;

    margin: 14px 0;

    color: #c8cbd0;

    font-size: 13px;
    line-height: 1.45;
}

label input {
    width: auto;
    min-height: auto;

    margin-right: 8px;
}

.check {
    display: grid;

    grid-template-columns: 22px 1fr;

    gap: 9px;

    align-items: start;
}

.check input {
    width: 18px;
    height: 18px;

    margin: 0;
}

button {
    border: 0;

    font-family: inherit;

    cursor: pointer;

    touch-action: manipulation;
}

#register button {
    width: 100%;
    min-height: 52px;

    margin-top: 12px;
    padding: 14px;

    background: #fff;
    color: #080a0d;

    border-radius: 11px;

    font-size: 15px;
    font-weight: 900;
}


/* =========================================================
   LIVE BOUT
========================================================= */

.liveBout h1 {
    margin-bottom: 16px;
}

.liveBout h1 span {
    padding: 0 5px;

    color: var(--muted);

    font-size: 14px;
}

#status {
    color: #ddd;

    font-size: 16px;
    font-weight: 600;
}

.pill {
    display: inline-block;

    margin-right: 6px;
    padding: 6px 10px;

    background: #303746;

    border-radius: 999px;

    color: #d9dde4;

    font-size: 11px;
    font-weight: 800;
}


/* =========================================================
   ROUNDS
========================================================= */

.rounds {
    display: grid;

    gap: 12px;

    width: 100%;
}

.round {
    width: 100%;

    padding: 22px;

    background:
        linear-gradient(
            145deg,
            #12171e,
            #10141a
        );

    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.round > b {
    color: #fff;

    font-size: 21px;
    font-weight: 900;
}

.round .muted {
    margin-left: 5px;

    color: var(--muted);

    font-size: 13px;
}

.round.live {
    border-color: #3a4554;
}

.round.locked {
    opacity: .42;
}

.round p {
    margin: 16px 0 4px;

    color: #d7d9de;

    font-size: 15px;
}


/* =========================================================
   SCORE BUTTONS
========================================================= */

.scoreBtns {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 12px;

    width: 100%;

    margin-top: 18px;
}

.scoreBtn {
    width: 100%;
    min-height: 68px;

    padding: 13px;

    border-radius: 14px;

    color: #fff;

    font-size: 16px;
    font-weight: 900;

    line-height: 1.25;

    transition:
        transform .12s ease,
        filter .12s ease;
}

.scoreBtn:hover {
    filter: brightness(1.08);
}

.scoreBtn:active {
    transform: scale(.97);
}


/*
   app.js currently outputs buttons in this order:

   1 Red 10-9
   2 Blue 10-9
   3 Even 10-10
   4 Custom

   Therefore nth-child can colour the
   Red and Blue buttons automatically.
*/

.scoreBtns .scoreBtn:nth-child(1) {
    background:
        linear-gradient(
            135deg,
            var(--red),
            var(--red-dark)
        );
}

.scoreBtns .scoreBtn:nth-child(2) {
    background:
        linear-gradient(
            135deg,
            var(--blue),
            var(--blue-dark)
        );
}


/* EVEN SCORE */

.scoreBtns .scoreBtn:nth-child(3),
.scoreBtn.even {
    grid-column: 1 / -1;

    min-height: 58px;

    background: #252c37;

    border: 1px solid #aab1bc;
}


/* CUSTOM */

.scoreBtns .scoreBtn:nth-child(4) {
    background: transparent;

    border: 1px solid #828b97;

    color: #fff;
}


/* =========================================================
   LIVE FAN SCORE
========================================================= */

#aggregate {
    width: 100%;
}

.totals {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 26px;

    width: 100%;

    margin-top: 22px;
}

.totals span {
    display: flex;

    flex-direction: column;

    min-width: 0;

    color: #fff;

    font-size: 0;
}


/*
   app.js currently generates:

   <span>Red Corner 76</span>
   <span>73 Blue Corner</span>

   CSS alone cannot reliably separate the number
   from the name inside a plain text node.

   The enhanced app.js below will generate
   .cornerName and .cornerScore elements.
*/


/* New aggregate structure */

.fanScoreGrid {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 26px;

    width: 100%;

    margin-top: 22px;
}

.fanScoreCorner {
    position: relative;

    min-width: 0;

    padding-left: 22px;
}

.fanScoreCorner::before {
    content: "";

    position: absolute;

    top: 0;
    bottom: 0;
    left: 0;

    width: 6px;

    border-radius: 999px;
}

.fanScoreCorner.red::before {
    background: var(--red);
}

.fanScoreCorner.blue::before {
    background: var(--blue);
}

.cornerName {
    display: block;

    margin-bottom: 7px;

    color: #fff;

    font-size: 18px;
    font-weight: 800;

    line-height: 1.15;
}

.cornerScore {
    display: block;

    font-size: 40px;
    font-weight: 900;

    line-height: 1;
}

.fanScoreCorner.red .cornerScore {
    color: var(--red);
}

.fanScoreCorner.blue .cornerScore {
    color: var(--blue);
}

.scoreSubmissionCount {
    margin-top: 24px !important;

    color: var(--muted) !important;

    font-size: 14px !important;
}


/* =========================================================
   PREVIOUS FIGHTS
========================================================= */

.history {
    width: 100%;

    margin-top: 42px;
}

.sectionHeading {
    margin-bottom: 22px;
}

.sectionHeading small {
    color: #a3a9b2;

    font-size: 12px;
    letter-spacing: .5px;
}

.sectionHeading h2 {
    margin: 10px 0;

    color: #fff;

    font-size: 30px;
    font-weight: 900;
}

.sectionHeading p {
    margin: 0;

    color: #c1c5cb;

    font-size: 16px;
    line-height: 1.45;
}

.historyBout {
    padding: 25px;
}

.completedLabel {
    display: inline-block;

    margin-bottom: 14px;
    padding: 6px 11px;

    background: #303746;
    color: #d9dde4;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 800;

    letter-spacing: .5px;
}

.historyBout > small {
    margin-bottom: 18px;

    color: #d3d6dc;

    font-size: 14px;
}

.historyBout h2 {
    margin: 15px 0;

    font-size: 25px;
}

.historyBout h2 span {
    padding: 0 5px;

    color: var(--muted);

    font-size: 13px;
}

.fightMeta {
    display: flex;

    flex-wrap: wrap;

    gap: 8px 18px;

    margin: 18px 0;

    color: var(--muted);

    font-size: 12px;
    font-weight: 700;
}

.fightDate {
    margin: 12px 0 18px;

    color: #777f89;

    font-size: 12px;
}

.viewScorecard {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 48px;

    padding: 12px 16px;

    background: #fff;
    color: #080a0d;

    border-radius: 10px;

    font-size: 13px;
    font-weight: 900;

    text-decoration: none;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    .wrap {
        max-width: none;

        padding: 14px 12px 40px;
    }

    header {
        margin-bottom: 18px;
    }

    .brand {
        font-size: 25px;

        letter-spacing: 3px;
    }

    .tag {
        font-size: 10px;

        letter-spacing: 5px;
    }

    .card {
        margin: 12px 0;
        padding: 21px 18px;

        border-radius: 17px;
    }

    .card h1 {
        font-size: 25px;
    }

    .card h2 {
        font-size: 24px;
    }


    /* Round */

    .round {
        padding: 19px 16px;

        border-radius: 17px;
    }

    .round > b {
        font-size: 20px;
    }


    /*
       Keep Red and Blue side-by-side
       like the mock-up.
    */

    .scoreBtns {
        grid-template-columns: 1fr 1fr;

        gap: 9px;

        margin-top: 16px;
    }

    .scoreBtn {
        min-height: 65px;

        padding: 11px 7px;

        border-radius: 13px;

        font-size: 14px;
    }

    .scoreBtns .scoreBtn:nth-child(3) {
        grid-column: 1 / -1;
    }


    /*
       Custom button full width on mobile
       for cleaner layout.
    */

    .scoreBtns .scoreBtn:nth-child(4) {
        grid-column: 1 / -1;

        min-height: 54px;
    }


    /* Fan score */

    .fanScoreGrid {
        gap: 18px;

        margin-top: 20px;
    }

    .fanScoreCorner {
        padding-left: 17px;
    }

    .fanScoreCorner::before {
        width: 5px;
    }

    .cornerName {
        font-size: 16px;
    }

    .cornerScore {
        font-size: 39px;
    }


    /* Previous fights */

    .history {
        margin-top: 34px;
    }

    .sectionHeading {
        padding: 0 2px;
    }

    .sectionHeading h2 {
        font-size: 27px;
    }

    .sectionHeading p {
        font-size: 15px;
    }

    .historyBout {
        padding: 22px 18px;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 380px) {

    .wrap {
        padding-left: 9px;
        padding-right: 9px;
    }

    .card {
        padding-left: 15px;
        padding-right: 15px;
    }

    .scoreBtn {
        font-size: 13px;
    }

    .cornerName {
        font-size: 15px;
    }

    .cornerScore {
        font-size: 35px;
    }

}

/* =========================================================
   ACCOUNT LOGIN / REGISTER TABS
========================================================= */

.accountTabs {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 6px;

    margin: 22px 0;

    padding: 5px;

    background: #0b0e12;

    border: 1px solid #29313d;
    border-radius: 12px;
}

.accountTab {
    min-height: 46px;

    padding: 10px;

    background: transparent;
    color: #8e96a1;

    border-radius: 9px;

    font-size: 13px;
    font-weight: 900;
}

.accountTab.active {
    background: #fff;
    color: #080a0d;
}

#loginPanel h2 {
    margin-top: 6px;
}

#loginForm {
    width: 100%;
}

#loginForm button {
    width: 100%;
    min-height: 52px;

    margin-top: 10px;
    padding: 14px;

    background: #fff;
    color: #080a0d;

    border-radius: 11px;

    font-size: 15px;
    font-weight: 900;
}

#loginmsg {
    margin-top: 14px;

    color: #ccc;

    font-size: 14px;
}

.logoutButton {
    margin-left: 8px;

    background: transparent;
    color: #aaa;

    border: 1px solid #414852;
}

@media (max-width: 600px) {

    .accountTabs {
        margin: 18px 0;
    }

    .accountTab {
        font-size: 12px;
    }

    .fanActions {
        display: grid;

        grid-template-columns: 1fr 1fr;

        gap: 8px;
    }

    .logoutButton {
        margin-left: 0;
    }

}