@import "https://fonts.googleapis.com/css2?family=Ubuntu+Mono&display=swap";

/* public/index.css */
html, body {
  overflow: hidden;
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, sans-serif;
  line-height: 1.6;
}

#app_root {
  width: 100%;
  height: 100%;
}

#app {
  display: flex;
  border: 0;
  flex-direction: column;
  height: 100vh;
  margin: 0;
  padding: 0;
}

#app_content {
  position: relative;
  overflow: hidden;
  flex: 1;
  height: 100vh;
}

.tv-broadcast-overlay {
  position: absolute;
  z-index: 120;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, sans-serif;
  font-weight: bold;
  top: 20px;
  left: 20px;
}

.broadcast-bar {
  display: flex;
  backdrop-filter: blur(10px);
  background: linear-gradient(90deg, #000000d9 0%, #000000e6 100%);
  border-radius: 6px;
  align-items:  center;
  gap: 8px;
  padding-right: 8px;
}

.team-info {
  display: flex;
  align-items:  center;
}

.team-name {
  color: #fff;
  text-align: center;
  min-width: 32px;
  padding: 4px 8px;
  font-size: 14px;
  font-weight: bold;
}

.red-team .team-name {
  background-color: #e74c3c;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.blue-team .team-name {
  background-color: #3498db;
  border-radius: 0;
}

.score-section {
  display: flex;
  align-items:  center;
  gap: 6px;
}

.score {
  color: #fff;
  text-align: center;
  min-width: 18px;
  font-size: 18px;
  font-weight: bold;
}

.score-separator {
  color: #ffffffb3;
  font-size: 16px;
}

.match-time {
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: 6px;
  width: 80px;
  font-size: 14px;
  font-weight: bold;
}

.play-pause-button {
  color: #fffc;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  background: none;
  border: 1px solid #ffffff4d;
  border-radius: 3px;
  justify-content: center;
  align-items:  center;
  width: 24px;
  height: 20px;
  margin: 0;
  padding: 2px 6px;
  transition: all .2s;
  font-size: 12px;
  line-height: 1;
}

.play-pause-button:hover {
  color: #fff;
  background: #ffffff1a;
  border-color: #ffffff80;
}

.play-icon {
  display: inline-block;
  transform: translateX(1px);
}

.pause-icon {
  display: inline-block;
}

#pitch-container {
  position: absolute;
  color: #fff;
  background: #00a878;
  inset: 0;
}

#gameview, #pitchInstructionView, #pitchInstructionViewContainer {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

button {
  color: #fff;
  cursor: pointer;
  display: block;
  background: #f71735;
  border: none;
  border-radius: 6px;
  margin-bottom: 6px;
  padding: 8px 16px;
  transition: all .3s;
  font-size: .9em;
  font-weight: bold;
}

button:hover {
  background: #d01430;
  transform: scale(1.01);
  box-shadow: 0 6px 12px #0000004d, inset 0 0 0 2px #ffffff1a;
}

button:active {
  background: #a01020;
  transition: all .1s;
  transform: scale(.98);
  box-shadow: inset 0 3px 8px #0006, inset 0 0 0 2px #ffffff1a;
}

.button-lime {
  width: 100%;
  color: #004e64 !important;
  background: #c9e265 !important;
}

.button-lime:hover {
  background: #b8d154 !important;
}

.button-lime:active {
  background: #96b032 !important;
}

.playerListFieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.playerListLegend {
  display: block;
  color: #fff;
  cursor: default;
  background: none;
  border-radius: 4px;
  margin-bottom: 2px;
  font-size: .9em;
  font-weight: bold;
}

.playerListLegendCollapsible {
  cursor: pointer;
  user-select: none;
  display: flex;
  box-sizing: border-box;
  align-items:  center;
  gap: 8px;
  width: 100%;
  padding: 8px;
  transition: background-color .2s;
}

.playerListLegendCollapsible:hover {
  background: #007a92;
}

.playerListLegendCollapsible:focus {
  outline: 2px solid #ffffff80;
  outline-offset: 2px;
}

.playerListToggleIcon {
  color: #fffc;
  flex-shrink: 0;
  font-size: 12px;
}

.playerRadioInput {
  display: none;
}

.playerRow {
  display: flex;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  background-color: #006b7d;
  border-radius: 4px;
  align-items:  center;
  margin-top: 2px;
  margin-bottom: 2px;
  padding: 8px;
  transition: background-color .2s;
  font-size: .9em;
}

.playerRow.hover {
  background-color: #007a92;
}

