/* Box2Box - 3x3 Immaculate Grid layout, Moroccan football theme */

.b2b-body {
  background: #1d1a47;
  color: #fff;
  font-family: "Courier New", "DejaVu Sans Mono", monospace;
}

.b2b-wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 12px;
}

.b2b-title {
  text-align: center;
  font-size: 24px;
  letter-spacing: 6px;
  font-weight: 700;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.b2b-stats {
  display: flex;
  justify-content: space-around;
  background: #4538e0;
  padding: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  margin: 12px 0;
}

.b2b-grid-wrap {
  background: #000;
  padding: 2px;
}
.b2b-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.b2b-grid th, .b2b-grid td {
  width: 25%;
  border: 2px solid #000;
  padding: 0;
  vertical-align: middle;
}
.b2b-grid .corner {
  background: #4538e0;
  text-align: center;
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 10px;
  padding: 14px 4px;
}
.b2b-grid .col-head, .b2b-grid .row-head {
  background: #2d5a2a;
  text-align: center;
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
}
.b2b-grid .col-head .type {
  display: block;
  font-size: 9px;
  color: #c4e9bd;
  margin: 2px 0;
  font-weight: 400;
  letter-spacing: 2px;
}
.b2b-grid .col-head .text,
.b2b-grid .row-head .text {
  display: block;
  margin-top: 4px;
  line-height: 1.1;
}
.b2b-img {
  display: block;
  margin: 0 auto;
  max-width: 48px;
  max-height: 48px;
  width: auto;
  height: auto;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}
/* Only country flags get the circle frame — crests stay their native shape. */
.b2b-grid .row-head .b2b-img.is-nation,
.b2b-grid .col-head .b2b-img.is-nation {
  border-radius: 50%;
  border: 2px solid #fff;
  background: #fff;
  width: 48px;
  height: 48px;
  object-fit: cover;
}
.b2b-grid .col-head .b2b-img { max-height: 40px; }
.b2b-grid .row-head { padding: 6px 4px; }
.b2b-grid .cell {
  background: #3a7a37;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}
.b2b-grid .cell:hover { background: #4a8d46; }
.b2b-grid .cell .empty {
  color: #c4e9bd;
  font-size: 10px;
  letter-spacing: 1px;
  text-align: center;
  padding-top: 45%;
  pointer-events: none;
}
.b2b-grid .cell .empty::before {
  content: "+";
  display: block;
  font-size: 32px;
  font-weight: 300;
  line-height: 0.8;
  margin-bottom: 4px;
}
.b2b-grid .cell.filled {
  background: #12224a;
  cursor: default;
}
.b2b-grid .cell.filled .player-kit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 6px;
}
.b2b-grid .cell.filled .player-kit .num {
  background: #0039a6;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  clip-path: polygon(0% 10%, 18% 0%, 30% 10%, 70% 10%, 82% 0%, 100% 10%, 100% 100%, 0% 100%);
  margin-bottom: 4px;
  color: #fff;
}
.b2b-grid .cell.filled .player-kit .name {
  font-size: 10px;
  text-align: center;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* search modal */
.b2b-search {
  position: relative;
  margin-top: 16px;
  background: #fff;
  color: #111;
  border: 3px solid #000;
  padding: 8px;
}
.b2b-input {
  width: calc(100% - 48px);
  font-family: inherit;
  font-size: 14px;
  padding: 8px;
  border: 2px solid #111;
}
.b2b-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: #e53e3e;
  color: #fff;
  border: 2px solid #111;
  font-weight: 700;
  cursor: pointer;
}
.b2b-results {
  max-height: 260px;
  overflow-y: auto;
  margin-top: 8px;
}
.b2b-results div {
  padding: 8px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}
.b2b-results div:hover { background: #d4ff00; }
.b2b-results .sub {
  font-size: 11px;
  color: #666;
}

#b2b-result:not(:empty) {
  margin-top: 14px;
  padding: 12px;
  background: #12224a;
  text-align: center;
}
