@font-face {
  font-family: Skip Tektur;
  src: url("/assets/skip-tektur.woff2") format("woff2");
  font-display: swap;
  font-weight: 400 900;
}
:root {
  color-scheme: dark;
  --bg: #0c131d; --nav: #101923; --surface: #141f2b; --raised: #1b2a38;
  --line: #304558; --ink: #edf5fd; --dim: #adbfce; --ice: #a7e8ee;
  --dark-ice: #143143; --warning: #ffd19d; --error: #ffafb0; --success: #a9e3be;
  --display: "Skip Tektur", "Segoe UI", sans-serif; --body: "Segoe UI", system-ui, sans-serif;
  --numbers: Consolas, monospace;
  scrollbar-color: #506679 var(--bg);
}
[data-theme="ember"] { --ice: #ffcfad; --dark-ice: #46281b; --line: #594334; --surface: #271f22; }
* { box-sizing: border-box; }
html { scroll-padding-block-start: 16px; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 15px/1.48 var(--body); }
[hidden] { display: none !important; }
a { color: var(--ice); text-decoration-thickness: 1px; text-underline-offset: .22em; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:not(:disabled) { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }
::selection { color: var(--bg); background: var(--ice); }
.shell { width: min(1280px, calc(100% - 72px)); margin-inline: auto; }
.skip-link { position: absolute; z-index: 4; left: 10px; top: 10px; padding: 8px; background: var(--surface); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.top { background: var(--nav); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 12px; align-items: center; white-space: nowrap; color: var(--ink); text-decoration: none; font: 730 clamp(19px, 3vw, 26px)/1 var(--display); letter-spacing: -.025em; }
#account { display: flex; gap: 10px; align-items: center; min-width: 0; }
.account-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav { display: flex; flex-wrap: wrap; gap: 3px 4px; padding-block: 4px; }
nav a { display: flex; align-items: center; min-height: 39px; padding: 0 10px; color: var(--dim); text-decoration: none; font: 560 14px var(--display); white-space: nowrap; }
nav a:first-child { padding-left: 0; }
nav a:hover, nav a[aria-current] { color: var(--ice); }
nav a[aria-current] { text-decoration: underline; text-underline-offset: 7px; text-decoration-thickness: 2px; }
.resources { display: flex; align-items: center; gap: 17px; color: var(--dim); font-size: 13px; white-space: nowrap; }
.resources b, .numeric { font-family: var(--numbers); font-variant-numeric: tabular-nums; color: var(--ink); }
.currency { color: var(--ice); }
.currency.lm { color: var(--warning); }
main.shell { min-height: 62vh; padding-block: clamp(24px, 5vw, 56px) 36px; }
h1, h2, h3 { margin: 0; font-family: var(--display); line-height: 1.12; font-weight: 650; letter-spacing: -.025em; overflow-wrap: anywhere; }
h1 { font-size: clamp(33px, 6vw, 70px); }
h2 { font-size: clamp(23px, 3.3vw, 37px); }
h3 { font-size: clamp(17px, 2vw, 23px); }
p { margin: 0 0 13px; }
p:last-child { margin-bottom: 0; }
.muted, small { color: var(--dim); }
.lede { max-width: 70ch; margin-top: 12px; color: var(--dim); }
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: clamp(32px, 5.2vw, 54px); }
.action, .quiet, .link-button { display: inline-flex; justify-content: center; gap: 7px; align-items: center; min-height: 41px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 5px; background: var(--raised); color: var(--ink); font-weight: 650; text-decoration: none; }
.quiet { background: transparent; }
.action { background: var(--ice); border-color: var(--ice); color: #0c1e28; }
.action:hover:not(:disabled) { background-color: #d7f8ff; }
.quiet:hover:not(:disabled) { border-color: var(--ice); background-color: var(--surface); }
button:disabled { opacity: .48; }
.link-button { min-height: 37px; padding-inline: 5px; color: var(--ice); background: transparent; border: 0; text-decoration: underline; text-underline-offset: .22em; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.danger { color: var(--error); }
.notice { padding: 13px 15px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--dim); overflow-wrap: anywhere; }
.feedback { color: var(--error); margin: 12px 0 0; overflow-wrap: anywhere; }
.notification { position: fixed; z-index: 5; bottom: 14px; left: 50%; width: min(480px, calc(100% - 26px)); transform: translateX(-50%); padding: 12px 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--raised); color: var(--ink); overflow-wrap: anywhere; }
.notification.error { color: var(--error); }
.login-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; margin-top: 22px; }
.login-layout section { padding: 19px; background: var(--surface); border-radius: 9px; }
.login-layout h2 { margin-bottom: 14px; }
.login-layout form { max-width: 490px; }
.form { display: grid; gap: 13px; }
.form .actions { margin-top: 4px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px,100%),1fr)); gap: 10px 12px; }
label { min-width: 0; display: grid; align-content: start; gap: 5px; color: var(--dim); font-size: 13px; }
input, select, textarea { width: 100%; min-width: 0; min-height: 40px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); color: var(--ink); caret-color: var(--ice); }
input[type=checkbox], input[type=radio] { width: auto; min-height: auto; accent-color: var(--ice); }
input[type=file] { min-height: 43px; padding: 6px; }
input::file-selector-button { background: var(--raised); color: var(--ink); border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; margin-right: 7px; }
input::placeholder, textarea::placeholder { color: var(--dim); opacity: .85; }
textarea { min-height: 86px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.block { margin-top: 25px; padding-top: 19px; border-top: 1px solid var(--line); }
.block h2 { margin-bottom: 13px; }
.filters { margin-bottom: 18px; }
.card-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; }
.card-grid.compact { grid-template-columns: repeat(auto-fill,minmax(min(140px,100%),1fr)); }
.card-tile { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); padding: 7px; }
.card-tile:hover, .card-tile:focus-within { border-color: var(--ice); }
.card-view { display: block; width: 100%; padding: 0; border: 0; text-align: left; background: none; }
.card-face { position: relative; display: block; isolation: isolate; }
.card-face img.art { display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: 5px; object-fit: cover; background: var(--dark-ice); }
.card-face img.frame-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.card-rarity { color: var(--rarity, var(--rarity-0,var(--dim))); }
[data-rarity="1"] { --rarity: var(--rarity-1, #a3d8b8); }
[data-rarity="2"] { --rarity: var(--rarity-2, #a3cbff); }
[data-rarity="3"] { --rarity: var(--rarity-3, #f7c37a); }
[data-rarity="4"] { --rarity: var(--rarity-4, #e5b4ff); }
[data-rarity="5"] { --rarity: var(--rarity-5, #ffb1ab); }
[data-rarity="6"] { --rarity: var(--rarity-6, #96ecf1); }
[data-rarity="7"] { --rarity: var(--rarity-7, #fff1b1); }
.frame-line { color: var(--dim); font-size: 11px; margin-top: 5px; overflow-wrap: anywhere; }
.card-tile[data-choice="keep"] { border-color: var(--success); background: #153029; }
.card-tile[data-choice="salvage"] { border-color: var(--warning); background: #332620; }
.card-picks { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 8px; }
.card-picks button { min-height: 36px; padding: 4px 6px; font-size: 12px; flex: 1; }
.card-picks button[aria-pressed=true] { border-color: var(--ice); color: var(--ice); }
.pack-section { margin: 16px 0 27px; padding: clamp(10px, 2vw, 19px); border: 1px solid var(--line); border-radius: 13px; background: var(--nav); }
.pack-head { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: start; margin-bottom: 15px; }
.pack-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding-top: 13px; margin-top: 13px; border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }

.split { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; align-items: start; }
.split > section, .panel { padding: 16px; background: var(--surface); border-radius: 10px; min-width: 0; }
.split > section h2 { margin-bottom: 12px; font-size: clamp(20px,3vw,26px); }
.list, .stack { display: grid; gap: 9px; }
.row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 15px; padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.shop-row, .lot-row { display: grid; grid-template-columns: minmax(145px, .85fr) minmax(0, 2fr) auto; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); padding-block: 12px; }
.lot-row { grid-template-columns: 105px minmax(0,1fr) minmax(0, 1fr); }
.lot-row h3 { margin-bottom: 5px; }
.lot-row .actions { justify-self: end; }
.shop-row small, .lot-row small { display: block; }
.metrics { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 10px 0; margin: 10px 0; border-block: 1px solid var(--line); }
.metrics div { min-width: 75px; }
.metrics dt { color: var(--dim); font-size: 12px; }
.metrics dd { margin: 2px 0 0; color: var(--ink); font: 620 16px var(--numbers); }
.table-scroll { overflow: auto; }
.table-scroll caption { padding: 8px; text-align: left; color: var(--dim); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 9px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--dim); font-weight: 650; }
td { overflow-wrap: anywhere; }
.profile-top { display: flex; align-items: center; gap: 16px; }
.avatar { display: grid; place-items: center; width: 68px; aspect-ratio: 1; border-radius: 12px; object-fit: cover; background: var(--dark-ice); color: var(--ice); font: 700 29px var(--display); }
details summary { cursor: pointer; color: var(--ice); padding: 9px 0; }
details[open] > summary { margin-bottom: 10px; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; }
.admin-tabs [aria-pressed=true] { border-color: var(--ice); color: var(--ice); }
.admin-preview { width: min(100%, 230px); margin-top: 10px; }
.editor-code { min-height: 310px; font: 13px/1.52 var(--numbers); }
.footer { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding-block: 10px 18px; color: var(--dim); border-top: 1px solid var(--line); }
dialog { width: min(650px,calc(100% - 24px)); max-height: calc(100dvh - 26px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
dialog.large { width: min(980px,calc(100% - 20px)); }
dialog::backdrop { background: #050a12d9; }
.modal-shell { position: relative; padding: 21px; }
.modal-shell h2 { margin: 0 38px 13px 0; }
.close { top: 9px; right: 9px; position: absolute; width: 43px; height: 43px; border: 1px solid var(--line); border-radius: 6px; background: var(--nav); }
.close::before, .close::after { content: ""; position: absolute; top: 20px; left: 12px; width: 17px; height: 2px; background: currentColor; transform: rotate(45deg); }
.close::after { transform: rotate(-45deg); }
.close:hover { color: var(--ice); }
.detail-card { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); align-items: start; gap: 15px; }
.detail-card .card-face img.art { aspect-ratio: 1; }
.detail-card p { margin-bottom: 9px; }

@media (max-width: 1000px) {
  .resources { min-height: 39px; border-top: 1px solid var(--line); }
  .card-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .shell { width: calc(100% - 28px); }
  .card-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .shop-row { grid-template-columns: 110px minmax(0,1fr); }
  .shop-row .actions { grid-column: 2; }
  .lot-row { grid-template-columns: 90px minmax(0,1fr); }
  .lot-row .actions { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 510px) {
  .shell { width: calc(100% - 22px); }
  .brand { gap: 6px; }
  .account-name { max-width: 75px; }
  #account { gap: 5px; }
  nav { display: flex; flex-wrap: nowrap; padding-block: 5px; overflow: auto; scrollbar-width: thin; }
  nav a { min-height: 43px; padding-inline: 7px; font-size: 13px; }
  .resources { gap: 9px; flex-wrap: wrap; }
  .split, .login-layout { grid-template-columns: 1fr; gap: 12px; }
  .card-grid, .card-grid.compact { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .card-tile { padding: 5px; }
  .card-picks { display: grid; }
  .modal-shell { padding: 16px; }
  .detail-card { grid-template-columns: 1fr; }
  .detail-card .card-face { width: min(100%, 235px); }
}

