*{box-sizing:border-box} 
html,body{height:100%;margin:0;font-family:system-ui,Segoe UI,Roboto,Arial,sans-serif;touch-action:manipulation;-ms-touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
input,select,textarea,button{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}
.topbar{display:flex;align-items:center;justify-content:space-between;padding:12px 20px;background:linear-gradient(135deg, #0a3d2e 0%, #0d5242 100%);color:#fff;box-shadow:0 2px 8px rgba(0,0,0,0.2)}
.topbar h1{margin:0;font-size:24px;font-weight:700}
.topbar .controls{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.topbar .control-group{display:flex;gap:8px;align-items:center;padding:6px 12px;background:rgba(255,255,255,0.1);border-radius:8px;border:1px solid rgba(255,255,255,0.15)}
.topbar label{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:500}
.topbar select{padding:6px 10px;border:1px solid rgba(255,255,255,0.3);border-radius:4px;background:rgba(255,255,255,0.95);font-size:13px;min-width:150px}
.topbar input[type="text"]{padding:6px 10px;border:1px solid rgba(255,255,255,0.3);border-radius:4px;font-size:13px;min-width:150px}
.topbar button{padding:6px 14px;background:#fff;color:#0a3d2e;border:none;border-radius:6px;cursor:pointer;font-weight:600;font-size:13px;transition:all 0.2s;box-shadow:0 2px 4px rgba(0,0,0,0.1)}
.topbar button:hover{background:#f0f0f0;transform:translateY(-1px);box-shadow:0 3px 6px rgba(0,0,0,0.15)}
.topbar button:active{transform:translateY(0);box-shadow:0 1px 2px rgba(0,0,0,0.1)}
.topbar button.danger{background:#dc3545;color:#fff}
.topbar button.danger:hover{background:#c82333}
.link{color:#fff;text-decoration:none;padding:6px 14px;background:rgba(255,255,255,0.15);border-radius:6px;font-weight:600;font-size:13px;transition:all 0.2s;border:1px solid rgba(255,255,255,0.2)}
.link:hover{background:rgba(255,255,255,0.25);border-color:rgba(255,255,255,0.4)}

.board-container{display:flex;gap:16px;padding:16px;padding-bottom:140px;transition:all 0.3s ease}
/* When toolbar is hidden, reduce bottom padding back to single-footer height */
.toolbar-hidden .board-container{padding-bottom:80px}
.field-column{flex:1;display:flex;flex-direction:column;gap:16px;max-width:1200px;transition:all 0.3s ease}
.board-container:has(.palette.collapsed) .field-column{max-width:none}
.board{
  position:relative;
  width:100%;
  aspect-ratio:16/10.5;
  max-height:80vh;
  border:4px solid #0a3d2e;border-radius:8px;overflow:visible;
  touch-action:none;
  /* grass + vertical mowing stripes */
  background: linear-gradient(90deg,
    #4a7c59 0%, #4a7c59 6.25%,
    #5a9068 6.25%, #5a9068 12.5%,
    #4a7c59 12.5%, #4a7c59 18.75%,
    #5a9068 18.75%, #5a9068 25%,
    #4a7c59 25%, #4a7c59 31.25%,
    #5a9068 31.25%, #5a9068 37.5%,
    #4a7c59 37.5%, #4a7c59 43.75%,
    #5a9068 43.75%, #5a9068 50%,
    #4a7c59 50%, #4a7c59 56.25%,
    #5a9068 56.25%, #5a9068 62.5%,
    #4a7c59 62.5%, #4a7c59 68.75%,
    #5a9068 68.75%, #5a9068 75%,
    #4a7c59 75%, #4a7c59 81.25%,
    #5a9068 81.25%, #5a9068 87.5%,
    #4a7c59 87.5%, #4a7c59 93.75%,
    #5a9068 93.75%, #5a9068 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Field boundary */
.field-boundary {
  position: absolute;
  top: 4%;
  left: 6%;
  width: 88%;
  height: 92%;
  border: 4px solid white;
  pointer-events: none;
}

/* Halfway line */
.halfway-line {
  position: absolute;
  top: 4%;
  left: 50%;
  width: 4px;
  height: 92%;
  background: white;
  transform: translateX(-50%);
  pointer-events: none;
}

/* Center circle */
.center-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18%;
  height: 27.5%;
  border: 4px solid white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Center spot */
.center-spot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.2%;
  height: 1.8%;
  background: white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Left penalty area */
.penalty-area-left {
  position: absolute;
  top: 23%;
  left: 6%;
  width: 13%;
  height: 54%;
  border: 4px solid white;
  border-left: none;
  pointer-events: none;
}

/* Right penalty area */
.penalty-area-right {
  position: absolute;
  top: 23%;
  right: 6%;
  width: 13%;
  height: 54%;
  border: 4px solid white;
  border-right: none;
  pointer-events: none;
}

/* Left goal area */
.goal-area-left {
  position: absolute;
  top: 37%;
  left: 6%;
  width: 5%;
  height: 26%;
  border: 4px solid white;
  border-left: none;
  pointer-events: none;
}

/* Right goal area */
.goal-area-right {
  position: absolute;
  top: 37%;
  right: 6%;
  width: 5%;
  height: 26%;
  border: 4px solid white;
  border-right: none;
  pointer-events: none;
}

/* Left penalty arc */
/* Team names */
.team-name {
  position: absolute;
  top: 0%;
  color: white;
  font-size: 1vw;
  font-weight: bold;
  text-align: center;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  z-index: 100;
  text-transform: uppercase;
  letter-spacing: 1px;
  width: 40%;
  padding: 1px 0;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.team-home {
  left: 5%;
  border-left: 3px solid #fff;
  border-right: 3px solid transparent;
}

.team-away {
  right: 5%;
  border-right: 3px solid #fff;
  border-left: 3px solid transparent;
}

.penalty-arc-left {
  position: absolute;
  top: 50%;
  right: 14.5%;
  width: 9%;
  height: 13.8%;
  border: 4px solid white;
  border-right: none;
  border-radius: 50%;
  transform: translateY(-50%);
  clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
  pointer-events: none;
}

/* Right penalty arc */
.penalty-arc-right {
  position: absolute;
  top: 50%;
  left: 14.5%;
  width: 9%;
  height: 13.8%;
  border: 4px solid white;
  border-left: none;
  border-radius: 50%;
  transform: translateY(-50%);
  clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
  pointer-events: none;
}

/* Penalty spots */
.penalty-spot-left {
  position: absolute;
  top: 50%;
  left: 14.5%;
  width: 1%;
  height: 1.5%;
  background: white;
  border-radius: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.penalty-spot-right {
  position: absolute;
  top: 50%;
  right: 14.5%;
  width: 1%;
  height: 1.5%;
  background: white;
  border-radius: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Corner arcs */
.corner-arc {
  position: absolute;
  width: 3%;
  height: 4.6%;
  border: 4px solid white;
  border-radius: 50%;
  pointer-events: none;
}

.corner-arc.top-left {
  top: 4%;
  left: 6%;
  border-right: none;
  border-bottom: none;
  clip-path: polygon(0 0, 0 100%, 100% 100%);
}

.corner-arc.top-right {
  top: 4%;
  right: 6%;
  border-left: none;
  border-bottom: none;
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

.corner-arc.bottom-left {
  bottom: 4%;
  left: 6%;
  border-right: none;
  border-top: none;
  clip-path: polygon(0 0, 0 100%, 100% 0);
}

.corner-arc.bottom-right {
  bottom: 4%;
  right: 6%;
  border-left: none;
  border-top: none;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}




/* Goals */
.goal {
  position: absolute;
  width: 2%;
  height: 12%;
  background: rgba(255, 255, 255, 0.2);
  border: 4px solid white;
  pointer-events: none;
}

.goal-left {
  top: 44%;
  left: 4%;
  border-right: none;
}

.goal-right {
  top: 44%;
  right: 4%;
  border-left: none;
}

/* drawing overlay */
.overlay{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}
.overlay path{stroke-linecap:round;stroke-linejoin:round}

/* heatmap canvas */
.heatmap-canvas{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:5;opacity:0.5}

/* drawing tools section */
.drawing-tools{background:#ffffff;border:1px solid #d0d5dd;border-radius:12px;padding:16px;box-shadow:0 4px 12px rgba(0,0,0,0.08)}
.drawing-tools h3{margin:0 0 12px 0;font-size:16px;font-weight:700;color:#0a3d2e;display:flex;align-items:center;gap:8px}
.drawing-tools h3::before{content:'';width:4px;height:20px;background:#0a3d2e;border-radius:2px}
.drawing-controls{display:flex;gap:16px;flex-wrap:wrap;align-items:end}
.drawing-controls .form-row{margin-bottom:0;min-width:140px}
.drawing-controls .form-row label{font-size:13px;font-weight:600;color:#374151;margin-bottom:4px}
.drawing-controls input[type="color"]{height:40px;cursor:pointer;padding:4px;border:1px solid #d0d5dd;border-radius:6px;transition:border-color 0.2s}
.drawing-controls input[type="color"]:focus{outline:none;border-color:#0a3d2e;box-shadow:0 0 0 3px rgba(10,61,46,0.1)}
.drawing-controls select{padding:8px 10px;border:1px solid #d0d5dd;border-radius:6px;font-size:13px;transition:border-color 0.2s}
.drawing-controls select:focus{outline:none;border-color:#0a3d2e;box-shadow:0 0 0 3px rgba(10,61,46,0.1)}
.drawing-controls input[type="checkbox"]{width:18px;height:18px;cursor:pointer;margin-right:8px;accent-color:#0a3d2e}
.drawing-controls .form-row label:has(input[type="checkbox"]){flex-direction:row;align-items:center;font-weight:500}
.drawing-buttons{display:flex;gap:8px;margin-left:auto}
.drawing-buttons button{padding:10px 16px;background:#0a3d2e;color:#fff;border:none;border-radius:6px;cursor:pointer;font-weight:600;font-size:14px;transition:all 0.2s;box-shadow:0 2px 4px rgba(0,0,0,0.1);white-space:nowrap}
.drawing-buttons button:hover{background:#0d5242;transform:translateY(-1px);box-shadow:0 3px 6px rgba(0,0,0,0.15)}
.drawing-buttons button:active{transform:translateY(0)}

/* heatmap tools section */
.heatmap-tools{background:#ffffff;border:1px solid #d0d5dd;border-radius:12px;padding:16px;box-shadow:0 4px 12px rgba(0,0,0,0.08);margin-top:16px}
.heatmap-controls{display:flex;gap:16px;flex-wrap:wrap;align-items:end}
.heatmap-controls .form-row{margin-bottom:0;min-width:140px}
.heatmap-controls .form-row label{font-size:13px;font-weight:600;color:#374151;margin-bottom:4px}
.heatmap-controls select{padding:8px 10px;border:1px solid #d0d5dd;border-radius:6px;font-size:13px;transition:border-color 0.2s}
.heatmap-controls select:focus{outline:none;border-color:#0a3d2e;box-shadow:0 0 0 3px rgba(10,61,46,0.1)}
.heatmap-controls input[type="checkbox"]{width:18px;height:18px;cursor:pointer;margin-right:8px;accent-color:#0a3d2e}
.heatmap-controls input[type="range"]{flex:1;min-width:100px;accent-color:#0a3d2e}
.heatmap-controls .form-row label:has(input[type="checkbox"]){flex-direction:row;align-items:center;font-weight:500}
.heatmap-controls .form-row:has(input[type="range"]){display:flex;flex-direction:row;gap:8px;align-items:center}
.heatmap-controls .form-row:has(input[type="range"]) label{margin-bottom:0}
.heatmap-controls #opacityValue{font-size:12px;font-weight:600;color:#0a3d2e;min-width:40px}
.heatmap-buttons{display:flex;gap:8px;margin-left:auto}
.heatmap-buttons button{padding:10px 16px;background:#0a3d2e;color:#fff;border:none;border-radius:6px;cursor:pointer;font-weight:600;font-size:14px;transition:all 0.2s;box-shadow:0 2px 4px rgba(0,0,0,0.1);white-space:nowrap}
.heatmap-buttons button:hover{background:#0d5242;transform:translateY(-1px);box-shadow:0 3px 6px rgba(0,0,0,0.15)}
.heatmap-buttons button:active{transform:translateY(0)}

.palette{width:320px;background:#ffffff;border:1px solid #d0d5dd;border-radius:12px;padding:0;height:fit-content;box-shadow:0 4px 12px rgba(0,0,0,0.08);max-height:90vh;overflow-y:auto;position:relative;transition:all 0.3s ease}
.palette.collapsed{width:60px;overflow:visible}
.palette.collapsed .section{display:none}
.palette-toggle{position:absolute;top:10px;left:-15px;width:30px;height:30px;background:#0a3d2e;color:#fff;border:2px solid #fff;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:16px;z-index:1000;transition:all 0.3s;box-shadow:0 2px 6px rgba(0,0,0,0.2);flex-direction:column;gap:2px;padding:4px}
.palette-toggle:hover{background:#0d5242;transform:scale(1.05)}
.palette.collapsed .palette-toggle{left:5px;width:50px;height:140px;border-radius:10px;top:100px;padding:10px;gap:8px}
.palette.collapsed .toggle-icon{transform:rotate(180deg);font-size:20px}
.toggle-icon{display:inline-block;transition:transform 0.3s ease;font-size:18px}
.toggle-text{font-size:10px;font-weight:600;white-space:nowrap;display:none}
.palette.collapsed .toggle-text{display:block;writing-mode:vertical-rl;text-orientation:mixed;font-size:14px;letter-spacing:3px;font-weight:700}
.palette .section{padding:16px;border-bottom:1px solid #e8eaed}
.palette .section:last-child{border-bottom:none}
.palette h3{margin:0 0 12px 0;font-size:16px;font-weight:700;color:#0a3d2e;display:flex;align-items:center;gap:8px}
.palette h3::before{content:'';width:4px;height:20px;background:#0a3d2e;border-radius:2px}
.form-row{display:flex;flex-direction:column;margin-bottom:10px}
.form-row label{font-size:13px;font-weight:600;color:#374151;margin-bottom:4px}
.palette input[type="text"],.palette input[type="color"],.palette select,.palette textarea{padding:8px 10px;border:1px solid #d0d5dd;border-radius:6px;font-size:13px;transition:border-color 0.2s;font-family:inherit}
.palette input[type="text"]:focus,.palette select:focus,.palette textarea:focus{outline:none;border-color:#0a3d2e;box-shadow:0 0 0 3px rgba(10,61,46,0.1)}
.palette textarea{resize:vertical;min-height:60px}
.palette input[type="color"]{height:40px;cursor:pointer}
.palette input[type="checkbox"]{width:18px;height:18px;cursor:pointer;margin-right:8px;accent-color:#0a3d2e}
.form-row label:has(input[type="checkbox"]){flex-direction:row;align-items:center;font-weight:500}
.palette button{width:100%;padding:10px;background:#0a3d2e;color:#fff;border:none;border-radius:6px;cursor:pointer;font-weight:600;font-size:14px;transition:all 0.2s;box-shadow:0 2px 4px rgba(0,0,0,0.1)}
.palette button:hover{background:#0d5242;transform:translateY(-1px);box-shadow:0 3px 6px rgba(0,0,0,0.15)}
.palette button:active{transform:translateY(0)}
.palette hr{border:none;border-top:1px solid #e8eaed;margin:12px 0}
.palette p{font-size:12px;color:#6b7280;margin:8px 0;line-height:1.4}
.palette .note{background:#f3f4f6;padding:8px 10px;border-radius:6px;font-size:12px;color:#4b5563;margin-top:8px}

.marker{position:absolute;width:45px;height:45px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:16px;user-select:none;cursor:grab;z-index:20;transition:all 0.2s ease;color:white;border:2px solid rgba(255,255,255,0.8);box-shadow:0 2px 8px rgba(0,0,0,0.2);}
.marker:active{cursor:grabbing}
.marker.special-player{border:3px solid #ff4500;box-shadow:0 0 15px rgba(255,215,0,0.8);animation:pulse-glow 2s infinite;}
@keyframes pulse-glow{0%,100%{box-shadow:0 0 15px rgba(255,215,0,0.8)}50%{box-shadow:0 0 25px rgba(255,215,0,1)}}
/* Player Chip Styles */
.player-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f8f9fa;
  border-radius: 20px;
  margin: 4px 0;
  cursor: grab;
  transition: all 0.2s;
  border: 1px solid #e9ecef;
}

.player-chip:hover {
  background: #e9ecef;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.player-chip-photo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,0.1);
}

.player-chip-text {
  font-size: 13px;
  font-weight: 500;
  color: #212529;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

/* Marker Styles */
.marker {
  position: absolute;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 16px;
  cursor: move;
  z-index: 10;
  border: 2px solid rgba(255,255,255,0.8);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: all 0.2s;
}

/* Removed hover effect for better user experience */
.marker {
  transition: none;
}

.marker-label {
  pointer-events: none;
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.marker-photo {
  width: 50%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  visibility: hidden;
}

.marker-name {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 5;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.marker-stats {
  position: absolute;
  bottom: -180px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: white;
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
  width: 180px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Removed hover effect for marker stats */
.marker .marker-stats {
  display: none;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.stat-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.stat-row span:first-child {
  color: #adb5bd;
  font-weight: 500;
}

.yellow-card {
  color: #ffc107;
  font-weight: bold;
  margin-right: 4px;
}

.red-card {
  color: #dc3545;
  font-weight: bold;
}

/* Player Details Panel */
.player-details-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  height: 100vh;
  background: white;
  box-shadow: -2px 0 15px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  transition: right 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.player-details-panel.visible {
  right: 0;
}

.player-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: #0a3d2e;
  color: white;
}

.player-details-header h3 {
  margin: 0;
  font-size: 18px;
}

.close-panel {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
}

.player-details-content {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.player-photo-container {
  width: 150px;
  /* height: 150px; */
  /* margin: 0 auto 20px; */
  /* border-radius: 50%; */
  overflow: hidden;
  border: 4px solid #f0f0f0;
}

.player-detail-photo {
  /* width: 100%; */
  /* height: 100%; */
  object-fit: cover;
}

.player-details-content h2 {
  text-align: center;
  margin: 0 0 20px 0;
  color: #333;
}

.player-stats {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-row span:first-child {
  color: #666;
  font-weight: 500;
}

/* View details button on marker */
.view-details-btn {
  transition: all 0.2s ease;
}

.view-details-btn:hover {
  transform: scale(1.1);
  background: #f0f0f0 !important;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .player-details-panel {
    width: 100%;
    right: -100%;
  }
  
  .player-photo-container {
    width: 120px;
    height: 120px;
  }
}

/* Overlay when panel is open */
.panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.panel-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* Special player indicator */
.special-player {
  animation: pulse 2s infinite;
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.5);
}

/* Marker info button */
.marker-info-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  background: #0a3d2e;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: scale(0.8);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Only show info button when marker is active/selected */
.marker .marker-info-btn {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.marker.active .marker-info-btn,
.marker.selected .marker-info-btn {
  opacity: 1;
  transform: scale(1);
}

.marker-info-btn:hover {
  background: #0d5242;
  transform: scale(1.1) !important;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(255, 193, 7, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
}
/* Ball marker styles */
.ball-marker {
  width: 40px !important;
  height: 40px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  z-index: 15;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.ball-marker::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url(../logo/soccerball.svg);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
}

.ball-marker:active {
  cursor: grabbing;
}

.ball-marker .marker-label {
  display: none; /* Hide label for ball */
}

.marker-name{position:absolute;top:50px;left:50%;transform:translateX(-50%);background:rgba(255,255,255,0.95);color:#111;padding:5px 10px;border-radius:6px;font-size:11px;font-weight:600;white-space:nowrap;box-shadow:0 2px 4px rgba(0,0,0,0.2);border:1px solid rgba(0,0,0,0.1);z-index:21;cursor:pointer;transition:all 0.2s ease;user-select:none;}
.marker-name:hover{background:#fff;transform:translateX(-50%) scale(1.05);box-shadow:0 3px 6px rgba(0,0,0,0.3);border-color:#0a3d2e;}
.marker-name:active{transform:translateX(-50%) scale(0.98);background:#f3f4f6;}

/* players palette */
.players-list{display:grid;grid-template-columns:repeat(3, 1fr);gap:8px;max-height:300px;overflow-y:auto;margin-top:10px;padding:4px}
.players-list::-webkit-scrollbar{width:6px}
.players-list::-webkit-scrollbar-track{background:#f1f1f1;border-radius:3px}
.players-list::-webkit-scrollbar-thumb{background:#0a3d2e;border-radius:3px}
.player-chip{padding:6px 8px;border:1px solid #d0d5dd;border-radius:8px;background:#f9fafb;cursor:grab;user-select:none;font-size:11px;font-weight:500;transition:all 0.2s;box-shadow:0 1px 2px rgba(0,0,0,0.05);text-align:center;word-wrap:break-word}
.player-chip:hover{background:#f3f4f6;border-color:#0a3d2e;box-shadow:0 2px 4px rgba(0,0,0,0.1)}
.player-chip:active{cursor:grabbing;transform:scale(0.98)}

/* highlight selected drawn shapes */
.overlay .selected{stroke:#e53935 !important;stroke-opacity:0.95;stroke-width:4px !important}

/* formation buttons */
.formation-btn{
  width:100%;
  padding:10px;
  margin-top:8px;
  background:#0a3d2e;
  color:#fff;
  border:none;
  border-radius:6px;
  cursor:pointer;
  font-weight:600;
  font-size:14px;
  transition:all 0.2s;
  box-shadow:0 2px 4px rgba(0,0,0,0.1);
}
.formation-btn:hover{
  background:#0d5242;
  transform:translateY(-1px);
  box-shadow:0 3px 6px rgba(0,0,0,0.15);
}
.formation-btn:active{
  background:#073528;
  transform:translateY(0);
}

/* team color swatch */
.team-color-swatch{
  width:32px;
  height:32px;
  border-radius:6px;
  border:2px solid #333;
  background:#e0e0e0;
  flex-shrink:0;
  box-shadow:0 2px 4px rgba(0,0,0,0.2);
}

/* footer */
.footer{position:fixed;bottom:0;left:0;right:0;background:linear-gradient(135deg, #0a3d2e 0%, #0d5242 100%);color:#fff;box-shadow:0 -2px 8px rgba(0,0,0,0.2);z-index:100;padding:12px 20px;display:flex;align-items:center;gap:16px}
.top-footer{bottom:60px;z-index:101}
.top-footer.is-hidden{display:none}
.footer .help-btn{padding:8px 16px;background:rgba(255,255,255,0.15);color:#fff;border:1px solid rgba(255,255,255,0.3);border-radius:6px;cursor:pointer;font-weight:600;font-size:14px;transition:all 0.2s;white-space:nowrap;flex-shrink:0}
.footer .help-btn:hover{background:rgba(255,255,255,0.25);transform:translateY(-1px);box-shadow:0 3px 8px rgba(0,0,0,0.2)}
.footer .help-btn:active{transform:translateY(0);background:rgba(255,255,255,0.2)}
.footer-controls{display:flex;gap:12px;align-items:center; flex-wrap:wrap;justify-content:center;flex:1}
.footer-right{margin-left:auto;display:flex;align-items:center}
.footer .control-group{display:flex;gap:8px;align-items:center;padding:6px 12px;background:rgba(255,255,255,0.1);border-radius:8px;border:1px solid rgba(255,255,255,0.15)}
.footer label{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:500}
.footer select{padding:6px 10px;border:1px solid rgba(255,255,255,0.3);border-radius:4px;background:rgba(255,255,255,0.95);font-size:13px}
.footer input[type="color"]{height:32px;width:40px;border:1px solid rgba(255,255,255,0.3);border-radius:4px;cursor:pointer;background:none}
.footer input[type="range"]{cursor:pointer}
.footer input[type="checkbox"]{width:18px;height:18px;cursor:pointer;margin:0;accent-color:#fff}
.footer button{padding:6px 14px;background:#fff;color:#0a3d2e;border:none;border-radius:6px;cursor:pointer;font-weight:600;font-size:13px;transition:all 0.2s;box-shadow:0 2px 4px rgba(0,0,0,0.1)}
.footer button:hover{background:#f0f0f0;transform:translateY(-1px);box-shadow:0 3px 6px rgba(0,0,0,0.15)}
.footer button:active{transform:translateY(0);box-shadow:0 1px 2px rgba(0,0,0,0.1)}

/* Toast notifications */
.toast-container{position:fixed;top:80px;right:20px;z-index:9999;display:flex;flex-direction:column;gap:10px;pointer-events:none}

/* Player Stats Popup */
.player-stats-popup {
  position: fixed;
  z-index: 1000;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  width: 400px;
  display: flex;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  overflow: hidden;
}

.player-stats-popup.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.player-photo-container {
  width: 150px;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  min-height: 200px;
  position: relative;
  overflow: hidden;
}

.player-photo {
  width: 200px;
  height: 100% !important;
  /* border-radius: 50%; */
  object-fit: cover;
  border: 3px solid white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  background-color: #e9ecef;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23adb5bd"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  transition: opacity 0.3s ease;
}

/* Loading state */
.player-photo.loading {
  opacity: 0.7;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" stroke="%23ccc" fill="none" stroke-width="5" stroke-linecap="round"><animateTransform attributeName="transform" type="rotate" from="0 50 50" to="360 50 50" dur="1s" repeatCount="indefinite"/></circle></svg>');
  background-size: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.player-info {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.player-name {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 5px;
  color: #333;
}

.player-number {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 8px;
}

.stat-value {
  font-size: 18px;
  font-weight: bold;
  color: #0a3d2e;
  margin-bottom: 2px;
}

.stat-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.close-popup {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 20px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: #666;
  background: rgba(255, 255, 255, 0.8);
}

.close-popup:hover {
  background: #f0f0f0;
  color: #333;
}
.toast{background:#fff;border-radius:8px;padding:16px 20px;box-shadow:0 4px 12px rgba(0,0,0,0.15);border-left:4px solid #0a3d2e;min-width:280px;max-width:400px;pointer-events:all;animation:slideIn 0.3s ease;display:flex;align-items:center;gap:12px}
.toast.success{border-left-color:#10b981}
.toast.error{border-left-color:#ef4444}
.toast.warning{border-left-color:#f59e0b}
.toast-icon{font-size:20px;flex-shrink:0}
.toast-content{flex:1;font-size:14px;color:#374151;font-weight:500}
.toast-close{background:none;border:none;color:#9ca3af;cursor:pointer;font-size:18px;padding:0;width:20px;height:20px;display:flex;align-items:center;justify-content:center;transition:color 0.2s}
.toast-close:hover{color:#374151}
@keyframes slideIn{from{transform:translateX(400px);opacity:0}to{transform:translateX(0);opacity:1}}
@keyframes slideOut{from{transform:translateX(0);opacity:1}to{transform:translateX(400px);opacity:0}}
.toast.removing{animation:slideOut 0.3s ease}

/* Player Stats Popup */
.player-stats-popup {
  position: absolute;
  z-index: 1000;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  width: 320px;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
}

.player-stats-popup.visible {
  transform: translateY(0);
  opacity: 1;
}

.player-stats-container {
  position: relative;
  padding: 20px;
}

.player-stats-header {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.player-stats-photo {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f5f5f5;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.photo-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
}

.photo-placeholder svg {
  width: 60%;
  height: 60%;
}

.player-popup-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.player-stats-info {
  flex: 1;
  min-width: 0;
}

.player-stats-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-stats-meta {
  display: flex;
  gap: 10px;
  color: #666;
  font-size: 14px;
  margin-bottom: 10px;
}

.player-number {
  font-weight: 600;
  color: #333;
}

.player-position {
  background: #f0f0f0;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.stat-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.stat-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a3d2e;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
}

.stat-details {
  line-height: 1.2;
}

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

.stat-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.yellow-card,
.red-card {
  display: inline-block;
  width: 18px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  font-weight: bold;
  border-radius: 3px;
  margin: 0 1px;
}

.yellow-card {
  background-color: #ffc107;
  color: #000;
}

.red-card {
  background-color: #dc3545;
  color: white;
}

.player-stats-footer {
  margin-top: 20px;
  text-align: center;
}

.close-popup {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #666;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.close-popup:hover {
  background: rgba(0,0,0,0.05);
  color: #333;
}

.close-popup svg {
  width: 16px;
  height: 16px;
}

/* Help Modal */
.modal{position:fixed;z-index:10000;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgba(0,0,0,0.6);backdrop-filter:blur(4px);animation:fadeIn 0.3s ease}
.modal-content{background:#fff;margin:5% auto;padding:0;border-radius:12px;width:90%;max-width:700px;box-shadow:0 20px 60px rgba(0,0,0,0.3);animation:slideDown 0.3s ease;overflow:hidden}
.modal-content h2{margin:0;padding:24px;background:linear-gradient(135deg, #0a3d2e 0%, #0d5242 100%);color:#fff;font-size:24px;font-weight:700}
.modal-close{color:#fff;float:right;font-size:32px;font-weight:700;line-height:1;cursor:pointer;transition:transform 0.2s}
.modal-close:hover{transform:scale(1.2)}
.help-section{padding:24px;border-bottom:1px solid #e5e7eb}
.help-section:last-child{border-bottom:none}
.help-section h3{margin:0 0 16px 0;font-size:18px;font-weight:700;color:#0a3d2e;display:flex;align-items:center;gap:8px}
.help-section ul{margin:0;padding-left:20px;line-height:1.8}
.help-section li{margin-bottom:8px;color:#374151}
.shortcuts-table{width:100%;border-collapse:collapse}
.shortcuts-table td{padding:10px 12px;border-bottom:1px solid #f3f4f6;color:#374151;font-size:14px}
.shortcuts-table tr:last-child td{border-bottom:none}
.shortcuts-table td:first-child{width:220px;font-weight:600}
kbd{display:inline-block;padding:4px 8px;background:#f3f4f6;border:1px solid #d1d5db;border-radius:4px;font-family:monospace;font-size:13px;font-weight:600;color:#0a3d2e;box-shadow:0 2px 0 #d1d5db}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes slideDown{from{transform:translateY(-50px);opacity:0}to{transform:translateY(0);opacity:1}}

/* Responsive adjustments */
@media(max-width:768px){
.footer{flex-direction:column;gap:12px;padding:10px 15px}
.footer .help-btn{width:100%;text-align:center}
.footer-controls{width:100%}
}
