/* Play Editor Styles */
.play-editor {
  background: #1a1a1a;
  border-radius: 8px;
  padding: 1rem;
}

.play-editor-viewport {
  display: flex;
  justify-content: center;
  align-items: center;
}

.play-editor svg {
  display: block;
  margin: 0 auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Player selection highlighting */
.player.selected circle {
  stroke: #ffffff !important;
  stroke-width: 4 !important;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}

/* Highlight selected immovable players (rectangles) */
.player.selected rect {
  stroke: #ffffff !important;
  stroke-width: 4 !important;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}

/* Highlight selected text items, footballs, and icons */
.player.selected text {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 0.5;
  paint-order: stroke fill;
}

svg:not([data-readonly]) .player:hover circle {
  stroke-width: 3 !important;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
}

/* Hover effect for rectangles (immovable players) */
svg:not([data-readonly]) .player:hover rect {
  stroke-width: 3 !important;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
}

/* Hover effect for text elements */
svg:not([data-readonly]) .player:hover text {
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
}

/* Player Control Bar Styles */
.player-control-bar {
  animation: fadeInUp 0.3s ease-out;
  background: #292524;
  border: 1px solid #44403c;
  border-radius: 12px;
  padding: 0.3rem 0.5rem;
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: nowrap;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.player-control-bar input[type="text"],
.player-control-bar input[type="color"] {
  transition: all 0.2s ease;
}

.player-control-bar input[type="text"]:focus,
.player-control-bar input[type="color"]:focus {
  border-color: #b45309;
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15);
}

.player-control-bar input[type="color"] {
  height: 2rem;
  cursor: pointer;
}

/* Player path styles */
.player-path {
  pointer-events: none;
}

.player-paths-container {
  /* Container for all player paths to ensure proper layering */
  z-index: 10;
}

.player-path line,
.player-path path,
.player-path circle {
  opacity: 0.9;
  /* Ensure paths render above end zones */
  z-index: 15;
}

svg:not([data-readonly]) .player-path line:hover,
svg:not([data-readonly]) .player-path path:hover {
  opacity: 1;
  stroke-width: 4 !important;
}

/* End zones should have lower z-index than paths */
.end-zones {
  z-index: 1;
}

.end-zones rect {
  z-index: 1;
}

/* Players should be above paths */
.player {
  z-index: 20;
}

/* Immovable checkbox styles */
.immovable-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  color: #ffffff;
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
}

.immovable-checkbox input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: #b45309;
}

.immovable-checkbox:hover {
  color: #d6d3d1;
}

/* Field grid styles */
.field .grid {
  opacity: 0.1;
}

.field .yard-lines {
  opacity: 0.4;
}

/* Icon Button Styles — Play Editor overrides */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4em;
  height: 2.4em;
  font-size: 1.2em;
  background: #e7e5e4;
  border: none !important;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  color: #2c3e50;
  text-decoration: none;
  outline: none;
  box-shadow: none;
  line-height: 1;
  text-align: center;
  vertical-align: middle;
  padding: 0;
  font-family: system-ui, -apple-system, sans-serif;
}

.icon-btn svg {
  pointer-events: none;
}

.icon-btn:hover,
.icon-btn:focus {
  background: #d6d3d1;
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.4) !important;
  outline: none;
}

.icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #e7e5e4;
  box-shadow: none !important;
}

.icon-btn:disabled:hover {
  background: #e7e5e4;
  box-shadow: none !important;
}

/* Active state for icon buttons */
.icon-btn.active {
  background: #b45309 !important;
  color: white !important;
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.4) !important;
}

html.dark-mode .icon-btn.active,
body.dark-mode .icon-btn.active {
  background: #b45309 !important;
  color: white !important;
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.4) !important;
}

/* Dark mode support for icon buttons */
html.dark-mode .icon-btn,
body.dark-mode .icon-btn {
  background: #292524;
  color: #f5f5f4;
}

html.dark-mode .icon-btn:hover,
html.dark-mode .icon-btn:focus,
body.dark-mode .icon-btn:hover,
body.dark-mode .icon-btn:focus {
  background: #44403c;
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.4) !important;
}

html.dark-mode .icon-btn:disabled,
body.dark-mode .icon-btn:disabled {
  background: #292524;
  box-shadow: none !important;
}

