:root {
  color-scheme: dark;
  --bg: #111214;
  --surface: #1b1d20;
  --deep: #151719;
  --line: #343437;
  --ink: #f3ebdf;
  --muted: #a9a49e;
  --warm: #e5bb84;
  --wine: #9b4035;
  --wine-light: #bf5b4c;
  --green: #8ab976;
  --bad: #ee9a8f;
  --section-gap: 17px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, select { font: inherit; }
button, a, input, select { outline-offset: 4px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--warm); }
button { min-height: 40px; padding: 7px 13px; color: #fff3e8; background: var(--wine); border: 1px solid #aa4b3d; border-radius: 4px; font-weight: 600; cursor: pointer; }
button:not(:disabled):hover { background: var(--wine-light); }
button:disabled { cursor: default; background: #232427; color: #9c9892; border-color: #3b3b3e; }
button.secondary { background: #28292b; color: var(--ink); border-color: var(--line); }
button.secondary:not(:disabled):hover { background: #373635; }
button.quiet, .link-button { background: transparent; color: var(--muted); border-color: transparent; }
button.quiet:not(:disabled):hover, .link-button:not(:disabled):hover { background: #2c2b2c; color: var(--ink); }
a { color: inherit; }
input, select { background: #141518; color: var(--ink); border: 1px solid #464443; border-radius: 4px; min-height: 41px; padding: 8px 10px; }
input[type="checkbox"] { min-height: auto; accent-color: var(--wine-light); width: 16px; height: 16px; margin: 2px 0 0; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 20px; letter-spacing: -.015em; }
h3 { font-size: 15px; }
strong, .metric { font-variant-numeric: tabular-nums; }
small, .hint { color: var(--muted); }
.hint { font-size: 13px; line-height: 1.53; }
.cash { color: var(--warm); }
.good { color: var(--green); }
.bad { color: var(--bad); }
.panel { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); min-width: 0; overflow: hidden; }
.padded { padding: 17px; }
.panel-heading { padding: 14px 17px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stack { display: grid; gap: var(--section-gap); }
.divider { border-top: 1px solid var(--line); }
.buttons { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }

.top { background: #141517; border-top: 3px solid var(--wine); border-bottom: 1px solid #303033; position: relative; z-index: 2; }
.top-inner { min-height: 67px; max-width: 1510px; margin: auto; padding: 8px 26px; display: flex; align-items: center; gap: 30px; }
.brand { font-family: "Bahnschrift Condensed", "Arial Narrow", sans-serif; font-weight: 800; font-size: clamp(25px, 3vw, 37px); text-transform: uppercase; text-decoration: none; letter-spacing: .025em; white-space: nowrap; line-height: 1; }
.brand span { color: #d26654; }
.season { display: flex; align-items: center; gap: 8px; padding-left: 24px; border-left: 1px solid var(--line); white-space: nowrap; color: var(--muted); font-size: 13px; }
.season strong { color: var(--ink); font-weight: 600; }
.season i { height: 7px; width: 7px; display: block; border-radius: 50%; background: var(--green); }
.top-account { margin-left: auto; display: flex; gap: 7px; align-items: center; }
.top-account label { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.top-account select { max-width: 195px; }

.layout { max-width: 1510px; margin: 23px auto 40px; padding: 0 26px; display: grid; grid-template-columns: 179px minmax(0, 1fr) 263px; gap: 21px; align-items: start; }
.left, .right { display: grid; gap: 14px; position: sticky; top: 14px; min-width: 0; }
.navigation button { width: 100%; padding: 12px; min-height: 51px; gap: 9px; display: flex; align-items: center; text-align: left; color: var(--muted); background: var(--surface); border: 0; border-radius: 0; }
.navigation button + button { border-top: 1px solid var(--line); }
.navigation button:hover, .navigation button:not(:disabled):hover { background: #252526; color: var(--ink); }
.navigation button[aria-current="page"], .navigation button[aria-current="page"]:hover { color: var(--ink); background: #362323; box-shadow: inset 3px 0 #d16653; }
.navigation span { width: 21px; flex: none; color: #d9ac91; text-align: center; font-size: 18px; }
.tickets { padding: 13px; }
.tickets strong { font-size: 17px; }
.tickets p { margin-top: 3px; }
#main { min-width: 0; }
.masthead { position: relative; isolation: isolate; display: flex; align-items: end; min-height: 158px; border: 1px solid #493e36; background: #211e1e; border-radius: 6px; overflow: hidden; }
.masthead::before { position: absolute; inset: 0; z-index: -1; content: ""; background: linear-gradient(90deg, #161618 0%, #151619df 28%, #19191b24 100%), url("/grafiki/district.webp") center 47% / cover no-repeat; }
.masthead-copy { padding: 18px 22px 22px; }
.masthead h1 { font-family: "Bahnschrift Condensed", "Arial Narrow", sans-serif; font-size: clamp(35px, 4.7vw, 50px); line-height: 1; font-weight: 750; letter-spacing: -.015em; }
.masthead p { color: #e0d7cd; margin-top: 7px; line-height: 1.45; font-size: 14px; }
#content { margin-top: var(--section-gap); }
.waiting { padding: 20px; }

.notice { padding: 12px 15px; background: #292322; border: 1px solid #503734; border-radius: 5px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.notice p { font-size: 13px; color: #e3ccc0; line-height: 1.45; }
.notice button { white-space: nowrap; flex: none; }
.tabbar { display: flex; align-items: stretch; padding: 0 13px; border-bottom: 1px solid var(--line); }
.tabbar button { border: 0; min-height: 53px; padding: 9px 13px; border-radius: 0; background: transparent; color: var(--muted); }
.tabbar button[aria-selected="true"], .tabbar button[aria-pressed="true"] { box-shadow: inset 0 -3px #d16653; color: var(--ink); }
.tabbar button:not(:disabled):hover { background: #262628; }
.jobs-table { width: 100%; border-collapse: collapse; }
.jobs-table th, .jobs-table td { text-align: right; padding: 10px 9px; vertical-align: middle; }
.jobs-table th { text-transform: uppercase; color: var(--muted); font-size: 10.5px; letter-spacing: .045em; font-weight: 700; background: var(--deep); white-space: nowrap; }
.jobs-table th:first-child, .jobs-table td:first-child { text-align: left; padding-left: 17px; }
.jobs-table th:last-child, .jobs-table td:last-child { padding-right: 15px; }
.jobs-table tr + tr { border-top: 1px solid #2f3032; }
.jobs-table tbody tr:hover { background: #222225; }
.jobs-table td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.jobs-table td:first-child { white-space: normal; }
.jobs-table td:first-child strong { display: block; }
.jobs-table td:first-child small { display: block; margin-top: 2px; font-size: 11px; }
.jobs-table td:first-child .mobile-money { display: none; color: var(--warm); }
.jobs-table td button { min-height: 34px; font-size: 12px; }
.jobs-table .needs { color: var(--muted); }

.profile { background: var(--surface); }
.profile .panel-heading { padding-block: 11px; }
.portrait { display: flex; align-items: center; gap: 11px; padding: 13px 14px; }
.portrait img { width: 53px; height: 61px; object-fit: cover; border-radius: 3px; border: 1px solid #655247; }
.portrait strong { overflow-wrap: anywhere; }
.portrait p { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.profile .energy { padding: 0 14px 13px; }
.profile .energy-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.meter { height: 7px; background: #353735; margin-top: 6px; overflow: hidden; border-radius: 4px; }
.meter > i { display: block; background: var(--green); height: 100%; transition: width .18s ease; }
.power-title { color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .065em; text-transform: uppercase; padding: 12px 14px 3px; border-top: 1px solid var(--line); }
.power-list { padding: 0 14px 12px; }
.power-item { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 4px; font-size: 12.5px; }
.power-item + .power-item { border-top: 1px solid var(--line); }
.power-item strong { color: var(--warm); font-size: 17px; }
.wallet { padding: 12px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; background: #1d1a17; border-top: 1px solid var(--line); }
.wallet span { display: block; color: var(--muted); font-size: 12px; }
.wallet strong { display: block; margin-top: 4px; font-size: 18px; }
.wallet .mobile-tickets { display: none; }
.stat-list { padding: 9px 14px; font-size: 12px; }
.stat-list div { padding: 5px 0; display: flex; justify-content: space-between; gap: 5px; }
.stat-list span { color: var(--muted); }
.activity { padding: 13px; }
.activity h3 { font-size: 13px; }
.activity p { margin-top: 7px; font-size: 12px; color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }

.rule { display: flex; gap: 8px; flex-wrap: wrap; }
.operation-title { display: flex; align-items: center; gap: 10px; }
.operation-title img { width: 52px; height: 33px; object-fit: cover; border: 1px solid #48413c; border-radius: 3px; }
.rule span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 12px; }
.roster { display: grid; gap: 6px; padding: 12px 17px 15px; }
.roster-member { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 9px 10px; border: 1px solid var(--line); background: var(--deep); border-radius: 4px; cursor: pointer; }
.roster-member span, .roster-member small { overflow-wrap: anywhere; }
.roster-member small { display: block; }
.roster-member strong { font-size: 13px; color: var(--warm); }
.roster-member:has(input:checked) { border-color: #a05949; }
.group-footer { padding: 12px 17px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.group-footer p { margin-top: 4px; }
.character-list { padding: 0 17px; }
.character-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px 0; }
.character-row + .character-row { border-top: 1px solid var(--line); }
.character-row h3 { overflow-wrap: anywhere; }
.character-row p { margin-top: 4px; }
.factory-wallet { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; padding: 10px 17px; border-bottom: 1px solid var(--line); }
.factory-note { padding: 12px 17px; }
.factory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; padding: 0 17px 17px; }
.factory-offer { min-width: 0; padding: 13px; display: flex; flex-direction: column; gap: 10px; background: var(--deep); border-radius: 4px; border: 1px solid var(--line); }
.factory-offer h3 + p { margin-top: 4px; }
.factory-offer > button { align-self: start; margin-top: auto; }
.factory-metrics { margin: 0; padding: 7px 0; border-block: 1px solid var(--line); font-size: 13px; }
.factory-metrics div { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.factory-metrics dt { color: var(--muted); }
.factory-metrics dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.market-event.is-active { border-color: #5f744e; }
.market-event p { margin-top: 6px; }
.market-form { display: flex; align-items: center; gap: 8px; }
.market-form label { display: flex; align-items: center; gap: 7px; }
.market-form input { width: 8ch; }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.inline-form label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.inline-form input { width: 100%; }
.inline-form label:first-child { flex: 1 1 125px; min-width: 0; }
.section-body { padding: 15px 17px; }
.club { display: grid; grid-template-columns: minmax(150px, 43%) minmax(0, 1fr); }
.club img { width: 100%; height: 100%; min-height: 178px; object-fit: cover; object-position: center; }
.club .padded > * + * { margin-top: 8px; }
.club-buttons { justify-content: flex-start; }
#fight-alert:not([hidden]) { position: fixed; z-index: 3; top: 76px; right: 16px; width: min(370px, calc(100% - 24px)); }
.fight-banner { display: flex; align-items: center; justify-content: space-between; gap: 9px; border-color: #a95b4f; padding: 11px; box-shadow: 0 3px 15px #000a; }
.fight-banner strong { color: var(--bad); }
.fight-card { border-color: #744b42; }
.fight-card .section-body > * + * { margin-top: 6px; }
.fight-response { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 8px; }
.fight-pick { grid-template-columns: 22px minmax(0, 1fr); }
.defense-options { border-top: 1px solid var(--line); padding-top: 8px; }
.defense-options summary { cursor: pointer; }
.defense-options .roster { padding-inline: 0; }
.clinic-note { color: var(--bad); padding: 0 14px 10px; font-size: 12px; }
.assault-entry { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 9px; }
.range-row { display: flex; gap: 9px; align-items: center; margin-top: 8px; }
.range-row input { flex: 1; }
dialog { width: min(440px, calc(100% - 30px)); max-height: calc(100% - 36px); padding: 20px; color: var(--ink); border: 1px solid #624640; border-radius: 7px; background: var(--surface); }
dialog::backdrop { background: #0c0d10c9; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
#auth-form { display: grid; gap: 11px; }
#auth-form label { display: grid; gap: 4px; color: var(--muted); }
#auth-form [hidden] { display: none; }
#auth-social { padding-bottom: 13px; margin-bottom: 13px; border-bottom: 1px solid var(--line); }
.auth-providers { display: grid; gap: 7px; }
#auth-profile-hint { margin-bottom: 12px; }
.form-error { color: var(--bad); }
.form-error:empty { display: none; }
.toast { position: fixed; z-index: 4; bottom: 16px; right: 17px; max-width: min(385px, calc(100% - 34px)); padding: 13px 15px; border: 1px solid #66513d; border-radius: 5px; background: #24211e; color: var(--ink); box-shadow: 0 3px 16px #0009; line-height: 1.45; }
.toast.error { border-color: var(--wine-light); color: #ffd6cc; }

@media (max-width: 1130px) {
  .layout { grid-template-columns: 148px minmax(0, 1fr) 224px; gap: 13px; padding-inline: 18px; }
  .top-inner { padding-inline: 18px; }
  .jobs-table th, .jobs-table td { padding-inline: 6px; }
  .jobs-table th:first-child, .jobs-table td:first-child { padding-left: 11px; }
  .jobs-table th:last-child, .jobs-table td:last-child { padding-right: 10px; }
}
@media (max-width: 880px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 13px; margin-top: 13px; }
  .left, .right { position: static; }
  .left { grid-row: 1; }
  .right { grid-row: 2; }
  #main { grid-row: 3; }
  .navigation { display: flex; flex-wrap: wrap; }
  .navigation button { width: auto; flex: 1; min-height: 44px; justify-content: center; }
  .navigation button + button { border-top: 0; }
  .navigation button[aria-current="page"] { box-shadow: inset 0 -2px #d16653; }
  .tickets, .profile .panel-heading, .profile .stat-list, .right .activity { display: none; }
  .profile { display: grid; grid-template-columns: 1fr 1fr; }
  .profile .portrait { grid-area: 1 / 1; }
  .profile .energy { grid-area: 1 / 2; padding: 16px 14px; align-self: center; }
  .power-title, .power-list { grid-column: 1 / -1; }
  .power-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .power-item { flex-direction: column; align-items: start; min-height: auto; padding: 7px 0 0; }
  .power-item + .power-item { border-top: 0; }
  .wallet { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-block: 8px; }
  .wallet > div { display: flex; justify-content: space-between; align-items: center; padding-right: 8px; }
  .wallet .mobile-tickets { display: flex; }
  .wallet strong { margin: 0; }
  .masthead { min-height: 126px; }
}
@media (max-width: 520px) {
  .top-inner { padding: 7px 12px; gap: 6px; flex-wrap: wrap; }
  .season { order: 3; width: 100%; padding: 0; border: 0; }
  .top-account select { max-width: 105px; }
  .top-account label > span { display: none; }
  .wallet > div { display: block; }
  .wallet .mobile-tickets { display: block; }
  .layout { padding: 0 11px; }
  .navigation { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .navigation button { grid-column: span 3; flex-direction: column; gap: 2px; min-height: 46px; padding: 3px; font-size: 11.5px; text-align: center; }
  .navigation button:nth-child(n + 5) { grid-column: span 4; }
  .navigation span { font-size: 13px; line-height: 1; }
  button { min-height: 44px; }
  .jobs-table td button { min-height: 44px; padding-inline: 7px; }
  .jobs-table th, .jobs-table td { padding-inline: 4px; font-size: 12px; }
  .jobs-table th { font-size: 9px; }
  .jobs-table .cash-col { display: none; }
  .jobs-table td:first-child .mobile-money { display: block; }
  .club { grid-template-columns: 1fr; }
  .club img { height: 150px; min-height: auto; }
  .factory-owned .character-row { grid-template-columns: 1fr; gap: 8px; }
  .factory-owned .buttons { justify-content: flex-start; }
  .market-row { grid-template-columns: 1fr; gap: 8px; }
  .notice { align-items: start; }
  .notice button { white-space: normal; }
}
