/* Website styles on top of the design system (theme.css). The original 2014 styles live in /Content/CSS. */

/* ---- Bootstrap in the Souls colours (admin pages, forms, dropdowns) ---------------------------------------- */

[data-bs-theme="dark"] {
    --bs-body-bg: var(--s-bg-0);
    --bs-body-color: var(--s-text);
    --bs-body-font-family: var(--s-font-body);
    --bs-emphasis-color: var(--s-gold-1);
    --bs-secondary-color: var(--s-muted);
    --bs-border-color: rgba(226, 184, 90, 0.2);
    --bs-primary: #e8601d;
    --bs-primary-rgb: 232, 96, 29;
    --bs-link-color: #f1cf7a;
    --bs-link-color-rgb: 241, 207, 122;
    --bs-link-hover-color: #fff0c2;
    --bs-link-hover-color-rgb: 255, 240, 194;
    --bs-tertiary-bg: var(--s-bg-2);
    --bs-secondary-bg: var(--s-bg-3);
    --bs-dropdown-bg: var(--s-bg-2);
}

.s-site .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--s-text);
    --bs-table-border-color: rgba(255, 255, 255, 0.06);
    --bs-table-hover-bg: rgba(226, 184, 90, 0.06);
}

.s-site .table > thead th {
    font-family: var(--s-font-display);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--s-gold-2);
    border-bottom-color: var(--s-line);
}

/* Table rows scroll sideways on a phone instead of wrapping every cell. */
.s-site .table-responsive > .table,
.table-responsive > .s-table { white-space: nowrap; }

/* Bootstrap form labels and selects look like the design system's (.s-label, .s-input). The theme's input background
   would hide Bootstrap's select arrow, so it is put back. */
.s-site .form-label { margin-bottom: 6px; font-family: var(--s-font-display); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--s-gold-2); }
.s-site .form-select,
.s-site .form-select:focus { padding-right: 2.4em; background-image: var(--bs-form-select-bg-img); background-repeat: no-repeat; background-position: right 0.85em center; background-size: 16px 12px; }
.s-site .form-control-sm,
.s-site .form-select-sm { min-height: 32px; padding-top: 0.3em; padding-bottom: 0.3em; font-size: 0.85rem; }
.s-input.input-validation-error,
.s-site .form-control.input-validation-error,
.s-site .form-select.input-validation-error { border-color: rgba(255, 110, 130, 0.85); }

.s-site .dropdown-menu,
.s-dropdown {
    --bs-dropdown-bg: rgba(20, 16, 26, 0.98);
    --bs-dropdown-border-color: var(--s-line);
    --bs-dropdown-link-color: var(--s-text);
    --bs-dropdown-link-hover-bg: rgba(226, 184, 90, 0.12);
    --bs-dropdown-link-hover-color: var(--s-gold-1);
    --bs-dropdown-link-active-bg: rgba(226, 184, 90, 0.2);
    box-shadow: var(--s-shadow);
}

.s-site .dropdown-item { display: flex; align-items: center; gap: 0.5em; }

/* ---- Page --------------------------------------------------------------------------------------------------- */

html { scroll-padding-top: 90px; }

body.s-site {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    font-family: var(--s-font-body);
    color: var(--s-text);
    background: var(--s-bg-0);
    isolation: isolate;
}

/* The arena behind every page, in one fixed layer: the photo softened and dimmed (::before), then the forge's glow from
   above, a vignette and a darkening toward the bottom (::after). Image and shading stay together while the page scrolls
   (background-attachment: fixed let them slide apart into a band, and phones ignore it). */
body.s-site::before,
body.s-site::after {
    content: "";
    position: fixed;
    z-index: -1;
    pointer-events: none;
}
body.s-site::before {
    inset: -32px;
    background: url("/img/backdrop.jpg") center 30% / cover no-repeat;
    filter: blur(9px) saturate(1.2) brightness(0.5);
}
body.s-site::after {
    inset: 0;
    background:
        radial-gradient(ellipse 70% 45% at 50% -5%, rgba(255, 140, 60, 0.2), transparent 70%),
        radial-gradient(ellipse 110% 85% at 50% 35%, transparent 30%, rgba(4, 3, 6, 0.88) 100%),
        linear-gradient(180deg, rgba(6, 5, 9, 0.25), rgba(6, 5, 9, 0.7));
}

body.s-site.full-screen { background: #000; overflow: hidden; }
body.s-site.full-screen::before,
body.s-site.full-screen::after { display: none; }

/* On the site's pages (not over the game's 3D arena, where a blur would cost every frame) the panels let the arena
   behind show through, frosted. */
body.s-site:not(.full-screen) {
    --s-panel: linear-gradient(180deg, rgba(30, 25, 38, 0.84), rgba(14, 12, 19, 0.9));
}
body.s-site:not(.full-screen) .s-panel {
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.s-game-navbar.navbar {
    display: block;
    height: 0;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: 0;
    overflow: hidden;
}

.s-skip {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 2000;
    padding: 10px 16px;
    border-radius: var(--s-radius-sm);
    background: var(--s-gold-2);
    color: #1a1003;
    font-weight: 700;
}

.s-skip:focus { top: 12px; }

a { color: #f1cf7a; }
a:hover { color: #fff0c2; }

:focus-visible { outline: 2px solid var(--s-gold-2); outline-offset: 2px; }

/* ---- Top bar ------------------------------------------------------------------------------------------------ */

.s-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: 0;
    background: linear-gradient(180deg, rgba(22, 18, 28, 0.96), rgba(10, 8, 14, 0.94));
    border-bottom: 1px solid var(--s-line);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
}

.s-topbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--s-gold-2) 30%, var(--s-gold-1) 50%, var(--s-gold-2) 70%, transparent);
    opacity: 0.6;
}

.s-topbar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    min-height: 68px;
}

.s-brand { display: flex; align-items: center; padding: 2px 0; }
.s-brand img { height: 52px; width: auto; filter: drop-shadow(0 0 12px rgba(255, 190, 80, 0.35)); transition: filter 0.3s; }
.s-brand:hover img { filter: drop-shadow(0 0 18px rgba(255, 190, 80, 0.7)); }

.s-nav { gap: 4px; }

.s-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 10px 14px;
    border-radius: var(--s-radius-sm);
    color: var(--s-text-2);
    font-family: var(--s-font-display);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.s-nav-link .s-icon { color: var(--s-gold-3); transition: color 0.2s; }