html.dark-mode .icon-btn:disabled:hover,
body.dark-mode .icon-btn:disabled:hover {
  background: #292524;
  box-shadow: none !important;
}

/* Control button groups */
.control-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.control-group .icon-btn {
  flex-shrink: 0;
}

/* Form styling for play editor */
.play-form {
  background: #292524;
  border: 1px solid #44403c;
  border-radius: 8px;
}

.play-form h2 {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.play-form .form-group {
  margin-bottom: 1rem;
}

.play-form label {
  display: block;
  color: #d6d3d1;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.play-form input,
.play-form select,
.play-form textarea {
  width: 100%;
  background: #44403c;
  border: 1px solid #57534e;
  border-radius: 6px;
  padding: 0.75rem;
  color: #ffffff;
  font-size: 0.875rem;
}

.play-form input:focus,
.play-form select:focus,
.play-form textarea:focus {
  outline: none;
  border-color: #b45309;
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15);
}

/* Instructions styling */
.editor-instructions {
  border-top: 1px solid #57534e;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.editor-instructions p {
  color: #a8a29e;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.editor-instructions ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.editor-instructions li {
  color: #78716c;
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

/* Responsive layout */
@media (max-width: 1024px) {
  .play-editor svg {
    max-width: 100%;
    height: auto;
  }
}

/* Dark mode specific overrides */
body.dark .play-form {
  background: #1c1917;
  border-color: #292524;
}

body.dark .play-form input,
body.dark .play-form select,
body.dark .play-form textarea {
  background: #292524;
  border-color: #44403c;
}

/* Player list styling */
.player-list {
  max-height: 400px;
  overflow-y: auto;
}

.player-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #44403c;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.player-symbol {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: bold;
  flex-shrink: 0;
}

.player-info {
  flex: 1;
}

.player-name {
  color: #ffffff;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.player-details {
  color: #a8a29e;
  font-size: 0.75rem;
}

/* Form actions */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid #44403c;
  margin-top: 1.5rem;
}

.form-actions button,
.form-actions a {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
}

/* Override form-actions styles for icon buttons */
.form-actions .icon-btn {
  padding: 0 !important;
  width: 2.4em !important;
  height: 2.4em !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}

.form-actions .btn-cancel {
  background: #78716c;
  color: #ffffff;
  border: none;
}

.form-actions .btn-cancel:hover {
  background: #57534e;
}

.form-actions .btn-submit {
  background: #b45309;
  color: #ffffff;
  border: none;
}

.form-actions .btn-submit:hover {
  background: #92400e;
}

/* Play Editor 2-Column Layout */
.play-editor-container,
.formation-editor-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.play-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.play-editor-header h1 {
  font-size: 2rem;
  font-weight: bold;
  margin: 0;
}

/* Light mode styles for play editor sections */
.play-editor-left {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #d6d3d1;
  color: #44403c;
}

.play-editor-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.play-details-section {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #d6d3d1;
  color: #44403c;
}

.play-editor-controls {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #d6d3d1;
  color: #44403c;
}

/* Dark mode overrides for play editor sections */
html.dark-mode .play-editor-left,
html.dark-mode .play-editor-right,
html.dark-mode .play-details-section,
html.dark-mode .play-editor-controls,
body.dark-mode .play-editor-left,
body.dark-mode .play-editor-right,
body.dark-mode .play-details-section,
body.dark-mode .play-editor-controls {
  background: #292524 !important;
  border-color: #44403c !important;
  color: #f5f5f4 !important;
}

.play-editor-layout {
  display: grid;
  grid-template-columns: 2.5fr 1.5fr;
  gap: 2rem;
  align-items: start;
  margin: 0 auto;
  max-width: 1600px;
}

/* Removed - replaced with light/dark mode responsive styles above */

.play-editor-controls h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #e7e5e4;
}

.control-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.control-btn {
  background: #44403c;
  border: none;
  border-radius: 6px;
  padding: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #e7e5e4;
}

.control-btn:hover {
  background: #57534e;
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.3);
}

