/* The participants' pages: Finfun's look (its blues, lime buttons, illustrations, square corners and slanted background) on
   nextOne4's structure: two panels that scroll on their own, and one column on a phone (ADR-012). */
@font-face { font-family: "Barlow Condensed"; font-weight: 400; font-display: swap; src: url("fonts/BarlowCondensed-Regular.ttf") format("truetype"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("fonts/BarlowCondensed-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("fonts/BarlowCondensed-Bold.ttf") format("truetype"); }

body.finfun {
    --ink: #1e394d; --navy: #1e394d; --navy-row: #294356; --navy-field: #334e61; --sky: #dce8eb; --sky-deep: #d4e0e4;
    --lime: #d7fd42; --lime-dark: #9fc216; --accent: #1e394d; --accent-dark: #1e394d; --line: #b9ccd2; --soft: #dce8eb; --muted: #41596a; --radius: 0; --radius-inner: 0;
    --series-0: #00baff; --series-1: #f4581d; --series-2: #ffcc33; --series-3: #accfb9; --series-4: #d67a8f; --series-5: #cfef8c;
    --chart-surface: #294356; --chart-grid: #41596a; --chart-baseline: #9fb2be; --chart-text: #fff; --tip-surface: #1b3548;
    display: flex; flex-direction: column; min-height: 100vh; box-sizing: border-box;
    font-family: "Barlow Condensed", "Trebuchet MS", sans-serif; font-size: 20px; line-height: 1.4; color: var(--ink);
    background: var(--sky) linear-gradient(-32deg, var(--sky-deep) 0%, var(--sky-deep) 40%, var(--sky) 40%, var(--sky) 100%) fixed;
}
body.finfun *, body.finfun *::before, body.finfun *::after { border-radius: 0 !important; }
body.finfun header { background: #fff; border: none; min-height: 60px; box-sizing: border-box; padding: 6px max(24px, calc((100% - 1392px) / 2)); justify-content: flex-start; gap: 4px 24px; }
body.finfun header form { margin: 0; }
body.finfun .brand strong { font-size: 36px; font-weight: 700; line-height: 1; }
body.finfun .header-end { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 18px; }
body.finfun a { color: var(--ink); font-weight: 600; }
body.finfun :focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
body.finfun button, body.finfun a.button { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: 18px; min-height: 36px; padding: 4px 14px; border: none; background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); text-decoration: none; cursor: pointer; }
body.finfun button.primary, body.finfun a.button.primary { min-height: 40px; min-width: 150px; text-transform: uppercase; font-weight: 600; background: var(--lime); box-shadow: 0 3px 0 0 var(--lime-dark); color: var(--ink); }
body.finfun button.primary:hover, body.finfun a.button.primary:hover { background: var(--lime-dark); }
body.finfun input, body.finfun select { font: inherit; }
.game-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }
.game-figure { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.game-figure img { height: 24px; }
.team-name { position: relative; }
.team-name > summary { cursor: pointer; list-style: none; text-decoration: underline dotted; text-underline-offset: 4px; }
.team-name > summary::-webkit-details-marker { display: none; }
.team-name > form { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; display: flex; align-items: end; gap: 8px; padding: 14px; background: #fff; box-shadow: 0 8px 24px rgba(30, 57, 77, 0.25); }
.downloads { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; min-width: 260px; margin: 0; padding: 14px 20px; list-style: none; background: #fff; box-shadow: 0 8px 24px rgba(30, 57, 77, 0.25); }
.downloads li { padding: 4px 0; }
.team-name label { display: flex; flex-direction: column; font-size: 16px; }
#staff-view { margin: 0; padding: 4px 12px; max-width: 250px; background: #c8102e; color: #fff; font-size: 15px; font-weight: 600; line-height: 1.2; text-align: center; text-wrap: balance; }
.team-fixed { font-size: 16px; color: var(--muted); }
body.finfun .game-countdown { background: var(--navy); color: #fff; padding: 2px 10px; }
body.finfun .game-countdown.is-low { background: #ffcc33; color: var(--ink); }
body.finfun .game-countdown.is-up { background: #a30d22; color: #fff; }

body.game main { width: 100%; max-width: 1440px; flex: 1; min-height: 0; padding: 8px 24px 24px; box-sizing: border-box; display: flex; flex-direction: column; gap: 12px; }
body.finfun .message { margin: 0; background: #fff; border-left: 6px solid var(--lime-dark); }
body.finfun .message.error { border-left-color: #a30d22; }
.month-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px 16px; }
.month-step { display: inline-flex; align-items: center; gap: 12px; min-height: 40px; line-height: 1; text-decoration: none; }
.month-step img { flex: none; }
.month-step.is-next { justify-content: flex-end; text-align: right; }
.month-list { font-size: 16px; line-height: 1.3; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; list-style: none; margin: 0; padding: 0; }
body.finfun .month-list a { display: block; min-width: 18px; padding: 4px 6px; text-align: center; text-decoration: none; font-weight: 400; }
body.finfun .month-list a[aria-current] { background: var(--navy); color: #fff; font-weight: 600; }
.month-word { padding-right: 6px; }

/* A page with a text: the illustration in the corner, under the text on a phone. */
body.game main.game-text { padding-inline: max(24px, 8vw); background: no-repeat right 24px bottom 24px; background-size: min(44%, 500px) auto; }
.game-text > h1 { margin: 12px 0 0; font-size: 48px; font-weight: 700; line-height: 60px; }
.game-text > h1, .page-text, .page-feedback, .page-buttons { max-width: 650px; }
.page-text { line-height: 32px; }
.page-text p { margin: 0 0 12px; }
.page-text h1, .page-text h2, .page-text h3 { font-size: 24px; margin: 12px 0 6px; }
.page-feedback, .pageTip { box-sizing: border-box; padding: 8px 20px; background: rgba(30, 57, 77, 0.08); border-left: 4px solid var(--navy); }
.page-buttons { padding: 8px 0; }

/* The office: results beside decisions, each scrolling on its own. */
.office { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; flex: 1; min-height: 0; }
.office-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; max-height: 100%; color: #fff; }
.panel-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; min-height: 56px; padding: 4px 0 4px 30px; color: var(--ink); }
.panel-title h2 { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 36px; font-weight: 400; line-height: 40px; }
.panel-title img { height: 24px; }
.panel-body { flex: 0 1 auto; min-height: 0; background: var(--navy-row); }
@media (min-width: 900px) {
    body.game.has-office { height: 100vh; }
    .panel-body { overflow-y: auto; scrollbar-gutter: stable; scrollbar-color: var(--navy-field) transparent; }
    .office { grid-template-rows: minmax(0, 1fr); align-items: start; }
}
.office-header { margin: 0; padding: 18px 20px 4px; background: var(--navy-row); font-size: 20px; font-weight: 400; text-transform: uppercase; }
.office-line { height: 2px; }
.office-line-spacer { height: 20px; }
.panel-body .office-line-spacer { background: var(--navy); }
.office-row { display: flex; align-items: center; gap: 12px; min-height: 43px; padding: 0 16px 0 36px; background: var(--navy-row); }
.office-row.is-indented { padding-left: 56px; }
.office-label { flex: 1 1 auto; min-width: 0; padding: 4px 0; }
.office-value { flex: 0 0 auto; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.office-delta { flex: 0 0 62px; font-size: 15px; padding-top: 2px; text-align: right; color: #dce8eb; }
.office-feedback { padding: 8px 20px 8px 36px; background: var(--navy-row); color: var(--lime); }
body.finfun .office-feedback a, body.finfun .office-panel .chart a { color: var(--lime); }
body.finfun .office-panel input, body.finfun .office-panel select { height: 38px; box-sizing: border-box; padding: 0 10px; border: none; box-shadow: 0 1px 0 0 #fff; background: var(--navy-field); color: #fff; text-align: right; }
body.finfun .office-panel .office-value input { width: 130px; }
body.finfun .office-panel select { max-width: min(270px, 48vw); }
body.finfun #results-menu { display: none; }
/* The results' list (game-results.js). */
.results-list { position: relative; width: min(270px, 48vw); }
body.finfun #results-button { width: 100%; min-height: 40px; justify-content: flex-end; gap: 10px; padding: 0 10px; background: var(--navy-field); box-shadow: 0 1px 0 0 #fff; color: #fff; font-size: 19px; line-height: 1.2; text-align: right; }
#results-button::after { content: url("images/dropdown.svg"); line-height: 0; flex: none; }
#results-items { position: absolute; z-index: 10; top: 100%; right: 0; min-width: 100%; max-height: 60vh; overflow-y: auto; margin: 0; padding: 0; list-style: none; background: var(--navy-field); color: #fff; box-shadow: 0 1px 0 0 #fff, 0 8px 24px rgba(0, 0, 0, 0.4); font-size: 16px; }
#results-items[hidden] { display: none; }
#results-items li { padding: 7px 10px; text-align: right; white-space: nowrap; cursor: pointer; }
#results-items li:hover, #results-items li:focus { background: var(--navy); }
#results-items li[aria-selected="true"] { font-weight: 600; }
body.finfun #results-items li:focus-visible { outline-offset: -3px; }
body.finfun #decisions-panel select { min-width: 160px; }
body.finfun .office-panel :focus-visible { outline-color: var(--lime); }
body.finfun .infoButton { min-height: 0; width: 20px; height: 20px; padding: 0; margin-left: 6px; vertical-align: -3px; background: url("images/question.png") center / 20px no-repeat; box-shadow: none; cursor: help; }
/* The explanations (game-tips.js). */
.game-tip { position: fixed; z-index: 50; max-width: min(420px, calc(100vw - 24px)); box-sizing: border-box; padding: 10px 20px; background: #fff; color: var(--ink); font-size: 16px; line-height: 1.4; white-space: pre-line; pointer-events: none; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }
.game-tip[hidden] { display: none; }
/* The lists: in the office's font and colours where the browser can (base-select), to the right as the numbers are. */
body.finfun .office-panel select { text-align: right; text-align-last: right; }
body.finfun .office-panel option { font: inherit; background: var(--navy-field); color: #fff; }
@supports (appearance: base-select) {
    body.finfun .office-panel select, body.finfun .office-panel select::picker(select) { appearance: base-select; }
    body.finfun .office-panel select { display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px; min-height: 38px; white-space: nowrap; }
    body.finfun .office-panel select::picker-icon { content: url("images/dropdown.svg"); line-height: 0; margin: 0; transition: none; }
    body.finfun .office-panel select::picker(select) { padding: 0; border: none; background: var(--navy-field); color: #fff; box-shadow: 0 1px 0 0 #fff, 0 8px 24px rgba(0, 0, 0, 0.4); font: inherit; max-height: 60vh; position-area: block-end span-inline-start; }
    body.finfun .office-panel option { min-height: 40px; padding: 4px 10px; justify-content: flex-end; text-align: right; }
    body.finfun .office-panel option::checkmark { display: none; }
    body.finfun .office-panel option:hover, body.finfun .office-panel option:focus-visible { background: var(--navy); }
    body.finfun .office-panel option:checked { font-weight: 600; }
}
.save-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 24px 13px; background: #1b3548; }
.save-bar.has-changes { color: var(--lime); }
#save-conflict { margin: 0 20px 16px; padding: 12px 16px; background: #fff; color: var(--ink); }
#save-conflict h3 { margin: 0; }
body.finfun #save-conflict a { color: var(--ink); }
.office-panel .chart { margin: 0; padding: 14px 20px; background: var(--navy-row); }
.office-panel .chart-figures table { margin: 8px 0 0; }
.missing-node { padding: 4px 36px; color: #ff8d8d; }
.game-closing { font-weight: 600; }
.game-new-month { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 16px; background: #fff; border-left: 6px solid var(--lime-dark); }

/* The pages around the game: the login, joining, waiting for a team. */
body.finfun .card { background: #fff; border: none; box-shadow: 0 2px 0 0 var(--line); }
body.finfun .account-card button.primary { width: 100%; }
/* The illustration beside the card, where there is room, and Simenco's logo under the page. */
body.finfun.account main { width: 100%; box-sizing: border-box; }
.account-card { position: relative; }
.account-card::after { content: ""; position: absolute; left: calc(100% + 24px); bottom: 0; width: min(420px, calc(50vw - 260px)); aspect-ratio: 1; background: url("images/illustration-home.png") left bottom / contain no-repeat; pointer-events: none; }
.account-footer { margin-top: auto; padding: 14px 24px; background: #fff; text-align: center; }
.account-footer img { display: block; width: 104px; height: 32px; margin: 0 auto; }
body.finfun form.stacked input { border: 1px solid var(--line); padding: 8px; }
@media (max-width: 899px) {
    body.finfun { font-size: 19px; }
    body.game main { padding: 8px 12px 16px; }
    body.game main.game-text { padding-inline: 16px; padding-bottom: min(62vw, 340px); background-position: center bottom; background-size: min(58vw, 320px) auto; }
    body.finfun header { padding: 6px 12px; }
    .month-nav { grid-template-columns: 1fr 1fr; }
    .month-list { grid-column: 1 / -1; grid-row: 1; }
    .month-list a { min-width: 34px; padding: 6px; }
    .office-row { padding: 0 10px 0 16px; gap: 8px; }
    .office-row.is-indented { padding-left: 30px; }
    .office-feedback { padding-left: 16px; }
    .office-delta { flex-basis: 48px; }
    .panel-title { padding-left: 16px; }
    .save-bar { padding-inline: 16px; }
    #decisions-panel .save-bar { position: sticky; bottom: 0; z-index: 5; }
    body.finfun .office-panel .office-value input { width: 104px; }
    .account-card::after { display: none; }
}

/* The assignments, in the look of the office, and the confetti after a month. */
.assignment { max-width: 650px; background: var(--navy); color: #fff; }
.assignment .message { color: var(--ink); }
.assignment h2.office-header, .assignment h3.office-header { margin: 0; padding-left: 20px; font-size: 20px; line-height: 1.4; }
.assignment .office-row, .assignment .save-bar { padding-left: 20px; padding-right: 20px; }
body.finfun .assignment input { width: 150px; height: 38px; box-sizing: border-box; padding: 0 10px; border: none; box-shadow: 0 1px 0 0 #fff; background: var(--navy-field); color: #fff; text-align: right; }
body.finfun .assignment :focus-visible { outline-color: var(--lime); }
.answer-mark { display: inline-block; width: 1.4em; text-align: center; font-weight: 700; }
.is-right .answer-mark { color: var(--lime); }
.is-wrong .answer-mark { color: #ff9d8a; }
.assignment-closed { color: var(--lime); }
.option-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; max-width: 650px; margin: 0; padding: 0; list-style: none; }
.option-cards li { padding: 14px 20px; background: #fff; }
.option-cards p { margin: 0 0 6px; }
.confetti { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
@media (max-width: 899px) { body.finfun .assignment input { width: 120px; } }

.game-inbox h1 { margin: 0; font-size: 40px; }
.inbox-message { max-width: 760px; padding: 14px 20px; background: #fff; }
.inbox-message summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; cursor: pointer; }