.s-nav-link:hover { color: var(--s-gold-1); background: rgba(226, 184, 90, 0.07); }
.s-nav-link:hover .s-icon { color: var(--s-gold-2); }

.s-nav-link.active { color: var(--s-gold-1); }
.s-nav-link.active .s-icon { color: var(--s-gold-2); }
.s-nav-link.active::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: var(--s-gold-text);
    box-shadow: 0 0 10px rgba(243, 212, 136, 0.8);
}

.s-nav-play {
    color: #fff4e0;
    background: linear-gradient(180deg, rgba(255, 140, 60, 0.35), rgba(200, 60, 10, 0.25));
    box-shadow: inset 0 0 0 1px rgba(255, 170, 100, 0.5), 0 0 16px rgba(255, 110, 30, 0.25);
}

.s-nav-play .s-icon { color: #ffc28a; }
.s-nav-play:hover { color: #fff; background: linear-gradient(180deg, rgba(255, 150, 70, 0.55), rgba(210, 70, 15, 0.4)); }

.s-topbar .navbar-collapse { flex-grow: 1; justify-content: space-between; gap: 12px; }

.s-topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* The language switch (EN | NB, see _LanguagePicker): a compact .s-seg, as tall as .s-btn-sm. */
.s-lang { flex: none; }
.s-lang > .s-lang-btn { padding: 6px 10px; }

.s-profile { display: flex; align-items: center; gap: 12px; }
.s-profile-who { display: flex; align-items: center; gap: 8px; }
.s-profile-portrait {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--s-gold-2);
    box-shadow: 0 0 10px rgba(226, 184, 90, 0.4);
}
.s-profile-name { display: flex; flex-direction: column; line-height: 1.1; font-weight: 700; color: var(--s-text); }
.s-profile-name small { font-weight: 500; font-size: 0.72rem; color: var(--s-muted); letter-spacing: 0.04em; }
.s-profile .s-emblem { font-size: 0.85rem; }

.navbar-toggler { border: 1px solid var(--s-line); }
.navbar-toggler:focus { box-shadow: var(--s-focus); }

/* Below 1400px the top bar is tight (longer words in Norwegian, the language switch): closer nav links. Below 1200px
   the nav collapses into the menu (navbar-expand-xl). */
@media (max-width: 1399.98px) {
    .s-nav-link { padding: 10px; letter-spacing: 0.1em; }
    .s-nav-link.active::after { left: 10px; right: 10px; }
}

@media (max-width: 1199.98px) {
    .s-topbar-inner { min-height: 60px; }
    .s-brand img { height: 42px; }
    .s-topbar .navbar-toggler { margin-left: auto; }
    .s-topbar .navbar-collapse { padding: 6px 0 14px; }
    .s-topbar-right { margin: 10px 0 0; flex-wrap: wrap; }
    .s-nav-link.active::after { display: none; }
}

/* ---- Main and footer ---------------------------------------------------------------------------------------- */

.s-main { flex: 1; width: 100%; padding-top: clamp(18px, 3vw, 36px); padding-bottom: 48px; }
.s-main-full { flex: 1; }

.s-footer {
    border-top: 1px solid var(--s-line-soft);
    background: rgba(5, 4, 8, 0.85);
    color: var(--s-faint);
    font-size: 0.78rem;
}

.s-footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 14px 12px; }
.s-footer-inner img { opacity: 0.6; }
.s-footer-credits { margin-left: auto; }

.s-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px 16px;
    border-radius: var(--s-radius-sm);
    border: 1px solid;
    font-weight: 600;
    animation: s-rise-in 0.45s var(--s-ease) both;
}

.s-alert-ok { border-color: rgba(67, 209, 122, 0.5); background: rgba(20, 70, 40, 0.55); color: #b8f5cf; }
.s-alert-error { border-color: rgba(224, 49, 75, 0.55); background: rgba(80, 12, 22, 0.6); color: #ffc2cc; }
/* Validation summaries: a plain list of messages. */
.s-alert > ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }

/* An empty list or table: an icon, a line of text and, where it helps, the way forward. */
.s-empty { display: grid; justify-items: center; gap: 10px; padding: 18px 12px; text-align: center; color: var(--s-muted); }
.s-empty > .s-icon { width: 2.2em; height: 2.2em; color: var(--s-gold-3); }
.s-empty p { margin: 0; max-width: 46ch; }

/* A panel head's note drops below the title when the two do not fit on one line. */
.s-main .s-panel-head { flex-wrap: wrap; }

.s-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; margin-bottom: 22px; }
.s-page-head > div:first-child { flex: 1 1 320px; }
.s-page-head p { margin: 0; color: var(--s-text-2); max-width: 70ch; }

.s-grid { display: grid; gap: clamp(14px, 1.6vw, 22px); }

/* ---- Card tiles (shop, deck, register) ---------------------------------------------------------------------- */

.s-card-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 10px 12px;
    border-radius: var(--s-radius);
    background: linear-gradient(180deg, rgba(40, 33, 50, 0.6), rgba(14, 11, 18, 0.75));
    border: 1px solid var(--s-line-soft);
    transition: transform 0.25s var(--s-ease), box-shadow 0.25s, border-color 0.25s;
}

.s-card-wrap:hover { transform: translateY(-4px); border-color: var(--s-line); box-shadow: 0 16px 30px rgba(0, 0, 0, 0.55), 0 0 22px rgba(226, 184, 90, 0.15); }

.s-card-wrap .card-container {
    transform-origin: 50% 80%;
    transition: transform 0.3s var(--s-ease), filter 0.3s;
    filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.65));
}

.s-card-wrap:hover .card-container { transform: scale(1.06) rotate(-1deg); }