.control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.control-btn:disabled:hover {
  background: #44403c;
  box-shadow: none;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #e7e5e4;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #78716c);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input, .form-select {
  width: calc(100% - 1rem);
  margin-left: 0;
  margin-right: 1rem;
  background: #ffffff;
  border: 1px solid #d6d3d1;
  border-radius: 6px;
  padding: 0.75rem;
  color: #44403c;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.form-display {
  width: calc(100% - 1rem);
  margin-left: 0;
  margin-right: 1rem;
  background: #f5f5f4;
  border: 1px solid #d6d3d1;
  border-radius: 6px;
  padding: 0.75rem;
  color: #44403c;
  font-size: 0.875rem;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: #b45309;
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15);
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
}

.btn-primary {
  background: #b45309;
  color: #ffffff;
}

.btn-primary:hover {
  background: #92400e;
}

.btn-secondary {
  background: #78716c;
  color: #ffffff;
}

.btn-secondary:hover {
  background: #57534e;
}

.error-message {
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.error-message::before {
  content: "⚠️ ";
  margin-right: 0.25rem;
}

.help-text {
  color: #a8a29e;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Responsive design */
@media (max-width: 1024px) {
  .play-editor-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .play-editor-container {
    padding: 1rem;
  }
}

@media (max-width: 768px) {
  .play-editor-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .control-buttons {
    justify-content: center;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
  
  /* Match add-item-toolbar button size with mobile icon-btn size */
  .add-item-toolbar button {
    padding: 0;
    font-size: 1.4rem;
    min-width: 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    line-height: 1;
  }
}

/* Utility classes */
.hidden {
  display: none !important;
}

/* Centered Control Strip */
.control-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(68, 64, 60, 0.5);
  border-radius: 8px;
  border: 1px solid #57534e;
}

/* Player Settings Panel */
.player-settings-panel {
  padding: 1rem;
  margin-top: 1rem;
  background: rgba(68, 64, 60, 0.3);
  border-radius: 8px;
  border-top: 1px solid #57534e;
}

.settings-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

/* Square Input Controls */
.square-input {
  width: 3rem;
  height: 3rem;
  border: 1px solid #57534e;
  border-radius: 6px;
  background: #44403c;
  transition: all 0.2s ease;
}

.square-input:focus {
  outline: none;
  border-color: #b45309;
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15);
}

.symbol-input {
  color: #ffffff;
  text-align: center;
  font-weight: bold;
  font-size: 1.125rem;
  font-family: 'Arial', sans-serif;
}

.color-input {
  cursor: pointer;
  padding: 0;
}

/* Rich Color Picker Widget */
.color-picker-widget {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #292524;
  border: 1px solid #57534e;
  border-radius: 8px;
  padding: 0.75rem;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  margin-bottom: 0.5rem;
}

.color-picker-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.color-picker-header {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  align-items: center;
}

.color-picker-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.color-picker-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.current-color-display {
  width: 2rem;
  height: 2rem;
  border: 2px solid #57534e;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s ease;
  flex-shrink: 0;
}

.current-color-display:hover {
  border-color: #b45309;
}

.basic-color-option {
  width: 2rem;
  height: 2rem;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.basic-color-option:hover {
  border-color: #ffffff;
  transform: scale(1.05);
}

.basic-color-option.selected {
  border-color: #b45309;
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.3);
}

.custom-color-button {
  width: 2rem;
  height: 2rem;
  background: linear-gradient(90deg, 
    #ff0000 0%, #ffff00 16.67%, #00ff00 33.33%, 
    #00ffff 50%, #0000ff 66.67%, #ff00ff 83.33%, #ff0000 100%);
  border: 2px solid #57534e;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.875rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  flex-shrink: 0;
  padding: 0;
}

.custom-color-button:hover {
  border-color: #b45309;
}

.color-picker-cancel {
  width: 2rem;
  height: 2rem;
  background: #78716c;
  color: #ffffff;
  border: 2px solid #57534e;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  z-index: 1001;
}

.color-picker-cancel:hover {
  background: #57534e;
  border-color: #b45309;
}

/* Dark mode support for color picker */
html.dark-mode .color-picker-widget,
body.dark-mode .color-picker-widget {
  background: #292524 !important;
  border-color: #57534e !important;
}

/* Icon Picker Widget (popup for football/cone/person) */
.icon-picker-widget {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #292524;
  border: 1px solid #57534e;
  border-radius: 8px;
  padding: 0.5rem;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  margin-bottom: 0.5rem;
}

.icon-picker-grid {
  display: flex;
  gap: 0.35rem;
}

.icon-picker-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4em;
  height: 2.4em;
  font-size: 1.2em;
  background: #44403c;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.icon-picker-option:hover {
  background: #57534e;
  border-color: #b45309;
}

.icon-picker-option.selected {
  background: #b45309;
  border-color: #d97706;
}

/* Symbol Picker Widget */
.symbol-picker-widget {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #292524;
  border: 1px solid #57534e;
  border-radius: 8px;
  padding: 1rem;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  min-width: 300px;
  margin-bottom: 0.5rem;
}

.symbol-picker-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.symbol-input-row {
  display: flex;
  justify-content: center;
}

.symbol-text-input {
  padding: 0.5rem;
  background: #44403c;
  border: 1px solid #57534e;
  border-radius: 4px;
  color: #e7e5e4;
  font-size: 1rem;
  text-align: center;
  width: 4rem;
  text-transform: uppercase;
}

.symbol-text-input:focus {
  outline: none;
  border-color: #b45309;
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.3);
}

