/* Game Details Modal Styles */

/* Backdrop overlay */
.game-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.game-modal-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

/* Modal container */
.game-modal {
  background: transparent;
  border-radius: 0;
  width: 95%;
  max-width: 1200px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  border-radius: 12px;
  transition: transform 0.2s ease;
}

.game-modal-backdrop.active .game-modal {
  transform: scale(1);
}

/* Close button */
.game-modal-close {
  display: none;
}

/* Header section */
.game-modal-header {
  padding: 24px 32px 16px;
  text-align: center;
}

.game-modal-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 6px;
  object-fit: cover;
  background: #fff;
  border: 4px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.game-modal-player-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 2px;
}

.game-modal-player-subtitle {
  font-size: 0.95rem;
  color: #666;
  margin: 0 0 8px;
}

/* Match info */
.game-modal-match {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 4px;
}

.game-modal-team-crest {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.game-modal-team-name-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #666;
  min-width: 60px;
  text-align: center;
}

.game-modal-match-score {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
}

.game-modal-match-date {
  font-size: 0.85rem;
  color: #888;
  margin: 0;
}

/* Score summary card */
.game-modal-summary {
  background: #fff;
  border-radius: 12px;
  padding: 24px 24px;
  margin: 0 24px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.game-modal-scores {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 32px;
  align-items: center;
}

/* Side score badges */
.game-modal-score-badge {
  text-align: center;
}

.game-modal-score-value {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e8f5e9;
  color: #2e7d32;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 8px;
}

.game-modal-score-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Center gauge */
.game-modal-gauge {
  text-align: center;
  position: relative;
}

.game-modal-gauge-svg {
  width: 140px;
  height: 80px;
  margin: 0 auto;
  display: block;
}

.game-modal-gauge-bg {
  fill: none;
  stroke: #e0e0e0;
  stroke-width: 12;
  stroke-linecap: round;
}

.game-modal-gauge-fill {
  fill: none;
  stroke: #2e7d32;
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.game-modal-gauge-text {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: -55px 0 4px;
  position: relative;
  z-index: 1;
}

.game-modal-gauge-subtext {
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.game-modal-gauge-events {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: #666;
}

.game-modal-gauge-events img {
  width: 16px;
  height: 16px;
}

/* Decisive actions summary */
.game-modal-decisive-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #555;
  font-weight: 600;
  margin-top: 4px;
}

.decisive-action-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 2px;
}

/* Tabs */
.game-modal-tabs {
  display: flex;
  gap: 0;
  background: #fff;
  margin: 0 24px;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.game-modal-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 16px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  border-bottom: 3px solid transparent;
}

.game-modal-tab:hover {
  color: #555;
}

.game-modal-tab.active {
  color: #ff6b35;
  border-bottom-color: #ff6b35;
}

/* Tab content */
.game-modal-content {
  background: #fff;
  margin: 0 24px 24px;
  border-radius: 0 0 12px 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Total row */
.game-modal-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #f5f5f5;
  border-radius: 8px;
  margin-bottom: 12px;
}

.game-modal-total-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-modal-total-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2e7d32;
}

/* Stats table */
.game-modal-stats-header {
  display: grid;
  grid-template-columns: 60px 1fr 80px;
  gap: 16px;
  padding: 8px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e0e0e0;
}

.game-modal-stats-header div:first-child {
  text-align: left;
}

.game-modal-stats-header div:nth-child(2) {
  text-align: center;
}

.game-modal-stats-header div:last-child {
  text-align: right;
}

.game-modal-stats-row {
  display: grid;
  grid-template-columns: 60px 1fr 80px;
  gap: 16px;
  padding: 8px 16px;
  align-items: center;
  transition: background 0.15s;
}

.game-modal-stats-row:hover {
  background: #fafafa;
}

.game-modal-stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  text-align: left;
}

.game-modal-stat-name {
  font-size: 0.9rem;
  color: #555;
  text-align: center;
}

.game-modal-stat-points {
  font-size: 1rem;
  font-weight: 700;
  color: #2e7d32;
  text-align: right;
}

/* Loading state */
.game-modal-loading {
  padding: 60px 24px;
  text-align: center;
  color: #888;
  font-size: 0.95rem;
}

/* Scrollbar styling */
.game-modal::-webkit-scrollbar {
  width: 8px;
}

.game-modal::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 0 16px 16px 0;
}

.game-modal::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 4px;
}

