body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    padding: 20px;
    margin: 0;
}

h1, h2 {
    font-weight: bold;
    color: #222;
    margin-top: 40px;
}

/* Default grid for everything */
.team-grid, .list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Wider cards ONLY for grids that include coverage maps */
.team-grid.coverage-grid {
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
}

.team-card, .list-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden; /* keeps table inside rounded corners */
    position: relative;
}

.pokemon {
    margin: 5px;
}

.name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 4px;
}

.info, .rating {
    font-size: 14px;
    color: #555;
    margin-top: 4px;
}

.team-section {
    margin: auto;
}

.pokemon-icon-wrapper {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 8px;
}

.pokemon-icon,
.pokemon-type-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 64px;
    height: 64px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
    border-radius: 6px;
}

.pokemon-icon {
    z-index: 1;
}

.pokemon-type-overlay {
    z-index: 2;
    opacity: 0.2; /* optional overlay for future effects */
}

/* --- coverage styles --- */
.coverage-wrap {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e5e5e5;
    background: #fff; /* blend into card */
}

.coverage-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: #444;
}

.coverage-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.coverage-table th,
.coverage-table td {
    border: 1px solid #eee;
    padding: 4px 6px;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    white-space: nowrap; /* keeps R/W/— aligned nicely */
}

/* narrow fixed columns for per-mon cells */
.coverage-table td:nth-child(2),
.coverage-table td:nth-child(3),
.coverage-table td:nth-child(4) {
    width: 2.2rem;
}

.coverage-table td:first-child,
.coverage-table th:first-child {
    width: 5.5rem;
}

.coverage-type {
    display: inline-block;
    min-width: 60px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #f3f3f3;
    border: 1px solid #e5e5e5;
}

.resist { background: #d9f7d9 !important; }   /* green */
.weak   { background: #ffd9d9 !important; }   /* red */
.neutral{ background: #efefef !important; }   /* gray */

.scorepos { color: #1a7f37; font-weight: 600; }
.scoreneg { color: #c62828; font-weight: 600; }

.mono { font-variant-numeric: tabular-nums; }

.coverage-legend {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 6px 0 0;
    color: #666;
    font-size: 0.9rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #ddd;
}

.box {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid #cfcfcf;
}

/* --- responsive safety: allow horizontal scroll if card is too narrow --- */
@media (max-width: 420px) {
    .coverage-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .coverage-table {
        min-width: 380px;
    }
}

.threat-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.threat-card {
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  background: #fafafa;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* ===== Type Pressure bars ===== */
.pressure-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.pressure-row {
  display: grid;
  grid-template-columns: 42px minmax(110px, 180px) 1fr 72px; /* rank | type | bar | value */
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.pressure-rank {
  color: #888;
  font-size: 0.9rem;
  text-align: right;
}

.type-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid #e6e6e6;
  background: #f6f6f6;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

/* progress bar */
.pressure-bar {
  position: relative;
  height: 10px;
  background: linear-gradient(#f3f3f3, #e9e9e9);
  border-radius: 999px;
  overflow: hidden;
}

.pressure-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(80,140,255,0.95), rgba(80,140,255,0.7));
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}

/* value */
.pressure-value {
  text-align: right;
  font-weight: 600;
  color: #333;
}

/* small screens: tighten the grid */
@media (max-width: 600px) {
  .pressure-row {
    grid-template-columns: 34px minmax(92px, 150px) 1fr 62px;
    padding: 8px;
  }
}

/* optional: subtle type tint for the chip; extend if you like */
.type-water   { background:#e9f3ff; border-color:#cfe4ff; }
.type-ground  { background:#f6eee4; border-color:#eadfce; }
.type-dark    { background:#eee;    border-color:#ddd; }
.type-flying  { background:#eef5ff; border-color:#d9e7ff; }
.type-steel   { background:#edf1f4; border-color:#dbe3ea; }
.type-normal  { background:#f5f5f5; border-color:#e6e6e6; }
.type-rock    { background:#f2ece3; border-color:#e3dac9; }
.type-fairy   { background:#ffeef7; border-color:#ffd6ea; }
.type-poison  { background:#f6e9ff; border-color:#ead6ff; }
.type-ghost   { background:#eee9ff; border-color:#ddd5ff; }
.type-ice     { background:#e9faff; border-color:#d4f1ff; }
.type-fighting{ background:#ffeaea; border-color:#ffd6d6; }
.type-psychic { background:#ffe9f3; border-color:#ffd4e7; }
.type-electric{ background:#fff7d9; border-color:#ffeeb0; }
.type-fire    { background:#ffefe9; border-color:#ffd9cc; }

