:root {
  --black: #0f0f0f;
  --black-2: #181818;
  --orange: #ff7a1a;
  --orange-dark: #e46800;
  --bg: #f2f2f2;
  --panel: #ffffff;
  --text: #111111;
  --muted: #666666;
  --line: #dddddd;
  --shadow: 0 4px 14px rgba(0,0,0,.08);
  --sidebar-width: 220px;
  --content-width: 1080px;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Microsoft JhengHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--black);
  color: #fff;
  border-right: 1px solid rgba(255,255,255,.05);
  min-height: 100vh;
  position: sticky;
  top: 0;
  align-self: start;
}

.brand {
  background: #000;
  color: #fff;
  padding: 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-text {
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: .5px;
}

.brand-subtext {
  color: var(--orange);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .55px;
  margin-top: 3px;
}

.side-group-title {
  background: #111;
  color: var(--orange);
  padding: 12px 18px;
  font-size: 17px;
  font-weight: 800;
  margin-top: 12px;
  border-left: 4px solid var(--orange);
}

.side-links {
  padding: 6px 0;
}

.side-links a {
  display: block;
  padding: 9px 22px;
  color: #d7d7d7;
  text-decoration: none;
  font-size: 15px;
  border-left: 4px solid transparent;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.side-links a:hover,
.side-links a.active {
  background: var(--black-2);
  color: var(--orange);
  border-left-color: var(--orange);
  font-weight: 800;
}

.content {
  min-width: 0;
}

.main-wrap {
  padding: 28px 28px 40px;
  max-width: var(--content-width);
  margin: 0 auto;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

.page-title {
  font-size: 30px;
  font-weight: 900;
  color: #111;
  margin: 0 0 24px;
  padding-bottom: 14px;
  border-bottom: 4px solid var(--orange);
}

.panel {
  background: var(--panel);
  border: 1px solid #dfdfdf;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.team-hero {
  border: 4px solid #000;
  border-radius: 18px;
  padding: 22px;
  display: grid;
  grid-template-columns: 180px 1fr 170px;
  gap: 22px;
  align-items: center;
  background: #fff;
  margin-bottom: 28px;
}

.team-logo-box {
  width: 160px;
  height: 160px;
  border: 1px solid #cfcfcf;
  background: #fafafa;
  display: grid;
  place-items: center;
}

.team-logo-circle,
.mini-logo-circle {
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #242424, #000 72%);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  letter-spacing: 1px;
}

.team-logo-circle {
  width: 126px;
  height: 126px;
  border: 8px solid #000;
  box-shadow: inset 0 0 0 4px var(--orange);
  font-size: 34px;
}

.team-name {
  font-size: 36px;
  font-weight: 900;
  color: #111;
  margin-bottom: 10px;
}

.team-divider {
  height: 3px;
  background: #111;
  margin-bottom: 16px;
}

.team-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 26px;
}

.meta-pair {
  font-size: 17px;
  color: #111;
  font-weight: 700;
}

.meta-label {
  font-weight: 900;
}

.team-colors {
  text-align: center;
}

.colors-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 10px;
}

.color-swatches {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.swatch {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  border: 1px solid #555;
  margin: 0 auto 6px;
}

.swatch.primary { background: var(--orange); }
.swatch.secondary { background: #f4f0eb; }

.swatch-label {
  font-size: 13px;
  color: var(--muted);
}

.team-cards-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}

.team-cards-grid-top {
  grid-template-columns: repeat(4, 1fr);
}

.team-cards-grid-bottom,
.tactics-grid,
.finance-grid {
  grid-template-columns: repeat(3, 1fr);
}

.info-card,
.table-panel,
.notes-panel,
.lineup-panel {
  background: #fff;
  border: 1px solid #d8d8d8;
  border-radius: var(--radius);
  padding: 18px;
  min-height: 120px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  transition: transform .18s ease, box-shadow .18s ease;
}

.info-card:hover,
.table-panel:hover,
.notes-panel:hover,
.lineup-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
}

.card-title {
  font-size: 18px;
  font-weight: 800;
  color: #2d2d2d;
  margin-bottom: 14px;
  text-align: center;
}

.card-title.small {
  color: #555;
  font-size: 16px;
}

.record-line {
  font-size: 26px;
  font-weight: 900;
  color: #111;
  margin-top: 16px;
  text-align: center;
}

.record-sub,
.player-name,
.bottom-card-value {
  font-size: 17px;
  font-weight: 700;
  color: #111;
  text-align: center;
  margin-top: 10px;
}

.mini-logo-circle {
  width: 62px;
  height: 62px;
  margin: 0 auto 10px;
  border: 5px solid #000;
  box-shadow: inset 0 0 0 3px var(--orange);
  font-size: 18px;
}

.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 16px;
}

.toolbar-title {
  font-size: 20px;
  font-weight: 900;
  color: #111;
}

.toolbar-sub {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

.tbl-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: #fff;
}

.tbl-table th,
.tbl-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e8e8e8;
  text-align: center;
  font-size: 14px;
}

.tbl-table th {
  background: #111;
  color: var(--orange);
  font-size: 13px;
  letter-spacing: .3px;
}

.tbl-table tbody tr:hover {
  background: #fff5ec;
}

.lineup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.lineup-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.lineup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: #f7f7f7;
  border-radius: 10px;
  border-left: 4px solid var(--orange);
  font-size: 15px;
}

.lineup-row span {
  color: var(--muted);
  font-weight: 800;
  min-width: 42px;
}

.notes-panel p {
  margin: 14px 0 0;
  line-height: 1.8;
  color: #333;
  font-size: 15px;
}