.s-card-name { font-family: var(--s-font-display); font-weight: 700; color: var(--s-gold-1); letter-spacing: 0.04em; text-align: center; }
.s-rarity { margin-top: -4px; color: var(--s-muted); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; text-align: center; }
.s-card-wrap.rarity-rare .s-rarity { color: #8cc8ff; }
.s-card-wrap.rarity-epic .s-rarity { color: #d9a8ff; }
.s-card-wrap.rarity-legendary .s-rarity { color: #ffc65a; }
.s-card-wrap.rarity-legendary { border-color: rgba(255, 192, 77, 0.35); }
.s-card-flavor-text { margin: 0; color: var(--s-faint); font: italic 0.76rem/1.4 Georgia, 'Times New Roman', serif; text-align: center; }
.s-card-wrap[hidden] { display: none; }
.s-decklist .s-r-rare { color: #8cc8ff; }
.s-decklist .s-r-epic { color: #d9a8ff; }
.s-decklist .s-r-legendary { color: #ffc65a; }

/* Shop filters. */
.s-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.s-filters .s-seg { flex-wrap: wrap; }
.s-check { display: inline-flex; align-items: center; gap: 6px; color: var(--s-text-2); font-size: 0.85rem; cursor: pointer; }
.s-check input { accent-color: var(--s-gold-2); width: 16px; height: 16px; }
.s-card-desc { margin: 0; font-size: 0.78rem; line-height: 1.4; color: var(--s-muted); text-align: center; }

/* Sits on the tile's top edge, clear of the card's race emblem. */
.s-ribbon {
    position: absolute;
    top: 0;
    right: -6px;
    transform: translateY(-50%);
    z-index: 2;
    padding: 4px 10px 4px 12px;
    background: linear-gradient(180deg, #3fa86a, #1b5e38);
    color: #e9fff1;
    font: 700 0.66rem/1 var(--s-font-display);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    clip-path: polygon(8px 0, 100% 0, 100% 100%, 8px 100%, 0 50%);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* The original tiles: owned cards were greyed out; keep them in colour now that they can be upgraded. */
.s-site .card-deactivated { filter: none; }

/* ---- Home --------------------------------------------------------------------------------------------------- */

.s-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    align-items: center;
    min-height: clamp(260px, 34vw, 400px);
    margin-bottom: clamp(18px, 2.4vw, 28px);
    padding: clamp(22px, 4vw, 54px);
    border-radius: 14px;
    border: 1px solid var(--s-line);
    background:
        linear-gradient(90deg, rgba(6, 5, 9, 0.92) 0%, rgba(6, 5, 9, 0.6) 45%, rgba(6, 5, 9, 0.1) 100%),
        url("/img/backdrop.jpg") 60% 45% / cover no-repeat;
    box-shadow: var(--s-shadow);
}

.s-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 40%;
    background: linear-gradient(0deg, rgba(255, 110, 30, 0.18), transparent);
    pointer-events: none;
}

.s-hero-copy { position: relative; z-index: 1; max-width: 680px; }
.s-hero-copy .s-title { font-size: clamp(2.1rem, 1.2rem + 3.6vw, 4rem); margin: 6px 0 12px; line-height: 1.05; }
.s-hero-copy p { font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.1rem); color: var(--s-text-2); margin: 0 0 22px; }
.s-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.s-home-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
.s-home-main,
.s-home-side { align-content: start; }
.s-home-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.s-home-grid #game-stats-feed { max-height: 360px; overflow-y: auto; }
/* The community's activity scrolls in its panel too, so the two columns end near each other. */
.s-home-grid #community-feed { max-height: 360px; overflow-y: auto; }
/* The news images are 2:1; wide columns crop them a little, narrow ones show them whole. */
#news-carousel img { aspect-ratio: 2 / 1; max-height: 240px; object-fit: cover; }
.news-wrapper:not(:empty) { margin-top: 16px; }

@media (max-width: 1199.98px) {
    .s-home-grid > .s-home-side { grid-column: span 12; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
}

@media (max-width: 767.98px) {
    .s-home-pair { grid-template-columns: minmax(0, 1fr); }
}
.s-col-4 { grid-column: span 4; }
.s-col-8 { grid-column: span 8; }

@media (max-width: 1199.98px) {
    .s-col-4 { grid-column: span 6; }
    .s-col-8 { grid-column: span 12; }
}

@media (max-width: 767.98px) {
    .s-col-4 { grid-column: span 12; }
}

.s-profile-card { display: grid; grid-template-columns: auto 1fr; gap: 14px 18px; align-items: center; }
.s-profile-card .s-portrait-lg {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--s-gold-2);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.6), 0 0 26px rgba(226, 184, 90, 0.35);
}
.s-profile-card h2 { margin: 0; font-family: var(--s-font-display); font-size: 1.4rem; color: var(--s-gold-1); }
.s-profile-card .s-rank { font-size: 1.05rem; }
.s-profile-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.s-stat { padding: 10px; border-radius: var(--s-radius-sm); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--s-line-soft); text-align: center; }
.s-stat b { display: block; font-size: 1.3rem; color: var(--s-gold-1); font-variant-numeric: tabular-nums; }
.s-stat span { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--s-muted); }

.s-quests { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.s-quest { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; }
.s-quest-icon {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--s-line);
    background: radial-gradient(circle at 35% 30%, #3a2f45, #120f17);
    color: var(--s-gold-2);
}
.s-quest.done .s-quest-icon { color: var(--s-life); border-color: rgba(67, 209, 122, 0.6); box-shadow: 0 0 12px rgba(67, 209, 122, 0.35); }
.s-quest-text { font-weight: 600; }
.s-quest-reward { grid-row: span 2; }
.s-quest .s-progress { grid-column: 2; }
.s-quest-count { font-size: 0.75rem; color: var(--s-muted); }

.s-leaders { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.s-leader {
    display: grid;
    grid-template-columns: 28px auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 7px 8px;
    border-radius: var(--s-radius-sm);
    transition: background 0.15s;
}
.s-leader:hover { background: rgba(226, 184, 90, 0.06); }
.s-leader-pos { font-family: var(--s-font-display); font-weight: 800; color: var(--s-muted); text-align: center; }
.s-leader:nth-child(1) .s-leader-pos { color: #f5c84e; text-shadow: 0 0 10px rgba(245, 200, 78, 0.7); }
.s-leader:nth-child(2) .s-leader-pos { color: #d3dde8; }
.s-leader:nth-child(3) .s-leader-pos { color: #d6935b; }
.s-leader-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-leader-name small { display: block; font-weight: 400; color: var(--s-muted); font-size: 0.72rem; }
.s-leader .s-emblem { font-size: 0.8rem; }

.s-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.s-feed a { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--s-radius-sm); color: var(--s-text); text-decoration: none; }
.s-feed a:hover { background: rgba(226, 184, 90, 0.07); color: var(--s-gold-1); }
.s-feed .s-icon { color: var(--s-gold-3); }

.s-news-item + .s-news-item { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--s-line-soft); }
.s-news-item h3 { font-family: var(--s-font-display); font-size: 1.05rem; color: var(--s-gold-1); margin: 0 0 6px; }
.s-news-item .s-news-body { color: var(--s-text-2); font-size: 0.92rem; }
.s-news-item .s-news-body img { max-width: 100%; height: auto; border-radius: 6px; }
.s-news-meta { margin-top: 6px; font-size: 0.75rem; color: var(--s-faint); }

.s-status { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.s-status li { display: flex; justify-content: space-between; align-items: center; }
.s-dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: var(--s-faint); }
.s-dot.on { background: var(--s-life); box-shadow: 0 0 8px var(--s-life); }
.s-dot.off { background: var(--s-blood); box-shadow: 0 0 8px var(--s-blood); }

.s-features { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 24px; }
.s-feature { display: flex; gap: 14px; align-items: flex-start; }
.s-feature .s-icon { width: 2.2em; height: 2.2em; color: var(--s-gold-2); filter: drop-shadow(0 0 8px rgba(226, 184, 90, 0.4)); }
.s-feature h3 { margin: 0 0 4px; font-family: var(--s-font-display); font-size: 1rem; color: var(--s-gold-1); }
.s-feature p { margin: 0; color: var(--s-text-2); font-size: 0.9rem; }

/* ---- Auth --------------------------------------------------------------------------------------------------- */

.s-auth { display: grid; place-items: center; min-height: calc(100vh - 220px); }
.s-auth .s-panel { width: min(440px, 100%); padding: clamp(22px, 4vw, 36px); }
.s-auth-logo { display: block; width: 210px; max-width: 70%; margin: 0 auto 6px; filter: drop-shadow(0 0 18px rgba(255, 190, 80, 0.35)); }
.s-auth h1 { text-align: center; }
.s-auth-foot { margin-top: 18px; text-align: center; color: var(--s-muted); }

.s-steps { display: grid; gap: 22px; }
.s-step-title { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font-family: var(--s-font-display); font-size: 1.1rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--s-gold-1); }
.s-step-num {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--s-gold-edge);
    color: #241503;
    font-weight: 800;
    box-shadow: 0 0 14px rgba(226, 184, 90, 0.4);
}

.s-classes { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.s-class { position: relative; display: block; cursor: pointer; }
.s-class input,
.s-pick input {
    position: absolute;
    inset: 0;
    z-index: 4;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.s-class-card {
    display: grid;
    grid-template-rows: auto auto 1fr;
    height: 100%;
    overflow: hidden;
    border-radius: var(--s-radius);
    border: 1px solid var(--s-line-soft);
    background: rgba(12, 10, 16, 0.8);
    transition: transform 0.25s var(--s-ease), border-color 0.25s, box-shadow 0.25s;
}
.s-class-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; filter: saturate(0.85) brightness(0.85); transition: filter 0.3s; }
.s-class-body { padding: 12px 14px 14px; }
.s-class-name { font-family: var(--s-font-display); font-weight: 800; font-size: 1.1rem; color: var(--s-gold-1); }
.s-class-race { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--s-gold-2); }
.s-class-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.s-class-text { margin: 0; font-size: 0.8rem; color: var(--s-muted); }
.s-class:hover .s-class-card { transform: translateY(-3px); border-color: var(--s-line); }
.s-class input:checked + .s-class-card {
    border-color: var(--s-gold-2);
    box-shadow: 0 0 0 2px var(--s-gold-2), 0 0 28px rgba(226, 184, 90, 0.45);
}
.s-class input:checked + .s-class-card img { filter: none; }
.s-class input:focus-visible + .s-class-card { box-shadow: var(--s-focus); }
.s-powers { max-width: 760px; }
.s-powers .s-class-race { display: flex; align-items: center; gap: 6px; }

.s-pick { position: relative; cursor: pointer; }
.s-pick .s-card-wrap { height: 100%; }
/* On the tile's top-right corner, clear of the card's cost gem and race emblem. */
.s-pick-check {
    position: absolute;
    top: -10px;
    right: -10px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--s-line);
    background: rgba(0, 0, 0, 0.7);
    color: transparent;
    transition: all 0.2s;
}
.s-pick input:checked ~ .s-pick-check { border-color: var(--s-life); background: var(--s-life); color: #04150b; box-shadow: 0 0 12px rgba(67, 209, 122, 0.6); }
.s-pick input:checked ~ .s-card-wrap { border-color: rgba(67, 209, 122, 0.7); box-shadow: 0 0 22px rgba(67, 209, 122, 0.25); }
.s-pick input:disabled { cursor: not-allowed; }
.s-pick input:disabled ~ .s-card-wrap { opacity: 0.45; }
.s-pick input:focus-visible ~ .s-card-wrap { box-shadow: var(--s-focus); }

/* ---- Shop --------------------------------------------------------------------------------------------------- */

.s-shop-head {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 18px;
    overflow: hidden;
}

.s-shop-head .hansel-art { width: min(280px, 34vw); filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.6)); }
.s-shop-layout { grid-template-columns: 280px 1fr; align-items: start; }
.s-shop-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.s-card-actions { display: grid; gap: 6px; width: 100%; margin-top: auto; }
.s-card-actions form { margin: 0; }

.s-shop-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

/* On a long page the filters and the pack stay at hand: the filter bar sticks under the top of the window, the side
   column beside the cards. */
#shop-filters {
    position: sticky; top: 0; z-index: 5; padding: 10px 12px; margin: 0 -12px;
    border-radius: var(--s-radius); background: rgba(13, 11, 18, 0.88); backdrop-filter: blur(8px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}
@media (min-width: 992px) and (min-height: 1000px) {
    .s-shop-side { position: sticky; top: 16px; }
}
.s-shop-bar form { margin: 0; }

@media (max-width: 991.98px) {
    .s-shop-layout { grid-template-columns: 1fr; }
    /* The cards first (under .s-shop-bar), the player panel and the pack's details after them. */
    .s-shop-layout > aside { order: 1; }
}

/* ---- Card packs: a fan of card backs in the shop, then five cards turned over one by one ------------------ */

.s-pack-art { position: relative; width: 74px; aspect-ratio: 416 / 546; margin: 6px auto 16px; }
.s-pack-art span,
.s-pack-back { background: url("/Content/Images/Card/cardback.png") center / 100% 100% no-repeat; }
.s-pack-art span { position: absolute; inset: 0; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6)); }
.s-pack-art span:first-child { transform: translateX(-26px) rotate(-14deg); }
.s-pack-art span:last-child { transform: translateX(26px) rotate(14deg); }

