/* Illustrated account lobby; game layouts remain separately scoped. */
.cabinet { color-scheme: dark; }
.cabinet:not(.sheet-open) {
  --bg: #101822; --panel: #1a2b34; --border: #3b505a; --text: #f8f1e5;
  --muted: #b5c4cc; --accent: #f2c77b; --accent-text: #211c15;
  --teal: #73dfae; --danger: #ff8d8d; --json-bg: #203638; --json-text: #a0efcc;
  background: var(--bg);
}
.cabinet :is(a, button, summary) { -webkit-tap-highlight-color: transparent; }
.cabinet .skip-link { position: fixed; top: -100px; left: 16px; z-index: 50; padding: 12px 20px; background: var(--accent); color: var(--accent-text); border-radius: 8px; }
.cabinet .skip-link:focus { top: 12px; }
.cabinet-header { max-width: 1440px; margin: auto; padding: 20px 48px; background: transparent; border-bottom: 1px solid #f2c77b26; }
.cabinet-header .logo { display: flex; align-items: center; gap: 12px; font: 500 30px/1.1 Georgia, serif; letter-spacing: 0; }
.brand-mark { width: 42px; height: 46px; color: #f2c77b; flex: none; }
.brand-caption { display: block; margin-top: 5px; font: 9px/1.4 system-ui, sans-serif; color: var(--muted); }
.cabinet-nav { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.cabinet-nav .nav-link { position: relative; display: inline-flex; min-height: 44px; align-items: center; font-size: 13px; font-weight: 500; }
.cabinet-nav .nav-link:hover { color: #fff1cd; }
.cabinet-nav [aria-current="page"] { color: #f2c77b; }
.cabinet-nav [aria-current="page"]::after { content: ""; position: absolute; bottom: 0; inset-inline: 0; height: 2px; background: #f2c77b; }
.cabinet-header .account { margin-left: 24px; }
.cabinet-header .avatar { background: #23483f; color: #a0efcc; border: 1px solid #55856c; }
.cabinet-header #logout { font-size: 13px; }
.cabinet:not(.sheet-open) main { max-width: 1320px; padding: 28px 40px 0; }
.cabinet main:focus { outline: none; }
.cabinet .button, .cabinet .icon-button { transition: background .18s, border-color .18s, box-shadow .18s, transform .18s; }
.cabinet .button:hover:not(:disabled), .cabinet .icon-button:hover:not(:disabled) { background: #f2c77b14; border-color: #d0b279; }
.cabinet .button:active:not(:disabled), .cabinet .icon-button:active:not(:disabled) { transform: translateY(1px); }
.cabinet .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); box-shadow: 0 4px 24px #efb95822; }
.cabinet .button.primary:hover { background: #ffdb99; box-shadow: 0 6px 28px #efb95833; }
.cabinet .button.danger:hover { background: #ffb1aa; }
.cabinet .error { padding: 14px 18px; background: #44272f; border: 1px solid #a0525b; border-radius: 10px; }
.account-loading { padding: 30px 0; text-align: center; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; color: var(--accent); font-size: 11px; font-weight: 650; letter-spacing: 0; text-transform: uppercase; }
.eyebrow > span { width: 20px; height: 2px; background: currentColor; }

/* A dark scrim keeps the image from competing with the title. */
.welcome { overflow: hidden; border: 1px solid #c7b58155; border-radius: 18px; background: #14232b; box-shadow: 0 20px 60px #0003; }
.welcome-stage { position: relative; isolation: isolate; min-height: 494px; display: flex; align-items: center; }
.adventure-art { position: absolute; z-index: -1; inset: 0 0 0 22%; overflow: hidden; }
.adventure-art img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 70% 48%; }
.adventure-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #14232b, #14232bf5 8%, #14232bc4 27%, #14232b18 64%), linear-gradient(0deg, #14232b88, transparent 35%); }
.welcome-content { position: relative; z-index: 1; max-width: 660px; padding: 48px 44px; }
.welcome .eyebrow { color: #b5f3d4; }
.welcome h1 { margin: 0 0 24px; font: 500 64px/1.08 Georgia, serif; letter-spacing: 0; text-wrap: balance; }
.welcome h1 em { color: #ffd58d; font-weight: 400; }
.welcome-lede { max-width: 470px; margin-bottom: 28px; color: #d0dde1; font-size: 15px; line-height: 1.8; }
.sign-in { min-height: 54px; padding: 14px 20px; border-radius: 9px; font-size: 14px; font-weight: 650; }
.sign-in > .icon { width: 18px; height: 18px; margin-left: 16px; }
.sign-in > svg:first-child { background: #fff; padding: 2px; border-radius: 50%; width: 23px; height: 23px; }
.sign-in-note { max-width: 365px; margin: 14px 0 0; font-size: 11px; line-height: 1.7; color: #bfccd0; }
.welcome-features { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; margin: 0; padding: 24px 32px; border-top: 1px solid #c7b58133; background: #172832; }
.welcome-features li { display: flex; align-items: center; gap: 14px; padding: 0 24px; border-right: 1px solid #b5c4cc22; }
.welcome-features li:first-child { padding-left: 0; }
.welcome-features li:last-child { border: 0; padding-right: 0; }
.welcome-features .icon { box-sizing: content-box; width: 25px; height: 25px; padding: 11px; border-radius: 12px; background: #235044; color: #8ef0bf; }
.welcome-features li:nth-child(2) .icon { color: #d3b9ff; background: #3a2e52; }
.welcome-features li:nth-child(3) .icon { color: #ffd58d; background: #4a3e2e; }
.welcome-features strong { display: block; font-size: 13px; font-weight: 600; }
.welcome-features span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.6; }

/* Every destination is one illustrated, keyboard-accessible link. */
.worlds { margin-top: 38px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font: 400 28px/1.3 Georgia, serif; letter-spacing: 0; }
.section-heading > span { color: var(--muted); font-size: 12px; }
.world-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.world-card { position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: 300px; gap: 16px; padding: 28px; color: #fff8ed; text-decoration: none; border: 1px solid #9f906d88; border-radius: 14px; background: #1c3038; transition: border-color .2s, box-shadow .2s, transform .2s; }
.world-art { position: absolute; z-index: -2; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 13px; }
.world-card::before { content: ""; position: absolute; z-index: -1; inset: 0; border-radius: 13px; background: linear-gradient(0deg, #101b29fa, #101b29a3 34%, #101b2900 74%); }
.lands-world::before { background: linear-gradient(0deg, #0c2728fa, #0c2728a3 34%, #0c272800 74%); }
.world-card:hover { border-color: #ffd58d; box-shadow: 0 10px 30px #0005; transform: translateY(-3px); }
.world-card:active { transform: translateY(0); }
.world-symbol { position: absolute; top: 20px; left: 22px; display: grid; place-items: center; width: 42px; height: 46px; padding: 4px; border: 1px solid #ffdf9c88; border-radius: 8px; background: #14232bd9; color: #ffdc99; font: 38px/1 Georgia, serif; }
.lands-world .world-symbol { color: #aff8da; border-color: #8ee4bb88; }
.world-card > div { min-width: 0; padding-right: 38px; }
.world-kicker { font-size: 10px; color: #e7d5b3; text-transform: uppercase; }
.lands-world .world-kicker { color: #b9efd8; }
.world-card h3 { margin: 6px 0 8px; font: 400 33px/1.15 Georgia, serif; }
.world-card p { margin: 0; max-width: 350px; font-size: 12px; line-height: 1.7; color: #dce3e7; }
.world-arrow { position: absolute; right: 24px; bottom: 28px; box-sizing: content-box; width: 20px; height: 20px; padding: 10px; border-radius: 50%; border: 1px solid #ffdc9966; background: #f2c77b17; color: #ffdc99; }
.lands-world .world-arrow { color: #aff8da; border-color: #8ee4bb66; background: #8ee4bb17; }
.android-banner { display: flex; align-items: center; gap: 22px; margin-top: 26px; padding: 26px 28px; border: 1px solid #8973b066; border-radius: 14px; background: linear-gradient(110deg, #29263e, #192d37); }
.android-symbol { box-sizing: content-box; width: 30px; height: 40px; padding: 14px 19px; flex: none; color: #d6bbff; border: 1px solid #a38cc366; border-radius: 16px; background: #8e6abb16; }
.android-banner .eyebrow { font-size: 10px; margin-bottom: 6px; color: #d6bbff; }
.android-banner h2 { font: 400 24px/1.3 Georgia, serif; margin: 0 0 6px; }
.android-banner p:last-child { margin: 0; font-size: 12px; line-height: 1.7; }
.android-banner .button { flex: none; margin-left: auto; font-size: 12px; padding: 11px 16px; border-color: #9f8bbd99; color: #eadcff; }
.android-banner .button .icon { width: 18px; }
.cabinet-footer { display: flex; justify-content: space-between; gap: 16px; padding: 28px 0; font-size: 11px; color: var(--muted); }
.cabinet-footer span[aria-hidden] { color: var(--accent); padding: 0 6px; }

/* Real statistics stay legible without opening a hero. */
.cabinet #member { padding-top: 0; }
.cabinet .characters-head { position: relative; margin-bottom: 24px; padding: 32px; gap: 20px; min-height: 206px; border: 1px solid #a2946b66; border-radius: 14px; background: linear-gradient(90deg, #192c34, #192c34f0 36%, #192c3455), url('/img/adventure/adventure-party-v1.webp') 75% 42% / cover; }
.cabinet .characters-head .eyebrow { margin-bottom: 12px; color: #a5ebc8; }
.cabinet .page-title { font: 400 42px/1.2 Georgia, serif; letter-spacing: 0; }
.cabinet .page-count { display: inline-block; font: 12px/1.5 system-ui, sans-serif; vertical-align: middle; padding: 4px 10px; border: 1px solid #8fa7a877; border-radius: 20px; color: #e1eae8; background: #10262b; }
.member-lede { font-size: 14px; margin: 12px 0 0; color: #d4dfe1; }
.cabinet .toolbar { align-self: flex-end; }
.cabinet .json-button { font: 600 12px/1.5 system-ui, sans-serif; border: 1px solid #84c7b288; padding: 0 14px; min-height: 44px; background: #1c3a38; color: #aff0cf; }
.cabinet .json-button .icon { width: 18px; }
.cabinet #view-toggle { background: #192c34; }
.cabinet .character-grid { gap: 20px; }
.cabinet .character-card { padding: 22px; min-height: 220px; border-radius: 14px; border-color: #50837688; border-top: 2px solid #77cfa9; background: linear-gradient(135deg, #203b39, #192c34 75%); box-shadow: 0 8px 24px #0002; transition: border-color .2s, box-shadow .2s; }
.cabinet .character-card:nth-child(3n + 2) { border-top-color: #c8a0f4; background: linear-gradient(135deg, #342d48, #1b2b36 75%); }
.cabinet .character-card:nth-child(3n) { border-top-color: #75c9ec; background: linear-gradient(135deg, #234156, #192c34 75%); }
.cabinet .character-card:hover { border-color: #f2c77b; box-shadow: 0 8px 24px #0004; }
.cabinet .character-body { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 18px 16px; padding-right: 0; align-items: center; }
.cabinet .portrait { width: 68px; height: 82px; border: 1px solid #c7b37688; border-radius: 28px 28px 10px 10px; background: linear-gradient(150deg, #526852, #243a39); color: #ffe1a9; font: 36px/1 Georgia, serif; }
.cabinet .character-name { padding-right: 14px; font: 400 26px/1.15 Georgia, serif; }
.cabinet .character-subtitle { margin: 8px 0 0; font-size: 12px; line-height: 1.6; }
.character-stats { grid-column: 1 / -1; display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 10px; padding-top: 15px; border-top: 1px solid #a9b5af22; }
.card-stat { min-width: 0; }
.card-stat-label { display: block; color: #bac9cf; font-size: 10px; margin-bottom: 5px; }
.cabinet .character-hp, .card-stat-value { display: flex; align-items: center; gap: 6px; margin: 0; color: #92edbd; font-size: 17px; line-height: 1.3; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card-stat .icon { width: 17px; height: 17px; }
.defense-stat .card-stat-value { color: #8edcfa; }
.initiative-stat .card-stat-value { color: #f8d492; }
.character-vitality { display: block; appearance: none; border: 0; width: 100%; height: 4px; max-width: 100px; margin-top: 8px; background: #ffffff18; border-radius: 3px; }
.character-vitality::-webkit-meter-bar { height: 4px; background: #ffffff18; border: 0; border-radius: 3px; }
.character-vitality::-webkit-meter-optimum-value { background: #73dfae; border-radius: 3px; }
.character-vitality::-webkit-meter-suboptimum-value { background: #f2c77b; border-radius: 3px; }
.character-vitality::-webkit-meter-even-less-good-value { background: #ff8d8d; border-radius: 3px; }
.character-vitality::-moz-meter-bar { background: #73dfae; border-radius: 3px; }
.cabinet .card-menu > summary { width: 44px; height: 44px; color: #c7d1d6; }
.cabinet .menu-items { background: #1c2e38; border-color: #60747a; box-shadow: 0 12px 35px #0008; }
.cabinet .menu-item { min-height: 44px; }
.cabinet .add-card { display: flex; flex-direction: column; justify-content: center; gap: 12px; min-height: 220px; height: 100%; padding: 24px; border-radius: 14px; background: #d2ad6610; border-color: #c7a25b88; font: inherit; transition: background .2s, border-color .2s; }
.cabinet .add-card:hover { background: #d2ad661c; border-color: #f2c77b; }
.cabinet .add-card:active { background: #d2ad6628; }
.cabinet .add-card .icon { box-sizing: content-box; width: 28px; height: 28px; padding: 12px; border: 1px solid #c7a25b66; border-radius: 50%; background: #d2ad6612; }
.cabinet .add-card > span { color: #ffe0a6; font-size: 14px; font-weight: 600; }
.cabinet .add-card small { color: var(--muted); font-size: 11px; }
.cabinet .character-grid.is-list .character-card { min-height: 100px; padding: 16px 22px; }
.cabinet .character-grid.is-list .character-body { grid-template-columns: 48px minmax(0, 1fr) 300px; gap: 18px; padding-right: 32px; }
.cabinet .character-grid.is-list .character-stats { grid-column: auto; border-top: 0; border-left: 1px solid #a9b5af22; padding: 0 0 0 20px; }
.cabinet .character-grid.is-list .portrait { width: 48px; height: 58px; font-size: 24px; border-radius: 20px 20px 6px 6px; }
.cabinet .character-grid.is-list .character-name { font-size: 23px; }
.cabinet .character-grid.is-list .character-subtitle { margin-top: 4px; }
.cabinet .character-grid.is-list .add-card { flex-direction: row; min-height: 76px; padding: 12px; }
.cabinet .character-grid.is-list .add-card .icon { width: 20px; height: 20px; padding: 6px; }
.cabinet .character-grid.is-list .add-card small { display: none; }
.cabinet .empty-state { padding: 8px 18px; }
.cabinet .empty-state p { font-size: 13px; }
.cabinet .dialog { background: #1a2b34; border-color: #8a7d5a; }
.cabinet.sheet-open :is(.worlds, .cabinet-footer) { display: none; }

@media (max-width: 1100px) {
  .cabinet-header { padding-inline: 28px; }
  .cabinet:not(.sheet-open) main { padding-inline: 28px; }
  .welcome-content { padding: 40px 32px; max-width: 600px; }
  .welcome h1 { font-size: 54px; }
  .welcome-features { padding: 22px; }
  .welcome-features li { padding-inline: 16px; gap: 10px; }
  .welcome-features .icon { padding: 9px; width: 22px; height: 22px; }
  .world-card { min-height: 285px; padding: 24px; }
  .world-card h3 { font-size: 30px; }
  .cabinet .characters-head { padding: 28px; }
}
@media (max-width: 699px) {
  .cabinet-header { flex-wrap: wrap; padding: 16px 20px 0; gap: 14px; }
  .cabinet-header .logo { font-size: 27px; }
  .brand-mark { width: 34px; height: 38px; }
  .brand-caption { font-size: 8px; }
  .cabinet-nav { order: 3; width: 100%; margin: 0; justify-content: space-between; gap: 10px; border-top: 1px solid #f2c77b22; }
  .cabinet-nav .nav-link { min-height: 46px; font-size: 11px; }
  .cabinet-header .account { margin-left: auto; gap: 8px; }
  .cabinet-header .avatar { width: 30px; height: 30px; font-size: 12px; }
  .cabinet-header #logout { padding: 6px 10px; font-size: 11px; }
  .cabinet:not(.sheet-open) main { padding: 18px 16px 0; }
  .welcome { border-radius: 13px; }
  .welcome-stage { display: flex; flex-direction: column; align-items: stretch; min-height: 0; }
  .adventure-art { position: relative; z-index: 0; inset: auto; height: 218px; order: -1; }
  .adventure-art img { object-position: 65% 47%; }
  .adventure-art::after { background: linear-gradient(0deg, #14232b, #14232b00 48%); }
  .welcome-content { padding: 0 22px 26px; margin-top: -9px; }
  .eyebrow { font-size: 10px; margin-bottom: 15px; }
  .welcome h1 { font-size: 38px; margin-bottom: 18px; line-height: 1.12; }
  .welcome-lede { font-size: 13px; margin-bottom: 20px; line-height: 1.75; }
  .desktop-break { display: none; }
  .sign-in { width: 100%; justify-content: center; padding-inline: 12px; font-size: 13px; }
  .sign-in > .icon { margin-left: 6px; }
  .sign-in-note { text-align: center; margin-inline: auto; font-size: 10px; }
  .welcome-features { grid-template-columns: 1fr; padding: 22px; gap: 20px; }
  .welcome-features li, .welcome-features li:first-child, .welcome-features li:last-child { padding: 0; border: 0; gap: 14px; }
  .welcome-features strong { font-size: 13px; }
  .welcome-features span { font-size: 11px; }
  .worlds { margin-top: 28px; }
  .section-heading { margin-bottom: 16px; }
  .section-heading h2 { font-size: 25px; }
  .section-heading > span { display: none; }
  .world-grid { grid-template-columns: 1fr; gap: 16px; }
  .world-card { min-height: 280px; padding: 22px; }
  .world-card h3 { font-size: 29px; }
  .world-card p { font-size: 12px; }
  .world-arrow { right: 18px; bottom: 22px; width: 18px; height: 18px; padding: 8px; }
  .world-symbol { top: 18px; left: 20px; }
  .android-banner { margin-top: 22px; padding: 24px 22px; flex-wrap: wrap; gap: 18px; }
  .android-symbol { display: none; }
  .android-banner h2 { font-size: 25px; }
  .android-banner .button { margin: 0; justify-content: center; width: 100%; }
  .android-banner p:last-child { font-size: 12px; }
  .cabinet-footer { flex-direction: column; gap: 9px; padding-block: 24px; font-size: 10px; }
  .cabinet .characters-head { padding: 26px 22px; min-height: 222px; margin-bottom: 18px; background-position: 70% 40%; }
  .cabinet .page-title { font-size: 33px; }
  .cabinet .page-count { padding: 2px 8px; font-size: 10px; }
  .member-lede { font-size: 13px; }
  .cabinet .toolbar { width: 100%; }
  .cabinet .json-button { flex: 1; justify-content: center; }
  .cabinet .character-grid { gap: 14px; }
  .cabinet .character-card { min-height: 210px; padding: 20px; }
  .cabinet .character-name { font-size: 25px; }
  .cabinet .character-subtitle { font-size: 11px; }
  .cabinet .character-body { grid-template-columns: 58px minmax(0, 1fr); gap: 16px 14px; }
  .cabinet .portrait { width: 58px; height: 74px; font-size: 32px; }
  .cabinet .character-hp, .card-stat-value { font-size: 16px; }
  .cabinet .add-card { min-height: 172px; }
  .cabinet .character-grid.is-list .character-card { padding: 16px; }
  .cabinet .character-grid.is-list .character-body { grid-template-columns: 44px minmax(0, 1fr); padding: 0; gap: 12px; }
  .cabinet .character-grid.is-list .character-stats { grid-column: 1 / -1; border-left: 0; border-top: 1px solid #a9b5af22; padding: 12px 0 0; }
  .cabinet .character-grid.is-list .portrait { width: 44px; height: 54px; }
  .cabinet .character-grid.is-list .character-name { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .cabinet *, .cabinet *::before, .cabinet *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .character-vitality { appearance: auto; }
  .adventure-art { display: none; }
  .world-card { border: 2px solid LinkText; }
  .world-card::before { background: Canvas; }
}
