:root {
  color-scheme: light;
  --bg: #e9edf2;
  --paper: #ffffff;
  --paper-soft: #f6f7f9;
  --ink: #2c2f35;
  --muted: #707986;
  --line: #d4d9e0;
  --top: #1f2733;
  --top-dark: #171d26;
  --orange: #f59d22;
  --orange-dark: #d98513;
  --blue: #2779bd;
  --green: #4f9d45;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

a,
button {
  color: inherit;
}

a {
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--top);
  border-bottom: 4px solid var(--orange);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.topbarInner,
.shell {
  width: min(1130px, calc(100% - 24px));
  margin: 0 auto;
}

.topbarInner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  gap: 18px;
}

.brand,
.mainNav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  color: #fff;
  font-size: 1.28rem;
  font-weight: 700;
}

.brandIcon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 4px;
  background: var(--orange);
  color: #1e2530;
  font-weight: 900;
}

.mainNav a {
  padding: 20px 14px 17px;
  color: #dce3ec;
  font-weight: 700;
}

.mainNav a:hover {
  background: var(--top-dark);
  color: #fff;
}

.searchHero {
  background:
    linear-gradient(rgba(25, 33, 43, 0.78), rgba(25, 33, 43, 0.78)),
    url("https://images.unsplash.com/photo-1511512578047-dfb367046420?auto=format&fit=crop&w=1600&q=80") center/cover;
  padding: 38px 0 32px;
  color: #fff;
}

.searchHero h1 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 5vw, 3.45rem);
  line-height: 1;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.36);
}

.searchPanel {
  display: grid;
  max-width: 760px;
  gap: 9px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 4px;
  color: var(--ink);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.2);
}

.searchPanel label {
  font-weight: 700;
}

.searchPanel p {
  margin: 0;
  color: var(--muted);
}

.searchRow {
  display: grid;
  grid-template-columns: 1fr 118px;
  gap: 8px;
}

input {
  width: 100%;
  border: 1px solid #bfc7d0;
  border-radius: 3px;
  padding: 11px 12px;
  background: #fff;
}

input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(39, 121, 189, 0.18);
}

button {
  border: 0;
  border-radius: 3px;
  background: var(--orange);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 10px 14px;
}

button:hover {
  background: var(--orange-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  padding: 18px 0 40px;
}

.sideMenu,
.noticeCard,
.profileHeader,
.panel,
.statsGrid article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.sideMenu {
  position: sticky;
  top: 78px;
  align-self: start;
  overflow: hidden;
}

.sideMenu a {
  display: block;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  color: #354254;
  font-weight: 700;
}

.sideMenu a:last-child {
  border-bottom: 0;
}

.sideMenu a:hover {
  background: var(--paper-soft);
  color: var(--orange-dark);
}

.content {
  display: grid;
  gap: 14px;
}

.noticeCard {
  padding: 22px;
}

.noticeCard h2,
.profileHeader h2,
.panel h2 {
  margin: 0;
}

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

.profileHeader {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 15px;
  padding: 16px;
  border-top: 4px solid var(--orange);
}

.avatar {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border-radius: 4px;
  background: linear-gradient(#ffe2a8, #f1a323);
  border: 1px solid #bc7d13;
  color: #533409;
  font-size: 2rem;
  font-weight: 900;
}

.crumb,
.muted,
.profileStat span,
.statsGrid span,
.resourceGrid span,
.historyList span,
.panelTitle span {
  color: var(--muted);
  font-size: 0.86rem;
}

.crumb {
  margin: 0 0 4px;
  color: var(--orange-dark);
  font-weight: 700;
  text-transform: uppercase;
}

.profileHeader h2 {
  font-size: 1.55rem;
}

.profileStat {
  min-width: 112px;
  text-align: right;
}

.profileStat strong {
  display: block;
  color: var(--green);
  font-size: 2rem;
  line-height: 1;
}

.statsGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.statsGrid article {
  padding: 14px;
}

.statsGrid strong,
.resourceGrid strong,
.historyList strong {
  display: block;
  margin-top: 5px;
  font-size: 1.48rem;
}

.panel {
  overflow: hidden;
}

.panelTitle {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  background: var(--paper-soft);
  border-bottom: 1px solid var(--line);
}

.panelTitle p {
  margin: 4px 0 0;
}

.resourceGrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.resourceGrid div,
.historyList div {
  padding: 14px 15px;
  border-right: 1px solid var(--line);
}

.resourceGrid div:last-child {
  border-right: 0;
}

.baseStage {
  min-height: 445px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.18) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.18) 25%, transparent 25%),
    #d8ead2;
  background-size: 28px 28px;
}

.baseStage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.historyList {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.historyList div:last-child {
  border-right: 0;
}

.tabs {
  display: flex;
  gap: 6px;
}

.tab {
  background: #dfe5ec;
  color: #2f3b4a;
  padding: 8px 10px;
}

.tab.isActive {
  background: var(--orange);
  color: #fff;
}

.tableWrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: #eef2f6;
  color: #465466;
  font-size: 0.82rem;
  text-transform: uppercase;
}

tr:hover td {
  background: #fbfcfe;
}

.playerLink {
  padding: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
}

.playerLink:hover {
  background: transparent;
  color: var(--orange-dark);
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .layout,
  .resourceGrid,
  .historyList {
    grid-template-columns: 1fr;
  }

  .sideMenu {
    position: static;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .sideMenu a {
    border-bottom: 0;
    border-right: 1px solid var(--line);
    text-align: center;
  }

  .sideMenu a:last-child {
    border-right: 0;
  }

  .resourceGrid div,
  .historyList div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  .topbarInner,
  .profileHeader,
  .panelTitle {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .topbarInner,
  .mainNav {
    display: grid;
  }

  .mainNav {
    grid-template-columns: repeat(4, 1fr);
  }

  .mainNav a {
    padding: 11px 6px;
    text-align: center;
    font-size: 0.86rem;
  }

  .searchRow,
  .statsGrid,
  .sideMenu {
    grid-template-columns: 1fr;
  }

  .profileStat {
    text-align: left;
  }
}