.symbol-options {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
}

.symbol-option {
  padding: 0.5rem;
  background: #44403c;
  border: 1px solid #57534e;
  border-radius: 4px;
  color: #e7e5e4;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.symbol-option:hover {
  background: #57534e;
  border-color: #78716c;
}

.symbol-option.selected {
  background: #b45309;
  border-color: #92400e;
  color: white;
}

.symbol-picker-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.symbol-picker-ok,
.symbol-picker-cancel {
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.symbol-picker-ok {
  background: #10b981;
  color: white;
}

.symbol-picker-ok:hover {
  background: #059669;
}

.symbol-picker-cancel {
  background: #78716c;
  color: white;
}

.symbol-picker-cancel:hover {
  background: #57534e;
}

/* Dark mode support for symbol picker */
html.dark-mode .symbol-picker-widget,
body.dark-mode .symbol-picker-widget {
  background: #292524 !important;
  border-color: #57534e !important;
}

/* Duplicate removed - dark mode styles are now defined above with light mode styles */

html.dark-mode .form-label,
html.dark-mode .form-group label,
body.dark-mode .form-label,
body.dark-mode .form-group label {
  color: #d6d3d1 !important;
}

html.dark-mode .form-input,
html.dark-mode .form-select,
html.dark-mode .form-textarea,
body.dark-mode .form-input,
body.dark-mode .form-select,
body.dark-mode .form-textarea {
  background: #44403c !important;
  border-color: #57534e !important;
  color: #ffffff !important;
}

html.dark-mode .form-display,
body.dark-mode .form-display {
  background: #292524 !important;
  border-color: #57534e !important;
  color: #e7e5e4 !important;
}

html.dark-mode .form-input:focus,
html.dark-mode .form-select:focus,
html.dark-mode .form-textarea:focus,
body.dark-mode .form-input:focus,
body.dark-mode .form-select:focus,
body.dark-mode .form-textarea:focus {
  border-color: #b45309 !important;
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15) !important;
}

html.dark-mode .help-text,
body.dark-mode .help-text {
  color: #a8a29e !important;
}

html.dark-mode .error-message,
body.dark-mode .error-message {
  color: #f87171 !important;
}

html.dark-mode .control-strip,
body.dark-mode .control-strip {
  background: rgba(68, 64, 60, 0.5) !important;
  border-color: #57534e !important;
}

html.dark-mode .player-settings-panel,
body.dark-mode .player-settings-panel {
  background: rgba(68, 64, 60, 0.3) !important;
  border-color: #57534e !important;
}

html.dark-mode .square-input,
body.dark-mode .square-input {
  background: #44403c !important;
  border-color: #57534e !important;
  color: #ffffff !important;
}

/* Print Configuration Styles */
.print-config-form {
  max-width: 100%;
}

.section-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #d6d3d1;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: #292524;
}

.section-subtitle {
  font-size: 0.875rem;
  color: #78716c;
  margin: 0;
}

.settings-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f5f5f4;
  border-radius: 0.5rem;
  border: 1px solid #d6d3d1;
}

.settings-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: #44403c;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.checkbox-group .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.checkbox-text {
  font-weight: 500;
  color: #44403c;
}

.form-checkbox {
  width: auto !important;
  margin: 0;
}

