/* web/styles.css */
:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #232733;
  --border: #2e3345;
  --text: #e4e4e7;
  --text-dim: #8b8fa3;
  --accent: #6c8cff;
  --accent-dim: #4a5a8a;
  --green: #4ade80;
  --red: #f87171;
  --orange: #fb923c;
  --yellow: #facc15;
  --purple: #a78bfa;
  --cyan: #22d3ee;
  --pink: #f472b6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-family: SF Mono, Fira Code, JetBrains Mono, monospace;
  font-size: 13px;
  line-height: 1.5;
}

#root {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}

header {
  display: flex;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 16px;
}

header h1 {
  color: var(--accent);
  font-size: 20px;
  font-weight: 600;
}

header .meta {
  color: var(--text-dim);
  font-size: 11px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.card h2 {
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-dim);
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
}

.card.full {
  grid-column: 1 / -1;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th {
  text-align: left;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
}

td {
  border-bottom: 1px solid var(--border);
  padding: 5px 8px;
  font-size: 13px;
}

tr:last-child td {
  border-bottom: none;
}

td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

td.label {
  color: var(--text-dim);
}

.val {
  color: var(--text);
  font-weight: 500;
}

.val-high {
  color: var(--green);
  font-weight: 600;
}

.val-mid {
  color: var(--yellow);
}

.val-low {
  color: var(--red);
}

.val-accent {
  color: var(--accent);
}

.val-purple {
  color: var(--purple);
}

.val-cyan {
  color: var(--cyan);
}

.val-pink {
  color: var(--pink);
}

.stat-bar {
  display: flex;
  align-items:  center;
  gap: 8px;
  margin-bottom: 6px;
}

.stat-bar .bar-label {
  color: var(--text-dim);
  flex-shrink: 0;
  width: 120px;
  font-size: 11px;
}

.stat-bar .bar-track {
  background: var(--surface2);
  overflow: hidden;
  border-radius: 3px;
  flex: 1;
  height: 6px;
}

.stat-bar .bar-fill {
  border-radius: 3px;
  height: 100%;
  transition: width .3s;
}

.stat-bar .bar-value {
  text-align: right;
  flex-shrink: 0;
  width: 60px;
  font-size: 12px;
  font-weight: 500;
}

.badge {
  display: inline-block;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
}

.badge-epic {
  color: #d8b4fe;
  background: #6b21a8;
}

.badge-unique {
  color: #fcd34d;
  background: #92400e;
}

.badge-legendary {
  color: #6ee7b7;
  background: #065f46;
}

.badge-mystic {
  color: #fca5a5;
  background: #991b1b;
}

.priority-list {
  list-style: none;
}

.priority-list li {
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items:  center;
  gap: 8px;
  padding: 8px;
}

.priority-list li:last-child {
  border-bottom: none;
}

.priority-num {
  display: flex;
  background: var(--accent-dim);
  color: var(--text);
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items:  center;
  width: 24px;
  height: 24px;
  font-size: 11px;
  font-weight: 700;
}

.priority-num.top {
  background: var(--green);
  color: #000;
}

.dps-big {
  color: var(--green);
  margin-bottom: 4px;
  font-size: 28px;
  font-weight: 700;
}

.dps-label {
  color: var(--text-dim);
  font-size: 11px;
}

.content-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
}

.content-tab {
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  background: none;
  border-radius: 6px;
  padding: 6px 12px;
  transition: all .15s;
  font-family: inherit;
  font-size: 12px;
}

.content-tab:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}

.content-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.delta-pos {
  color: var(--green);
}

.delta-neg {
  color: var(--red);
}

.delta-neutral {
  color: var(--text-dim);
}

.section-title {
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  padding-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.artifact-slot {
  display: flex;
  background: var(--surface2);
  border-radius: 6px;
  align-items:  center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 10px;
}

.artifact-slot .artifact-name {
  font-size: 13px;
  font-weight: 500;
}

.artifact-slot .artifact-effect {
  color: var(--text-dim);
  font-size: 11px;
}

.stat-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  text-align: right;
  border-radius: 4px;
  width: 100px;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 13px;
}

