/* Team Builder Specific Styles */
    .team-builder-container {
      max-width: 1200px;
      width: 100%;
      margin: 0 auto;
      padding: 20px;
      box-sizing: border-box;
      overflow: hidden;
    }

    .team-builder-header {
      text-align: center;
      margin-bottom: 30px;
      color: rgb(230, 230, 230);
    }

    .team-builder-layout {
      display: grid;
      grid-template-columns: 1fr 300px;
      gap: 30px;
      align-items: start;
    }

    /* Court Area */
    /* Court and Synergies Layout */
    .court-and-subs-layout {
      display: grid;
      grid-template-columns: 1fr;
      gap: 20px;
      align-items: start;
    }

    .court-area {
      background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
      border-radius: 15px;
      padding: 20px;
      border: 2px solid rgba(255, 255, 255, 0.1);
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
      width: 100%;
      box-sizing: border-box;
    }

    .court-title {
      text-align: center;
      margin-bottom: 20px;
      color: rgb(230, 230, 230);
      font-size: 1.5rem;
      font-weight: bold;
      text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
      letter-spacing: 1px;
      text-transform: uppercase;
    }

    .court-field {
      position: relative;
      border-radius: 15px;
      padding: 20px;
      min-height: 480px;
      overflow: hidden;
      display: grid;
      grid-template-columns: repeat(5, 120px);
      grid-template-rows: 180px 40px 180px;
      gap: 25px;
      width: 100%;
      max-width: 1000px;
      margin: 0 auto;
      justify-content: center;
      box-sizing: border-box;
    }

    .court-field::before {
      content: '';
      position: absolute;
      top: calc(180px + 20px + 20px); /* First row height + padding + more space down */
      left: 20px;
      right: 20px;
      height: 3px;
      background: rgba(255, 255, 255, 0.7);
      border-radius: 2px;
      z-index: 1;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    }

    /* Position Slots - direkt im Court Field Grid */
    .position-slot, .back-slot {
      background: rgba(255, 255, 255, 0.08);
      border: 2px solid rgba(255, 255, 255, 0.4);
      border-radius: 0;
      width: 100%;
    
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.3s ease;
      position: relative;
      overflow: hidden;
      padding: 0;
      aspect-ratio: 2/3;
      cursor: pointer;
      backdrop-filter: blur(1px);
      box-sizing: border-box;
    }

    .position-slot:hover, .back-slot:hover {
      border-color: rgba(255, 255, 255, 0.6);
      background: rgba(255, 255, 255, 0.15);
    }

    /* Default borders for empty slots */
    .position-slot, .back-slot {
      border: 2px solid rgba(255, 255, 255, 0.4);
    }

    .position-slot.occupied, .back-slot.occupied {
      border-style: solid;
      border-color: #4a90e2;
      background: rgba(74, 144, 226, 0.1);
    }

    .position-label {
      position: absolute;
      top: 4px;
      left: 4px;
      background: rgba(0, 0, 0, 0.8);
      color: white;
      padding: 2px 6px;
      border-radius: 4px;
      font-size: 0.6rem;
      font-weight: bold;
      border: 1px solid rgba(255, 255, 255, 0.3);
      backdrop-filter: blur(2px);
      z-index: 2;
    }

    .remove-player {
      position: absolute;
      top: 6px;
      right: 6px;
      background: rgba(220, 53, 69, 0.9);
      color: white;
      border: 1px solid rgba(255, 255, 255, 0.3);
      border-radius: 50%;
      width: 22px;
      height: 22px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 14px;
      font-weight: bold;
      opacity: 0;
      transition: all 0.3s ease;
      backdrop-filter: blur(2px);
      z-index: 2;
    }

    .remove-player:hover {
      background: rgba(220, 53, 69, 1);
      transform: scale(1.1);
    }

    .position-slot:hover .remove-player,
    .sub-slot:hover .remove-player,
    .bench-slot:hover .remove-player {
      opacity: 1;
    }

    /* Add Player Button (Plus) */
    .add-player-btn {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 30px;
      height: 30px;
      background: rgba(34, 197, 94, 0.9);
      border: 2px solid rgba(255, 255, 255, 0.5);
      border-radius: 50%;
      color: white;
      font-size: 20px;
      font-weight: bold;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 3;
      transition: all 0.3s ease;
    }

    .add-player-btn:hover {
      background: rgba(34, 197, 94, 1);
      transform: translate(-50%, -50%) scale(1.2);
      box-shadow: 0 0 15px rgba(34, 197, 94, 0.5);
    }

    /* Empty Slot Card in Modal */
    .empty-slot-card {
      background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%) !important;
      border: 2px solid rgba(220, 53, 69, 0.3) !important;
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .empty-slot-card:hover {
      background: linear-gradient(135deg, rgba(220, 53, 69, 0.2) 0%, rgba(220, 53, 69, 0.1) 100%) !important;
      border-color: rgba(220, 53, 69, 0.6) !important;
      transform: translateY(-2px);
    }

    /* Enhanced Borders for Rarity Consistency */
    .character-select-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
    }

    .empty-slot-content {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 100%;
      padding: 10px;
      text-align: center;
    }

    .empty-slot-icon {
      font-size: 32px;
      margin-bottom: 8px;
      opacity: 0.8;
    }

    .empty-slot-card .character-select-name {
      color: rgba(220, 53, 69, 0.9);
      font-weight: bold;
      font-size: 12px;
      margin-top: 0;
    }

    /* Synergies Area */
    .synergies-area {
      background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
      border-radius: 15px;
      padding: 20px;
      display: flex;
      flex-direction: column;
      align-items: center;
      border: 2px solid rgba(255, 255, 255, 0.1);
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
      min-height: 150px;
      position: relative;
      width: 100%;
      box-sizing: border-box;
    }

    /* Synergies Section */
    .synergies-section {
      width: 100%;
      margin-top: 30px;
      padding-top: 20px;
      border-top: 2px solid rgba(255, 255, 255, 0.1);
    }

    /* Bench Slots */
    .bench-slot-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 5px;
    }

    .bench-slot {
      width: 100px;
      height: 160px;
      background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
      border: 2px dashed rgba(255, 255, 255, 0.4);
      border-radius: 12px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.3s ease;
      backdrop-filter: blur(1px);
      position: relative;
      overflow: hidden;
      padding: 8px;
      gap: 6px;
    }

    .bench-slot:hover {
      border-color: rgba(255, 255, 255, 0.6);
      background-color: rgba(255, 255, 255, 0.15);
    }

    /* Default borders for empty bench slots */
    .bench-slot {
      border: 2px dashed rgba(255, 255, 255, 0.4);
    }

    .bench-slot.occupied {
      border-style: solid;
      border-color: rgba(255, 255, 255, 0.6);
      /* background removed to allow background-image from JavaScript to show */
    }

    .bench-info {
      color: rgb(230, 230, 230);
      font-size: 0.8rem;
      font-weight: bold;
      text-align: center;
      margin-top: 5px;
    }

    .add-slot-btn:hover {
      background: rgba(255, 255, 255, 0.2) !important;
      border-color: rgba(255, 255, 255, 0.5) !important;
    }

    .synergies-title {
      color: rgb(230, 230, 230);
      font-weight: bold;
      font-size: 1.2rem;
      text-align: center;
      margin-bottom: 15px;
      text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    }

    .synergies-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
      max-width: 100%;
    }

    .synergy-item {
      background: rgba(255, 255, 255, 0.05);
      border-radius: 8px;
      padding: 12px;
      border: 2px solid rgba(255, 255, 255, 0.1);
      transition: all 0.3s ease;
    }

    .synergy-item.active {
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }



    .synergy-item.inactive {
      opacity: 0.6;
    }

    .synergy-school {
      color: rgb(230, 230, 230);
      font-weight: bold;
      font-size: 1rem;
      margin-bottom: 5px;
    }

    .synergy-effect {
      color: rgba(230, 230, 230, 0.9);
      font-size: 0.9rem;
      line-height: 1.4;
    }

    .synergy-requirement {
      color: rgba(255, 255, 255, 0.6);
      font-size: 0.8rem;
      margin-top: 5px;
      font-style: italic;
    }

    .subs-title {
      position: absolute;
      top: 15px;
      left: 50%;
      transform: translateX(-50%);
      color: rgb(230, 230, 230);
      font-weight: bold;
      font-size: 1.4rem;
      text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
      letter-spacing: 1px;
    }

    .sub-slots-container {
      display: flex;
      gap: 20px;
      align-items: center;
      margin-top: 20px;
    }





    .sub-slot {
      background: rgba(255, 255, 255, 0.08);
      border: 2px dashed rgba(255, 255, 255, 0.4);
      border-radius: 12px;
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      transition: all 0.3s ease;
      position: relative;
      overflow: hidden;
      padding: 10px;
      gap: 8px;
      min-height: 140px;
      max-height: 140px;
      max-width: 100px;
      margin: 0 auto;
      cursor: pointer;
      backdrop-filter: blur(1px);
    }

    .sub-slot:hover {
      border-color: rgba(255, 255, 255, 0.6);
      background: rgba(255, 255, 255, 0.15);
    }

    .sub-slot.occupied {
      border-style: solid;
      border-color: #28a745;
      background: rgba(40, 167, 69, 0.1);
    }

    /* Character Search */
    .character-search-area {
      background: rgba(255, 255, 255, 0.05);
      border-radius: 10px;
      padding: 15px;
      margin-bottom: 20px;
      display: flex;
      gap: 10px;
      align-items: center;
    }

    .character-search-input {
      flex: 1;
      padding: 10px 15px;
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 5px;
      background: rgba(255, 255, 255, 0.1);
      color: white;
      font-size: 14px;
    }

    .character-search-input::placeholder {
      color: rgba(255, 255, 255, 0.6);
    }

    .character-search-input:focus {
      outline: none;
      border-color: #4a90e2;
      box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
    }

    .clear-search-btn {
      background: rgba(220, 53, 69, 0.8);
      color: white;
      border: none;
      border-radius: 50%;
      width: 30px;
      height: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 16px;
      transition: background 0.2s ease;
    }

    .clear-search-btn:hover {
      background: #dc3545;
    }

    /* Character Pool */
    .character-pool-area {
      background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
      border-radius: 15px;
      padding: 20px;
      border: 2px solid rgba(255, 255, 255, 0.1);
      max-height: 600px;
      overflow-y: auto;
    }

    .pool-title {
      text-align: center;
      margin-bottom: 20px;
      color: rgb(230, 230, 230);
      font-size: 1.3rem;
      font-weight: bold;
    }

    #characterCount {
      background: rgba(74, 144, 226, 0.2);
      border: 1px solid rgba(74, 144, 226, 0.3);
      border-radius: 12px;
      padding: 2px 8px;
      font-size: 0.9rem;
      color: rgb(230, 230, 230);
      margin-left: 8px;
    }

    .character-pool {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
      gap: 10px;
      max-height: 500px;
      overflow-y: auto;
    }

    /* Team Management */
    .team-management {
      background: rgba(255, 255, 255, 0.05);
      border-radius: 10px;
      padding: 15px;
      margin-top: 20px;
      width: 100%;
      box-sizing: border-box;
      overflow: hidden;
    }

    .team-name-input {
      width: 100%;
      padding: 10px;
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 5px;
      background: rgba(255, 255, 255, 0.1);
      color: white;
      margin-bottom: 10px;
      box-sizing: border-box;
      max-width: 100%;
    }

    .team-name-input::placeholder {
      color: rgba(255, 255, 255, 0.6);
    }

    .team-name-input.error {
      border-color: #ff4444 !important;
      box-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
    }

    .input-row {
      display: flex;
      gap: 10px;
      margin-bottom: 15px;
      width: 100%;
      box-sizing: border-box;
    }

    .input-row .team-name-input {
      flex: 1;
    }

    .team-buttons {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .team-btn {
      padding: 10px;
      border: none;
      border-radius: 5px;
      color: white;
      cursor: pointer;
      font-weight: bold;
      transition: all 0.3s ease;
    }

    .save-btn {
      background: #28a745;
    }

    .save-btn:hover {
      background: #218838;
    }



    .share-btn {
      background: #17a2b8;
    }

    .share-btn:hover {
      background: #138496;
    }

    /* Saved Teams */
    .saved-teams {
      margin-top: 20px;
    }

    .saved-teams-title {
      text-align: center;
      margin-bottom: 15px;
      color: rgb(230, 230, 230);
      font-weight: bold;
    }

    /* Popular Teams Section */
    .popular-teams-section {
      margin-top: 40px;
      width: 100%;
      box-sizing: border-box;
    }

    .popular-teams-container {
      padding: 25px 0;
    }

    .popular-teams-title {
      text-align: center;
      color: rgb(230, 230, 230);
      font-size: 1.8rem;
      margin-bottom: 25px;
      font-weight: bold;
    }

    .popular-teams-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
      gap: 20px;
      padding: 0;
      width: 100%;
      box-sizing: border-box;
    }

    .popular-team-item {
      background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
      border-radius: 15px;
      padding: 25px;
      border: 2px solid rgba(255, 255, 255, 0.1);
      cursor: pointer;
      transition: all 0.3s ease;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
      overflow: hidden;
      min-height: 280px;
    }

    .popular-team-item:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 25px rgba(74, 144, 226, 0.2);
      border-color: #4a90e2;
    }

    .popular-team-name {
      color: rgb(230, 230, 230);
      font-weight: bold;
      font-size: 1.3rem;
      text-align: center;
      margin-bottom: 15px;
      text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    }

    .popular-team-content {
      display: flex;
      align-items: center;
      gap: 20px;
      justify-content: center;
      margin-bottom: 10px;
    }

    .popular-team-creator {
      color: rgba(230, 230, 230, 0.7);
      font-size: 0.9rem;
      text-align: center;
      margin-top: 5px;
    }

    /* Miniature Court Area - Exact replica of main court */
    .mini-court-area {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
      grid-template-rows: 1fr 20px 1fr;
      gap: 3px;
      width: 280px;
      height: 160px;
      background: linear-gradient(135deg, #1e1e1e 0%, #141414 100%);
      border-radius: 10px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      padding: 6px;
      position: relative;
      flex-shrink: 0;
      box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
    }

    /* Net for mini court */
    .mini-net {
      background: rgba(255, 255, 255, 0.6) !important;
      border-radius: 1px;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
      height: 2px !important;
      min-height: 2px !important;
    }

    .mini-position-slot {
      background: rgba(255, 255, 255, 0.08);
      border-radius: 4px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      overflow: hidden;
      min-height: 16px;
    }

    .mini-position-slot img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      border-radius: 3px;
    }

    .mini-position-slot.empty {
      background: rgba(255, 255, 255, 0.05);
    }

    /* Position labels for mini court */
    .mini-position-label {
      position: absolute;
      top: 2px;
      left: 2px;
      background: rgba(0, 0, 0, 0.7);
      color: white;
      font-size: 6px;
      font-weight: bold;
      padding: 1px 2px;
      border-radius: 2px;
      z-index: 2;
    }

    /* Voting Section (Reddit-style) */
    .popular-team-voting {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      min-width: 80px;
      margin-left: 20px;
    }

    .popular-vote-btn {
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 8px;
      color: rgb(230, 230, 230);
      padding: 8px 12px;
      cursor: pointer;
      transition: all 0.2s ease;
      font-size: 18px;
      min-width: 35px;
      text-align: center;
      font-weight: bold;
    }

    .popular-vote-btn:hover {
      background: rgba(255, 255, 255, 0.2);
      transform: scale(1.15);
    }

    .upvote-btn:hover {
      background: rgba(34, 197, 94, 0.3);
      border-color: rgba(34, 197, 94, 0.5);
    }

    .downvote-btn:hover {
      background: rgba(239, 68, 68, 0.3);
      border-color: rgba(239, 68, 68, 0.5);
    }

    .popular-vote-count {
      font-size: 20px;
      font-weight: bold;
      color: rgb(230, 230, 230);
      text-align: center;
      min-width: 40px;
      margin: 5px 0;
    }

    /* Negative vote count styling */
    .popular-vote-count.negative {
      color: rgb(239, 68, 68);
    }

    /* Load Team Button */
    .load-team-btn {
      width: 100%;
      padding: 10px;
      background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
      color: white;
      border: none;
      border-radius: 6px;
      font-size: 14px;
      font-weight: bold;
      cursor: pointer;
      transition: all 0.3s ease;
      margin: 10px 0 5px 0;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .load-team-btn:hover {
      background: linear-gradient(135deg, #218838 0%, #1ca085 100%);
      transform: translateY(-1px);
      box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
    }

    .load-team-btn:active {
      transform: translateY(0);
    }

    /* Info Dropdown Styles */
    .info-dropdown-container {
      width: 100%;
      max-width: 1200px;
      margin: 0 auto 30px auto;
      background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
      border-radius: 15px;
      border: 2px solid rgba(255, 255, 255, 0.1);
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
      overflow: hidden;
    }

    .info-dropdown-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 15px 20px;
      cursor: pointer;
      background: rgba(255, 255, 255, 0.05);
      transition: all 0.3s ease;
      user-select: none;
    }

    .info-dropdown-header:hover {
      background: rgba(255, 255, 255, 0.1);
    }

    .info-dropdown-header span:first-child {
      color: rgb(230, 230, 230);
      font-weight: bold;
      font-size: 1.1rem;
    }

    .dropdown-arrow, .category-arrow, .subcategory-arrow {
      color: rgb(230, 230, 230);
      font-size: 1rem;
      transition: transform 0.3s ease;
    }

    .info-dropdown-container.open .dropdown-arrow,
    .info-category.open .category-arrow,
    .info-subcategory.open .subcategory-arrow {
      transform: rotate(180deg);
    }

    .info-dropdown-content {
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.3s ease;
      background: rgba(255, 255, 255, 0.02);
    }

    .info-dropdown-content.open {
      max-height: 800px;
      overflow-y: auto;
    }

    /* Info Category Styles */
    .info-category {
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .info-category:last-child {
      border-bottom: none;
    }

    .info-category-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 20px;
      cursor: pointer;
      background: rgba(255, 255, 255, 0.03);
      transition: all 0.3s ease;
      user-select: none;
    }

    .info-category-header:hover {
      background: rgba(255, 255, 255, 0.08);
    }

    .info-category-header span:first-child {
      color: rgb(230, 230, 230);
      font-weight: bold;
      font-size: 1rem;
    }

    .info-category-content {
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.3s ease;
    }

    .info-category-content.open {
      max-height: 600px;
      overflow-y: auto;
    }

    /* Info Subcategory Styles */
    .info-subcategory {
      border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    }

    .info-subcategory:last-child {
      border-bottom: none;
    }

    .info-subcategory-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 25px;
      cursor: pointer;
      background: rgba(255, 255, 255, 0.02);
      transition: all 0.3s ease;
      user-select: none;
      gap: 10px;
    }

    .info-subcategory-header:hover {
      background: rgba(255, 255, 255, 0.06);
    }

    .info-subcategory-header span:nth-child(2) {
      color: rgba(230, 230, 230, 0.9);
      font-weight: 500;
      font-size: 0.9rem;
      flex: 1;
    }

    .info-subcategory-content {
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.3s ease;
      background: rgba(255, 255, 255, 0.01);
    }

    .info-subcategory-content.open {
      max-height: 400px;
      overflow-y: auto;
    }

    .synergy-dropdown-item {
      padding: 15px 20px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .synergy-dropdown-item:hover {
      background: rgba(255, 255, 255, 0.08);
    }

    .synergy-dropdown-item:last-child {
      border-bottom: none;
    }

    .synergy-dropdown-name {
      color: rgb(230, 230, 230);
      font-weight: bold;
      font-size: 1rem;
      margin-bottom: 8px;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .synergy-type-badge {
      padding: 2px 8px;
      border-radius: 12px;
      font-size: 0.7rem;
      font-weight: bold;
      text-transform: uppercase;
    }

    .synergy-type-badge.school {
      background: rgba(74, 144, 226, 0.3);
      color: #4a90e2;
      border: 1px solid rgba(74, 144, 226, 0.5);
    }

    .synergy-type-badge.bond {
      background: rgba(255, 193, 7, 0.3);
      color: #ffc107;
      border: 1px solid rgba(255, 193, 7, 0.5);
    }

    .synergy-dropdown-details {
      display: none;
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .synergy-dropdown-details.show {
      display: block;
    }

    .synergy-dropdown-effect {
      color: rgba(230, 230, 230, 0.9);
      font-size: 0.9rem;
      line-height: 1.4;
      margin-bottom: 10px;
    }

    .synergy-dropdown-requirements {
      color: rgba(255, 255, 255, 0.7);
      font-size: 0.8rem;
      margin-bottom: 8px;
    }

    .synergy-dropdown-characters {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 8px;
    }

    .synergy-character-tag {
      background: rgba(40, 167, 69, 0.2);
      color: #28a745;
      padding: 4px 8px;
      border-radius: 8px;
      font-size: 0.75rem;
      font-weight: bold;
      border: 1px solid rgba(40, 167, 69, 0.4);
    }



    /* Character images now fill entire slots */

    /* Responsive adjustments for popular teams */
    @media (max-width: 1200px) {
      .popular-teams-grid {
        grid-template-columns: 1fr;
        gap: 20px;
      }

      .mini-court-area {
        width: 320px;
        height: 180px;
      }

      .popular-team-item {
        padding: 20px;
        min-height: 300px;
      }
    }

    @media (max-width: 700px) {
      .mini-court-area {
        width: 280px;
        height: 160px;
      }

      .popular-team-item {
        padding: 15px;
        min-height: 280px;
      }

      .popular-team-content {
        flex-direction: column;
        gap: 15px;
      }

      .popular-team-voting {
        margin-left: 0;
        margin-top: 15px;
      }
    }

    @media (max-width: 500px) {
      .mini-court-area {
        width: 240px;
        height: 140px;
      }

      .popular-team-item {
        padding: 12px;
        min-height: 260px;
      }

      .popular-team-name {
        font-size: 1.1rem;
        margin-bottom: 10px;
      }
    }

    /* Old mobile styles replaced by new responsive styles above */

    /* Drag and Drop Styles */
    .dragging {
      opacity: 0.5;
      transform: rotate(5deg);
    }

    .drag-over {
      border-color: #4a90e2 !important;
      background: rgba(74, 144, 226, 0.2) !important;
    }

    .drag-invalid {
      border-color: #dc3545 !important;
      background: rgba(220, 53, 69, 0.2) !important;
    }

    /* Responsive Design */
    @media (max-width: 768px) {
      .team-builder-container {
        padding: 15px;
        margin-top: 60px; /* Space for fixed hamburger menu */
        max-width: 100vw;
        overflow-x: hidden;
      }

      .team-builder-layout {
        grid-template-columns: 1fr;
        gap: 15px;
      }

      .court-and-subs-layout {
        grid-template-columns: 1fr;
        gap: 15px;
      }

      .court-area {
        padding: 10px;
      }

      .court-field {
        min-height: 380px;
        padding: 10px;
        gap: 15px;
        grid-template-columns: repeat(5, minmax(60px, 1fr));
        grid-template-rows: 120px 25px 120px;
        justify-content: center;
        width: 100%;
        max-width: none;
      }

      .court-field::before {
        top: calc(120px + 10px + 12px); /* Adjust for mobile grid size + more space down */
        left: 10px;
        right: 10px;
        height: 2px;
      }

      .position-slot, .back-slot {
        aspect-ratio: 2/3;
        padding: 0;
        gap: 2px;
        border-radius: 0;
        border: 1px solid rgba(255, 255, 255, 0.4);
      }

      .position-label {
        top: 2px;
        left: 2px;
        padding: 1px 3px;
        font-size: 0.5rem;
      }

      .remove-player {
        top: 3px;
        right: 3px;
        width: 18px;
        height: 18px;
        font-size: 12px;
      }

      .add-player-btn {
        width: 24px;
        height: 24px;
        font-size: 16px;
      }

      .synergies-area {
        padding: 15px;
        min-height: 120px;
      }

      .synergies-title {
        font-size: 1rem;
        margin-bottom: 10px;
      }

      .synergy-item {
        padding: 8px;
      }

      .synergy-school {
        font-size: 0.9rem;
      }

      .synergy-effect {
        font-size: 0.8rem;
      }

      .bench-row-wrapper {
        margin-top: 15px;
        padding: 0 10px;
      }

      .bench-row {
        gap: 10px;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        max-width: 400px;
      }

      .bench-slot {
        width: 70px;
        height: 100px;
      }

      .bench-info {
        font-size: 0.7rem;
      }

      .add-slot-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
      }

      .team-management {
        margin-top: 15px;
        padding: 12px;
      }

      .input-row {
        flex-direction: column;
        gap: 8px;
      }

      .team-name-input {
        padding: 8px;
        font-size: 14px;
        box-sizing: border-box;
        max-width: 100%;
      }

      .team-buttons {
        grid-template-columns: 1fr;
        gap: 8px;
      }

      .team-btn {
        padding: 12px;
        font-size: 14px;
      }

      .popular-teams-section {
        margin-top: 20px;
      }

      .popular-teams-container {
        padding: 10px 0;
      }

      .popular-teams-title {
        font-size: 1.4rem;
        margin-bottom: 15px;
      }

      .popular-teams-grid {
        grid-template-columns: 1fr;
        gap: 15px;
      }

      .popular-team-item {
        padding: 15px;
        min-height: 240px;
      }

      .popular-team-name {
        font-size: 1.1rem;
        margin-bottom: 10px;
      }

      .popular-team-content {
        flex-direction: column;
        gap: 12px;
        align-items: center;
      }

      .mini-court-area {
        width: 240px;
        height: 140px;
        gap: 2px;
        padding: 4px;
      }

      .mini-position-label {
        font-size: 5px;
        padding: 1px;
      }

      .popular-team-voting {
        margin-left: 0;
        margin-top: 10px;
        flex-direction: row;
        gap: 15px;
        align-items: center;
      }

      .popular-vote-btn {
        padding: 6px 10px;
        font-size: 16px;
        min-width: 30px;
      }

      .popular-vote-count {
        font-size: 18px;
        margin: 0 5px;
      }

      .info-dropdown-container {
        margin: 0 auto 20px auto;
      }

      .info-dropdown-header {
        padding: 12px 15px;
      }

      .info-dropdown-header span:first-child {
        font-size: 1rem;
      }

      .info-category-header {
        padding: 10px 15px;
      }

      .info-category-header span:first-child {
        font-size: 0.9rem;
      }

      .info-subcategory-header {
        padding: 8px 20px;
        gap: 8px;
      }

      .info-subcategory-header span:nth-child(2) {
        font-size: 0.8rem;
      }

      .synergy-dropdown-item {
        padding: 12px 15px;
      }

      .synergy-dropdown-name {
        font-size: 0.9rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
      }

      .synergy-dropdown-effect {
        font-size: 0.8rem;
      }

      .synergy-dropdown-requirements {
        font-size: 0.75rem;
      }

      .character-modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 2% auto;
      }

      .character-modal-header h3 {
        font-size: 1.2rem;
      }

      .character-selection-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
      }

      .character-select-card {
        width: 90px;
        height: 118px;
      }

      .character-select-card img {
        width: 84px;
        height: 105px;
      }

      .character-select-name {
        font-size: 9px;
        bottom: 2px;
        padding: 1px 2px;
      }
    }

    @media (max-width: 480px) {
      .team-builder-container {
        padding: 10px;
        max-width: 100vw;
        overflow-x: hidden;
      }

      .court-field {
        min-height: 290px;
        padding: 8px;
        gap: 8px;
        grid-template-columns: repeat(5, minmax(45px, 1fr));
        grid-template-rows: 90px 15px 90px;
        width: 100%;
        max-width: none;
      }

      .court-field::before {
        top: calc(90px + 8px + 7px); /* Adjust for mobile grid size + more space down */
        left: 8px;
        right: 8px;
        height: 1px;
      }

      .position-slot, .back-slot {
        aspect-ratio: 2/3;
        padding: 0;
        border-radius: 0;
        border: 1px solid rgba(255, 255, 255, 0.4);
      }

      .bench-slot {
        width: 60px;
        height: 85px;
      }

      .mini-court-area {
        width: 200px;
        height: 120px;
      }

      .popular-team-voting {
        flex-direction: column;
        gap: 8px;
      }

      .character-selection-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 6px;
      }

      .character-select-card {
        width: 90px;
        height: 114px;
      }

      .character-select-card img {
        width: 84px;
        height: 105px;
      }

      .load-team-btn {
        padding: 8px;
        font-size: 12px;
        margin: 8px 0 4px 0;
      }
    }

    /* Desktop Layout - Content with fixed left margin and responsive right margin */
    /* Content adjustment for mobile when sidebar is open */
    @media (max-width: 1080px) {
      .team-builder-container {
        margin-top: 20px;
      }
    }

    /* Loading Animation */
    .loading {
      display: inline-block;
      width: 20px;
      height: 20px;
      border: 3px solid rgba(255, 255, 255, 0.3);
      border-radius: 50%;
      border-top-color: #4a90e2;
      animation: spin 1s ease-in-out infinite;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    /* Character Modal Styles */
    .character-modal {
      display: none;
      position: fixed;
      z-index: 10000;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.8);
      backdrop-filter: blur(5px);
    }

    .character-modal-content {
      background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
      margin: 5% auto;
      padding: 0;
      border: 2px solid rgba(255, 255, 255, 0.2);
      border-radius: 15px;
      width: 90%;
      max-width: 800px;
      max-height: 80vh;
      overflow: hidden;
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    }

    .character-modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 20px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .character-modal-header h3 {
      color: rgb(230, 230, 230);
      margin: 0;
      font-size: 1.5rem;
    }

    .character-modal-close {
      color: rgba(255, 255, 255, 0.7);
      font-size: 28px;
      font-weight: bold;
      cursor: pointer;
      transition: color 0.3s ease;
    }

    .character-modal-close:hover {
      color: #ff6b6b;
    }

    .character-modal-body {
      padding: 20px;
      max-height: calc(80vh - 100px);
      overflow-y: auto;
    }

    .character-selection-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
      gap: 12px;
      margin-top: 20px;
    }

    .character-select-card {
      border: 2px solid rgba(255, 255, 255, 0.1);
      border-radius: 10px;
      padding: 0;
      cursor: pointer;
      transition: all 0.3s ease;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      position: relative;
      overflow: visible;
      width: 80px;
      height: 112px;
    }

    /* Rarity Backgrounds and Borders for Modal Character Cards */
    .character-select-card.Character-UR {
      background-image: url("https://ik.imagekit.io/frnrxcqkq/Haikyu-FlyHigh/img/BackroundUR.png?tr=w-400,h-600,q-85") !important;
      background-size: cover !important;
      background-position: center !important;
      border: 2px solid #e04444 !important; /* Rot für UR */
    }

    .character-select-card.Character-SSR {
      background-image: url("https://ik.imagekit.io/frnrxcqkq/Haikyu-FlyHigh/img/BackroundSSR.png?tr=w-400,h-600,q-85") !important;
      background-size: cover !important;
      background-position: center !important;
      border: 2px solid #ebac43 !important; /* Gold/Gelb für SSR */
    }

    .character-select-card.Character-SR {
      background-image: url("https://ik.imagekit.io/frnrxcqkq/Haikyu-FlyHigh/img/BackroundSR.png?tr=w-400,h-600,q-85") !important;
      background-size: cover !important;
      background-position: center !important;
      border: 2px solid #9966cc !important; /* Lila für SR */
    }

    .character-select-card.Character-SP {
      background-image: url("https://ik.imagekit.io/frnrxcqkq/Haikyu-FlyHigh/img/BackroundSP.png?tr=w-400,h-600,q-85") !important;
      background-size: cover !important;
      background-position: center !important;
      border: 2px solid #c6e3ff !important; /* Hellblau für SP */
    }

    .character-select-card.Character-R {
      background-image: url("https://ik.imagekit.io/frnrxcqkq/Haikyu-FlyHigh/img/BackroundR.png?tr=w-400,h-600,q-85") !important;
      background-size: cover !important;
      background-position: center !important;
      border: 2px solid #87ceeb !important; /* Hellblau für R */
    }

    .character-select-card.Character-N {
      background-image: url("https://ik.imagekit.io/frnrxcqkq/Haikyu-FlyHigh/img/BackroundN.png?tr=w-400,h-600,q-85") !important;
      background-size: cover !important;
      background-position: center !important;
      border: 2px solid #d3d3d3 !important; /* Grau für N */
    }

    .character-select-card:hover {
      border-color: #4a90e2;
      transform: translateY(-2px);
      box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
    }

    .character-select-card.selected {
      border-color: #28a745;
      background: rgba(40, 167, 69, 0.1);
    }

    .character-select-card img {
      width: 84px;
      height: 105px;
      object-fit: contain;
      border-radius: 6px;
    }



          .character-select-name {
        font-size: 10px;
        font-weight: bold;
        color: rgb(230, 230, 230);
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        position: absolute;
        bottom: 4px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.7);
        padding: 2px 3px;
        border-radius: 4px;
        backdrop-filter: blur(2px);
        z-index: 3;
      }

    /* Notification Styles */
    .notification {
      position: fixed;
      top: 20px;
      right: 20px;
      background: #28a745;
      color: white;
      padding: 15px 20px;
      border-radius: 8px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
      z-index: 10001;
      transform: translateX(400px);
      transition: transform 0.3s ease;
    }

    .notification.show {
      transform: translateX(0);
    }

    .notification.error {
      background: #dc3545;
    }