.form-help {
  font-size: 0.875rem;
  color: #78716c;
  margin-top: 0.25rem;
  font-style: italic;
}

.primary-btn {
  background: #b45309 !important;
  color: white !important;
}

.primary-btn:hover {
  background: #92400e !important;
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.5);
}

/* Dark mode styles for print config */
html.dark-mode .section-header,
body.dark-mode .section-header {
  border-bottom-color: #44403c;
}

html.dark-mode .section-title,
body.dark-mode .section-title {
  color: #f5f5f4;
}

html.dark-mode .section-subtitle,
body.dark-mode .section-subtitle {
  color: #a8a29e;
}

html.dark-mode .settings-section,
body.dark-mode .settings-section {
  background: #292524;
  border-color: #44403c;
}

html.dark-mode .settings-title,
body.dark-mode .settings-title {
  color: #e7e5e4;
}

html.dark-mode .checkbox-text,
body.dark-mode .checkbox-text {
  color: #e7e5e4;
}

html.dark-mode .form-help,
body.dark-mode .form-help {
  color: #a8a29e;
}

/* Zone Dialog Widget */
.zone-dialog-widget {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #292524;
  border: 1px solid #57534e;
  border-radius: 8px;
  padding: 1rem;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  min-width: 280px;
  margin-bottom: 0.5rem;
}

.zone-dialog-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.zone-size-row {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

#zone-diameter {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #44403c;
  outline: none;
  cursor: pointer;
}

#zone-diameter::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #b45309;
  cursor: pointer;
}

#zone-diameter::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #b45309;
  cursor: pointer;
  border: none;
}

#zone-diameter:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.zone-dialog-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.zone-dialog-ok,
.zone-dialog-cancel {
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zone-dialog-ok {
  background: #10b981;
  color: white;
}

.zone-dialog-ok:hover {
  background: #059669;
}

.zone-dialog-cancel {
  background: #78716c;
  color: white;
}

.zone-dialog-cancel:hover {
  background: #57534e;
}

/* Default formation indicator styles */
.icon-btn.default-offense-btn {
  background-color: var(--offense-color) !important;
  color: white !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.4) !important;
}

.icon-btn.default-defense-btn {
  background-color: var(--defense-color) !important;
  color: white !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.4) !important;
}

/* Dark mode support for default formation buttons */
html.dark-mode .icon-btn.default-offense-btn,
body.dark-mode .icon-btn.default-offense-btn {
  background-color: var(--offense-color) !important;
  color: white !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.6) !important;
}

html.dark-mode .icon-btn.default-defense-btn,
body.dark-mode .icon-btn.default-defense-btn {
  background-color: var(--defense-color) !important;
  color: white !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.6) !important;
}

/* Hover states for default buttons */
.icon-btn.default-offense-btn:hover,
.icon-btn.default-offense-btn:focus {
  background-color: #1d4ed8 !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.6) !important;
}

.icon-btn.default-defense-btn:hover,
.icon-btn.default-defense-btn:focus {
  background-color: #b91c1c !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.6) !important;
}

html.dark-mode .icon-btn.default-offense-btn:hover,
html.dark-mode .icon-btn.default-offense-btn:focus,
body.dark-mode .icon-btn.default-offense-btn:hover,
body.dark-mode .icon-btn.default-offense-btn:focus {
  background-color: #1d4ed8 !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.7) !important;
}

html.dark-mode .icon-btn.default-defense-btn:hover,
html.dark-mode .icon-btn.default-defense-btn:focus,
body.dark-mode .icon-btn.default-defense-btn:hover,
body.dark-mode .icon-btn.default-defense-btn:focus {
  background-color: #b91c1c !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.7) !important;
}

/* Segment Editor Widget */
.segment-editor-widget {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #292524;
  border: 1px solid #57534e;
  border-radius: 8px;
  padding: 1rem;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  min-width: 320px;
  max-width: 400px;
  margin-bottom: 0.5rem;
}

.segment-editor-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.segment-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.segment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  background: #44403c;
  border-radius: 6px;
  border: 1px solid #57534e;
}

.segment-label {
  color: #e7e5e4;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 80px;
}

.segment-controls {
  display: flex;
  gap: 0.25rem;
}

.segment-style-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid #57534e;
  border-radius: 4px;
  background: #44403c;
  color: #e7e5e4;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.segment-style-btn:hover {
  background: #57534e;
  border-color: #78716c;
}