.stat-input:focus {
  outline: none;
  border-color: var(--accent);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.faq-item {
  border: 1px solid var(--border);
  overflow: hidden;
  border-radius: 6px;
}

.faq-item.open {
  border-color: var(--accent-dim);
}

.faq-question {
  display: flex;
  background: var(--surface2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border: none;
  justify-content: space-between;
  align-items:  center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  transition: background .15s;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
}

.faq-question:hover {
  background: var(--border);
}

.faq-chevron {
  color: var(--text-dim);
  flex-shrink: 0;
  font-size: 10px;
}

.faq-answer {
  color: var(--text-dim);
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
}

.faq-answer p {
  margin-bottom: 8px;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-answer strong {
  color: var(--text);
}

.faq-answer code {
  display: block;
  background: var(--surface2);
  color: var(--cyan);
  border-radius: 4px;
  margin: 8px 0;
  padding: 6px 10px;
  font-size: 11px;
}

@media (max-width: 768px) {
  .grid, .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* web/guild-styles.css */
.nav-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.nav-bar a {
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 10px;
  transition: all .15s;
  font-size: 12px;
}

.nav-bar a:hover {
  color: var(--text);
  border-color: var(--accent-dim);
}

.nav-bar a.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.guild-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  justify-content: space-between;
  align-items:  center;
  margin-bottom: 24px;
  padding-bottom: 16px;
}

.guild-header h1 {
  color: var(--accent);
  font-size: 20px;
  font-weight: 600;
}

.guild-header .guild-meta {
  text-align: right;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.6;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
  border-radius: 8px;
  padding: 14px 16px;
}

.stat-tile .tile-value {
  margin-bottom: 2px;
  font-size: 22px;
  font-weight: 700;
}

.stat-tile .tile-label {
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: 10px;
}

.rank-badge {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: .3px;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
}

.rank-kage {
  color: #fecaca;
  background: #dc2626;
}

.rank-anbu {
  color: #ddd6fe;
  background: #7c3aed;
}

.rank-jonin {
  color: #bfdbfe;
  background: #2563eb;
}

.rank-chuninn {
  color: #99f6e4;
  background: #0d9488;
}

.rank-genin {
  color: #d1d5db;
  background: #374151;
}

.tier-badge {
  display: inline-block;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
}

.tier-champion {
  color: #fecaca;
  background: #dc2626;
}

.tier-challenger {
  color: #ddd6fe;
  background: #7c3aed;
}

.tier-grandmaster {
  color: #bfdbfe;
  background: #2563eb;
}

.tier-master {
  color: #d1d5db;
  background: #374151;
}

.cp-bar-wrap {
  display: flex;
  align-items:  center;
  gap: 8px;
}

.cp-bar-track {
  background: var(--surface2);
  overflow: hidden;
  border-radius: 2px;
  flex: 1;
  min-width: 40px;
  height: 4px;
}

.cp-bar-fill {
  background: var(--accent);
  border-radius: 2px;
  height: 100%;
  transition: width .3s;
}

.table-scroll {
  overflow-x: auto;
}

.rank-dist {
  display: flex;
  align-items:  flex-end;
  gap: 6px;
  height: 80px;
  padding-top: 8px;
}

.rank-dist-bar {
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items:  center;
  gap: 4px;
}

.rank-dist-bar .bar {
  border-radius: 3px 3px 0 0;
  width: 100%;
  min-height: 2px;
  transition: height .3s;
}

.rank-dist-bar .bar-count {
  font-size: 11px;
  font-weight: 600;
}

.rank-dist-bar .bar-name {
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 9px;
}

tr.highlight {
  background: #6c8cff14;
}

tr.highlight td {
  font-weight: 500;
}

tr.near-promo {
  border-left: 2px solid var(--green);
  background: #4ade8014;
}

.promo-badge {
  display: inline-block;
  color: var(--green);
  vertical-align: middle;
  background: #4ade801f;
  border-radius: 3px;
  margin-left: 6px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 600;
}

th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable:hover {
  color: var(--text);
}

th.sortable.sorted-asc:after {
  content: " u25B2";
  font-size: 9px;
}

th.sortable.sorted-desc:after {
  content: " u25BC";
  font-size: 9px;
}

.view-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
}

.view-tab {
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  background: none;
  border-radius: 6px;
  padding: 8px 16px;
  transition: all .15s;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
}

.view-tab:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}

.view-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.view-tabs-row {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: 12px;
  margin-bottom: 16px;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.player-link {
  cursor: pointer;
  color: var(--text);
  transition: color .15s;
}

.player-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.profile-nav-row {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: 8px;
  margin-bottom: 16px;
}

.profile-back {
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  background: none;
  border-radius: 6px;
  flex-shrink: 0;
  padding: 6px 14px;
  transition: all .15s;
  font-family: inherit;
  font-size: 12px;
}

.profile-back:hover {
  color: var(--text);
  border-color: var(--accent-dim);
}

.profile-nav-arrows {
  display: flex;
  gap: 6px;
}

.profile-nav-btn {
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: none;
  border-radius: 6px;
  max-width: 140px;
  padding: 6px 12px;
  transition: all .15s;
  font-family: inherit;
  font-size: 11px;
}

.profile-nav-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--accent-dim);
}