.game-modal::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Game Formation Modal Styles */
.game-formation-modal {
  padding: 0;
  display: flex;
  flex-direction: column;
  background: #000;
}

.game-formation-header {
  background: #242424;
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  width: 100%;
}

.game-formation-match {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 24px;
  padding: 0 32px;
}

.game-formation-team-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.game-formation-team-section--home {
  justify-content: flex-start;
}

.game-formation-team-section--away {
  justify-content: flex-end;
}

.game-formation-team-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.game-formation-pill {
  background: #666;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.game-formation-team-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.game-formation-team-score {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-left: auto;
}

.game-formation-team-section--away .game-formation-team-score {
  margin-left: 0;
  margin-right: auto;
}

.game-formation-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
}

.game-formation-dash {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.game-formation-minutes {
  font-size: 0.9rem;
  font-weight: 700;
}

.game-formation-date {
  font-size: 0.8rem;
  color: #aaa;
}

.game-formation-live {
  color: #ff0000;
  font-weight: 700;
  animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.game-formation-field-container {
  background-image: url("../lineup_image_bg.png");
  background-size: 100% 100%;
  background-position: center top;
  background-repeat: no-repeat;
  position: relative;
  width: 100%;
  aspect-ratio: 1024 / 403;
}

.game-formation-lineup {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: center;
  padding: 0 20px;
}

.game-formation-lineup--home {
  left: 0;
}

.game-formation-lineup--away {
  right: 0;
}

.game-formation-row {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  height: 100%;
}

.game-formation-player {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.game-formation-player-info {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.game-formation-player-number {
  font-size: 0.7rem;
  color: #d1d1d1;
  font-weight: 600;
}

.game-formation-player-name {
  font-size: 0.75rem;
  color: #fff;
  font-weight: 600;
}

.game-formation-player-score {
  width: 40px;
  padding: 3px 6px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
}

.game-formation-player-score.score-elite {
  background: #00a749;
}

.game-formation-player-score.score-great {
  background: #24c792;
}

.game-formation-player-score.score-good {
  background: #b0c623;
}

.game-formation-player-score.score-ok {
  background: #f0ce1d;
}

.game-formation-player-score.score-poor {
  background: #f09b1b;
}

.game-formation-player-score.score-terrible {
  background: #dc1a0f;
}

.game-formation-player-score.score-nt {
  background: #666;
}

.game-formation-player-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
}

.game-formation-player-circle > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.game-formation-player-events {
  position: absolute;
  bottom: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.game-formation-player-events--top-left {
  top: 0;
  right: 100%;
  margin-right: -6px;
  flex-direction: row-reverse;
}

.game-formation-player-events--left {
  right: 100%;
  margin-right: -6px;
  flex-direction: row-reverse;
}

.game-formation-player-events--right {
  left: 100%;
  margin-left: -6px;
  flex-direction: row;
}

.game-formation-event-icon {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  margin: 0 -4.5px;
  position: relative;
  pointer-events: none;
}

.game-formation-sub-indicator {
  position: absolute;
  top: -2px;
  right: -24px;
  display: flex;
  align-items: center;
  gap: 2px;
  pointer-events: none;
}

.game-formation-sub-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dc1a0f;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  border: 2px solid #fff;
}

.game-formation-sub-icon img {
  width: 10px;
  height: 10px;
  object-fit: contain;
}

.game-formation-sub-minute {
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.game-formation-sub-icon--in {
  background: #00a749;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
  .game-modal {
    width: 96%;
    max-height: 92vh;
  }

  .game-modal-header {
    padding: 20px 24px 14px;
  }

  .game-modal-avatar {
    width: 80px;
    height: 80px;
  }

  .game-modal-player-name {
    font-size: 1.3rem;
  }

  .game-modal-summary {
    padding: 20px;
    margin: 0 20px 20px;
  }

  .game-modal-scores {
    gap: 24px;
  }

  .game-modal-tabs {
    margin: 0 20px;
  }

  .game-modal-content {
    margin: 0 20px 20px;
    padding: 20px;
  }

  .game-formation-field-container {
    aspect-ratio: 1024 / 450;
  }
}

@media (max-width: 768px) {
  .game-modal {
    width: 98%;
    max-height: 94vh;
    border-radius: 8px;
  }

  .game-modal-header {
    padding: 16px 20px 12px;
  }

  .game-modal-avatar {
    width: 70px;
    height: 70px;
    border: 3px solid #fff;
  }

  .game-modal-player-name {
    font-size: 1.2rem;
  }

  .game-modal-player-subtitle {
    font-size: 0.85rem;
  }

  .game-modal-team-crest {
    width: 24px;
    height: 24px;
  }

  .game-modal-team-name-text {
    font-size: 0.8rem;
    min-width: 50px;
  }

  .game-modal-match-score {
    font-size: 1rem;
  }

  .game-modal-summary {
    padding: 16px;
    margin: 0 16px 16px;
  }

  .game-modal-scores {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .game-modal-score-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
  }

  .game-modal-score-value {
    width: 56px;
    height: 56px;
    font-size: 1.3rem;
    margin: 0;
  }

  .game-modal-score-label {
    font-size: 0.7rem;
    text-align: left;
  }

  .game-modal-gauge {
    order: -1;
  }

  .game-modal-gauge-svg {
    width: 120px;
    height: 70px;
  }

  .game-modal-gauge-text {
    font-size: 2.2rem;
    margin: -48px 0 4px;
  }

  .game-modal-gauge-subtext {
    font-size: 0.75rem;
  }

  .game-modal-tabs {
    margin: 0 16px;
    flex-wrap: wrap;
  }

  .game-modal-tab {
    flex: 1 1 auto;
    min-width: 80px;
    padding: 14px 10px;
    font-size: 0.85rem;
  }

  .game-modal-content {
    margin: 0 16px 16px;
    padding: 16px;
  }

  .game-modal-stats-header {
    grid-template-columns: 50px 1fr 70px;
    gap: 12px;
    padding: 6px 12px;
    font-size: 0.7rem;
  }

  .game-modal-stats-row {
    grid-template-columns: 50px 1fr 70px;
    gap: 12px;
    padding: 6px 12px;
  }

  .game-modal-stat-value {
    font-size: 0.9rem;
  }

  .game-modal-stat-name {
    font-size: 0.85rem;
  }

  .game-modal-stat-points {
    font-size: 0.9rem;
  }

  .game-formation-header {
    height: 65px;
  }

  .game-formation-match {
    gap: 16px;
    padding: 0 20px;
  }

  .game-formation-team-logo {
    width: 32px;
    height: 32px;
  }

  .game-formation-pill {
    font-size: 0.7rem;
    padding: 3px 8px;
  }

  .game-formation-team-name {
    font-size: 0.9rem;
  }

  .game-formation-team-score {
    font-size: 2rem;
  }

  .game-formation-dash {
    font-size: 2rem;
  }

  .game-formation-minutes {
    font-size: 0.8rem;
  }

  .game-formation-date {
    font-size: 0.75rem;
  }

  .game-formation-field-container {
    aspect-ratio: 1024 / 500;
  }

  .game-formation-lineup {
    padding: 0 12px;
  }

  .game-formation-player-number {
    font-size: 0.65rem;
  }

  .game-formation-player-name {
    font-size: 0.7rem;
  }

  .game-formation-player-score {
    width: 36px;
    font-size: 0.65rem;
  }

  .game-formation-player-circle {
    width: 36px;
    height: 36px;
  }

  .game-formation-event-icon {
    width: 13px;
    height: 13px;
  }

  .game-formation-sub-icon {
    width: 16px;
    height: 16px;
  }

  .game-formation-sub-icon img {
    width: 9px;
    height: 9px;
  }

  .game-formation-sub-minute {
    font-size: 0.6rem;
  }
}

@media (max-width: 640px) {
  .game-modal {
    width: 100%;
    max-height: 96vh;
    border-radius: 0;
  }

  .game-modal-header {
    padding: 14px 16px 10px;
  }

  .game-modal-avatar {
    width: 60px;
    height: 60px;
    border: 2px solid #fff;
  }

  .game-modal-player-name {
    font-size: 1.1rem;
  }

  .game-modal-player-subtitle {
    font-size: 0.8rem;
  }

  .game-modal-match {
    gap: 8px;
    flex-wrap: wrap;
  }

  .game-modal-team-crest {
    width: 20px;
    height: 20px;
  }

  .game-modal-team-name-text {
    font-size: 0.75rem;
    min-width: 40px;
  }

  .game-modal-match-score {
    font-size: 0.95rem;
  }

  .game-modal-match-date {
    font-size: 0.8rem;
    width: 100%;
    text-align: center;
  }

  .game-modal-summary {
    padding: 14px;
    margin: 0 12px 12px;
  }

  .game-modal-scores {
    gap: 16px;
  }

  .game-modal-score-value {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  .game-modal-score-label {
    font-size: 0.65rem;
  }

  .game-modal-gauge-svg {
    width: 110px;
    height: 65px;
  }

  .game-modal-gauge-text {
    font-size: 2rem;
    margin: -45px 0 4px;
  }

  .game-modal-gauge-subtext {
    font-size: 0.7rem;
  }

  .game-modal-gauge-events {
    gap: 4px;
    font-size: 0.8rem;
    flex-wrap: wrap;
  }

  .game-modal-gauge-events img {
    width: 14px;
    height: 14px;
  }

  .game-modal-tabs {
    margin: 0 12px;
  }

  .game-modal-tab {
    padding: 12px 8px;
    font-size: 0.8rem;
    min-width: 70px;
  }

  .game-modal-content {
    margin: 0 12px 12px;
    padding: 14px;
  }

  .game-modal-total {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .game-modal-total-label {
    font-size: 0.85rem;
  }

  .game-modal-total-value {
    font-size: 1.6rem;
  }

  .game-modal-stats-header {
    grid-template-columns: 45px 1fr 65px;
    gap: 8px;
    padding: 6px 10px;
    font-size: 0.65rem;
  }

  .game-modal-stats-row {
    grid-template-columns: 45px 1fr 65px;
    gap: 8px;
    padding: 6px 10px;
  }

  .game-modal-stat-value {
    font-size: 0.85rem;
  }

  .game-modal-stat-name {
    font-size: 0.8rem;
  }

  .game-modal-stat-points {
    font-size: 0.85rem;
  }

  .game-formation-header {
    height: 55px;
  }

  .game-formation-match {
    gap: 12px;
    padding: 0 12px;
  }

  .game-formation-team-section {
    gap: 8px;
  }

  .game-formation-team-logo {
    width: 28px;
    height: 28px;
  }

  .game-formation-pill {
    font-size: 0.65rem;
    padding: 2px 6px;
  }

  .game-formation-team-name {
    font-size: 0.8rem;
  }

  .game-formation-team-score {
    font-size: 1.8rem;
  }

  .game-formation-dash {
    font-size: 1.8rem;
  }

  .game-formation-minutes {
    font-size: 0.75rem;
  }

  .game-formation-date {
    font-size: 0.7rem;
  }

  .game-formation-field-container {
    aspect-ratio: 1024 / 600;
  }

  .game-formation-lineup {
    padding: 0 8px;
  }

  .game-formation-player {
    gap: 3px;
  }

  .game-formation-player-info {
    gap: 3px;
  }

  .game-formation-player-number {
    font-size: 0.6rem;
  }

  .game-formation-player-name {
    font-size: 0.65rem;
  }

  .game-formation-player-score {
    width: 32px;
    padding: 2px 5px;
    font-size: 0.6rem;
  }

  .game-formation-player-circle {
    width: 32px;
    height: 32px;
  }

  .game-formation-event-icon {
    width: 12px;
    height: 12px;
    margin: 0 -3.5px;
  }

  .game-formation-sub-icon {
    width: 14px;
    height: 14px;
  }

  .game-formation-sub-icon img {
    width: 8px;
    height: 8px;
  }

  .game-formation-sub-minute {
    font-size: 0.55rem;
  }
}

/* Substitutes Bench Styles */
.game-formation-bench-container {
  background: #1a1a1a;
  padding: 24px 32px;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.game-formation-bench-section {
  flex: 1;
  min-width: 300px;
}

.game-formation-bench-header {
  font-size: 0.9rem;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
  text-align: center;
}

.game-formation-bench-players {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  align-items: flex-start;
}

.game-formation-bench-player {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.game-formation-bench-empty {
  color: #666;
  font-size: 0.85rem;
  text-align: center;
  padding: 20px;
  width: 100%;
}

@media (max-width: 1024px) {
  .game-formation-bench-container {
    padding: 20px 24px;
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .game-formation-bench-container {
    padding: 16px 20px;
    gap: 20px;
    flex-direction: column;
  }

  .game-formation-bench-section {
    min-width: 100%;
  }

  .game-formation-bench-header {
    font-size: 0.85rem;
    margin-bottom: 12px;
  }

  .game-formation-bench-players {
    gap: 12px;
  }
}

@media (max-width: 640px) {
  .game-formation-bench-container {
    padding: 12px 16px;
    gap: 16px;
  }

  .game-formation-bench-header {
    font-size: 0.8rem;
    margin-bottom: 10px;
  }

  .game-formation-bench-players {
    gap: 10px;
  }
}