.s-pack { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(12px, 2vw, 28px); margin: 0 0 28px; padding: 18px 0 0; list-style: none; }

.s-pack-slot {
    position: relative;
    isolation: isolate;
    flex: 0 0 clamp(100px, 28vw, 200px);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    align-content: start;
    gap: 10px;
    animation-delay: calc(var(--i) * 90ms);
}

.s-pack-card {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: inherit;
    perspective: 1100px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.s-pack-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); transform-style: preserve-3d; transition: transform 0.8s var(--s-ease); }
.s-pack-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
/* The back art has no frame, so it covers only the body of the card face. */
.s-pack-back { position: absolute; inset: 5.6% 6.8% 5.6% 7.4%; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.65)); transition: filter 0.2s; }
/* Hidden until turned, so its tooltip and text do not give the card away. */
.s-pack-front { transform: rotateY(180deg); visibility: hidden; }
.revealed .s-pack-front { visibility: visible; }
.s-pack-front .s-card.card-container { --w: 100%; }
.s-pack-card:hover .s-pack-back,
.s-pack-card:focus-visible .s-pack-back { filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 12px rgba(226, 184, 90, 0.55)) brightness(1.12); }
.revealed .s-pack-card { cursor: default; }
.revealed .s-pack-inner { transform: rotateY(180deg); }