.profile-nav-btn:disabled {
  opacity: .3;
  cursor: default;
}

.profile-header {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  justify-content: space-between;
  align-items:  flex-start;
  margin-bottom: 20px;
  padding: 16px 20px;
}

.profile-header-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-name {
  color: var(--text);
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items:  center;
  gap: 8px;
}

.profile-detail {
  color: var(--text-dim);
  font-size: 11px;
}

.kage-title {
  color: #dc2626;
  text-transform: uppercase;
  letter-spacing: 1px;
  vertical-align: middle;
  border: 1px solid #dc2626;
  border-radius: 4px;
  margin-left: 10px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}

.profile-gps-big {
  text-align: right;
  flex-shrink: 0;
}

.profile-gps-number {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}

.profile-gps-label {
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
  font-size: 10px;
}

.profile-gps-rank {
  color: var(--text-dim);
  margin-top: 4px;
  font-size: 11px;
}

.profile-radar-row {
  display: flex;
  align-items:  flex-start;
  gap: 24px;
}

.profile-verdict-col {
  flex: 1;
  min-width: 0;
}

.profile-verdict-badge {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: .5px;
  border: 2px solid;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
}

.radar-chart {
  flex-shrink: 0;
}

.stat-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  border-radius: 8px;
}

.stat-card-header {
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text);
  border-bottom: 2px solid;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
}

.stat-card-body {
  padding: 10px 12px;
}

.stat-card-row {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  padding: 3px 0;
  font-size: 12px;
}

.stat-card-row > span:first-child {
  color: var(--text-dim);
  font-size: 11px;
}

.season-history-section {
  margin-bottom: 16px;
}

.season-history-section:last-child {
  margin-bottom: 0;
}

.season-history-label {
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text);
  border-bottom: 2px solid;
  margin-bottom: 8px;
  padding-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
}

.season-history-table-wrap {
  overflow-x: auto;
}

.season-history-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}

.season-history-table th {
  text-align: left;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .3px;
  border-bottom: 1px solid var(--border);
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 600;
}

.season-history-table td {
  color: var(--text);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  padding: 8px 10px;
}

.season-history-table tbody tr:last-child td {
  border-bottom: none;
}

.season-history-table tr.current-season td {
  background: var(--surface2);
  font-weight: 500;
}

.season-history-table tr.current-season td:first-child {
  border-left: 2px solid var(--accent);
}

.progress-report h2 {
  margin-bottom: 12px;
}

.report-body {
  background: var(--surface2);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 12px 16px;
}

.report-line {
  color: var(--text);
  margin: 0;
  padding: 3px 0;
  font-size: 13px;
  line-height: 1.7;
}

.report-line:first-child {
  font-weight: 600;
}

.report-footer {
  color: var(--text-dim);
  text-align: right;
  margin-top: 10px;
  font-size: 10px;
}

