  .deck-pack {
    position: relative;
    width: 100%;
    aspect-ratio: 900 / 835;
    height: auto;
    background: url("/assets/commander-deck-template-140b59eb.avif") center / cover no-repeat;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: sans-serif;
    font-size: clamp(14px, 2.4vw, 18px);
    overflow: hidden;
    border-radius: clamp(6px, 1.2vw, 12px);
    cursor: pointer;
    box-shadow: inset 0 10px 15px -3px rgba(0, 0, 0, 0.5), inset 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
  }

  .deck-pack:hover {
    transform: scale(1.02);
    box-shadow: inset 0 15px 20px -3px rgba(0, 0, 0, 0.6), inset 0 8px 10px -2px rgba(0, 0, 0, 0.4);
  }

  .deck-pack-content {
    position: relative;
    width: 100%;
    height: 100%;
  }

  .deck-pack-card-face {
    position: absolute;
    left: 53.33%;
    top: 32.34%;
    width: 31.11%;
    height: auto;
    aspect-ratio: 488 / 680;
    border-radius: 7px;
  }

  /* Hero card image loading animation */
  .deck-pack-card-face img {
    width: 100%;
    height: 100%;
    object-cover;
    border-radius: 7px;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease-in, transform 0.6s ease-in;
  }
  
  .deck-pack-card-face img.loaded {
    opacity: 1;
    transform: scale(1);
  }

  .select-hero-card-btn {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px dashed rgba(255, 255, 255, 0.8);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: clamp(8px, 1.6vw, 12px);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
  }

  .select-hero-card-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    border-color: white;
    transform: scale(1.05);
  }

  .hero-card-display {
    width: 100%;
    height: 100%;
    cursor: pointer;
    border-radius: 7px;
    transition: transform 0.2s ease;
    position: relative;
  }

  .hero-card-display:hover {
    transform: scale(1.05);
  }

  .hero-card-display img {
    width: 100%;
    height: 100%;
    object-cover;
    border-radius: 7px;
  }

  .hero-card-display:hover::after {
    content: "Click to change";
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
  }

  .deck-pack-title {
    position: absolute;
    width: 65%;
    height: 9%;
    overflow: hidden;
    color: black;
    top: 87.66%;
    left: 6.67%;
    font-weight: 600;
    font-size: clamp(16px, 2.8vw, 20px);
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
  }

  /* Mobile-specific adjustments for deck-pack-title */
  @media (max-width: 768px) {
    .deck-pack-title {
      width: 65%;
      left: 5%;
      font-size: clamp(14px, 3.5vw, 18px);
    }
  }

  .deck-pack-slogan {
    transform: skewX(-15deg);
    position: absolute;
    color: white;
    top: 5.99%;
    left: 36%;
    font-size: clamp(8px, 1.6vw, 12px);
    font-weight: 400;
    width: 27.56%;
    height: 5.99%;
    display: flex;
    align-items: center;
    overflow: hidden;
  }

  .deck-pack-extra-info {
    position: absolute;
    top: 37%;
    left: 7%;
    color: white;
    font-size: clamp(14px, 1.6vw, 20px);
    width: 40%;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
  }

  .deck-pack-actions {
    position: absolute;
    bottom: 5%;
    right: 6%;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  .deck-pack:hover .deck-pack-actions {
    opacity: 1;
  }

  .deck-pack-actions a {
    padding: 4px 8px;
    font-size: 10px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    color: white;
    transition: background-color 0.2s ease;
  }

  .deck-pack-actions .open-deck-btn {
    background-color: rgba(0,0,0,0);
    border: 2px solid black;
    color: black;
    font-size: 100%;
  }

  .deck-pack-actions .open-deck-btn:hover {
    background-color: rgba(0,0,0,0);
    color: black;
  }

  .deck-pack-actions .view-btn {
    background-color: rgba(59, 130, 246, 0.8);
  }

  .deck-pack-actions .view-btn:hover {
    background-color: rgba(59, 130, 246, 1);
  }

  .deck-pack-actions .delete-btn {
    background-color: rgba(239, 68, 68, 0.8);
    text-align: center;
    padding: 12px;
  }

  .deck-pack-actions .delete-btn:hover {
    background-color: rgba(239, 68, 68, 1);
  }

  @media (max-width: 768px) {
    .deck-pack-actions {
      height: 8%;
      font-size: 80%;
      padding: 0px;
      text-align: center;
      vertical-align: middle;
    }
    .deck-pack-actions .delete-btn {
      background-color: rgba(239, 68, 68, 0.8);
      text-align: center;
      padding-bottom: 12px;
    }
  }

  /* Dark theme overrides for the page container */
  .dark-theme-deck-assemblies .container {
    background: transparent;
  }

  .dark-theme-deck-assemblies h1 {
    color: #d5d5d5;
  }

  /* Hero card selector modal styles */
  .hero-selector-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
  }

  .hero-selector-content {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 16px;
    max-width: 700px;
    max-height: 85vh;
    width: 95%;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    color: #e5e7eb;
  }

  .hero-selector-content .bg-gray-50 {
    background-color: #374151 !important;
    border-color: #4b5563 !important;
  }

  .hero-selector-content .text-gray-900 {
    color: #f9fafb !important;
  }

  .hero-selector-content .text-gray-600 {
    color: #d1d5db !important;
  }

  .hero-selector-content .text-gray-400 {
    color: #9ca3af !important;
  }

  .hero-selector-content .border-gray-200,
  .hero-selector-content .border-gray-300 {
    border-color: #4b5563 !important;
  }

  .hero-selector-content input {
    background-color: #374151 !important;
    border-color: #4b5563 !important;
    color: #f9fafb !important;
  }

  .hero-selector-content input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
  }

  .hero-selector-content input::placeholder {
    color: #9ca3af !important;
  }

  /* Hero card option styles */
  .hero-card-option {
    position: relative;
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
  }

  .hero-card-option:hover {
    background: #4b5563;
    border-color: #6b7280;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.3);
  }

  .hero-card-art {
    aspect-ratio: 488 / 680;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
  }

  .hero-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
  }

  .hero-card-option:hover .hero-card-image {
    transform: scale(1.05);
  }

  .hero-card-info {
    padding: 16px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .hero-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #f9fafb;
    margin: 0;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-card-form {
    width: 100%;
  }

  .hero-select-btn {
    width: 100% !important;
    background: rgba(59, 130, 246, 0.9) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 8px 16px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
  }

  .hero-select-btn:hover {
    background: rgba(59, 130, 246, 1) !important;
    transform: translateY(-1px) !important;
  }

  /* Inline editing styles */
  .inline-editable {
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
    display: block;
  }

  .inline-editable:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }

  .inline-edit-input {
    display: none !important; /* Hidden by default */
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: inherit;
    font-weight: inherit;
    font-family: inherit;
    width: 100%;
    outline: none;
    resize: none;
  }

  .inline-edit-input.editing {
    display: block !important; /* Show when editing */
  }

  .inline-edit-input:focus {
    border-color: rgba(59, 130, 246, 0.8);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  }

  .inline-edit-save-btn {
    display: none !important; /* Hidden by default */
    position: absolute;
    right: -60px; /* Position outside the text area */
    top: 50%;
    transform: translateY(-50%);
    padding: 4px 8px;
    background-color: rgba(34, 197, 94, 0.8);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    z-index: 10;
  }

  .inline-edit-save-btn.editing {
    display: block !important; /* Show when editing */
  }

  .inline-edit-save-btn:hover {
    background-color: rgba(34, 197, 94, 1);
  }

  .inline-edit-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }

  /* Context-specific styling */
  .deck-pack-title .inline-edit-input {
    font-size: clamp(14px, 2.8vw, 20px);
    font-weight: 600;
    color: black;
    background-color: rgba(255, 255, 255, 0.9);
    text-align: left;
  }

  .deck-pack-title .inline-editable {
    text-align: left;
    width: 100%;
  }

  .deck-pack-slogan .inline-editable {
    text-align: left;
    width: 100%;
    height: 98%;
    padding: 2px;
    font-size: 85%;
    width: 108%;
  }
  .deck-pack-slogan .inline-edit-input {
    font-size: clamp(8px, 1.6vw, 12px);
    font-weight: 400;
    background-color: rgba(0, 0, 0, 0.8);
  }


  @media (max-width: 768px) {
    .deck-pack-slogan .inline-editable {
      text-align: left;
      width: 100%;
      height: 98%;
      padding: 2px;
      font-size: 75%;
      width: 108%;
    }
    .deck-pack-slogan .inline-edit-input {
      font-size: clamp(8px, 1.6vw, 12px);
      font-weight: 400;
      background-color: rgba(0, 0, 0, 0.8);
    }

  }

    @media (max-width: 1020px) {
    .deck-pack-slogan .inline-editable {
      text-align: left;
      width: 100%;
      height: 98%;
      padding: 1px;
      font-size: 0.9cqh;
      width: 108%;
    }
    .deck-pack-slogan .inline-edit-input {
      font-size: clamp(8px, 1.6vw, 12px);
      font-weight: 400;
      background-color: rgba(0, 0, 0, 0.8);
    }

  }


  .deck-pack-extra-info .inline-edit-input {
    font-size: clamp(8px, 1.6vw, 12px);
    background-color: rgba(0, 0, 0, 0.8);
    min-height: 60px;
    resize: vertical;
  }

  /* Ensure the editor containers have relative positioning and allow overflow */
  .inline-editor-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: visible; /* Allow save buttons to overflow outside */
  }

  .deck-pack-extra-info {
    font-family: "Goudy Mediaeval";
  }

  .deck-pack-title,
  .deck-pack-slogan,
  .deck-pack-extra-info {
    overflow: visible !important; /* Override any existing overflow constraints */
  }

  /* Special positioning for different contexts */
  .deck-pack-title .inline-editor-container {
    display: flex;
    justify-content: center;
    position: relative;
    overflow: visible; /* Allow button to overflow outside title area */
    width: 100%;
    box-sizing: border-box;
    text-align: left;
  }

  /* Mobile-specific adjustments for deck-pack-title */
  @media (max-width: 768px) {
    .deck-pack-title .inline-editor-container {
      width: 100%;
      max-width: 100%;
      height: 100%;
    }

    .deck-pack-title .inline-editable {
      text-align: left;
      width: 100%;
      height: 100%;
    }
  }

  .deck-pack-title .inline-edit-save-btn {
    position: absolute;
    right: -70px; /* This will overflow outside the deck-pack-title container */
    top: 50%;
    transform: translateY(-50%);
    z-index: 20; /* Higher z-index to ensure visibility over other deck elements */
  }

  .deck-pack-slogan .inline-edit-save-btn {
    position: absolute;
    right: -50px; /* This will overflow outside the deck-pack-slogan container */
    top: 2px;
    transform: none;
    z-index: 20;
  }

  .deck-pack-extra-info .inline-edit-save-btn {
    position: absolute;
    right: -50px; /* This will overflow outside the deck-pack-extra-info container */
    top: 2px;
    transform: none;
    z-index: 20;
  }

  /* Ensure the main deck-pack container allows overflow for save buttons */
  .deck-pack {
    overflow: visible !important;
  }

  .deck-pack-content {
    overflow: visible !important;
  }