.segment-style-btn.active {
  background: #b45309;
  border-color: #92400e;
  color: white;
}

/* Dark mode support for segment editor */
html.dark-mode .segment-editor-widget,
body.dark-mode .segment-editor-widget {
  background: #292524 !important;
  border-color: #57534e !important;
}

html.dark-mode .segment-item,
body.dark-mode .segment-item {
  background: #44403c !important;
  border-color: #57534e !important;
}

html.dark-mode .segment-label,
body.dark-mode .segment-label {
  color: #e7e5e4 !important;
}

html.dark-mode .segment-style-btn,
body.dark-mode .segment-style-btn {
  background: #44403c !important;
  border-color: #57534e !important;
  color: #e7e5e4 !important;
}

html.dark-mode .segment-style-btn:hover,
body.dark-mode .segment-style-btn:hover {
  background: #57534e !important;
  border-color: #78716c !important;
}

html.dark-mode .segment-style-btn.active,
body.dark-mode .segment-style-btn.active {
  background: #b45309 !important;
  border-color: #92400e !important;
  color: white !important;
}

/* Add Item Toolbar */
.add-item-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: var(--bg-tertiary, #f5f5f4);
  border: 1px solid var(--border-color, #d6d3d1);
  border-radius: 8px;
  justify-content: center;
}

.add-item-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.4rem;
  background: var(--btn-secondary-bg, #e7e5e4);
  border: 1px solid var(--border-color, #d6d3d1);
  border-radius: var(--radius-md, 6px);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--btn-secondary-text, #44403c);
  text-decoration: none;
  outline: none;
  font-family: system-ui, -apple-system, sans-serif;
  padding: 0;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
}

.add-item-toolbar button:hover {
  background: var(--btn-secondary-hover, #d6d3d1);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.1));
  border-color: var(--border-focus, #b45309);
}

html.dark-mode .add-item-toolbar,
body.dark-mode .add-item-toolbar {
  background: #292524;
  border-color: #44403c;
}

/* Text Editor Input */
.text-editor-input {
  padding: 0.5rem;
  border: 1px solid #44403c;
  border-radius: 6px;
  background: #292524;
  color: #e7e5e4;
  font-family: Arial, sans-serif;
  font-size: 14px;
  min-width: 150px;
}

.text-editor-input:focus {
  outline: none;
  border-color: #d97706;
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.3);
}

html.dark-mode .text-editor-input,
body.dark-mode .text-editor-input {
  background: #292524;
  border-color: #57534e;
  color: #e7e5e4;
}

html.dark-mode .text-editor-input:focus,
body.dark-mode .text-editor-input:focus {
  border-color: #d97706;
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.3);
}

/* ============================================
   Badges (offense/defense type indicators)
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm, 3px);
  font-size: 0.8125rem;
  font-weight: 600;
  color: white;
  line-height: 1.4;
}

.badge-primary {
  background-color: var(--primary, #b45309);
}

.badge-danger {
  background-color: var(--danger, #dc2626);
}

/* ============================================
   Section Labels (uppercase headings)
   ============================================ */
.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #78716c);
}

/* Text tool icon (serif A) */
.text-tool-icon {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.1em;
  font-weight: bold;
  line-height: 1;
}

/* ============================================
   Play Detail Values (show view)
   ============================================ */
.play-detail-value {
  color: var(--text-color, #292524);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
}

.play-detail-value--name {
  font-size: 1.5rem;
  font-weight: 700;
}

.play-detail-value--link {
  color: var(--primary, #b45309);
  font-weight: 600;
}

.play-detail-value--description {
  font-weight: 400;
  color: var(--text-color, #292524);
  line-height: 1.55;
}

/* ============================================
   Tag Pills (show & edit views)
   ============================================ */
.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs, 0.25rem);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  background: var(--bg-tertiary, #e7e5e4);
  border: 1px solid var(--border-color, #d6d3d1);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-color, #292524);
  line-height: 1.4;
}

.tag-pill-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted, #78716c);
  font-size: 0.75rem;
  padding: 0;
  border-radius: 50%;
  transition: color 0.15s ease, background 0.15s ease;
}

.tag-pill-remove:hover {
  color: var(--danger, #dc2626);
  background: rgba(var(--danger-rgb, 220, 38, 38), 0.1);
}

.tag-pill-remove:focus-visible {
  outline: 2px solid var(--border-focus, #b45309);
  outline-offset: 1px;
}

/* ============================================
   Tag Input Widget (edit view)
   ============================================ */
.tag-input-widget {
  background: var(--bg-tertiary, #f5f5f4);
  border: 1px solid var(--border-color, #d6d3d1);
  border-radius: var(--radius-md, 6px);
  padding: 0.375rem;
  min-height: 2.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tag-input-widget:focus-within {
  border-color: var(--border-focus, #b45309);
  box-shadow: 0 0 0 3px var(--primary-transparent, rgba(180, 83, 9, 0.15));
}

.tag-pills-editable {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.tag-add-input {
  flex: 1;
  min-width: 80px;
  border: none;
  background: transparent;
  padding: 0.25rem 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-color, #292524);
  outline: none;
}

.tag-add-input::placeholder {
  color: var(--text-subtle, #a8a29e);
}

.tag-add-input:focus-visible {
  outline: none; /* parent widget shows focus ring via :focus-within */
}

html.dark-mode .tag-input-widget,
body.dark-mode .tag-input-widget {
  background: var(--bg-tertiary, #292524);
  border-color: var(--border-color, #44403c);
}

html.dark-mode .tag-add-input,
body.dark-mode .tag-add-input {
  color: var(--text-color, #e7e5e4);
}

/* ============================================
   Editor Toolbar (below field in edit view)
   ============================================ */
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm, 0.5rem);
  padding: var(--spacing-sm, 0.5rem) var(--spacing-md, 1rem);
  margin-top: var(--spacing-sm, 0.5rem);
}

.editor-toolbar-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs, 0.25rem);
}

.editor-toolbar-separator {
  width: 1px;
  height: 1.5rem;
  background: var(--border-color, #d6d3d1);
  margin: 0 var(--spacing-xs, 0.25rem);
}

.editor-toolbar .icon-btn.editor-tool {
  width: 2.25em;
  height: 2.25em;
}

html.dark-mode .editor-toolbar-separator,
body.dark-mode .editor-toolbar-separator {
  background: var(--border-color, #44403c);
}

/* ============================================
   Side Indicator (edit view, read-only display)
   ============================================ */
.side-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm, 3px);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  background: var(--bg-tertiary, #e7e5e4);
  color: var(--text-color, #292524);
  border: 1px solid var(--border-color, #d6d3d1);
}

.side-indicator.offense {
  background: var(--offense-bg, #eff6ff);
  color: var(--offense-text, #1d4ed8);
  border-color: var(--offense-border, #93c5fd);
}

.side-indicator.defense {
  background: var(--defense-bg, #fef2f2);
  color: var(--defense-text, #b91c1c);
  border-color: var(--defense-border, #fca5a5);
}

/* ============================================
   Play Display (show view)
   ============================================ */
.play-display {
  display: flex;
  justify-content: center;
  padding: var(--spacing-sm, 0.5rem);
}

.play-display svg {
  max-width: 100%;
  height: auto;
}

/* Two-column layout (show view) */
.two-column-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Two-column layout columns (show view) */
.editor-column {
  /* No min-height — let content dictate size */
}

.details-column {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md, 1rem);
}

.details-column .card-body {
  padding: var(--spacing-md, 1rem) var(--spacing-lg, 1.5rem);
}

.details-column .form-group {
  margin-bottom: 1.25rem;
}

.details-column .form-label {
  margin-bottom: 0.25rem;
}

/* ============================================
   Responsive: Play Editor Layout
   ============================================ */
@media (max-width: 1024px) {
  .two-column-layout {
    grid-template-columns: 1fr;
    max-width: 600px;
  }

  .editor-column {
    order: 2;
  }

  .details-column {
    order: 1;
  }
  
  .play-editor-layout {
    grid-template-columns: 1fr;
    gap: var(--spacing-md, 1rem);
  }
}

@media (max-width: 768px) {
  .editor-toolbar {
    padding: var(--spacing-xs, 0.25rem);
    gap: var(--spacing-xs, 0.25rem);
  }

  .editor-toolbar .icon-btn.editor-tool {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }
  
  .tag-pill {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
  }
}