@media (max-width: 768px) {
  .guild-header {
    flex-direction: column;
    gap: 8px;
  }

  .guild-header .guild-meta {
    text-align: left;
  }

  .view-tabs-row {
    flex-direction: column;
    align-items: stretch;
  }

  .view-tabs {
    flex-wrap: wrap;
    gap: 6px;
  }

  .action-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .view-tab {
    text-align: center;
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    font-size: 11px;
  }

  .stat-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-tile {
    padding: 10px 8px;
  }

  .stat-tile .tile-value {
    font-size: 18px;
  }

  td {
    padding: 6px 4px;
    font-size: 12px;
  }

  th {
    padding: 4px;
    font-size: 10px;
  }

  .player-link {
    display: inline-block;
    padding: 4px 0;
  }

  .profile-header {
    flex-direction: column;
    gap: 12px;
    padding: 12px 14px;
  }

  .profile-gps-big {
    text-align: left;
  }

  .profile-gps-number {
    font-size: 28px;
  }

  .profile-name {
    font-size: 16px;
  }

  .kage-title {
    display: block;
    width: -moz-fit-content;
    width: fit-content;
    margin-top: 4px;
    margin-left: 0;
  }

  .profile-radar-row {
    flex-direction: column;
    align-items:  center;
  }

  .stat-card-grid {
    grid-template-columns: 1fr;
  }

  .profile-verdict-badge {
    padding: 5px 10px;
    font-size: 11px;
  }

  .card {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .stat-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-tile .tile-value {
    font-size: 16px;
  }

  .stat-tile .tile-label {
    font-size: 9px;
  }

  .view-tab {
    padding: 6px 8px;
    font-size: 10px;
  }

  .profile-gps-number {
    font-size: 24px;
  }
}

.wr-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wr-bar-row {
  display: flex;
  align-items:  center;
  gap: 10px;
  padding: 4px 0;
}

.wr-bar-row.wr-bar-highlight {
  background: #6c8cff14;
  border-radius: 4px;
  margin: 2px -8px;
  padding: 6px 8px;
}

.wr-bar-label {
  display: flex;
  align-items:  center;
  gap: 6px;
  min-width: 180px;
  font-size: 12px;
}

.wr-bar-rank {
  color: var(--text-dim);
  min-width: 24px;
  font-size: 10px;
}

.wr-bar-track {
  background: var(--surface2);
  overflow: hidden;
  border-radius: 5px;
  flex: 1;
  min-width: 80px;
  height: 10px;
}

.wr-bar-fill {
  border-radius: 5px;
  height: 100%;
  transition: width .3s;
}

.wr-bar-pts {
  text-align: right;
  white-space: nowrap;
  min-width: 100px;
  font-size: 11px;
  font-weight: 600;
}

.wr-scenario-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wr-scenario-row {
  display: flex;
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  border-radius: 6px;
  align-items:  center;
  gap: 12px;
  padding: 10px 14px;
  transition: all .15s;
}

.wr-scenario-row:hover {
  border-color: var(--accent-dim);
}

.wr-scenario-row.wr-scenario-active {
  border-color: var(--accent);
  background: #6c8cff1a;
}

.wr-scenario-check {
  border: 2px solid var(--border);
  display: flex;
  color: var(--accent);
  border-radius: 4px;
  flex-shrink: 0;
  justify-content: center;
  align-items:  center;
  width: 24px;
  height: 24px;
  font-size: 14px;
  font-weight: 700;
}

.wr-scenario-active .wr-scenario-check {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.wr-scenario-info {
  flex: 1;
  min-width: 0;
}

.wr-scenario-impact {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
}

.prob-badge {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: .3px;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
}

.prob-high {
  color: #fecaca;
  background: #dc2626;
}

.prob-medium {
  color: #fef3c7;
  background: #d97706;
}

.prob-low {
  color: #d1d5db;
  background: #374151;
}

.snipe-badge {
  display: inline-block;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .5px;
  animation: snipePulse 2s ease-in-out infinite;
  background: #d97706;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 700;
}

@keyframes snipePulse {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: .6;
  }
}

@media (max-width: 768px) {
  .wr-bar-label {
    min-width: 120px;
    font-size: 11px;
  }

  .wr-bar-pts {
    min-width: 70px;
    font-size: 10px;
  }

  .wr-scenario-row {
    gap: 8px;
    padding: 8px 10px;
  }

  .wr-scenario-impact {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .wr-bar-row {
    flex-wrap: wrap;
  }

  .wr-bar-label {
    min-width: 100%;
  }

  .wr-bar-track {
    flex: 1;
  }

  .wr-bar-pts {
    min-width: auto;
  }
}
