:root {
    --bg: #100e18;
    --panel: #1b1725;
    --panel2: #241d30;
    --gold: #e8b85c;
    --gold2: #ffd986;
    --text: #f7f0e2;
    --muted: #b8adbd;
    --line: #463753;
    --green: #8fd08f;
    --red: #ef918f;
    --shadow: 0 18px 50px #0007;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    font-family: Georgia, 'Times New Roman', serif;
    background: radial-gradient(circle at 20% 0%, #3b274d 0, #181321 35%, var(--bg) 75%);
    min-height: 100vh;
}

body:before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.12;
    background-size: 5px 5px;
    mix-blend-mode: screen;
}

.wrap {
    width: min(1120px, calc(100% - 32px));
    margin: auto;
    padding: 10px 0 12px;
}

.site-header,
.logged-in-nav,
.account-nav {
    display: flex;
    align-items: center;
}

.site-header {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.site-brand {
    color: var(--gold2);
    font-weight: bold;
    text-decoration: none;
}

.account-nav,
.logged-in-nav {
    justify-content: flex-end;
    gap: 12px;
}

.account-name {
    color: var(--muted);
    font:
        14px Arial,
        sans-serif;
}

.nav-link {
    padding: 8px 4px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    font:
        bold 14px Arial,
        sans-serif;
    cursor: pointer;
    text-decoration: none;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
    color: var(--gold2);
}

.nav-link[aria-current="page"] {
    border-bottom-color: var(--gold);
}

.logged-in-nav form {
    margin: 0;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.24em;
    color: var(--gold);
    font:
        700 12px Arial,
        sans-serif;
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: end;
    margin-bottom: 10px;
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero h1 {
    font-size: clamp(30px, 3vw, 44px);
    line-height: 0.95;
    margin: 4px 0 5px;
    color: var(--gold2);
    text-shadow: 0 3px 22px #000;
}

.hero p {
    color: var(--muted);
    font-size: 17px;
    margin: 0;
}

.crest {
    font-size: 50px;
    color: var(--gold);
    filter: drop-shadow(0 4px 12px #000);
}

.panel {
    background: linear-gradient(145deg, #241c31ee, #15121eeb);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.admin-servers {
    padding: 20px;
}

.admin-server-list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.admin-server-icon {
    display: grid;
    place-items: center;
    width: 80px;
    height: 80px;
    border: 2px solid var(--line);
    border-radius: 50%;
    background: var(--panel2);
    color: var(--gold2);
    font: bold 28px Arial, sans-serif;
    text-decoration: none;
    overflow: hidden;
}

.admin-server-icon:hover,
.admin-server-icon:focus-visible {
    border-color: var(--gold);
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

.admin-server-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.guild-settings {
    display: grid;
    gap: 10px;
    max-width: 720px;
    margin-top: 20px;
}

.guild-settings h2 {
    margin: 0;
    color: var(--gold2);
}

.guild-settings p {
    margin: 0 0 8px;
    color: var(--muted);
}

.guild-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    cursor: pointer;
}

.guild-checkbox input {
    position: absolute;
    width: 44px;
    height: 26px;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.guild-switch-track {
    flex: 0 0 44px;
    height: 26px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel2);
    transition: background 0.2s, border-color 0.2s;
}

.guild-switch-track span {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--muted);
    transition: transform 0.2s, background 0.2s;
}

.guild-checkbox input:checked + .guild-switch-track {
    background: var(--gold);
    border-color: var(--gold2);
}

.guild-checkbox input:checked + .guild-switch-track span {
    transform: translateX(18px);
    background: var(--bg);
}

.guild-checkbox input:focus-visible + .guild-switch-track {
    outline: 2px solid var(--gold2);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .guild-switch-track,
    .guild-switch-track span {
        transition: none;
    }
}

.guild-formula-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.guild-formula-input input[type="text"] {
    flex: 1 1 280px;
    width: auto;
}

.guild-formula-input button {
    flex: 0 0 auto;
}

.guild-management {
    margin-top: 30px;
}

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

.guild-management fieldset:disabled {
    opacity: 0.6;
}

.guild-management h2 {
    color: var(--gold2);
    margin: 24px 0 8px;
}

.guild-management p {
    color: var(--muted);
}

.guild-reward-list {
    padding: 0;
    list-style: none;
}

.guild-reward-list li {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.guild-reward-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.guild-reward-form label {
    display: grid;
    gap: 6px;
}

.guild-management input,
.guild-management select {
    width: 100%;
    min-width: 90px;
    padding: 8px;
    color: var(--text);
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.guild-player-pages,
.guild-player-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.guild-settings input[type="text"],
.guild-settings select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel2);
    color: var(--text);
}

.guild-settings button {
    justify-self: start;
}

.developer-settings,
.developer-logs {
    padding: 20px;
    margin-bottom: 16px;
}

.developer-settings h2,
.developer-logs h2 {
    color: var(--gold2);
    margin: 0 0 12px;
}

.developer-setting-list {
    display: grid;
    gap: 8px;
}

.developer-house-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.developer-house-players {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.developer-house-details {
    margin-top: 16px;
}

.house-live-odds,
.house-live-hands {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.house-live-card-odds,
.house-live-hand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.house-live-odds .bj-card,
.house-live-hands .bj-card,
.house-live-card-odds .bj-card {
    width: 58px;
    height: 82px;
}

.house-live-odds .bj-card .corner,
.house-live-hands .bj-card .corner,
.house-live-card-odds .bj-card .corner {
    font-size: 13px;
}

.house-live-odds .bj-card .pip,
.house-live-hands .bj-card .pip,
.house-live-card-odds .bj-card .pip {
    font-size: 28px;
}

.house-live-notes {
    margin: 4px 0 8px;
    padding-left: 20px;
}

.house-live-plan {
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 0.9em;
}

.house-live-plan th,
.house-live-plan td {
    padding: 4px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    text-align: left;
}

.house-live-plan tr.best td {
    font-weight: 700;
}

.house-live-moves {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.house-live-anticipations {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.house-live-move-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.house-live-move-list span {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.9em;
}

.house-live-move-list span.unavailable {
    opacity: 0.45;
}

.house-live-move-list span.top {
    background: rgba(255, 215, 0, 0.25);
    font-weight: 700;
}

.house-thinking {
    animation: house-thinking-pulse 1.2s ease-in-out infinite;
}

@keyframes house-thinking-pulse {
    50% { opacity: 0.45; }
}

.house-live-range {
    columns: 2;
    margin: 8px 0;
}

.developer-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel2);
}

.developer-setting button[aria-pressed="true"] {
    color: var(--green);
    border-color: var(--green);
}

.house-live-latest {
    margin: 16px 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    max-height: 70vh;
    overflow: auto;
    overflow-wrap: anywhere;
}

.house-live-latest h3 {
    margin-top: 0;
}

.house-live-latest > strong {
    color: var(--gold2);
}

.house-live-latest:empty {
    display: none;
}

.house-live-runouts {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px 0;
}

.house-live-examples {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.house-live-example {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.house-live-example .bj-cards {
    display: flex;
    gap: 4px;
    margin: 0;
}

.house-live-example .bj-card {
    width: 36px;
    height: 50px;
}

.house-live-example .bj-card .corner {
    font-size: 11px;
}

.house-live-example .bj-card .pip {
    font-size: 18px;
}

.developer-log-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 65vh;
    overflow-y: auto;
}

.developer-log-list li {
    padding: 12px 4px;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
}

.developer-log-list strong {
    color: var(--gold2);
}

.developer-log-context {
    color: var(--muted);
    margin: 4px 0;
    font: 14px Arial, sans-serif;
}

.home-hero {
    padding: clamp(32px, 7vw, 76px) clamp(20px, 5vw, 64px);
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
        radial-gradient(ellipse at 82% 18%, #76543855, transparent 38%),
        linear-gradient(145deg, #30223dee, #15121eeb);
    box-shadow: var(--shadow);
    text-align: center;
}

.home-hero h1 {
    margin: 12px 0;
    color: var(--gold2);
    font-size: clamp(38px, 7vw, 68px);
    text-shadow: 0 3px 22px #000;
}

.home-hero > p:not(.status) {
    max-width: 700px;
    margin: 0 auto;
    color: var(--muted);
    font-size: clamp(17px, 2.5vw, 22px);
    line-height: 1.5;
}

.home-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.secondary-btn {
    border-color: var(--line);
    background: linear-gradient(#55435f, #30263c);
    color: var(--text);
    box-shadow: 0 2px 0 #17111d;
}

.home-hero .status {
    min-height: 18px;
    margin: 12px 0 0;
}

.home-stats,
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.home-stat {
    display: grid;
    gap: 8px;
    padding: 18px;
}

.home-stat strong {
    overflow-wrap: anywhere;
    color: var(--gold2);
    font-size: clamp(20px, 3vw, 30px);
}

.home-stat > span:last-child {
    color: var(--muted);
    font: 13px Arial, sans-serif;
}

.home-section {
    margin-top: 30px;
}

.home-section .hero h2 {
    margin: 4px 0 5px;
    color: var(--gold2);
    font-size: clamp(25px, 3vw, 34px);
}

.top-players {
    list-style: none;
    margin: 0;
    padding: 0 18px;
}

.top-player {
    display: grid;
    grid-template-columns: 48px minmax(120px, 1fr) minmax(160px, auto) minmax(90px, auto);
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.top-player:last-child {
    border-bottom: 0;
}

.top-player-rank {
    color: var(--gold);
    font-weight: bold;
    font-size: 20px;
}

.top-player a,
.feature-card a {
    color: var(--gold2);
    font-weight: bold;
}

.top-player-level {
    color: var(--muted);
    font: 13px Arial, sans-serif;
}

.top-player-balance {
    text-align: right;
}

.top-player-empty {
    padding: 18px 0;
    color: var(--muted);
}

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

.feature-card {
    padding: 20px;
}

.feature-card h3 {
    margin: 0 0 8px;
    color: var(--gold2);
}

.feature-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.wiki-content {
    padding: clamp(16px, 3vw, 30px);
}

.wiki-content section + section {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.wiki-content h2 {
    margin: 0 0 8px;
    color: var(--gold2);
}

.wiki-content p,
.wiki-content li {
    color: var(--muted);
    line-height: 1.55;
}

.wiki-content a {
    color: var(--gold2);
}

.toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 6px 12px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

.search {
    flex: 1;
    min-width: 220px;
    background: #100d17;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 6px 10px;
    color: var(--text);
    font: 14px Georgia;
}

.toolbar select.search {
    flex: 0 1 190px;
    min-width: 150px;
    min-height: 34px;
}

.status {
    color: var(--muted);
    font:
        14px Arial,
        sans-serif;
}

.table-wrap {
    overflow: auto;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 6px 10px;
    border-top: 1px solid var(--line);
}

.page-number {
    display: grid;
    gap: 4px;
    color: var(--text);
    text-align: center;
    font:
        14px Arial,
        sans-serif;
}

.page-number span {
    color: var(--muted);
    font-size: 12px;
}

.page-button {
    border: 1px solid #9f7835;
    background: linear-gradient(#dba74e, #9b662b);
    color: #1b1210;
    padding: 6px 10px;
    border-radius: 8px;
    font:
        bold 13px Arial,
        sans-serif;
    box-shadow: 0 2px 0 #58371b;
    cursor: pointer;
}

.page-button:hover:not(:disabled) {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.page-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    text-align: left;
    padding: 6px 12px;
    border-bottom: 1px solid #332a40;
}

th {
    color: var(--gold);
    font:
        700 12px Arial,
        sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    background: #211a2b;
}

td {
    font-size: 15px;
}

tbody tr {
    transition: 0.2s;
}

tbody tr:hover {
    background: #ffffff08;
}

tbody tr.current-player {
    background: #e8b85c20;
    box-shadow: inset 4px 0 var(--gold);
}

.you-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 3px 7px;
    border: 1px solid #9f7835;
    border-radius: 999px;
    color: var(--gold2);
    font:
        bold 10px Arial,
        sans-serif;
    text-transform: uppercase;
    vertical-align: middle;
}

.name {
    font-weight: bold;
    color: var(--gold2);
}

.rank {
    color: var(--gold);
    font:
        bold 14px Arial,
        sans-serif;
    font-variant-numeric: tabular-nums;
}

.num {
    font-variant-numeric: tabular-nums;
}

.btn {
    display: inline-block;
    border: 1px solid #9f7835;
    background: linear-gradient(#dba74e, #9b662b);
    color: #1b1210;
    padding: 5px 9px;
    border-radius: 8px;
    text-decoration: none;
    font:
        bold 12px Arial,
        sans-serif;
    box-shadow: 0 2px 0 #58371b;
    cursor: pointer;
}

.btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.empty,
.error {
    padding: 20px;
    text-align: center;
    color: var(--muted);
    font:
        16px Arial,
        sans-serif;
}

.error {
    color: var(--red);
}

.profile-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.profile-companion-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel2);
}

.profile-companion-filters .search {
    min-width: 0;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--panel);
    font: 14px Arial, sans-serif;
    transition: border-color 0.2s ease;
}

.profile-companion-filters .search::placeholder {
    color: var(--muted);
}

.profile-companion-filters .search:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-color: var(--gold);
}

.profile-companion-filters input {
    flex: 1 1 240px;
}

.profile-companion-sort {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    flex: 1 1 460px;
    gap: 4px;
    min-width: 0;
}

.profile-companion-sort .sort-button {
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--muted);
    font: bold 13px Arial, sans-serif;
    text-transform: none;
    letter-spacing: normal;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.profile-companion-sort .sort-button:hover {
    color: var(--text);
    background: var(--panel);
    border-color: var(--line);
}

.profile-companion-sort .sort-button.active {
    color: var(--gold2);
    background: color-mix(in srgb, var(--gold) 12%, var(--panel));
    border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
}

.profile-companion-sort .sort-arrow {
    min-width: 12px;
    font-size: 12px;
}

.profile-collection-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.profile-collection-card {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 13px 15px;
    border: 1px solid color-mix(in srgb, var(--rarity-color) 36%, var(--line));
    border-left: 3px solid var(--rarity-color);
    border-radius: 12px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--rarity-color) 9%, var(--panel2)), #17131f);
}

.profile-companion-list {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}

.profile-companion-list .profile-collection-card {
    gap: 5px;
    padding: 10px 12px;
}

.profile-companion-open {
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
}

.profile-companion-open:hover {
    color: var(--gold2);
}

.profile-companion-actions,
.profile-companion-card-heading,
.profile-companion-detail-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.profile-companion-card-heading .profile-collection-name {
    flex: 0 1 auto;
    min-width: 0;
}

.profile-companion-rename form {
    display: grid;
    gap: 6px;
    margin-top: 6px;
}

.profile-companion-rename input {
    width: 100%;
    box-sizing: border-box;
}

.profile-companion-detail-heading {
    margin-bottom: 12px;
}

.profile-companion-list .profile-collection-card.companion-equipped {
    background: linear-gradient(135deg, color-mix(in srgb, #f6c65c 25%, var(--panel)), var(--panel2));
    outline: 3px solid #f6c65c;
    outline-offset: -2px;
    box-shadow: 0 0 18px #f6c65c40;
}

.profile-companion-list .profile-collection-card.companion-on-team {
    background: linear-gradient(135deg, color-mix(in srgb, #74c9ff 25%, var(--panel)), var(--panel2));
    border-color: #74c9ff;
    border-left-width: 6px;
}

.profile-companion-list .profile-collection-card.companion-equipped.companion-on-team {
    background: linear-gradient(135deg, color-mix(in srgb, #f6c65c 25%, var(--panel)), color-mix(in srgb, #74c9ff 25%, var(--panel2)));
}

.profile-companion-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.profile-companion-badges span {
    padding: 4px 8px;
    border-radius: 6px;
    font: bold 12px Arial, sans-serif;
}

.companion-equipped-badge {
    color: #271b08;
    background: #f6c65c;
}

.companion-team-badge {
    color: #102538;
    background: #74c9ff;
}

.profile-companion-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

.profile-collection-name {
    overflow-wrap: anywhere;
    color: var(--rarity-color);
    font-size: 17px;
    font-weight: bold;
    text-decoration: none;
}

a.profile-collection-name:hover {
    color: var(--gold2);
}

.profile-collection-kind,
.profile-collection-count {
    color: var(--muted);
    font: 12px Arial, sans-serif;
}

.profile-collection-effect {
    margin: 0;
    color: var(--text);
    font: 13px/1.45 Arial, sans-serif;
}

.profile-collection-effect strong {
    color: var(--gold2);
}

.profile-sell-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.profile-equipment-button,
.profile-team-button {
    justify-self: start;
}

.profile-use-button {
    justify-self: start;
}

.profile-bulk-sale {
    margin: 12px 0;
}

.profile-team-add {
    display: grid;
    gap: 8px;
    max-width: 420px;
    margin-top: 20px;
}

.profile-team-add select {
    min-width: 0;
    min-height: 42px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    background: var(--panel2);
    font: 14px system-ui, sans-serif;
}

.profile-team-add p {
    margin: 0;
}

.profile-sale-card {
    position: relative;
}

.profile-sale-card.is-selected {
    box-shadow: 0 0 0 3px var(--gold2), inset 0 0 0 1px var(--gold2);
}

.profile-sale-select-button {
    position: absolute;
    inset: 0;
    z-index: 0;
    padding: 0;
    border: 0;
    border-radius: inherit;
    background: transparent;
    cursor: pointer;
}

.profile-sale-select-button:focus-visible {
    outline: 3px dashed var(--gold2);
    outline-offset: -5px;
}

.profile-sale-card > :not(.profile-sale-select-button) {
    position: relative;
    pointer-events: none;
}

.profile-sale-card > .profile-collection-name,
.profile-sale-card > .profile-use-button,
.profile-sale-card > .profile-equipment-button,
.profile-sale-card .profile-sell-form label,
.profile-sale-card .profile-sell-form button {
    pointer-events: auto;
}

.profile-equipment-confirm {
    margin: 10px 0;
    padding: 12px 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel2);
}

.profile-equipment-confirm p {
    margin: 0 0 10px;
}

.profile-equipment-confirm button {
    margin: 0 8px 8px 0;
}

.profile-sell-form input {
    width: 5.5em;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel2);
    color: var(--text);
}

.profile-collection-count {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.profile-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 1fr);
    align-items: center;
    gap: clamp(24px, 4vw, 56px);
    padding: clamp(24px, 4vw, 38px);
    border-color: #715459;
    background: radial-gradient(ellipse at 10% 0%, #72505466, transparent 50%),
        radial-gradient(ellipse at 100% 100%, #a4782d20, transparent 55%),
        linear-gradient(120deg, #30223dee, #171320);
}

.profile-identity {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 22px;
}

.profile-identity-text {
    min-width: 0;
}

.avatar-frame {
    position: relative;
    width: 112px;
    height: 112px;
    flex: none;
    margin: 0;
}

.avatar,
.profile-avatar {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    border: 4px solid var(--gold);
    box-shadow: 0 0 0 5px #e8b85c22, 0 12px 30px #0006;
}

.avatar {
    display: grid;
    place-items: center;
    background: radial-gradient(circle, #f8dfaa, #bf9355 62%, #223d60 64%);
    font-size: 40px;
    color: #1d3046;
}

.profile-avatar {
    position: absolute;
    inset: 0;
    object-fit: cover;
    background: var(--panel2);
}

.profile-identity h2 {
    margin: 8px 0 0;
    color: var(--gold2);
    font-size: 30px;
    overflow-wrap: anywhere;
}

.profile-username {
    margin: 5px 0 0;
    color: var(--muted);
    font: 14px Arial, sans-serif;
    overflow-wrap: anywhere;
}

.profile-rank {
    display: inline-block;
    margin-top: 14px;
    padding: 7px 12px;
    border: 1px solid #8a693b;
    border-radius: 999px;
    background: #e8b85c12;
    color: var(--gold);
    font:
        bold 14px Arial,
        sans-serif;
}

.profile-name-form {
    display: grid;
    gap: 8px;
    max-width: 420px;
    margin-top: 24px;
    text-align: left;
    color: var(--muted);
    font: 13px Arial, sans-serif;
}

.profile-name-form input {
    min-width: 0;
    width: 100%;
    padding: 10px;
    color: var(--text);
    background: #130f1b;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}

.profile-name-form button {
    padding: 9px;
}

.profile-name-form p {
    margin: 0;
    line-height: 1.4;
}

.profile-settings-hint {
    color: var(--muted);
    line-height: 1.5;
}

.profile-theme-select {
    display: block;
    margin-top: 6px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: var(--panel2);
    font: inherit;
}

.profile-progress {
    padding: 20px;
    border: 1px solid #8a674e;
    border-radius: 16px;
    background: linear-gradient(110deg, #c18b3b26, #171321bd);
    font: 13px Arial, sans-serif;
}

.profile-progress-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 10px;
    color: var(--muted);
}

.profile-progress-heading > div {
    display: grid;
    gap: 6px;
}

.profile-progress-label {
    color: var(--gold);
    font-weight: bold;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: 10px;
}

.profile-progress-heading > div:first-child strong {
    font: bold 20px Georgia, serif;
}

.profile-progress-numbers {
    text-align: right;
}

.profile-progress strong {
    color: var(--gold2);
    font-variant-numeric: tabular-nums;
}

.profile-progress-track {
    height: 10px;
    margin-top: 16px;
    border-radius: 999px;
    background: #090e16;
    overflow: hidden;
}

.profile-progress-track span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #5181b3, #d6bb79);
    border-radius: inherit;
}
.profile-tabs {
    display: flex;
    gap: 6px;
    margin: 18px 0 12px;
    padding: 6px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #1b1725cc;
}

.profile-tabs button {
    flex: 1 0 auto;
    padding: 11px 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--muted);
    background: transparent;
    font: bold 13px Arial, sans-serif;
    cursor: pointer;
}

.profile-tabs button:hover,
.profile-tabs button[aria-selected="true"] {
    color: var(--gold2);
    background: #e8b85c16;
    border-color: #ad824557;
}

.profile-tabs button:focus-visible {
    outline: 2px solid var(--gold2);
    outline-offset: -2px;
}

.profile-panel {
    padding: clamp(20px, 3vw, 30px);
}

.profile-base {
    overflow: hidden;
}

.profile-base-stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 360px;
    overflow: hidden;
    border: 1px solid #bc996a6b;
    border-radius: 12px;
    background: #282335;
    isolation: isolate;
}

.profile-base-scene {
    position: absolute;
    inset: -10px;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    filter: blur(4px);
    z-index: -2;
}

.profile-base-stage::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, #15121c44, #15121cbf);
    content: "";
}

.profile-base-message {
    box-sizing: border-box;
    max-width: calc(100% - 32px);
    padding: 28px 36px;
    border: 1px solid #d5ad725f;
    border-radius: 14px;
    color: #f7ebd8;
    background: #181521e8;
    text-align: center;
}

.profile-base-marker {
    display: block;
    color: #f4cb83;
    font-size: 34px;
    line-height: 1;
}

.profile-base-message .eyebrow {
    margin: 18px 0 8px;
    color: #f4cb83;
}

.profile-base-message h3 {
    margin: 0;
    color: #fff3da;
    font-size: clamp(30px, 5vw, 48px);
}

.profile-base-message p:last-child {
    margin: 10px 0 0;
    color: #e4d7c6;
}

.profile-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.profile-section-heading h3 {
    margin: 7px 0 0;
    color: var(--gold2);
    font-size: 26px;
}

.profile-section-heading p {
    margin: 8px 0 0;
    color: var(--muted);
    font: 14px Arial, sans-serif;
    line-height: 1.5;
}

.profile-section-mark {
    color: #e8b85c88;
    font-size: 32px;
}

.profile-panel .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}

.profile-panel .stat {
    padding: 16px;
    background: linear-gradient(135deg, #2d2438, #15121e);
    border-color: #53415d;
}

.profile-inventory-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.profile-inventory-summary p {
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #100d1888;
    color: var(--muted);
    font: 13px Arial, sans-serif;
    line-height: 1.5;
}

.profile-skill-frame {
    display: block;
    width: 100%;
    height: 1100px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #101927;
}

.embedded-skill-tree .wrap {
    width: 100%;
    padding: 0;
}

.embedded-skill-tree #siteHeader,
.embedded-skill-tree main > .hero {
    display: none;
}

.embedded-skill-tree .skill-tree {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--panel);
}

.embedded-skill-tree .skill-tree-heading,
.embedded-skill-tree .skill-zoom-controls {
    background: #211a2d;
    border-color: var(--line);
}

.embedded-skill-tree .skill-tree-viewport {
    background-color: #171320;
    background-image:
        radial-gradient(circle, #c0a3ce25 1px, transparent 1px),
        radial-gradient(ellipse at 50% 45%, #34243e, #171320 72%);
}

.skill-tree {
    background: #101927;
}

.skill-tree-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px 24px;
    flex-wrap: wrap;
    padding: 20px 24px;
    background: #141a25;
    border-bottom: 1px solid #334053;
}

.skill-tree-heading p {
    margin: 8px 0 0;
}

.skill-tree-heading p,
.skill-tree-status,
.skill-cost {
    color: #b6c2d0;
    font: 14px Arial, sans-serif;
    line-height: 1.5;
}

#skillPoints {
    color: var(--gold2);
    font-weight: bold;
    font-size: 18px;
}

.skill-reset-note {
    max-width: 240px;
}

.skill-tree-status:not(:empty) {
    padding: 12px 24px;
}

.skill-zoom-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 24px;
    background: #141a25;
}

.skill-zoom-controls output {
    min-width: 48px;
    text-align: center;
    color: #b6c2d0;
    font: 14px Arial, sans-serif;
}

.skill-tree-viewport {
    height: clamp(320px, 55vh, 620px);
    overflow: auto;
    background-color: #101927;
    background-image:
        radial-gradient(circle, #71839a25 1px, transparent 1px),
        radial-gradient(ellipse at 50% 45%, #1a3043, #111b2b 72%);
    background-size: 24px 24px, auto;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.skill-tree-viewport.dragging,
.skill-tree-viewport.dragging .skill-node {
    cursor: grabbing;
}

.skill-tree-viewport:focus-visible {
    outline: 2px solid var(--gold2);
    outline-offset: -2px;
}

.skill-tooltip {
    position: fixed;
    z-index: 20;
    width: min(280px, calc(100vw - 24px));
    padding: 12px 14px;
    border: 1px solid #627388;
    border-radius: 10px;
    background: #182435;
    box-shadow: 0 8px 24px #0009;
    color: var(--text);
    font: 14px Arial, sans-serif;
    line-height: 1.4;
    pointer-events: none;
}

.skill-tooltip strong {
    color: var(--gold2);
}

.skill-tooltip p {
    margin: 6px 0 0;
}

.skill-tooltip .skill-cost {
    font-size: 12px;
}

#skillTree {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: max-content;
    min-width: 100%;
    padding: 38px 26px 26px;
}

.skill-branch {
    flex: none;
    --branch-color: #bfc9d3;
}

.branch-experience {
    --branch-color: #45e3ac;
}

.branch-balance {
    --branch-color: #ffce4d;
}

.branch-skill {
    --branch-color: #ff7778;
}

.branch-companionSpawn {
    --branch-color: #66c9ff;
}

.branch-companionRarity {
    --branch-color: #c493ff;
}

.branch-casino {
    --branch-color: #ff8a65;
}

.branch-lootboxDrop,
.branch-lootboxRarity,
.branch-lootboxReward,
.branch-lootboxFind {
    --branch-color: #f3c96b;
}

.branch-scavenge,
.branch-scavengeCooldown,
.branch-scavengeRarity,
.branch-scavengeFind,
.branch-scavengeExperience,
.branch-toolSlots {
    --branch-color: #8bd1ff;
}

.skill-tree-graph {
    position: relative;
    flex: none;
    transform-origin: top left;
}

.skill-tree-zoom-frame {
    position: relative;
    flex: none;
    overflow: hidden;
}

.skill-tree-zoom-frame .skill-tree-graph {
    position: absolute;
    top: 0;
    left: 0;
}

.skill-links {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.skill-link {
    fill: none;
    stroke: #8292a755;
    stroke-width: 2.5;
    transition: opacity .2s, stroke .2s, stroke-width .2s;
}

.skill-link.active {
    stroke: var(--branch-color);
    stroke-width: 4;
    filter: drop-shadow(0 0 4px var(--branch-color));
}

.skill-link.prerequisite-highlight {
    opacity: 1;
    stroke: var(--branch-color, #e8b85c);
    stroke-width: 4;
    filter: drop-shadow(0 0 5px var(--branch-color, #e8b85c));
}

.skill-node {
    position: absolute;
    transform: translate(-50%, -26px);
    width: 160px;
    padding: 8px 8px 10px;
    border: 1px solid color-mix(in srgb, var(--branch-color) 45%, #42516a);
    border-radius: 16px;
    background: linear-gradient(155deg, #1d2b3d, #121c2b 72%);
    box-shadow: 0 8px 20px #0005, inset 0 1px #ffffff0b;
    color: #d7e0e9;
    font: 12px Arial, sans-serif;
    line-height: 1.25;
    cursor: pointer;
    text-align: center;
    transition: border-color .2s, background .2s, box-shadow .2s;
}

.skill-node-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin: 0 auto 6px;
    border: 2px solid #718090;
    border-radius: 50%;
    background: #142031;
    color: #a7b3bf;
    font: bold 24px Georgia, serif;
    transition: box-shadow .2s, border-color .2s, color .2s;
}

.skill-node.available .skill-node-icon,
.skill-node.owned .skill-node-icon {
    color: var(--branch-color);
    border-color: var(--branch-color);
}

.skill-node.prerequisite-highlight .skill-node-icon {
    color: var(--branch-color);
    border-color: var(--branch-color);
    box-shadow: 0 0 0 3px #dce8f355, 0 0 15px var(--branch-color);
}

.skill-node.owned .skill-node-icon {
    background: color-mix(in srgb, var(--branch-color) 20%, #142031);
    box-shadow: 0 0 14px color-mix(in srgb, var(--branch-color) 50%, transparent);
}

.skill-node:hover .skill-node-icon,
.skill-node[aria-pressed="true"] .skill-node-icon {
    box-shadow: 0 0 0 4px #dce8f355, 0 0 18px var(--branch-color);
}

.skill-node:hover,
.skill-node[aria-pressed="true"] {
    z-index: 2;
    border-color: var(--branch-color);
    background: linear-gradient(155deg, #263950, #162336 72%);
    box-shadow: 0 12px 28px #0008, 0 0 0 2px color-mix(in srgb, var(--branch-color) 35%, transparent);
}

.skill-node.owned {
    border-color: color-mix(in srgb, var(--branch-color) 70%, #42516a);
}

.skill-node:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
    border-radius: 6px;
}

.skill-node-name {
    display: block;
    max-width: 100%;
    padding: 2px 5px;
    color: #e6edf5;
    font-weight: 600;
    overflow-wrap: break-word;
}

.skill-tree-fallback {
    max-width: 700px;
    color: #b6c2d0;
    font: 14px Arial, sans-serif;
}

.skill-tree-fallback-nodes {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.skill-tree-fallback .skill-node {
    position: static;
    transform: none;
}

.skill-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px 24px;
    background: #171d29;
    border-top: 1px solid #334053;
}

.skill-details h2 {
    margin: 5px 0;
    color: var(--gold2);
    font-size: 21px;
}

.skill-details p {
    margin: 6px 0 0;
    line-height: 1.4;
}

.skill-detail-status {
    color: #bdc9d4;
    font: bold 11px Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.skill-details-hint,
.skill-tree-empty {
    color: #b6c2d0;
}

#retrySkillTree {
    margin: 0 24px 12px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.stat {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #100d1888;
}

.stat label {
    display: block;
    color: var(--muted);
    font:
        12px Arial,
        sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat strong {
    display: block;
    color: var(--gold2);
    font-size: 22px;
    margin-top: 4px;
}

.wide {
    grid-column: 1/-1;
}

.hidden {
    display: none;
}

@media (max-width: 720px) {
    .home-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .top-player {
        grid-template-columns: 38px minmax(0, 1fr) auto;
    }

    .top-player-level {
        grid-column: 2;
    }

    .top-player-balance {
        grid-column: 3;
        grid-row: 1 / span 2;
    }

    .hero {
        align-items: start;
    }

    .crest {
        display: none;
    }

    .profile-hero {
        grid-template-columns: 1fr;
    }

    .profile-identity {
        gap: 16px;
    }

    .profile-identity .avatar-frame,
    .profile-identity .avatar,
    .profile-identity .profile-avatar {
        width: 84px;
        height: 84px;
    }

    .profile-skill-frame {
        height: 1250px;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .wrap {
        width: min(100% - 20px, 1120px);
        padding-top: 8px;
    }

    .site-header,
    .logged-in-nav {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .site-header {
        flex-direction: column;
    }

    .logged-in-nav {
        justify-content: flex-start;
    }
}

@media (max-width: 460px) {
    .home-stats,
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

.sort-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    color: var(--gold);
    background: transparent;
    font: inherit;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    cursor: pointer;
}

.sort-button:hover {
    color: var(--gold2);
}

.sort-button:focus-visible {
    outline: 2px solid var(--gold2);
    outline-offset: 4px;
    border-radius: 4px;
}

.sort-arrow {
    display: inline-block;
    min-width: 14px;
    color: var(--muted);
    font-size: 15px;
    transition: transform 0.2s ease, color 0.2s ease;
}

.sort-button.active .sort-arrow {
    color: var(--gold2);
}

.companion-wrap {
    width: min(1320px, calc(100% - 32px));
}

.companion-table {
    min-width: 520px;
}

.item-table {
    min-width: 1020px;
}

.item-wiki section {
    margin-top: 24px;
}

.item-wiki ul {
    color: var(--muted);
    line-height: 1.7;
}

.item-wiki .item-recipe-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 185px), 1fr));
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    line-height: 1.3;
}

.item-recipe-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid color-mix(in srgb, var(--rarity-color) 36%, var(--line));
    border-left: 3px solid var(--rarity-color);
    border-radius: 8px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--rarity-color) 9%, var(--panel2)), #17131f);
}

.item-recipe-name {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--rarity-color);
    font-weight: bold;
    text-decoration: none;
}

.item-recipe-name:hover,
.item-recipe-name:focus-visible {
    color: var(--gold2);
    text-decoration: underline;
}

.item-recipe-quantity {
    flex-shrink: 0;
    padding: 2px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel2);
    color: var(--text);
    font: 12px Arial, sans-serif;
    font-variant-numeric: tabular-nums;
}

.companion-table th,
.companion-table td {
    padding: 14px 20px;
    font-size: 16px;
}

.rarity-common { --rarity-color: #dfdce3; }
.rarity-uncommon { --rarity-color: #a4e7a4; }
.rarity-rare { --rarity-color: #88c8ff; }
.rarity-epic { --rarity-color: #d3a6ff; }
.rarity-legendary { --rarity-color: #ffd37b; }
.rarity-mythic { --rarity-color: #ff9cae; }
.rarity-eternal { --rarity-color: #a5f2e6; }
.rarity-retired { --rarity-color: #b8adbd; }

.companion-table td,
.companion-table td a,
.companion-wiki h2,
.companion-wiki #wikiRarity {
    color: var(--rarity-color);
}

.companion-table td a:hover {
    text-decoration-thickness: 2px;
}

.companion-wiki {
    padding: 24px;
}

.companion-wiki h2 {
    font-size: 32px;
    margin: 0 0 8px;
}

.companion-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.companion-stats div {
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 14px;
    max-width: 100%;
}

.companion-stats dt {
    color: var(--muted);
    font: 13px Arial, sans-serif;
}

.companion-stats dd {
    margin: 6px 0 0;
    font-size: 18px;
    overflow-wrap: anywhere;
}

.balance-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.balance-label {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.balance-badge strong {
    color: var(--gold2);
    font-size: 28px;
}

.balance-badge #casinoPayoutBonus {
    font-size: 18px;
}

.game-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.game-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 220px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    background: var(--panel);
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.game-card:hover,
.game-card[aria-selected="true"] {
    border-color: var(--gold);
    background: var(--panel2);
}

.game-icon {
    color: var(--gold2);
}

.game-name {
    font-weight: bold;
}

.game-desc {
    color: var(--muted);
    font-size: 13px;
}

.rules {
    margin-bottom: 16px;
    padding: 10px 14px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
    border-radius: 10px;
    font-size: 14px;
}

.rules summary {
    cursor: pointer;
    font-weight: 600;
}

.rules ul {
    margin: 10px 0 0;
    padding-left: 20px;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bills-table {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.bills-seats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    width: 100%;
}

.bills-seat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
    border-radius: 10px;
    min-height: 64px;
    transition: border-color 0.2s, background 0.2s;
}

.bills-seat.you {
    border-style: dashed;
}

.bills-seat.active {
    border-color: #f5c542;
    background: rgba(245, 197, 66, 0.12);
}

.bills-seat.winner {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
}

.bills-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.bills-dice {
    font-size: 40px;
    min-height: 52px;
    letter-spacing: 8px;
}

.house-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.house-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel2);
}

.house-stat strong {
    color: var(--gold2);
    font-size: 24px;
}

.house-stat strong.win,
td.win {
    color: var(--green);
}

.house-stat strong.loss,
td.loss {
    color: var(--red);
}

.board-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 18px 0 8px;
}

.board-header h2 {
    margin: 0;
}

.muted-note {
    color: var(--muted);
    font-size: 13px;
}

[data-lbsort][aria-pressed="true"] {
    border-color: var(--gold);
    background: var(--panel2);
}

.plinko-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
}

.plinko-board {
    flex: 1 1 560px;
    max-width: none;
}

.plinko-board canvas {
    display: block;
    width: 100%;
    height: auto;
}

.plinko-controls {
    display: flex;
    flex-direction: column;
    flex: 0 1 340px;
    gap: 14px;
    font-size: 16px;
}

.wrap.wide {
    width: calc(100% - 32px);
    max-width: none;
}

.plinko-layout .plinko-board {
    flex: 0 0 auto;
    width: min(100%, calc((100vh - 450px) * 1500 / 1300));
    margin: 0 auto;
}

.plinko-layout .plinko-controls {
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: end;
}

.plinko-controls .plinko-result,
.plinko-controls .plinko-history {
    grid-column: 1 / -1;
}

.bet-shortcuts {
    display: flex;
    gap: 12px;
}

.plinko-result {
    min-height: 24px;
    font-weight: bold;
}

.plinko-result.win {
    color: var(--green);
}

.plinko-result.loss {
    color: var(--red);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.segmented button {
    padding: 8px 0;
    border: 0;
    color: var(--muted);
    background: var(--panel);
    font: bold 14px Arial, sans-serif;
    cursor: pointer;
}

.segmented button[aria-checked="true"] {
    color: #17121f;
    background: var(--gold);
}

.plinko-controls input[type="range"] {
    width: 100%;
    accent-color: var(--gold);
}

.plinko-controls button:disabled,
.plinko-controls input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.total-bet {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel2);
}

.total-bet strong {
    color: var(--gold2);
}

.plinko-board {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.plinko-history {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.history-chip {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    background: var(--panel2);
}

.history-chip.win {
    color: var(--green);
}

.history-chip.loss {
    color: var(--red);
}

.blackjack-table {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
    padding: 10px 20px;
    text-align: center;
    border: 6px solid #3b2a1a;
    border-radius: 24px;
    background: radial-gradient(ellipse at center, #22724a 0%, #124a2d 65%, #0b3220 100%);
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5), var(--shadow);
}

.bj-table-top {
    display: flex;
    justify-content: flex-end;
}

.bj-chip {
    padding: 8px 16px;
    border: 3px dashed rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, 0.35);
    font-size: 18px;
}

.bj-chip strong {
    color: var(--gold2);
}

.bj-next-card {
    align-self: center;
    padding: 8px 14px;
    border: 1px solid rgba(255, 215, 128, 0.55);
    border-radius: 12px;
    background: rgba(15, 20, 32, 0.7);
    color: #ffe4a3;
    font-size: 0.85rem;
    text-align: center;
}

.bj-next-card.hidden {
    display: none;
}

.bj-label {
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.bj-total {
    display: inline-block;
    min-width: 36px;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    color: #17121f;
    background: var(--gold);
    text-align: center;
}

.bj-total:empty {
    display: none;
}

.bj-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    min-height: 112px;
    margin-top: 2px;
}

.lobby-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.lobby-seats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.poker-seats {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}

.lobby-seat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    transition: border-color 0.2s, background 0.2s;
}

.lobby-seat.turn {
    border-color: #f5c542;
    background: rgba(245, 197, 66, 0.12);
}

.lobby-seat.winner {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
}

.lobby-seat.folded {
    opacity: 0.5;
}

.lobby-seat .bj-cards {
    min-height: 0;
    gap: 4px;
}

.lobby-seat .poker-hole .bj-card {
    width: 78px;
    height: 110px;
    border-radius: 10px;
    font-size: 0.7em;
}

.lobby-centre,
.poker-info,
.poker-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 10px 0;
    text-align: center;
}

.poker-table {
    padding: 14px;
    border-radius: 14px;
    background: rgba(20, 90, 55, 0.35);
}

.house-poker-table .poker-community {
    flex-wrap: nowrap;
}

.poker-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    margin: 6px 0;
}

.poker-chip-stack {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    position: relative;
}

.poker-chip,
.poker-chip-edge {
    --chip: #e5e7eb;
    --chip-ink: #111827;
    --chip-mark: #f8fafc;
    box-sizing: border-box;
    width: 34px;
    border: 1px solid rgba(0, 0, 0, 0.45);
}

/* The face of the top chip, seen at an angle, carrying the chip's value. */
.poker-chip {
    display: grid;
    place-items: center;
    height: 22px;
    margin-bottom: -5px;
    border-radius: 50%;
    background:
        radial-gradient(ellipse, var(--chip) 0 52%, transparent 53%),
        repeating-conic-gradient(var(--chip) 0 30deg, var(--chip-mark) 30deg 45deg);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12);
    color: var(--chip-ink);
    font: 700 9px/1 Arial, sans-serif;
}

/* One chip in the pile, seen side-on: a thin striped edge so the chips can be counted. */
.poker-chip-edge {
    height: 6px;
    border-radius: 0 0 6px 6px / 0 0 3px 3px;
    background: repeating-linear-gradient(90deg, var(--chip) 0 5px, var(--chip-mark) 5px 8px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.poker-chip-edge:not(:first-child) {
    margin-bottom: -1px;
}

.chip-1 { --chip: #e5e7eb; --chip-ink: #111827; --chip-mark: #111827; }
.chip-5 { --chip: #dc2626; --chip-ink: #fff; }
.chip-25 { --chip: #16a34a; --chip-ink: #fff; }
.chip-100 { --chip: #1f2937; --chip-ink: #fff; }
.chip-500 { --chip: #7c3aed; --chip-ink: #fff; }
.chip-1000 { --chip: #f59e0b; --chip-ink: #111827; }

.poker-chip-count {
    position: absolute;
    top: -16px;
    font: 700 11px/1 Arial, sans-serif;
    color: var(--gold2);
}

.poker-chip-total {
    flex-basis: 100%;
    text-align: center;
    font-size: 0.9em;
}

.house-poker-seats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 560px) {
    .house-poker-table .poker-community {
        gap: 5px;
        min-height: 76px;
    }

    .house-poker-table .bj-card {
        width: min(52px, 16vw);
        height: 74px;
    }

    .house-poker-table .bj-card .corner {
        font-size: 13px;
    }

    .house-poker-table .bj-card .pip {
        font-size: 28px;
    }
}

.bj-card.empty {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: none;
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

.poker-mine {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
}

.lobby-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
}

.lobby-actions input {
    width: 110px;
}

.bj-card {
    position: relative;
    width: 78px;
    height: 110px;
    border-radius: 12px;
    color: #17121f;
    background: linear-gradient(160deg, #ffffff, #ece8f2);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
    font-family: Georgia, serif;
    font-weight: bold;
}

.bj-card.dealt {
    animation: bj-deal 0.35s ease-out backwards;
}

.bj-card.poker-dealt {
    animation: poker-deal 360ms cubic-bezier(.2, .75, .3, 1) both;
}

@keyframes poker-deal {
    from {
        opacity: 0;
        transform: translate(45px, -38px) rotate(12deg) scale(.8);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes bj-deal {
    from {
        opacity: 0;
        transform: translate(60px, -80px) rotate(12deg) scale(0.8);
    }
}

.poker-showdown .bj-card:not(.winning-card):not(.empty):not(.back) {
    opacity: 0.5;
}

.bj-card.winning-card {
    outline: 3px solid var(--gold2);
    outline-offset: 2px;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.55);
}

.poker-made-hand {
    font-weight: 700;
}

.poker-made-hand.won {
    color: var(--gold2);
}

.bj-card.red {
    color: #c0392b;
}

.bj-card .corner {
    position: absolute;
    font-size: 18px;
    line-height: 1.05;
    text-align: center;
    white-space: pre;
}

.bj-card .corner.top {
    top: 8px;
    left: 10px;
}

.bj-card .corner.bottom {
    right: 10px;
    bottom: 8px;
    transform: rotate(180deg);
}

.bj-card .pip {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
}

.lobby-seat .poker-hole .bj-card .corner {
    font-size: 16px;
    line-height: 1;
}

.lobby-seat .poker-hole .bj-card .corner.top {
    top: 6px;
    left: 5px;
}

.lobby-seat .poker-hole .bj-card .corner.bottom {
    right: 5px;
    bottom: 6px;
}

.lobby-seat .poker-hole .bj-card .pip {
    font-size: 36px;
}

@media (max-width: 420px) {
    .house-poker-seats {
        grid-template-columns: 1fr;
    }
}

.bj-card.back {
    border: 6px solid #fff;
    background: repeating-linear-gradient(45deg, #5b3a8c, #5b3a8c 10px, #7a52b3 10px, #7a52b3 20px);
}

.bj-banner {
    position: absolute;
    inset: 0;
    z-index: 5;
    width: fit-content;
    height: fit-content;
    margin: auto;
    min-width: 320px;
    padding: 14px 44px;
    border: 3px solid currentColor;
    border-radius: 20px;
    background: rgba(10, 10, 16, 0.9);
    text-align: center;
    pointer-events: none;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35), 0 12px 40px rgba(0, 0, 0, 0.7);
    animation: bj-pop 0.35s ease-out;
}

@keyframes bj-pop {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
}

.bj-banner.win {
    color: var(--green);
}

.bj-banner.loss {
    color: var(--red);
}

.bj-banner.push {
    color: var(--gold2);
}

.bj-banner-title {
    font-size: 26px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.bj-banner-amount {
    font-size: 34px;
    font-weight: 900;
}

.blackjack-controls {
    margin-top: 10px;
}

.bj-bet {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.bj-bet .search {
    flex: 0 0 110px;
    box-sizing: border-box;
    width: 110px;
    max-width: 110px;
    min-width: 0;
    height: 20px;
    margin: 0;
    padding: 0 8px;
    font-size: 16px;
    text-align: center;
}

.bj-bet .bet-shortcuts {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bj-bet .bet-shortcuts button {
    min-width: 0;
    height: 10px;
    padding: 0 14px;
    font-size: 16px;
}

.blackjack-controls .bj-bet .btn,
.blackjack-controls .bj-actions .btn {
    height: 20px;
    padding: 0 26px;
}

.bj-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.blackjack-controls {
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    text-align: center;
}

.blackjack-table {
    overflow: hidden;
}

.bj-hand {
    padding: 2px 0;
}

.bj-card {
    transition: transform 0.15s ease;
}

.bj-card:hover {
    transform: translateY(-4px);
}

.blackjack-controls button {
    min-width: 112px;
    padding: 0 26px;
    font-size: 17px;
}

.blackjack-table .plinko-result {
    font-size: 20px;
}

.blackjack-controls button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Shared visual language */
:root {
    --bg: #060910;
    --panel: #0a0f18;
    --panel2: #0e1420;
    --gold: #d7b574;
    --gold2: #f3d9a1;
    --text: #edf2f7;
    --muted: #aeb9c8;
    --line: #293747;
    --shadow: 0 18px 48px #02061199;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: linear-gradient(160deg, #0b111a, var(--bg) 68%);
    line-height: 1.5;
}

body::before {
    opacity: .16;
    background-image: radial-gradient(#adbccc 0.65px, transparent 0.65px);
    background-size: 30px 30px;
    mask-image: linear-gradient(#000, transparent 75%);
}

h1, h2, h3, .site-brand, .game-name {
    font-family: Georgia, "Times New Roman", serif;
}

a {
    color: var(--gold2);
}

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

.wrap,
.companion-wrap {
    width: min(1320px, calc(100% - 48px));
    padding: 18px 0 64px;
}

.wrap.wide {
    width: min(1600px, calc(100% - 48px));
}

.site-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand navigation actions" "alert alert alert";
    gap: 0 18px;
    margin-bottom: 30px;
    padding: 8px 14px 0;
    border: 0;
    border-bottom: 1px solid #d7ad6a38;
    background: transparent;
}

.site-brand {
    display: inline-flex;
    grid-area: brand;
    align-items: center;
    flex: none;
    min-width: 0;
    gap: 13px;
    color: var(--text);
    letter-spacing: -.02em;
}

.brand-emblem {
    display: block;
    width: 42px;
    height: 42px;
    flex: none;
    filter: drop-shadow(0 0 8px #d7ad6a22);
}

.brand-copy {
    display: grid;
    gap: 2px;
    line-height: 1;
}

.brand-copy strong {
    font-size: 19px;
}

.brand-copy small {
    color: var(--gold);
    font: 700 8px system-ui, sans-serif;
    letter-spacing: .16em;
}

.header-actions {
    display: flex;
    grid-area: actions;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.header-actions form {
    margin: 0;
}

.account-name {
    max-width: 120px;
    padding: 8px;
    overflow: hidden;
    color: var(--gold2);
    border-radius: 6px;
    font: 600 12px system-ui, sans-serif;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-name:hover,
.account-name[aria-current="page"] {
    background: #d7ad6a14;
    box-shadow: inset 0 -2px var(--gold);
}

.site-brand:hover .brand-copy strong,
.site-brand[aria-current="page"] .brand-copy strong {
    color: var(--gold2);
}

.account-nav {
    grid-area: navigation;
    justify-content: flex-start;
    justify-content: safe center;
    flex-wrap: nowrap;
    min-width: 0;
    gap: 2px;
    margin: 0;
    padding: 10px 2px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

.logged-in-nav {
    flex: none;
    flex-wrap: nowrap;
    gap: 2px;
}

.site-header .nav-link {
    flex: none;
    position: relative;
    padding: 9px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    font: 600 13px system-ui, sans-serif;
    white-space: nowrap;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

.site-header .nav-link:hover,
.site-header .nav-link[aria-current="page"] {
    background: #d7ad6a0d;
    color: var(--gold2);
}

.account-nav .nav-link[aria-current="page"] {
    background: #d7ad6a14;
    box-shadow: inset 0 -2px var(--gold);
}

.site-header .theme-toggle {
    border-color: #d7ad6a40;
    background: #d7ad6a0c;
}

.site-header .shop-restock-alert {
    grid-area: alert;
    margin: 0 0 14px;
}

.eyebrow {
    font: 700 10px system-ui, sans-serif;
    letter-spacing: .18em;
}

.hero {
    align-items: end;
    gap: 20px;
    margin: 0 0 22px;
}

.hero h1 {
    margin: 9px 0 6px;
    color: var(--text);
    font-size: clamp(32px, 4vw, 48px);
    letter-spacing: -.035em;
    line-height: 1.08;
}

.hero p {
    max-width: 65ch;
    color: var(--muted);
    font: 15px/1.6 system-ui, sans-serif;
}

.panel {
    border: 1px solid #39475580;
    border-radius: 18px;
    background: linear-gradient(145deg, #0e1420, #0a0f17);
    box-shadow: inset 0 1px #ffffff0b, var(--shadow);
}

.btn,
.page-button {
    padding: 10px 15px;
    border: 1px solid #dfb97f;
    border-radius: 10px;
    color: #281b1a;
    background: linear-gradient(135deg, #f3d396, #c99a59);
    box-shadow: 0 3px 12px #08061033;
    font: 700 13px/1.2 system-ui, sans-serif;
    transition: filter .2s ease, transform .2s ease, border-color .2s ease;
}

.secondary-btn {
    border-color: #aa91a577;
    color: var(--text);
    background: #ffffff0b;
    box-shadow: none;
}

.secondary-btn:hover {
    border-color: var(--gold);
    background: #ffffff16;
}

.toolbar {
    gap: 12px;
    padding: 16px 20px;
    border-color: #ffffff12;
}

.toolbar label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.search,
.profile-name-form input,
.profile-sell-form input {
    min-height: 42px;
    padding: 10px 13px;
    border: 1px solid #4c5c6e;
    border-radius: 10px;
    color: var(--text);
    background: #0b111a;
    font: 14px system-ui, sans-serif;
}

.search::placeholder {
    color: #aa9dac;
}

th,
td {
    padding: 15px 20px;
    border-bottom: 1px solid #ffffff0e;
}

th {
    color: #b7c8da;
    background: #0e1420;
    font: 700 11px system-ui, sans-serif;
    letter-spacing: .1em;
}

td {
    font-size: 14px;
}

tbody tr:hover {
    background: #f5d69c0b;
}

tbody tr.current-player {
    background: #d7ad6a14;
}

.sort-button {
    color: inherit;
}

.pagination {
    padding: 14px;
    border-color: #ffffff12;
}

/* The front page */
.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, .8fr);
    align-items: center;
    gap: 20px;
    position: relative;
    min-height: 480px;
    padding: clamp(30px, 5vw, 66px);
    overflow: hidden;
    border-color: #394a5d80;
    background: linear-gradient(125deg, #0e1420, #091019 65%, #070b13);
    text-align: left;
}

.home-hero-copy {
    position: relative;
    z-index: 1;
}

.home-hero h1 {
    max-width: 12ch;
    margin: 16px 0;
    color: var(--text);
    font-size: clamp(44px, 6vw, 74px);
    line-height: 1;
    letter-spacing: -.045em;
}

.home-hero h1 em {
    color: var(--gold2);
    font-weight: normal;
}

.home-hero > .home-hero-copy > p:not(.status) {
    max-width: 49ch;
    margin: 0;
    color: #c6d3e2;
    font-size: 16px;
    line-height: 1.7;
}

.home-hero-eyebrow span {
    margin-right: 5px;
    color: var(--gold2);
}

.home-actions {
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin-top: 26px;
}

.home-primary-action {
    padding: 14px 20px;
}

.home-hero-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 20px;
    color: #c6d3e2;
    font: 12px system-ui, sans-serif;
}

.home-hero-highlights span::before {
    content: '✦';
    margin-right: 7px;
    color: var(--gold);
    font-size: 9px;
}

.home-text-link {
    padding: 10px 5px;
    color: var(--gold2);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.home-text-link:hover {
    text-decoration: underline;
}

.home-hero-art {
    position: relative;
    display: grid;
    width: min(100%, 340px);
    aspect-ratio: 1;
    place-items: center;
    justify-self: center;
}

.hero-orbit {
    position: absolute;
    border: 1px solid #d6ba7b77;
    border-radius: 50%;
}

.hero-orbit-outer {
    inset: 4%;
    box-shadow: inset 0 0 0 12px #bdc9d606, 0 0 40px #1c273425;
}

.hero-orbit-inner {
    inset: 16%;
    border-style: dashed;
    transform: rotate(30deg);
}

.hero-sigil {
    display: grid;
    width: 45%;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid #f3d59b80;
    border-radius: 28%;
    background: linear-gradient(145deg, #1a2635, #0f1926);
    box-shadow: inset 0 0 0 8px #f4d19a12, 0 14px 40px #050b18aa;
    transform: rotate(45deg);
}

.hero-sigil span {
    color: var(--gold2);
    font-size: clamp(52px, 6vw, 80px);
    text-shadow: 0 0 28px #edbd8a88;
    transform: rotate(-45deg);
}

.hero-star {
    position: absolute;
    color: var(--gold2);
}

.hero-star-one { top: 14%; right: 12%; font-size: 27px; }
.hero-star-two { bottom: 20%; left: 7%; font-size: 18px; }

.hero-art-caption {
    position: absolute;
    bottom: 3%;
    color: #d7ad6acc;
    font: 700 9px system-ui, sans-serif;
    letter-spacing: .2em;
}

.home-stats,
.feature-grid {
    gap: 14px;
}

.home-stat {
    gap: 9px;
    min-width: 0;
    padding: 20px;
}

.home-stat strong {
    font-family: Georgia, serif;
    letter-spacing: -.03em;
}

.home-section {
    margin-top: 48px;
}

.home-section .hero h2 {
    color: var(--text);
    letter-spacing: -.025em;
}

.home-section .hero {
    margin-bottom: 20px;
}

.home-get-started {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
    gap: clamp(24px, 5vw, 64px);
    padding: clamp(24px, 4vw, 42px);
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #0b121c;
}

.home-get-started h2 {
    margin: 10px 0;
    font-size: clamp(27px, 3vw, 36px);
    letter-spacing: -.025em;
}

.home-get-started > div > p {
    max-width: 33ch;
    color: var(--muted);
    line-height: 1.6;
}

.home-get-started .home-text-link {
    display: inline-block;
    padding-left: 0;
}

.home-steps {
    display: grid;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-steps li {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 14px;
}

.home-steps li > span {
    color: var(--gold);
    font: 700 12px system-ui, sans-serif;
    letter-spacing: .08em;
}

.home-steps strong {
    font-size: 16px;
}

.home-steps p {
    margin: 5px 0 0;
    color: var(--muted);
    font: 14px/1.5 system-ui, sans-serif;
}

.home-leaderboard-heading {
    margin: 30px 0 12px;
    font-size: 20px;
}

#homeStatus:not(:empty) {
    margin-bottom: 12px;
}

.top-players {
    padding: 4px 22px;
}

.top-player {
    padding: 19px 0;
    border-color: #ffffff12;
}

.top-player-rank {
    font-family: Georgia, serif;
}

.top-player a {
    color: var(--text);
    text-decoration: none;
}

.top-player a:hover {
    color: var(--gold2);
}

.feature-card {
    min-height: 180px;
    padding: 23px;
    transition: border-color .2s ease, transform .2s ease;
}

.feature-card:hover {
    transform: translateY(-3px);
    border-color: #d7ad6a80;
}

.feature-icon {
    display: grid;
    width: 38px;
    height: 38px;
    margin-bottom: 18px;
    place-items: center;
    border: 1px solid #d7ad6a40;
    border-radius: 11px;
    color: var(--gold2);
    background: #d7ad6a13;
    font-size: 19px;
}

.feature-card h3 {
    color: var(--text);
    font-size: 19px;
}

.feature-card p {
    font-size: 14px;
    line-height: 1.65;
}

/* Character records, catalog entries, and the handbook */
.profile-hero {
    border-color: #394a5d80;
    background: linear-gradient(120deg, #0e1521, #090e17);
}

.profile-tabs {
    border-color: var(--line);
    background: #0a0f18;
}

.profile-tabs button {
    font-family: system-ui, sans-serif;
}

.profile-section-heading h3,
.companion-wiki h2,
.wiki-content h2 {
    letter-spacing: -.025em;
}

.profile-progress,
.profile-panel .stat,
.profile-inventory-summary p,
.companion-stats div,
.house-stat {
    background: linear-gradient(145deg, #111925, #0b121c);
    border-color: #364555;
}

.profile-collection-card,
.item-recipe-card {
    background: linear-gradient(135deg, color-mix(in srgb, var(--rarity-color) 9%, var(--panel2)), #0b121c);
    box-shadow: inset 0 1px #ffffff0a;
}

.wiki-content {
    padding: clamp(24px, 5vw, 48px);
}

.wiki-content section {
    max-width: 85ch;
}

.wiki-content section + section {
    margin-top: 32px;
    padding-top: 28px;
    border-color: #ffffff16;
}

.wiki-content p,
.wiki-content li {
    font-size: 15px;
    line-height: 1.8;
}

.wiki-content code,
.profile-panel code {
    padding: 2px 6px;
    border-radius: 5px;
    color: var(--gold2);
    background: #d7ad6a18;
}

.companion-wiki {
    padding: clamp(24px, 4vw, 40px);
}

.companion-stats {
    gap: 10px;
}

.companion-stats div {
    min-width: 130px;
    padding: 15px 18px;
}

.compendium-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.compendium-section {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 15px 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--text);
    background: var(--panel);
    text-decoration: none;
    transition: border-color .2s ease, background-color .2s ease;
}

.compendium-section:hover,
.compendium-section[aria-current="page"] {
    border-color: var(--gold);
    background: color-mix(in srgb, var(--gold) 9%, var(--panel));
}

.compendium-section-icon {
    display: grid;
    flex: none;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
    border-radius: 12px;
    color: var(--gold2);
    background: color-mix(in srgb, var(--gold) 10%, transparent);
    font-size: 19px;
}

.compendium-section strong,
.compendium-section small {
    display: block;
}

.compendium-section strong {
    font: 700 16px Georgia, "Times New Roman", serif;
}

.compendium-section small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.compendium-list-heading {
    padding: 20px 20px 0;
}

.compendium-list-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: 22px;
}

.compendium-list-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.companion-table th,
.companion-table td {
    padding: 16px 20px;
    font-size: 14px;
}

.item-table + .status,
.table-wrap + .status {
    padding: 0 20px 14px;
}

/* Skill tree and game spaces retain their functional layouts. */
.skill-tree,
.embedded-skill-tree .skill-tree {
    background: var(--panel);
}

.skill-tree-heading,
.skill-zoom-controls,
.embedded-skill-tree .skill-tree-heading,
.embedded-skill-tree .skill-zoom-controls {
    background: var(--panel2);
    border-color: var(--line);
}

.skill-tree-heading p,
.skill-tree-status,
.skill-cost {
    color: var(--muted);
}

.skill-tree-viewport,
.embedded-skill-tree .skill-tree-viewport {
    background-color: #0a0f18;
    background-image:
        radial-gradient(circle, #a5b8cc25 1px, transparent 1px),
        radial-gradient(ellipse at 50% 45%, #192536, #0a0f18 72%);
}

.skill-details,
.skill-tooltip {
    border-color: var(--line);
    background: var(--panel2);
}

.balance-badge {
    padding: 15px 18px;
    border: 1px solid #d7ad6a40;
    border-radius: 14px;
    background: #d7ad6a0d;
}

.game-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 12px;
}

.game-card {
    width: auto;
    min-height: 142px;
    padding: 18px;
    border-color: #39475580;
    border-radius: 16px;
    background: linear-gradient(145deg, #111925, #0b121c);
    box-shadow: inset 0 1px #ffffff0a;
    transition: border-color .2s ease, transform .2s ease, background .2s ease;
}

.game-card:hover,
.game-card[aria-selected="true"] {
    border-color: var(--gold);
    background: linear-gradient(145deg, #253449, #101b2a);
}

.game-card:hover {
    transform: translateY(-2px);
}

.game-icon {
    margin-bottom: 8px;
    font-size: 23px;
}

.game-name {
    font-size: 18px;
}

.game-desc {
    font: 13px/1.45 system-ui, sans-serif;
}

.rules,
.blackjack-controls,
.bills-seat,
.lobby-seat {
    border-color: #806b8059;
    background-color: #ffffff08;
}

.blackjack-controls .bj-bet .btn,
.blackjack-controls .bj-actions .btn,
.bj-bet .bet-shortcuts button {
    height: auto;
    min-height: 40px;
}

.bj-bet .search {
    height: 40px;
}

@media (max-width: 1250px) {
    .site-header {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "brand actions" "navigation navigation" "alert alert";
        gap: 0 16px;
    }

    .account-nav {
        justify-content: flex-start;
        margin-top: 8px;
        border-top: 1px solid #d7ad6a20;
    }
}

@media (max-width: 720px) {
    .wrap,
    .companion-wrap,
    .wrap.wide {
        width: calc(100% - 28px);
        padding: 12px 0 48px;
    }

    .site-header {
        gap: 0 10px;
        margin-bottom: 24px;
        padding: 6px 10px 0;
    }

    .brand-copy strong {
        font-size: 16px;
    }

    .brand-copy small {
        font-size: 7px;
    }

    .brand-emblem {
        width: 38px;
        height: 38px;
    }

    .header-actions {
        gap: 3px;
    }

    .account-name {
        max-width: 100px;
    }

    .account-nav {
        margin-top: 12px;
    }

    .site-header .nav-link {
        padding: 9px;
    }

    .home-hero {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }

    .home-hero-art {
        width: 190px;
        margin-top: 4px;
    }

    .home-get-started {
        grid-template-columns: 1fr;
    }

    .home-stats,
    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero {
        flex-wrap: wrap;
    }

    .game-menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .toolbar {
        padding: 14px;
    }

    .search {
        min-width: 0;
    }
}

@media (max-width: 600px) {
    .site-header {
        grid-template-areas: "brand brand" "actions actions" "navigation navigation" "alert alert";
    }

    .header-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
        margin-top: 12px;
    }

    .account-nav {
        margin-top: 10px;
    }
}

@media (max-width: 460px) {
    .compendium-sections {
        grid-template-columns: 1fr;
    }

    .home-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .home-actions {
        align-items: stretch;
    }

    .home-actions .btn {
        text-align: center;
    }

    .game-card {
        min-height: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

.skill-tree-viewport,
.embedded-skill-tree .skill-tree-viewport {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.skill-tree-viewport::-webkit-scrollbar {
    display: none;
}

.skill-tree-guide {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, .9fr);
    gap: 30px;
    padding: 28px 24px;
    border-top: 1px solid var(--line);
    background: var(--panel2);
}

.skill-tree-guide h2 {
    margin: 5px 0 12px;
    color: var(--text);
    font-size: 23px;
}

.skill-tree-guide p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.skill-balance {
    min-width: 0;
}

.skill-balance > p {
    margin: 0 0 8px;
}

#skillBalance {
    display: flex;
    align-items: center;
    gap: 12px;
}

.skill-balance-chart {
    flex: 1 1 200px;
    width: 100%;
    min-width: 0;
    max-width: 250px;
}

.skill-balance-ring {
    fill: none;
    stroke: #bba2b770;
    stroke-width: 1;
}

.skill-balance-axis {
    stroke: #bba2b770;
    stroke-width: 1;
}

.skill-balance-fill {
    fill: #d7ad6a55;
    stroke: #f5d69c;
    stroke-width: 2.5;
}

.skill-balance-marker {
    fill: #f5d69c;
}

.skill-balance-chart text {
    fill: var(--gold2);
    font: 700 11px system-ui, sans-serif;
}

.skill-balance-list {
    flex: 1 1 150px;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
}

.skill-balance-list li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0;
    color: var(--muted);
}

.skill-balance-list b {
    display: inline-block;
    width: 18px;
    color: var(--gold);
}

.skill-balance-list strong {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.profile-skill-frame {
    height: 1450px;
    background: var(--panel2);
}

@media (max-width: 900px) {
    .skill-tree-guide {
        grid-template-columns: 1fr;
    }

    .profile-skill-frame {
        height: 1800px;
    }
}

@media (max-width: 460px) {
    #skillBalance {
        flex-wrap: wrap;
    }

    .skill-balance-chart {
        flex-basis: 100%;
        margin: auto;
    }

    .profile-skill-frame {
        height: 2150px;
    }
}

.theme-toggle {
    white-space: nowrap;
    border-color: var(--line);
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.overview-group {
    min-width: 0;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--gold) 6%, var(--panel2)), var(--panel));
}

.overview-group h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 6px;
    color: var(--text);
    font: 700 15px Georgia, serif;
}

.overview-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--gold2);
    background: color-mix(in srgb, var(--gold) 12%, transparent);
    font: 18px Georgia, serif;
}

.overview-group dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
    margin: 0;
}

.overview-group dl div {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 3px 8px;
    min-width: 0;
    padding: 7px 0;
    border-top: 1px solid var(--line);
}

.overview-group dt {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
}

.overview-stat-icon {
    display: inline-grid;
    flex: none;
    width: 23px;
    height: 23px;
    place-items: center;
    border-radius: 7px;
    background: color-mix(in srgb, var(--gold) 11%, transparent);
    color: var(--gold);
    font: 14px Georgia, serif;
}

.overview-group dd {
    margin: 0;
    color: var(--gold2);
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.boost-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.boost-section + .boost-section { margin-top: 24px; }
.boost-section > h4 { margin: 0 0 10px; color: var(--gold2); font: 700 17px Georgia, serif; }

.boost-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--gold) 7%, var(--panel2)), var(--panel));
}

.boost-icon {
    display: grid;
    flex: none;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--gold2);
    background: color-mix(in srgb, var(--gold) 12%, transparent);
    font: 20px Georgia, serif;
}

.boost-card h4 {
    margin: 0 0 4px;
    color: var(--text);
    font: 700 16px Georgia, serif;
}

.boost-card p,
.boost-empty {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.boost-expiry {
    display: block;
    margin-top: 8px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 720px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .overview-group dl {
        grid-template-columns: 1fr;
    }
}

/* Light theme */
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #e9eff5;
    --panel: #f9fbfe;
    --panel2: #e9f0f7;
    --gold: #755019;
    --gold2: #67430d;
    --text: #24354b;
    --muted: #52677e;
    --line: #b7c7d8;
    --green: #276638;
    --red: #a12e38;
    --shadow: 0 14px 35px #283e5918;
}

[data-theme="light"] body {
    background: radial-gradient(ellipse at 10% 0%, #cbddec, transparent 42%),
        radial-gradient(ellipse at 90% 15%, #f5e8ca, transparent 40%),
        linear-gradient(160deg, #f8fafc, var(--bg));
}

[data-theme="light"] body::before {
    opacity: .09;
    background-image: radial-gradient(#7898b9 0.65px, transparent 0.65px);
}

[data-theme="light"] .panel,
[data-theme="light"] .home-hero,
[data-theme="light"] .profile-hero {
    border-color: var(--line);
    background: linear-gradient(145deg, #fbfdff, #e3ecf5);
}

[data-theme="light"] .home-hero {
    border-color: #a9bfd5;
    background: radial-gradient(ellipse at 80% 45%, #b8d3ec99, transparent 40%),
        linear-gradient(125deg, #f8fafc, #dce8f4);
}

[data-theme="light"] .home-hero > .home-hero-copy > p:not(.status) {
    color: var(--muted);
}

[data-theme="light"] .hero h1,
[data-theme="light"] .home-hero h1 {
    text-shadow: none;
}

[data-theme="light"] .home-hero-highlights {
    color: var(--muted);
}

[data-theme="light"] .home-get-started {
    background: radial-gradient(ellipse at 0% 0%, #c6dcee99, transparent 55%), #eff5fb;
}

[data-theme="light"] .hero-sigil {
    border-color: #b99565;
    background: linear-gradient(145deg, #dceaf5, #abc5dd);
}

[data-theme="light"] .hero-sigil span {
    text-shadow: none;
}

[data-theme="light"] .hero-orbit {
    border-color: #a7784066;
}

[data-theme="light"] .hero-art-caption {
    color: var(--gold);
}

[data-theme="light"] .site-header {
    border-color: #b9956580;
    background: transparent;
}

[data-theme="light"] .account-nav {
    border-color: #b9956540;
}

[data-theme="light"] .site-header .nav-link:hover,
[data-theme="light"] .account-nav .nav-link[aria-current="page"] {
    background: #b995651c;
}

[data-theme="light"] .secondary-btn {
    color: var(--text);
    background: #fffaf8;
    border-color: var(--line);
}

[data-theme="light"] .search,
[data-theme="light"] .profile-name-form input,
[data-theme="light"] .profile-sell-form input {
    color: var(--text);
    background: #fbfcfe;
    border-color: var(--line);
}

[data-theme="light"] .search::placeholder {
    color: #766677;
}

[data-theme="light"] th {
    color: #354d66;
    background: #e3edf6;
}

[data-theme="light"] th,
[data-theme="light"] td,
[data-theme="light"] .toolbar,
[data-theme="light"] .pagination,
[data-theme="light"] .top-player {
    border-color: var(--line);
}

[data-theme="light"] tbody tr:hover,
[data-theme="light"] tbody tr.current-player {
    background: #c9a56c24;
}

[data-theme="light"] .profile-tabs,
[data-theme="light"] .profile-panel .stat,
[data-theme="light"] .profile-inventory-summary p,
[data-theme="light"] .companion-stats div,
[data-theme="light"] .house-stat,
[data-theme="light"] .game-card,
[data-theme="light"] .developer-setting,
[data-theme="light"] .total-bet,
[data-theme="light"] .history-chip {
    color: var(--text);
    border-color: var(--line);
    background: var(--panel2);
}

[data-theme="light"] .profile-tabs,
[data-theme="light"] .profile-panel .stat,
[data-theme="light"] .profile-inventory-summary p,
[data-theme="light"] .companion-stats div,
[data-theme="light"] .house-stat {
    background: #e6eff8;
}

[data-theme="light"] .profile-progress {
    border-color: var(--line);
    background: #e6eff8;
}

[data-theme="light"] .profile-progress-track {
    background: #cbd9e7;
}

[data-theme="light"] .profile-collection-card,
[data-theme="light"] .item-recipe-card {
    background: linear-gradient(145deg, #fffdfa, #e5eef7);
}

[data-theme="light"] .rarity-common { --rarity-color: #514853; }
[data-theme="light"] .rarity-uncommon { --rarity-color: #286d35; }
[data-theme="light"] .rarity-rare { --rarity-color: #235e9d; }
[data-theme="light"] .rarity-epic { --rarity-color: #7342a1; }
[data-theme="light"] .rarity-legendary { --rarity-color: #8a570a; }
[data-theme="light"] .rarity-mythic { --rarity-color: #a03d55; }
[data-theme="light"] .rarity-eternal { --rarity-color: #126a65; }
[data-theme="light"] .rarity-retired { --rarity-color: #695b6b; }

[data-theme="light"] .skill-tree,
[data-theme="light"] .embedded-skill-tree .skill-tree,
[data-theme="light"] .skill-tree-heading,
[data-theme="light"] .skill-zoom-controls,
[data-theme="light"] .embedded-skill-tree .skill-tree-heading,
[data-theme="light"] .embedded-skill-tree .skill-zoom-controls,
[data-theme="light"] .skill-tree-guide,
[data-theme="light"] .skill-details,
[data-theme="light"] .skill-tooltip {
    color: var(--text);
    border-color: var(--line);
    background: var(--panel);
}

[data-theme="light"] .skill-tree-heading p,
[data-theme="light"] .skill-tree-status,
[data-theme="light"] .skill-cost,
[data-theme="light"] .skill-details-hint,
[data-theme="light"] .skill-tree-empty,
[data-theme="light"] .skill-tree-fallback,
[data-theme="light"] .skill-detail-status,
[data-theme="light"] .skill-zoom-controls output {
    color: var(--muted);
}

[data-theme="light"] .skill-tree-viewport,
[data-theme="light"] .embedded-skill-tree .skill-tree-viewport {
    background-color: #ede3ec;
    background-image: radial-gradient(circle, #765c802b 1px, transparent 1px),
        radial-gradient(ellipse at 50% 45%, #fff8f4, #ede3ec 72%);
}

[data-theme="light"] .skill-balance-ring,
[data-theme="light"] .skill-balance-axis {
    stroke: #87698688;
}

[data-theme="light"] .skill-balance-fill {
    fill: #b17e3555;
    stroke: #80520f;
}

[data-theme="light"] .skill-balance-marker {
    fill: #80520f;
}

[data-theme="light"] .profile-skill-frame {
    background: var(--panel);
}

[data-theme="light"] .segmented button {
    color: var(--text);
}

[data-theme="light"] .segmented button[aria-checked="true"] {
    color: #fffaf0;
}

[data-theme="light"] .blackjack-table .plinko-result.win,
[data-theme="light"] .bj-banner.win {
    color: #8fd08f;
}

[data-theme="light"] .blackjack-table .plinko-result.loss,
[data-theme="light"] .bj-banner.loss {
    color: #ef918f;
}

[data-theme="light"] .bj-banner.push {
    color: #ffd986;
}

[data-theme="light"] .bj-total {
    color: #fffaf0;
}

[data-theme="light"] .rules,
[data-theme="light"] .blackjack-controls,
[data-theme="light"] .bills-seat,
[data-theme="light"] .lobby-seat {
    border-color: var(--line);
    background-color: #f5ebef;
}

.market-section {
    padding: clamp(20px, 3vw, 30px);
    margin-bottom: 16px;
}

.market-section h2 {
    margin: 0 0 10px;
    color: var(--gold2);
}

.market-section p,
.market-section li {
    color: var(--muted);
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 12px;
}

.market-card,
.profile-auction-notice {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel2);
    overflow-wrap: anywhere;
}

.market-card.promoted {
    border-color: var(--gold);
    background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 18%, var(--panel2)), var(--panel));
    box-shadow: 0 0 20px color-mix(in srgb, var(--gold) 18%, transparent);
}

.market-promotion {
    color: var(--gold2);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.market-card h3 {
    margin: 8px 0;
}

.market-card p {
    margin: 5px 0;
    font-size: 13px;
}

.market-card strong {
    color: var(--gold2);
}

.market-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.market-form label {
    display: grid;
    flex: 1 1 180px;
    gap: 5px;
    color: var(--muted);
    font-size: 13px;
}

.market-form .search {
    width: 100%;
}

.market-description {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.market-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    color: var(--muted);
}

.bot-shop-card {
    position: relative;
}

.shop-restock-alert {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--gold);
    border-radius: 12px;
    background: var(--panel2);
}

.shop-restock-alert.hidden { display: none; }
.shop-filters { margin: 18px 0; }
.shop-history {
    margin-top: 28px;
    padding: clamp(16px, 2.5vw, 24px);
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel2);
    overflow-wrap: anywhere;
}

.shop-history-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.shop-history-header h3 { margin: 3px 0; color: var(--gold2); }
.shop-history-header p { margin: 0; font-size: 13px; }
.shop-history-emblem { color: var(--gold); font-size: 30px; }
.shop-history-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.shop-purchase { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.shop-purchase-icon { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 10px; color: var(--gold2); background: color-mix(in srgb, var(--gold) 15%, var(--panel)); }
.shop-purchase-main { flex: 1; min-width: 0; }
.shop-purchase-main, .shop-purchase-meta { display: grid; gap: 3px; }
.shop-purchase-main span, .shop-purchase-meta time { color: var(--muted); font-size: 12px; }
.shop-purchase-meta { text-align: right; }
.shop-purchase-meta strong { color: var(--gold2); }
.shop-history-empty { padding: 20px; text-align: center; color: var(--muted); }
@media (max-width: 560px) {
    .shop-purchase { flex-wrap: wrap; }
    .shop-purchase-meta { margin-left: 50px; text-align: left; }
}

.bot-shop-sold-out {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: inherit;
    background: rgb(16 12 22 / 78%);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bot-shop-sold-out span {
    border: 2px solid currentColor;
    border-radius: 6px;
    padding: 8px 14px;
}

.profile-auction-notice {
    margin-top: 16px;
}

.profile-auction-notice h4 {
    color: var(--gold2);
    margin: 0 0 8px;
}

.house-raise {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.house-raise-slider {
    width: min(260px, 100%);
    accent-color: #d4a017;
}

.house-raise-share {
    min-width: 9em;
}

.house-raise-quick {
    display: flex;
    gap: 4px;
}

.battle-panel { padding: 22px; }
.battle-volume {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font: 14px Arial, sans-serif;
}
.battle-volume input { width: 120px; max-width: 100%; accent-color: var(--gold); }
.battle-volume output { min-width: 3em; }
.duel-setup { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.duel-setup[hidden] { display: none; }
.duel-setup h2 { margin: 0 0 8px; }
.duel-controls, .duel-entry { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.duel-controls input { min-width: 0; max-width: 180px; }
.duel-search { position: relative; flex: 1 1 240px; min-width: min(220px, 100%); max-width: 320px; }
.duel-controls .duel-search input { width: 100%; max-width: none; box-sizing: border-box; }
.duel-suggestions:not(:empty) {
    position: absolute;
    z-index: 5;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel2);
    box-shadow: 0 8px 20px #0006;
}
.duel-suggestion {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    padding: 10px 13px;
    border: 0;
    color: var(--text);
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: 14px system-ui, sans-serif;
}
.duel-suggestion:hover, .duel-suggestion:focus-visible { background: color-mix(in srgb, var(--gold) 15%, transparent); }
.duel-suggestion-id { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.duel-suggestions .muted-note { margin: 0; padding: 10px 13px; }
.duel-entry { margin: 8px 0; }
.duel-timer { color: var(--gold2); font: bold 14px Arial, sans-serif; }
.battle-top, .battle-top-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.battle-top { justify-content: space-between; }
.battle-top[hidden] { display: none; }
.battle-top p { color: var(--muted); margin: 8px 0; }
.battle-round { margin: 12px 0; }
.battle-playback { margin: 8px 0; color: var(--gold2); font: bold 14px/1.4 Arial, sans-serif; }
.battle-playback:empty { display: none; }
.battle-result {
    --result-accent: var(--gold);
    max-width: 460px;
    margin: 8px auto;
    padding: 28px 20px;
    border: 1px solid var(--result-accent);
    border-radius: 18px;
    background: radial-gradient(circle at top, color-mix(in srgb, var(--result-accent) 15%, transparent), transparent 70%), var(--panel2);
    text-align: center;
}
.battle-result-loss { --result-accent: var(--red); }
.battle-result-emblem {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    border: 1px solid var(--result-accent);
    border-radius: 50%;
    color: var(--result-accent);
    font-size: 30px;
}
.battle-result h2 { margin: 8px 0; color: var(--result-accent); font-size: 28px; }
.battle-result p { margin: 8px 0; }
.battle-result .btn { margin-top: 12px; }
.battle-board {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(145deg, var(--panel2), var(--panel));
}
.battle-opponent-panel, .battle-player-panel, .battle-switch-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel2);
}
.battle-opponent-panel { grid-column: 1; grid-row: 1; }
.battle-player-panel { grid-column: 2; grid-row: 2; }
.battle-opponent-panel h4, .battle-player-panel h4 { margin: 12px 0 6px; }
.battle-identity { display: flex; align-items: center; gap: 10px; }
.battle-identity h3 { margin: 3px 0 0; overflow-wrap: anywhere; }
.battle-avatar {
    display: grid;
    flex: 0 0 48px;
    place-items: center;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border: 1px solid var(--gold);
    border-radius: 50%;
    background: var(--panel);
    color: var(--gold2);
    font-weight: bold;
    font-size: 20px;
}
.battle-avatar img { width: 100%; height: 100%; object-fit: cover; }
.battle-opponent-roster {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.battle-roster-slot {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel);
    font: 11px/1.2 Arial, sans-serif;
}
.battle-roster-slot.active { border-color: var(--gold); }
.battle-roster-slot.defeated { opacity: 0.6; }
.battle-roster-name { color: var(--text); overflow-wrap: anywhere; }
.battle-roster-hp { color: var(--muted); }
.battle-commands {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel2);
}
.battle-command-prompt h3 { margin: 0 0 8px; white-space: pre-line; overflow-wrap: anywhere; }
.battle-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.battle-buttons .btn { min-width: 0; min-height: 36px; overflow-wrap: anywhere; }
.battle-meter {
    --meter-start: #b57835;
    --meter-end: #ffd986;
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    font: 12px Arial, sans-serif;
    font-variant-numeric: tabular-nums;
}
.battle-meter-hp { --meter-start: #36854e; --meter-end: #8fd08f; }
.battle-meter span { color: var(--text); }
.battle-meter progress {
    appearance: none;
    display: block;
    width: 100%;
    height: 10px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: var(--line);
    color: var(--gold);
}
.battle-meter progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
.battle-meter progress::-webkit-progress-value { background: linear-gradient(90deg, var(--meter-start), var(--meter-end)); border-radius: 999px; }
.battle-meter progress::-moz-progress-bar { background: linear-gradient(90deg, var(--meter-start), var(--meter-end)); border-radius: 999px; }
.battle-action-attack { animation: battle-strike 480ms ease-in-out; }
.battle-action-special { animation: battle-special 480ms ease-in-out; }
.battle-action-defend { animation: battle-defend 480ms ease-in-out; }
.battle-action-rest { animation: battle-rest 480ms ease-in-out; }
.battle-action-switch { animation: battle-switch 480ms ease-in-out; }
.battle-action-hit, .battle-action-failed { animation: battle-hit 480ms ease-in-out; }
@keyframes battle-strike {
    35% { transform: translateY(-5px) scale(1.02); border-color: var(--gold2); }
    65% { transform: translateY(3px); }
}
@keyframes battle-special {
    50% { transform: scale(1.025); border-color: var(--gold2); box-shadow: 0 0 24px #e8b85c77; }
}
@keyframes battle-defend {
    50% { border-color: var(--gold2); box-shadow: inset 0 0 18px #e8b85c55; }
}
@keyframes battle-rest {
    50% { border-color: var(--green); box-shadow: 0 0 20px #8fd08f66; }
}
@keyframes battle-switch {
    45% { opacity: 0.5; transform: translateX(8px); }
}
@keyframes battle-hit {
    25%, 75% { transform: translateX(-4px); border-color: var(--red); }
    50% { transform: translateX(4px); }
}
.battle-switch-dialog {
    width: min(550px, calc(100% - 32px));
    max-height: 85vh;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    color: var(--text);
}
.battle-switch-dialog::backdrop { background: #000a; }
.battle-switch-dialog h2, .battle-switch-card h3, .battle-log h3 { margin: 0 0 8px; }
.battle-switch-list { display: grid; gap: 10px; margin: 16px 0; }
.battle-switch-card p { margin: 7px 0; }
.battle-log { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.battle-log ul { margin: 0; padding-left: 20px; color: var(--muted); }
@media (max-width: 700px) {
    .battle-panel { padding: 16px; }
    .battle-board { grid-template-columns: minmax(0, 1fr); padding: 12px; }
    .battle-opponent-panel, .battle-player-panel, .battle-commands { grid-column: 1; grid-row: auto; }
    .battle-commands { grid-template-columns: minmax(0, 1fr); }
    .battle-meter { grid-template-columns: 120px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .battle-action-attack, .battle-action-special, .battle-action-defend, .battle-action-rest,
    .battle-action-switch, .battle-action-hit, .battle-action-failed { animation: none; }
}

/* Original purple palette */
:root[data-palette="legacy"][data-theme="dark"] {
    --bg: #100d18;
    --panel: #1d1728;
    --panel2: #292034;
    --gold: #d7ad6a;
    --gold2: #f5d69c;
    --text: #f4edf1;
    --muted: #beb1c1;
    --line: #514257;
    --shadow: 0 18px 48px #08061066;
}

:root[data-palette="legacy"][data-theme="dark"] body {
    background: radial-gradient(ellipse at 10% -10%, #59395270, transparent 38%),
        radial-gradient(ellipse at 95% 16%, #45335a54, transparent 34%),
        linear-gradient(160deg, #15101f, var(--bg) 68%);
}

:root[data-palette="legacy"][data-theme="dark"] body::before {
    background-image: radial-gradient(#e4c8ed 0.65px, transparent 0.65px);
}

:root[data-palette="legacy"][data-theme="dark"] .panel {
    border-color: #7d667b59;
    background: linear-gradient(145deg, #292032f2, #1a1524f5);
}

:root[data-palette="legacy"][data-theme="dark"] .home-hero {
    border-color: #bd936b60;
    background: radial-gradient(ellipse at 76% 45%, #9a634e55, transparent 37%),
        radial-gradient(ellipse at 5% 0%, #7d517349, transparent 54%),
        linear-gradient(125deg, #312239, #201829 65%, #211725);
}

:root[data-palette="legacy"][data-theme="dark"] .home-hero > .home-hero-copy > p:not(.status) { color: #d1c3ce; }
:root[data-palette="legacy"][data-theme="dark"] .home-hero-highlights { color: #d6c6d1; }
:root[data-palette="legacy"][data-theme="dark"] .hero-orbit { border-color: #edc89155; }
:root[data-palette="legacy"][data-theme="dark"] .hero-orbit-outer { box-shadow: inset 0 0 0 12px #e6bd8b08, 0 0 60px #dfaa6940; }
:root[data-palette="legacy"][data-theme="dark"] .hero-sigil {
    background: linear-gradient(145deg, #b7856355, #37243b);
    box-shadow: inset 0 0 0 8px #f4d19a0b, 0 14px 40px #0e081a70;
}
:root[data-palette="legacy"][data-theme="dark"] .home-get-started {
    background: radial-gradient(ellipse at 0% 0%, #89634635, transparent 55%), #211a2b;
}
:root[data-palette="legacy"][data-theme="dark"] .profile-hero {
    border-color: #bd936b60;
    background: radial-gradient(ellipse at 10% 0%, #8a5a6870, transparent 48%),
        radial-gradient(ellipse at 100% 100%, #a4782d24, transparent 55%),
        linear-gradient(120deg, #302238, #1b1624);
}
:root[data-palette="legacy"][data-theme="dark"] .profile-tabs { border-color: #7d667b59; background: #1d1728; }
:root[data-palette="legacy"][data-theme="dark"] .profile-progress {
    border-color: #8a674e;
    background: linear-gradient(110deg, #c18b3b26, #171321bd);
}
:root[data-palette="legacy"][data-theme="dark"] .profile-panel .stat,
:root[data-palette="legacy"][data-theme="dark"] .profile-inventory-summary p,
:root[data-palette="legacy"][data-theme="dark"] .companion-stats div,
:root[data-palette="legacy"][data-theme="dark"] .house-stat {
    border-color: #806b8059;
    background: linear-gradient(145deg, #302438, #1c1626);
}
:root[data-palette="legacy"][data-theme="dark"] .profile-progress-track { background: #100e18; }
:root[data-palette="legacy"][data-theme="dark"] .profile-progress-track span { background: linear-gradient(90deg, #b57835, #ffd986); }
:root[data-palette="legacy"] .avatar {
    background: radial-gradient(circle, #ffe09a, #a96d30 62%, #44283b 64%);
    color: #39202a;
}
:root[data-palette="legacy"][data-theme="dark"] .profile-collection-card:not(.companion-equipped):not(.companion-on-team),
:root[data-palette="legacy"][data-theme="dark"] .item-recipe-card {
    background: linear-gradient(135deg, color-mix(in srgb, var(--rarity-color) 9%, var(--panel2)), #17131f);
}
:root[data-palette="legacy"][data-theme="dark"] .search,
:root[data-palette="legacy"][data-theme="dark"] .profile-name-form input,
:root[data-palette="legacy"][data-theme="dark"] .profile-sell-form input {
    border-color: #79688080;
    background: #120f1c;
}
:root[data-palette="legacy"][data-theme="dark"] th { color: #c9b8cb; background: #16121ec9; }
:root[data-palette="legacy"][data-theme="dark"] .skill-tree { background: #1c1726; }
:root[data-palette="legacy"][data-theme="dark"] .skill-tree-heading,
:root[data-palette="legacy"][data-theme="dark"] .skill-zoom-controls { background: #241c30; }
:root[data-palette="legacy"][data-theme="dark"] .skill-tree-heading p,
:root[data-palette="legacy"][data-theme="dark"] .skill-tree-status,
:root[data-palette="legacy"][data-theme="dark"] .skill-cost { color: #c7b9cc; }
:root[data-palette="legacy"][data-theme="dark"] .skill-tree-viewport {
    background-color: #171320;
    background-image: radial-gradient(circle, #c0a3ce25 1px, transparent 1px),
        radial-gradient(ellipse at 50% 45%, #34243e, #171320 72%);
}
:root[data-palette="legacy"][data-theme="dark"] .skill-details,
:root[data-palette="legacy"][data-theme="dark"] .skill-tooltip { background: #251d30; }
:root[data-palette="legacy"][data-theme="dark"] .skill-tree-guide,
:root[data-palette="legacy"][data-theme="dark"] .profile-skill-frame { background: #211a2d; }
:root[data-palette="legacy"][data-theme="dark"] .game-card {
    border-color: #7d667b59;
    background: linear-gradient(145deg, #302438, #1c1726);
}
:root[data-palette="legacy"][data-theme="dark"] .game-card:hover,
:root[data-palette="legacy"][data-theme="dark"] .game-card[aria-selected="true"] {
    border-color: var(--gold);
    background: linear-gradient(145deg, #493344, #241c2f);
}

:root[data-palette="legacy"][data-theme="light"] {
    --bg: #f3eced;
    --panel: #fffaf8;
    --panel2: #f5ebef;
    --gold: #80520f;
    --gold2: #704300;
    --text: #302333;
    --muted: #68576b;
    --line: #d3bec9;
    --shadow: 0 14px 35px #49304618;
}
:root[data-palette="legacy"][data-theme="light"] body {
    background: radial-gradient(ellipse at 10% 0%, #e8d5e4, transparent 42%),
        radial-gradient(ellipse at 90% 15%, #f5e6ca, transparent 40%),
        linear-gradient(160deg, #fcf7f6, var(--bg));
}
:root[data-palette="legacy"][data-theme="light"] body::before { background-image: radial-gradient(#735679 0.65px, transparent 0.65px); }
:root[data-palette="legacy"][data-theme="light"] .panel,
:root[data-palette="legacy"][data-theme="light"] .profile-hero { background: linear-gradient(145deg, #fffdfa, #f3e7ed); }
:root[data-palette="legacy"][data-theme="light"] .home-hero {
    border-color: var(--line);
    background: radial-gradient(ellipse at 80% 45%, #e8cfaa80, transparent 40%),
        linear-gradient(125deg, #fffdfa, #f1e4ed);
}
:root[data-palette="legacy"][data-theme="light"] .home-get-started {
    background: radial-gradient(ellipse at 0% 0%, #e8cfaa80, transparent 55%), #fffaf8;
}
:root[data-palette="legacy"][data-theme="light"] .hero-sigil { background: linear-gradient(145deg, #f7e6c6, #e4d1e4); }
:root[data-palette="legacy"][data-theme="light"] .profile-tabs,
:root[data-palette="legacy"][data-theme="light"] .profile-panel .stat,
:root[data-palette="legacy"][data-theme="light"] .profile-inventory-summary p,
:root[data-palette="legacy"][data-theme="light"] .companion-stats div,
:root[data-palette="legacy"][data-theme="light"] .house-stat { background: var(--panel2); }
:root[data-palette="legacy"][data-theme="light"] .profile-progress { background: #fffaf8; }
:root[data-palette="legacy"][data-theme="light"] .profile-progress-track { background: #dfcbd5; }
:root[data-palette="legacy"][data-theme="light"] .profile-progress-track span { background: linear-gradient(90deg, #b57835, #ffd986); }
:root[data-palette="legacy"][data-theme="light"] .profile-collection-card:not(.companion-equipped):not(.companion-on-team),
:root[data-palette="legacy"][data-theme="light"] .item-recipe-card {
    background: linear-gradient(135deg, color-mix(in srgb, var(--rarity-color) 9%, var(--panel2)), #fffaf8);
}
:root[data-palette="legacy"][data-theme="light"] .search,
:root[data-palette="legacy"][data-theme="light"] .profile-name-form input,
:root[data-palette="legacy"][data-theme="light"] .profile-sell-form input { background: #fffdfb; }
:root[data-palette="legacy"][data-theme="light"] th { color: var(--muted); background: #efe3e9; }