.s-pack-result { display: grid; justify-items: center; gap: 6px; margin: 0; text-align: center; visibility: hidden; }
.s-pack-result .s-card-name { font-size: 0.9rem; }
.revealed .s-pack-result { visibility: visible; animation: s-rise-in 0.5s 0.5s var(--s-ease) both; }
.s-pack-slot.rarity-rare .s-rarity { color: #8cc8ff; }
.s-pack-slot.rarity-epic .s-rarity { color: #d9a8ff; }
.s-pack-slot.rarity-legendary .s-rarity { color: #ffc65a; }

/* Rarity glow behind a turned card; legendaries add turning light rays and a pop. */
.s-pack-slot::before,
.s-pack-slot::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
}
.s-pack-slot::before { inset: -12% -16% 22%; background: radial-gradient(closest-side, var(--glow, transparent), transparent); }
.s-pack-slot.rarity-rare { --glow: rgba(76, 155, 255, 0.55); }
.s-pack-slot.rarity-epic { --glow: rgba(178, 107, 255, 0.65); }
.s-pack-slot.rarity-legendary { --glow: rgba(255, 176, 46, 0.8); }
.s-pack-slot.revealed::before { opacity: 1; transition: opacity 0.6s 0.45s; }
.s-pack-slot.rarity-legendary::after {
    inset: -30% -40% 10%;
    background: repeating-conic-gradient(rgba(255, 214, 120, 0.4) 0 5deg, transparent 5deg 22deg);
    -webkit-mask: radial-gradient(closest-side, #000 25%, transparent);
    mask: radial-gradient(closest-side, #000 25%, transparent);
}
.s-pack-slot.rarity-legendary.revealed::after { opacity: 1; transition: opacity 0.8s 0.5s; animation: s-pack-rays 16s linear infinite; }
.rarity-legendary.revealed .s-pack-card { animation: s-pack-pop 0.7s 0.55s var(--s-ease) both; }

@keyframes s-pack-rays { to { transform: rotate(1turn); } }
@keyframes s-pack-pop {
    40% { transform: scale(1.12); filter: brightness(1.4); }
    to { transform: none; filter: none; }
}

.s-pack-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

@media (prefers-reduced-motion: reduce) {
    .s-pack-inner,
    .s-pack-slot.revealed::before,
    .s-pack-slot.revealed::after { transition: none; }
    .revealed .s-pack-result,
    .s-pack-slot.revealed::after,
    .revealed .s-pack-card { animation: none; }
}

/* ---- Deck --------------------------------------------------------------------------------------------------- */

.s-deck-layout { grid-template-columns: 1fr 340px; align-items: start; }
.s-deck-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.s-deck-side { position: sticky; top: 90px; }

.s-stepper { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.s-stepper .s-input { width: 64px; min-height: 36px; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.s-stepper .s-input::-webkit-outer-spin-button,
.s-stepper .s-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.s-deck-count { display: flex; align-items: baseline; gap: 6px; font-family: var(--s-font-display); }
.s-deck-count b { font-size: 2.2rem; color: var(--s-gold-1); font-variant-numeric: tabular-nums; }
.s-deck-count.bad b { color: var(--s-blood); }

.s-curve { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; align-items: end; height: 96px; margin: 12px 0 4px; }
.s-curve-bar { position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.s-curve-bar span {
    display: block;
    min-height: 3px;
    border-radius: 4px 4px 1px 1px;
    background: linear-gradient(180deg, #8fc4ff, #2c64c4);
    box-shadow: 0 0 10px rgba(76, 155, 255, 0.4);
    transition: height 0.4s var(--s-ease);
}
.s-curve-bar em { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-style: normal; font-size: 0.7rem; color: var(--s-text-2); }
.s-curve-labels { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; text-align: center; font-size: 0.7rem; color: var(--s-muted); }

.s-decklist { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 4px; max-height: 40vh; overflow-y: auto; }
.s-decklist li {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(76, 155, 255, 0.12), rgba(0, 0, 0, 0.35));
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.s-mana {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    background: linear-gradient(180deg, #8fc4ff, #2050a8);
    color: #fff;
    font-weight: 800;
    font-size: 0.8rem;
    text-shadow: 0 1px 0 #001;
}
.s-decklist .s-x { font-weight: 800; color: var(--s-gold-1); }

@media (max-width: 991.98px) {
    .s-deck-layout { grid-template-columns: 1fr; }
    /* Relative, not static: the panel's gold corners are positioned on it. */
    .s-deck-side { position: relative; top: auto; order: -1; }
}

/* ---- Stats -------------------------------------------------------------------------------------------------- */

.s-versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: clamp(12px, 3vw, 40px); }
.s-fighter { text-align: center; }
.s-fighter-portrait {
    position: relative;
    width: min(260px, 100%);
    aspect-ratio: 1;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: center / cover no-repeat;
    border: 4px solid var(--s-gold-3);
    box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.6), var(--s-shadow);
}
.s-fighter.won .s-fighter-portrait { border-color: var(--s-gold-2); box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.6), 0 0 46px rgba(245, 200, 78, 0.55); }
.s-fighter.lost .s-fighter-portrait { filter: grayscale(0.85) brightness(0.65); }
.s-fighter-result {
    display: inline-block;
    margin-bottom: 6px;
    padding: 4px 14px;
    border-radius: 999px;
    font: 800 0.75rem/1.3 var(--s-font-display);
    letter-spacing: 0.24em;
    text-transform: uppercase;
}
.s-fighter.won .s-fighter-result { background: var(--s-gold-edge); color: #241503; }
.s-fighter.lost .s-fighter-result { background: rgba(224, 49, 75, 0.25); color: #ffb3c0; border: 1px solid rgba(224, 49, 75, 0.5); }
.s-fighter.draw .s-fighter-result { background: rgba(255, 255, 255, 0.1); color: var(--s-text); }
.s-fighter h2 { font-family: var(--s-font-display); font-size: clamp(1.1rem, 0.9rem + 1vw, 1.6rem); color: var(--s-gold-1); margin: 0 0 6px; overflow-wrap: anywhere; }
.s-fighter-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.s-vs-mark { align-self: center; justify-self: center; font: 900 clamp(2.4rem, 1.5rem + 4vw, 5rem)/1 var(--s-font-title); color: #ffcc4d; text-shadow: 0 0 30px rgba(255, 106, 0, 0.8), 0 4px 0 #4a0d00; }

.s-timeline { list-style: none; margin: 0; padding: 0 0 0 6px; max-height: 60vh; overflow-y: auto; }
.s-timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 10px;
    align-items: start;
    padding: 6px 0;
}
.s-timeline li::before { content: ""; position: absolute; left: 14px; top: 30px; bottom: -6px; width: 1px; background: var(--s-line-soft); }
.s-timeline li:last-child::before { display: none; }
.s-timeline .s-tl-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--s-line-soft);
    background: #15111b;
    color: var(--s-gold-2);
}
.s-tl-attack .s-tl-icon { color: #ff8a5c; }
.s-tl-death .s-tl-icon { color: #c9a0ff; }
.s-tl-heal .s-tl-icon { color: var(--s-life); }
.s-tl-turn .s-tl-icon { color: var(--s-muted); }
.s-tl-end .s-tl-icon { color: #f5c84e; border-color: var(--s-gold-2); }
.s-tl-turn span { color: var(--s-muted); font-size: 0.85rem; }
.s-timeline span { padding-top: 4px; }

@media (max-width: 575.98px) {
    .s-versus { grid-template-columns: minmax(0, 1fr); }
    .s-fighter-portrait { width: min(180px, 60%); }
}

/* ---- Home: the season's ladder as six columns, Bronze to Champion ------------------------------------------- */

.s-ladder-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: end; }
.s-ladder-strip > li { position: relative; display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border-radius: var(--s-radius-sm); text-align: center; }
.s-ladder-strip > li.is-me { background: linear-gradient(180deg, transparent, var(--tier-glow)); box-shadow: inset 0 0 0 1px var(--tier); }
.s-ladder-column { display: flex; align-items: flex-end; width: 28px; height: 84px; border-radius: 6px; background: rgba(255, 255, 255, 0.04); overflow: hidden; }
.s-ladder-column > span {
    display: block; width: 100%; height: var(--share); min-height: 3px;
    background: linear-gradient(0deg, var(--tier-dark), var(--tier)); box-shadow: 0 0 10px var(--tier-glow);
    transform-origin: bottom; animation: s-ladder-rise 0.9s var(--s-ease) both;
}
.s-ladder-strip-name { font-family: var(--s-font-display); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tier); }
.s-ladder-strip-count { font-size: 0.72rem; color: var(--s-muted); }
.s-ladder-strip .s-ladder-you { grid-column: auto; justify-self: center; }
@keyframes s-ladder-rise { from { transform: scaleY(0); } }
@media (prefers-reduced-motion: reduce) { .s-ladder-column > span { animation: none; } }

/* Server status as one quiet line under the home page. */
.s-status-strip { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin: 22px 0 0; padding: 0; font-size: 0.8rem; color: var(--s-muted); }
.s-status-strip li { display: inline-flex; align-items: center; gap: 8px; }
.s-status-strip .fw-semibold { font-weight: 500 !important; display: inline-flex; align-items: center; gap: 6px; }

/* ---- Player profile ---------------------------------------------------------------------------------------- */

.s-profile-head { align-items: center; }
.s-portrait-xl {
    width: 132px; height: 132px; border-radius: 50%; object-fit: cover;
    border: 3px solid transparent; background: var(--s-gold-edge) border-box;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.6), 0 0 34px rgba(241, 207, 122, 0.25);
}
.s-profile-head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.s-profile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.s-col-span-2 { grid-column: span 2; }
.s-profile-stats-4 { grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; }
.s-profile-tier { padding: 4px 0 0; }
.s-profile-tier::before { display: none; }

.s-rating-chart { display: block; width: 100%; height: auto; overflow: visible; }
.s-chart-rank { stroke: rgba(226, 184, 90, 0.18); stroke-width: 1; stroke-dasharray: 4 5; }
.s-chart-label { fill: var(--s-muted); font: 11px var(--s-font-body); }
.s-chart-area { fill: url(#rating-fill); }
.s-chart-line { fill: none; stroke: #f1cf7a; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(241, 207, 122, 0.45)); }
.s-chart-now { fill: #ffe9b0; stroke: #1a1420; stroke-width: 2; }
.s-chart-value { fill: #fff3d0; font: 600 13px var(--s-font-body); }

.s-match-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.s-match {
    display: grid; grid-template-columns: 4.2rem 36px minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
    padding: 8px 10px; border-radius: var(--s-radius-sm); background: rgba(0, 0, 0, 0.28); border: 1px solid var(--s-line-soft);
    border-left: 3px solid var(--result, var(--s-muted));
}
.s-match-won { --result: var(--s-life); }
.s-match-lost { --result: var(--s-blood); }
.s-match-draw { --result: var(--s-gold-2); }
.s-match-result { font-family: var(--s-font-display); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--result); }
.s-match-portrait { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1px solid var(--s-line); }
.s-match-who { display: grid; min-width: 0; }
.s-match-who > a, .s-match-who > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--s-text); font-weight: 600; }
.s-match-who small { color: var(--s-muted); font-size: 0.75rem; }
.s-match-delta { font-weight: 700; }
.s-match-delta.up { color: var(--s-life); }
.s-match-delta.down { color: var(--s-blood); }

/* Player names that open a profile: quiet until hovered. */
.s-player-link { color: inherit; text-decoration: none; }
.s-player-link:hover, .s-player-link:focus-visible { color: var(--s-gold-1); text-decoration: underline; text-underline-offset: 3px; }

/* ---- Season: the ranked ladder beside the leaderboard ----------------------------------------------------- */

.s-season-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; }
.s-ladder .s-panel-head { margin-bottom: 8px; }
.s-ladder-tier { position: relative; padding: 10px 0 6px 14px; }
/* A strand of the tier's colour down the left of each tier: the ladder's rail. */
.s-ladder-tier::before {
    content: ""; position: absolute; left: 0; top: 14px; bottom: 6px; width: 3px; border-radius: 2px;
    background: linear-gradient(180deg, var(--tier), var(--tier-dark));
    box-shadow: 0 0 10px var(--tier-glow);
}
.s-ladder-tier + .s-ladder-tier { border-top: 1px solid var(--s-line-soft); }
.s-ladder-tier-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.s-ladder-tier-head h3 { margin: 0; font-family: var(--s-font-display); font-size: 1rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tier); }
.s-ladder-tier-head .s-chip { margin-left: auto; font-size: 0.75rem; }
.tier-champion .s-ladder-tier-head h3 { text-shadow: 0 0 14px var(--tier-glow); }
.s-ladder-rungs { list-style: none; margin: 0; padding: 0; }
.s-ladder-rung {
    position: relative; display: grid; grid-template-columns: 7.5rem 6.5rem minmax(0, 1fr) 2.5rem; align-items: center; gap: 10px;
    padding: 5px 8px; border-radius: var(--s-radius-sm); font-size: 0.85rem;
}
.s-ladder-name { color: var(--s-text); white-space: nowrap; }
.s-ladder-band { color: var(--s-muted); font-size: 0.78rem; white-space: nowrap; }
.s-ladder-bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
.s-ladder-bar > span {
    display: block; height: 100%; width: var(--share); min-width: 2px; border-radius: inherit;
    background: linear-gradient(90deg, var(--tier-dark), var(--tier)); box-shadow: 0 0 8px var(--tier-glow);
    transform-origin: left; animation: s-ladder-grow 0.9s var(--s-ease) both;
}
.s-ladder-count { text-align: right; color: var(--s-muted); }
.s-ladder-rung.is-me { background: linear-gradient(90deg, var(--tier-glow), transparent 85%); box-shadow: inset 0 0 0 1px var(--tier); }
.s-ladder-rung.is-me .s-ladder-name { color: #fff; font-weight: 600; }
.s-ladder-you {
    grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 6px; justify-self: start;
    font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tier);
}
@keyframes s-ladder-grow { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .s-ladder-bar > span { animation: none; } }

/* ---- Admin and errors --------------------------------------------------------------------------------------- */

.s-admin .s-panel { overflow-x: auto; }
.s-error { text-align: center; padding: clamp(28px, 6vw, 70px) 20px; }
.s-error .s-title { font-size: clamp(3rem, 2rem + 6vw, 7rem); margin: 0; }

/* ---- Modal dialogs ------------------------------------------------------------------------------------------ */

.s-modal {
    width: min(460px, calc(100vw - 32px));
    margin: auto;
    padding: 26px;
}

.s-modal::backdrop { background: rgba(4, 3, 6, 0.72); backdrop-filter: blur(3px); }
.s-modal[open] { animation: s-rise-in 0.3s var(--s-ease) both; }

.deck-card:not(.in-deck) .card-container { filter: grayscale(0.6) brightness(0.7) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.65)); }
.deck-card.in-deck { border-color: rgba(76, 155, 255, 0.35); }

/* The legacy Home.css gives the GitHub feed a fixed height and a black border. */
.s-site .github-feed { height: auto; max-height: none; overflow: visible; border: 1px solid var(--s-line); }
.s-site #github-feed { max-height: 260px; overflow-y: auto; }

/* ---- The card (same layout as the in-game card face, 330 x 450) --------------------------------------------- */

.s-card.card-container {
    --w: 168px;
    position: relative;
    width: var(--w);
    max-width: 100%;
    aspect-ratio: 330 / 450;
    height: auto;
    overflow: visible;
    container-type: inline-size;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    font-family: Arial, Helvetica, sans-serif;
    user-select: none;
    filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.65));
}

.s-card .s-card-portrait.card-portrait {
    position: absolute;
    top: 24.4%;
    left: 14.25%;
    width: 71.5%;
    height: 37.1%;
    min-width: 0;
    min-height: 0;
    background-size: 100% 100%;
    background-position: center;
}
/* The site's card tiles use an <img> (lazy); the in-game ones a background. No placeholder behind the image. */
img.s-card-portrait { background: none; }

.s-card-title,
.s-card-ability {
    position: absolute;
    left: 15%;
    right: 15%;
    color: #000;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The name band runs from x 72 to 244 of 330 (as on the 3D client's card), clear of the cost gem and the race emblem;
   _CardTile sets --len to the name's length so long names shrink to fit. */
.s-card-title {
    top: 15.2%;
    left: 21.8%;
    right: 26.1%;
    transform: translateY(-50%);
    font-size: clamp(4.2cqw, calc(84cqw / var(--len, 10)), 10.5cqw);
    line-height: 1.2;
}
/* The game clients' card faces mark long names with classes instead of setting --len. */
.s-card-title.long { --len: 14; }
.s-card-title.xlong { --len: 17; }
/* Centred on y 312 of 450, above the rules text. */
.s-card-ability { top: 69.3%; transform: translateY(-50%); font-size: 9cqw; line-height: 1.2; color: #1b130b; }

/* Rules text and flavor in the text box (y 294-361 of 450). */
.s-card-rules,
.s-card-flavor {
    position: absolute;
    left: 14%;
    right: 14%;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #2b2118;
    text-align: center;
}
.s-card-rules { top: 72.2%; font-size: 4.5cqw; line-height: 1.15; -webkit-line-clamp: 2; line-clamp: 2; }
.s-card-flavor { top: 67%; font: italic 4.9cqw/1.2 Georgia, 'Times New Roman', serif; -webkit-line-clamp: 3; line-clamp: 3; color: #3a2d20; }

/* Rarity: a gem where the portrait meets the text box; epic and legendary cards get a coloured edge. */
.s-card-gem {
    position: absolute;
    left: 50%;
    top: 60.2%;
    width: 9.4%;
    aspect-ratio: 30 / 32;
    transform: translateX(-50%);
    clip-path: polygon(50% 0, 100% 40%, 80% 100%, 20% 100%, 0 40%);
    background: linear-gradient(135deg, var(--gem-1), var(--gem-2) 50%, var(--gem-3));
    filter: drop-shadow(0 0 0.8cqw #000);
}
.s-card-gem::after {
    content: "";
    position: absolute;
    inset: 12% 30% 50% 18%;
    background: rgba(255, 255, 255, 0.55);
    clip-path: polygon(40% 0, 100% 60%, 0 100%);
}
.rarity-common { --gem-1: #f4f1ea; --gem-2: #a39e93; --gem-3: #5b574f; }
.rarity-rare { --gem-1: #bfe4ff; --gem-2: #2f8de4; --gem-3: #123b73; }
.rarity-epic { --gem-1: #f1d4ff; --gem-2: #a24ff0; --gem-3: #45136e; }
.rarity-legendary { --gem-1: #fff3c4; --gem-2: #ff9d1c; --gem-3: #7a3a00; }

.s-card.rarity-epic::before,
.s-card.rarity-legendary::before {
    content: "";
    position: absolute;
    inset: 1.2%;
    border-radius: 5cqw;
    border: 1.3cqw solid #a24ff0;
    box-shadow: 0 0 3cqw rgba(178, 107, 255, 0.7), inset 0 0 2cqw rgba(178, 107, 255, 0.45);
    pointer-events: none;
}
.s-card.rarity-legendary::before {
    border: 1.8cqw solid transparent;
    background: linear-gradient(135deg, #fff0b8, #d99a1e 50%, #fff0b8) border-box;
    -webkit-mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0);
    box-shadow: none;
    filter: drop-shadow(0 0 2cqw rgba(255, 176, 46, 0.8));
}
.s-card.rarity-legendary::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -1%;
    width: 18%;
    aspect-ratio: 54 / 28;
    transform: translateX(-50%);
    clip-path: polygon(0 100%, 0 20%, 25% 60%, 50% 0, 75% 60%, 100% 20%, 100% 100%);
    background: linear-gradient(#fff6cf, #c97d0b);
    filter: drop-shadow(0 0 1cqw #4a2a00);
    pointer-events: none;
}
.s-card .s-card-gem,
.s-card-title { z-index: 1; }

.s-card-cost,
.s-card-attack,
.s-card-health,
.s-card-armor {
    position: absolute;
    width: 22%;
    margin-left: -11%;
    color: #fff;
    font-size: 13cqw;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    -webkit-text-stroke: 0.9cqw #000;
    paint-order: stroke fill;
    text-shadow: 0 0.6cqw 0 #000;
}

.s-card-cost { left: 11.5%; top: 5.2%; }
.s-card-attack { left: 12.1%; top: 87%; }
.s-card-health { left: 90.3%; top: 86.6%; }

.s-card-armor {
    left: 50%;
    top: 85%;
    width: 17%;
    margin-left: -8.5%;
    padding: 1.6cqw 0 2.4cqw;
    font-size: 11cqw;
    border-radius: 3cqw 3cqw 9cqw 9cqw;
    background: linear-gradient(#d9e2ec, #3e4c59);
    border: 0.8cqw solid #1f2933;
}

/* Spells: a dark plate hides the frame's attack and health gems, with the spell gem (an orb) in the middle. */
.s-card-spell {
    position: absolute;
    left: 1.2%;
    right: 1.2%;
    top: 82.2%;
    height: 16.4%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 9%;
    border: 0.9cqw solid #c9a24a;
    border-radius: 4.8cqw;
    background: linear-gradient(#2b2140, #100b18);
    color: #f3dc9a;
    font: 700 6.4cqw/1 Arial, Helvetica, sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.s-card-spell::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 17%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border: 0.7cqw solid #f3dc9a;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #fff 0 10%, #b98cff 48%, #1b0f24);
    box-shadow: 0 0 4cqw #b98cff;
}

.s-card-stars {
    position: absolute;
    top: 19.4%;
    left: 0;
    right: 0;
    color: #ffd34d;
    font-size: 9cqw;
    line-height: 1;
    text-align: center;
    text-shadow: 0 0 1cqw #5c3d00, 0 0 1cqw #5c3d00;
}

.s-card-wrap .s-card { --w: min(168px, 100%); }

/* ---- Small screens ------------------------------------------------------------------------------------------ */

.s-curve { margin-top: 30px; }

@media (max-width: 991.98px) {
    .s-season-grid { grid-template-columns: minmax(0, 1fr); }
    .s-profile-grid { grid-template-columns: minmax(0, 1fr); }
    .s-col-span-2 { grid-column: auto; }
}

@media (max-width: 575.98px) {
    .s-ladder-rung { grid-template-columns: 6.6rem minmax(0, 1fr) 2rem; }
    .s-ladder-band { display: none; }
    .s-ladder-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .s-portrait-xl { width: 88px; height: 88px; }
    .s-match { grid-template-columns: 3.4rem 32px minmax(0, 1fr) auto auto; gap: 8px; }
    .s-match-portrait { width: 32px; height: 32px; }

    /* The leaderboard fits a phone with only the rank emblem; the tier name stays for screen readers. */
    #season-standings .s-rank > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    #season-standings th,
    #season-standings td { padding-left: 6px; padding-right: 6px; }
    #season-standings th { letter-spacing: 0.06em; }
    .s-btn-lg,
    .s-btn-xl { white-space: normal; text-align: center; }
    .s-page-head > .s-btn { width: 100%; }
    .s-shop-grid,
    .s-deck-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .s-card-wrap { padding: 10px 6px; }
    .s-card-wrap .s-card { --w: min(150px, 100%); }
    .s-card-desc { font-size: 0.72rem; }
    .s-ribbon { font-size: 0.58rem; right: -4px; }
    .s-stepper .s-input { width: 46px; }
    .s-hero-actions .s-btn { flex: 1 1 140px; }
}

/* The Discord Activity's start page (Views/Discord/Index.cshtml): the name and a line while it signs in. */
.s-discord { min-height: 100vh; display: grid; place-items: center; background: var(--s-bg-0); }
.s-discord-start { text-align: center; padding: 24px; color: var(--s-text-2); }

/* Terms of Service and Privacy Policy. */
.s-legal { max-width: 72ch; margin: 0 auto; }
.s-legal h2 { margin: 1.4em 0 0.4em; font-family: var(--s-font-display); font-size: 1.15rem; letter-spacing: 0.04em; color: var(--s-gold-1); }