.playerRow.selected {
  color: #fff;
  background-color: #007a92;
  border-radius: 4px 4px 0 0;
  margin-bottom: 0;
  font-weight: bold;
}

.playerRow.onBall {
  color: #fff;
  position: relative;
  background-color: #28a745;
  font-weight: bold;
}

.playerRow.onBall:after {
  content: "⚽";
  margin-left: 8px;
  font-size: 1.1em;
}

.lineupImg {
  padding: 2px 10px 2px 2px;
}

.playerPosition {
  color: #fff;
  opacity: .8;
  flex-shrink: 0;
  padding-right: 10px;
}

.playerName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.playerInstruction {
  color: #fff;
  opacity: .6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: italic;
}

.playerInstructions {
  overflow: hidden;
  margin-top: 0;
  margin-bottom: 0;
  padding: 8px;
  transition: height .3s linear, opacity .3s linear, margin .3s linear, padding .3s linear;
}

.playerInstructions.expanded {
  opacity: 1;
  height: 70px;
}

.playerRow.selected + .playerInstructions.expanded {
  border-radius: 0 0 4px 4px;
}

.playerInstructions.collapsed {
  opacity: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

.overlay-controls {
  position: absolute;
  z-index: 100;
  pointer-events: none;
  inset: 0;
}

.overlay-controls > * {
  pointer-events: auto;
}

.overlay-player-list {
  position: absolute;
  backdrop-filter: blur(10px);
  overflow-y: auto;
  background: #004e6480;
  border-radius: 8px;
  width: 320px;
  padding: 10px;
  top: 20px;
  right: 20px;
  box-shadow: 0 8px 32px #0000004d;
}

.overlay-shout-controls {
  position: absolute;
  backdrop-filter: blur(10px);
  background: #004e6480;
  border-radius: 8px;
  padding: 0;
  bottom: 30px;
  right: 20px;
  box-shadow: 0 8px 32px #0000004d;
}

.mode-switcher {
  display: flex;
  overflow: hidden;
  border: 1px solid #fff3;
  border-radius: 8px;
  flex-direction: row;
  gap: 0;
}

.mode-button {
  display: flex;
  color: #fff;
  cursor: pointer;
  text-align: left;
  position: relative;
  background: #ffffff0d;
  border: none;
  border-bottom: 1px solid #ffffff26;
  border-radius: 0;
  align-items:  center;
  gap: 8px;
  margin-bottom: 0;
  transition: all .3s;
  font-size: 14px;
}

.mode-button:last-child {
  border-bottom: none;
}

.mode-button:hover:not(.disabled):not(.active) {
  background: #ffffff1a;
}

.mode-button.active {
  background: #fff3;
  font-weight: 500;
}

.mode-button.active:before {
  content: "";
  position: absolute;
  background: #0f0;
  width: 3px;
  top: 0;
  bottom: 0;
  left: 0;
}

.mode-button.disabled {
  opacity: .4;
  cursor: not-allowed;
}

.mode-indicator {
  display: none;
  width: 0;
}

.mode-label {
  flex: 1;
}

.game-over-modal-overlay {
  position: fixed;
  backdrop-filter: blur(10px);
  display: flex;
  z-index: 200;
  background: #000c;
  justify-content: center;
  align-items:  center;
  inset: 0;
}

.game-over-modal {
  text-align: center;
  background: linear-gradient(135deg, #000000f2 0%, #000000e6 100%);
  border: 2px solid #ffffff1a;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  padding: 32px;
  box-shadow: 0 16px 64px #0009;
}

.game-over-header {
  margin-bottom: 24px;
}

.game-over-header h2 {
  color: #fff;
  text-shadow: 2px 2px 4px #00000080;
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: bold;
}

.game-over-time {
  color: #fffc;
  font-size: 16px;
  font-weight: bold;
}

.game-over-score {
  margin-bottom: 24px;
}

.final-score-section {
  display: flex;
  justify-content: center;
  align-items:  center;
  gap: 16px;
  margin-bottom: 16px;
}

.team-score {
  display: flex;
  flex-direction: column;
  align-items:  center;
  gap: 8px;
}

.team-score .team-name {
  color: #fff;
  text-align: center;
  border-radius: 6px;
  min-width: 48px;
  padding: 8px 16px;
  font-size: 18px;
  font-weight: bold;
}

.team-score.red-team .team-name {
  background-color: #e74c3c;
}

.team-score.blue-team .team-name {
  background-color: #3498db;
}

.team-score .score {
  color: #fff;
  text-shadow: 2px 2px 4px #00000080;
  font-size: 48px;
  font-weight: bold;
}

.final-score-section .score-separator {
  color: #ffffffb3;
  align-self:  flex-end;
  margin-bottom: 8px;
  font-size: 32px;
  font-weight: bold;
}

.game-over-winner {
  margin-bottom: 32px;
}

.game-over-winner h3 {
  color: #f39c12;
  text-shadow: 2px 2px 4px #00000080;
  animation: glow 2s ease-in-out infinite alternate;
  margin: 0;
  font-size: 24px;
  font-weight: bold;
}

@keyframes glow {
  from {
    text-shadow: 2px 2px 4px #00000080, 0 0 10px #f39c1280;
  }

  to {
    text-shadow: 2px 2px 4px #00000080, 0 0 20px #f39c12cc;
  }
}

.game-over-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.restart-button {
  color: #fff;
  cursor: pointer;
  background: #27ae60;
  border: none;
  border-radius: 8px;
  min-width: 150px;
  padding: 12px 32px;
  transition: all .3s;
  font-size: 16px;
  font-weight: bold;
}

.restart-button:hover {
  background: #219a52;
  transform: scale(1.05);
  box-shadow: 0 8px 24px #27ae604d;
}

.restart-button:active {
  background: #1e8449;
  transform: scale(.98);
}

.pass-action-cursor {
  cursor: crosshair;
}

.pass-to-player-cursor {
  cursor: pointer;
}

.pass-tooltip {
  position: fixed;
  color: #fff;
  pointer-events: none;
  z-index: 200;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  background: #000000d9;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: bold;
  transform: translate(-50%, -150%);
  box-shadow: 0 2px 8px #0000004d;
}

.pass-tooltip.pass-to-player {
  background: #22c55ee6;
  border: 1px solid #4ade804d;
}

.pass-tooltip.pass-to-space {
  background: #3b82f6e6;
  border: 1px solid #60a5fa4d;
}

.mode-indicator {
  position: absolute;
  color: #fff;
  z-index: 10;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: bold;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 10px #0000004d;
}

.mode-indicator.passing-mode {
  background-color: #22c55ee6;
}

.mode-indicator.follow-ball {
  background-color: #3498dbe6;
}

@media (max-width: 768px) {
  .overlay-player-list {
    width: 280px;
    max-width: calc(100vw - 40px);
    max-height: 45vh;
  }

  .tv-broadcast-overlay {
    font-size: 12px;
    top: 10px;
    left: 10px;
  }

  .team-name {
    min-width: 28px;
    padding: 3px 6px;
    font-size: 12px;
  }

  .score {
    font-size: 16px;
  }

  .match-time {
    width: 70px;
    font-size: 12px;
  }

  .play-pause-button {
    width: 32px;
    height: 28px;
    font-size: 11px;
  }

  .mode-indicator {
    padding: 8px 16px;
    font-size: 14px;
    top: 50px;
  }

  button {
    min-height: 44px;
    margin-bottom: 8px;
    padding: 12px 16px;
    font-size: 16px;
  }

  .playerRow {
    min-height: 44px;
    padding: 12px 8px;
    font-size: 16px;
  }

  .playerPosition {
    font-size: 14px;
  }

  .playerName {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .overlay-player-list {
    width: calc(100vw - 20px);
    max-width: 320px;
    max-height: 35vh;
    margin: 0 auto;
    top: 80px;
    left: 10px;
    right: 10px;
  }

  .tv-broadcast-overlay {
    font-size: 11px;
    top: 8px;
    left: 8px;
  }

  .broadcast-bar {
    gap: 8px;
    padding-left: 4px;
    padding-right: 8px;
  }

  .team-name {
    min-width: 28px;
    padding: 4px 6px;
    font-size: 12px;
  }

  .score {
    font-size: 16px;
  }

  .score-section {
    gap: 8px;
  }

  .match-time {
    gap: 8px;
    width: 70px;
    font-size: 12px;
  }

  .play-pause-button {
    width: 32px;
    height: 28px;
    font-size: 11px;
  }

  .overlay-shout-controls {
    bottom: 20px;
    right: 10px;
  }

  .mode-indicator {
    text-align: center;
    max-width: calc(100vw - 20px);
    padding: 6px 12px;
    font-size: 13px;
    top: 45px;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 768px) and (orientation: portrait) {
  .overlay-player-list {
    overflow-y: auto;
    max-height: 40vh;
  }

  .overlay-shout-controls {
    bottom: 15px;
  }
}