@media (max-width: 1280px) {
  .team-hero {
    grid-template-columns: 180px 1fr;
  }

  .team-colors {
    grid-column: 1 / -1;
    justify-self: start;
    text-align: left;
  }

  .team-cards-grid-top {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1060px) {
  .content-topbar {
    padding: 16px 18px 0;
  }

  .team-login-btn {
    min-width: 110px;
    height: 40px;
  }

  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  .team-hero,
  .team-meta-grid,
  .team-cards-grid-top,
  .team-cards-grid-bottom,
  .tactics-grid,
  .finance-grid,
  .lineup-grid {
    grid-template-columns: 1fr;
  }

  .main-wrap {
    padding: 18px;
  }
}
.players-table {
  min-width: 1800px;
}

.players-table th[rowspan="2"] {
  vertical-align: middle;
}

.players-table thead tr:first-child th {
  background: #000;
  color: #ff7a1a;
  border-right: 1px solid rgba(255,255,255,.08);
}

.players-table thead tr:nth-child(2) th {
  background: #1a1a1a;
  color: #f3f3f3;
  font-size: 12px;
}

.players-table td {
  white-space: nowrap;
}

.players-table tbody tr:nth-child(even) {
  background: #fafafa;
}
.players-table th,
.players-table td {
  border: 1px solid #d0d0d0;
}

.players-table thead th {
  border: 1px solid #333;
}

.players-table {
  border-collapse: collapse;
}
.players-table th:nth-child(5),
.players-table td:nth-child(5),
.players-table th:nth-child(9),
.players-table td:nth-child(9),
.players-table th:nth-child(12),
.players-table td:nth-child(12),
.players-table th:nth-child(16),
.players-table td:nth-child(16),
.players-table th:nth-child(20),
.players-table td:nth-child(20) {
  border-left: 2px solid #000;
}
.tactics-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 8px;
}

.tactic-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tactic-field label {
  font-size: 14px;
  font-weight: 800;
  color: #222;
}

.tactic-field select {
  height: 44px;
  border: 1px solid #cfcfcf;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  background: #fff;
  color: #111;
  outline: none;
}

.tactic-field select:focus {
  border-color: #ff7a1a;
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.15);
}

@media (max-width: 1060px) {
  .tactics-form-grid {
    grid-template-columns: 1fr;
  }
}
.lineup-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1280px) {
  .lineup-grid-3 {
    grid-template-columns: 1fr;
  }
}
.lineup-table-block {
  margin-bottom: 28px;
}

.lineup-table {
  min-width: 1900px;
}

.lineup-table th,
.lineup-table td {
  border: 1px solid #d0d0d0;
}

.lineup-table thead tr:first-child th {
  background: #000;
  color: #ff7a1a;
  border: 1px solid #333;
}

.lineup-table thead tr:nth-child(2) th {
  background: #1a1a1a;
  color: #f3f3f3;
  border: 1px solid #333;
  font-size: 12px;
}

.lineup-select {
  min-width: 150px;
  height: 34px;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
}
.simulate-controls {
  margin-bottom: 18px;
}

.simulate-btn {
  background: #ff7a1a;
  color: #111;
  border: none;
  border-radius: 10px;
  height: 44px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.simulate-btn:hover {
  background: #e46800;
}

.game-result-box {
  background: #fafafa;
  border: 1px solid #dddddd;
  border-radius: 12px;
  padding: 18px;
  min-height: 90px;
}

.game-result-empty {
  color: #666;
  font-size: 14px;
}

.game-result-score {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 10px;
}

.game-result-winner {
  font-size: 16px;
  font-weight: 700;
}

.content-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px 0;
}

.content-topbar-spacer {
  flex: 1;
}

.team-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 126px;
  height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--orange);
  color: #111;
  text-decoration: none;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.team-login-btn:hover {
  background: var(--orange-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,.16);
}
.topbar-user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.topbar-team {
  font-size: 18px;
  font-weight: 900;
  color: #111;
}

.topbar-email {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logout-btn {
  min-width: 96px;
  height: 42px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.topbar-logout-btn:hover {
  background: #2a2a2a;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,.16);
}
.tactic-field input {
  height: 44px;
  border: 1px solid #cfcfcf;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  background: #fff;
  color: #111;
  outline: none;
}

.tactic-field input:focus {
  border-color: #ff7a1a;
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.15);
}
.simulate-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.simulate-label {
  font-size: 14px;
  color: #d1d5db;
}

.simulate-select {
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #374151;
  background: #111827;
  color: #f9fafb;
}
.game-result-meta {
  font-size: 13px;
  color: #666;
  font-weight: 700;
  margin-bottom: 16px;
}

.game-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.game-result-team-card {
  background: #ffffff;
  border: 1px solid #dddddd;
  border-radius: 12px;
  padding: 14px;
}

.game-result-team-title {
  font-size: 18px;
  font-weight: 900;
  color: #111;
  margin-bottom: 8px;
}

.game-result-team-sub {
  font-size: 13px;
  font-weight: 800;
  color: #666;
  margin: 12px 0 8px;
}

.game-result-tactic-list {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: #222;
}

.game-result-lineup {
  display: grid;
  gap: 8px;
}

.game-result-lineup-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f7f7f7;
}

.game-result-slot {
  font-weight: 900;
  color: #ff7a1a;
}

.game-result-name {
  font-weight: 700;
  color: #111;
}

.game-result-ovr {
  font-size: 13px;
  font-weight: 800;
  color: #555;
}

@media (max-width: 1060px) {
  .game-result-grid {
    grid-template-columns: 1fr;
  }
}