/* Furrow's website, in the game's look (docs/specs/ui-text-first.md): text first on dark bark, cream text never pure
   white, gold for titles and the chosen thing, the brush stroke under the main button, no ornate plates. Colours from
   cardgame2d/Assets/Scripts/UI/UiColors.cs; fonts from cardgame2d/Assets/Fonts (linked into wwwroot/fonts by the csproj). */

@font-face { font-family: "Cinzel"; src: url("/fonts/Cinzel-Black.ttf") format("truetype"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("/fonts/Alegreya-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("/fonts/Alegreya-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("/fonts/Alegreya-Italic.ttf") format("truetype"); font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant SC"; src: url("/fonts/CormorantSC-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
    --cream: #f0e6cc;      /* UiColors.Cream: text */
    --dim: #ccc2ab;        /* UiColors.DimCream: labels, hints, secondary lines */
    --gold: #ffd14f;       /* UiColors.Gold: titles, the chosen option */
    --ink: #301a08;        /* UiColors.Ink: on the brush stroke */
    --rust: #ff8c5c;       /* the opponent's colour (HistoryPanel.Rust) */
    --win: #b8d98a;
    --bark: #1c130c;
    --bark-2: #261a10;
    --line: rgba(240, 230, 204, 0.14);
    --shadow: rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { background: var(--bark); }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--cream);
    font: 18px/1.5 "Alegreya", Georgia, serif;
    background:
        radial-gradient(ellipse at 50% -10%, rgba(255, 209, 79, 0.08), transparent 60%),
        radial-gradient(ellipse at 100% 100%, rgba(255, 140, 92, 0.05), transparent 50%),
        linear-gradient(180deg, var(--bark-2), var(--bark) 40%);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

h1, h2, h3 { font-family: "Cinzel", Georgia, serif; font-weight: 900; color: var(--gold); letter-spacing: 0.04em; line-height: 1.15; margin: 0 0 0.4em; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); }
h2 { font-size: 1.5rem; margin-top: 1.6em; }
h3 { font-size: 1.15rem; }

.label { font-family: "Cormorant SC", Georgia, serif; font-weight: 700; color: var(--dim); letter-spacing: 0.08em; font-size: 0.95rem; }
.dim { color: var(--dim); }
.rust { color: var(--rust); }
.win { color: var(--win); }
.gold { color: var(--gold); }

/* ---------------------------------------------------------------- the frame */

.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

header.site { border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.wordmark { font-family: "Cinzel", Georgia, serif; font-weight: 900; font-size: 1.6rem; color: var(--gold); letter-spacing: 0.08em; margin-right: auto; }
.wordmark:hover { text-decoration: none; }
nav.site { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
nav.site a { color: var(--cream); font-family: "Cormorant SC", Georgia, serif; font-weight: 700; font-size: 1.1rem; letter-spacing: 0.06em; padding: 6px 2px; }
nav.site a.on { color: var(--gold); background: url("/img/stroke_underline.png") center bottom / 100% 8px no-repeat; }
nav.site a:hover { text-decoration: none; color: var(--gold); }

main { padding: 28px 0 64px; }

.back { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); font-family: "Cormorant SC", Georgia, serif; font-weight: 700; letter-spacing: 0.06em; margin-bottom: 18px; }
.back svg { width: 22px; height: 22px; fill: var(--gold); transform: scaleX(-1); }
.back:hover { color: var(--gold); text-decoration: none; }

footer.site { border-top: 1px solid var(--line); color: var(--dim); font-size: 0.9rem; padding: 18px 0 28px; }
footer.site .wrap { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- buttons: text on a brush stroke, or plain text */

.stroke, button.stroke {
    display: inline-block; border: 0; cursor: pointer;
    font: 700 1.2rem "Cormorant SC", Georgia, serif; letter-spacing: 0.06em; color: var(--ink);
    padding: 14px 40px 16px;
    background: url("/img/stroke_banner.png") center / 100% 100% no-repeat;
    filter: drop-shadow(0 3px 6px var(--shadow));
}
.stroke:hover { text-decoration: none; filter: drop-shadow(0 3px 10px rgba(255, 209, 79, 0.35)); }
button.text, .text-button {
    background: none; border: 0; padding: 4px 0; cursor: pointer;
    font: 700 1.05rem "Cormorant SC", Georgia, serif; letter-spacing: 0.06em; color: var(--gold);
}
button.text:hover { text-decoration: underline; text-underline-offset: 3px; }
button.danger { color: var(--rust); }

/* ---------------------------------------------------------------- the home page */

.hero { text-align: center; padding: 56px 0 24px; }
.hero p.lede { font-size: 1.25rem; color: var(--dim); max-width: 34em; margin: 0 auto 32px; font-style: italic; }
.hero .actions { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.notice { border-left: 3px solid var(--rust); padding: 8px 14px; margin: 0 auto 24px; max-width: 34em; text-align: left; color: var(--cream); }

/* ---------------------------------------------------------------- the profile */

.profile { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--gold), 0 4px 14px var(--shadow); background: var(--bark-2); }
.avatar.initial { display: grid; place-items: center; font: 900 2rem "Cinzel", Georgia, serif; color: var(--gold); }
.profile h1 { margin: 0; }
.profile .tag { color: var(--dim); font-size: 1rem; font-family: "Alegreya", Georgia, serif; font-weight: 400; letter-spacing: 0; }
.tier { font: 900 1.25rem "Cinzel", Georgia, serif; color: var(--gold); letter-spacing: 0.05em; }

.facts { display: flex; gap: 36px; flex-wrap: wrap; margin: 26px 0 8px; }
.fact .value { font: 900 1.6rem "Cinzel", Georgia, serif; color: var(--cream); display: block; }

/* ---------------------------------------------------------------- tables: lines, no boxes */

.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.lines { width: 100%; border-collapse: collapse; }
table.lines th { text-align: left; font: 700 0.95rem "Cormorant SC", Georgia, serif; letter-spacing: 0.08em; color: var(--dim); padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.lines td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.lines tr:hover td { background: rgba(255, 209, 79, 0.03); }
table.lines .num { text-align: right; font-variant-numeric: tabular-nums; }
.rank { font: 900 1.1rem "Cinzel", Georgia, serif; color: var(--dim); width: 3em; }
tr.me td { background: rgba(255, 209, 79, 0.06); }

.pager { display: flex; justify-content: space-between; margin-top: 18px; }

/* ---------------------------------------------------------------- decks and cards */

.decks { display: grid; gap: 28px; }
.deck-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.deck-head h3 { margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px; margin-top: 12px; }
.card { position: relative; margin: 0; }
.card img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; box-shadow: 0 6px 14px var(--shadow); display: block; background: var(--bark-2); }
.card .name { display: block; font-size: 0.9rem; line-height: 1.25; margin-top: 6px; }
.card .count { position: absolute; top: 6px; right: 6px; font: 900 0.95rem "Cinzel", Georgia, serif; color: var(--ink);
               background: url("/img/stroke_banner.png") center / 100% 100% no-repeat; padding: 2px 10px 4px; }

/* ---------------------------------------------------------------- settings and forms */

.setting { padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.setting p { margin: 0; color: var(--dim); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
input[type=text] {
    font: 1.05rem "Alegreya", Georgia, serif; color: var(--cream); background: transparent;
    border: 0; border-bottom: 1px solid var(--dim); padding: 6px 2px; min-width: 14em; max-width: 100%;
}
input[type=text]::placeholder { color: rgba(204, 194, 171, 0.6); font-style: italic; }
input[type=text]:focus { border-bottom-color: var(--gold); outline: none; }
.error-text { color: var(--rust); margin: 0; }
.ok-text { color: var(--win); margin: 0; }

/* ---------------------------------------------------------------- match history filters: plain words, the chosen one gold */

.filters { display: grid; gap: 6px; margin: 0 0 14px; }
.chips { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.chip { font: 700 1rem "Cormorant SC", Georgia, serif; letter-spacing: 0.06em; color: var(--dim); padding: 4px 2px; }
.chip.on { color: var(--gold); background: url("/img/stroke_underline.png") center bottom / 100% 6px no-repeat; }
.chip:hover { color: var(--gold); text-decoration: none; }

/* ---------------------------------------------------------------- the portrait picker */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.avatar-picker { display: grid; gap: 12px; justify-items: start; }
.avatar-picker fieldset { border: 0; padding: 0; margin: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.pick { display: grid; justify-items: center; gap: 6px; cursor: pointer; width: 104px; text-align: center; font-size: 0.9rem; color: var(--dim); }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick img, .pick .avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--line), 0 4px 12px var(--shadow); transition: box-shadow 0.15s; }
.pick:hover img, .pick:hover .avatar { box-shadow: 0 0 0 2px var(--dim), 0 4px 12px var(--shadow); }
.pick input:checked ~ img, .pick input:checked ~ .avatar { box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(255, 209, 79, 0.35); }
.pick input:checked ~ span:last-child { color: var(--gold); }
.pick input:focus-visible ~ img, .pick input:focus-visible ~ .avatar { outline: 2px solid var(--gold); outline-offset: 4px; }

@media (max-width: 640px) {
    body { font-size: 17px; }
    header.site .wrap { gap: 10px; padding-top: 10px; padding-bottom: 6px; }
    nav.site { gap: 14px; }
    .facts { gap: 22px; }
    table.lines .hide-narrow { display: none; }
    table.lines td, table.lines th { padding: 8px 6px; }
}
